Get a subscription
curl --request GET \
--url https://demo-api-harmony.compago.com/api/developer/v1/subscription/{id} \
--header 'x-api-key: <api-key>'import requests
url = "https://demo-api-harmony.compago.com/api/developer/v1/subscription/{id}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://demo-api-harmony.compago.com/api/developer/v1/subscription/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://demo-api-harmony.compago.com/api/developer/v1/subscription/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://demo-api-harmony.compago.com/api/developer/v1/subscription/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://demo-api-harmony.compago.com/api/developer/v1/subscription/{id}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://demo-api-harmony.compago.com/api/developer/v1/subscription/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "ACTIVE",
"amount": 123,
"currency": "<string>",
"billingPeriod": "WEEKLY",
"chargedPeriods": 123,
"maxBillingCycles": 123,
"failedAttempts": 123,
"maxFailedAttempts": 123,
"failedBillingCycles": 123,
"maxFailedBillingCycles": 123,
"nextBillingDate": "2023-11-07T05:31:56Z",
"lastBillingDate": "2023-11-07T05:31:56Z",
"startedAt": "2023-11-07T05:31:56Z",
"cancelledAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"paymentLinkId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paymentLink": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"description": "<string>"
},
"customer": {
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"phoneNumber": "<string>"
},
"card": {
"lastFourDigits": "<string>",
"network": "<string>",
"fundingSource": "<string>",
"issuingBank": "<string>"
},
"totalCollected": 123,
"daysActive": 123
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}Subscriptions
Get a subscription
A single subscription, with its collected total and days active.
GET
/
developer
/
v1
/
subscription
/
{id}
Get a subscription
curl --request GET \
--url https://demo-api-harmony.compago.com/api/developer/v1/subscription/{id} \
--header 'x-api-key: <api-key>'import requests
url = "https://demo-api-harmony.compago.com/api/developer/v1/subscription/{id}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://demo-api-harmony.compago.com/api/developer/v1/subscription/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://demo-api-harmony.compago.com/api/developer/v1/subscription/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://demo-api-harmony.compago.com/api/developer/v1/subscription/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://demo-api-harmony.compago.com/api/developer/v1/subscription/{id}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://demo-api-harmony.compago.com/api/developer/v1/subscription/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "ACTIVE",
"amount": 123,
"currency": "<string>",
"billingPeriod": "WEEKLY",
"chargedPeriods": 123,
"maxBillingCycles": 123,
"failedAttempts": 123,
"maxFailedAttempts": 123,
"failedBillingCycles": 123,
"maxFailedBillingCycles": 123,
"nextBillingDate": "2023-11-07T05:31:56Z",
"lastBillingDate": "2023-11-07T05:31:56Z",
"startedAt": "2023-11-07T05:31:56Z",
"cancelledAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"paymentLinkId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paymentLink": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"description": "<string>"
},
"customer": {
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"phoneNumber": "<string>"
},
"card": {
"lastFourDigits": "<string>",
"network": "<string>",
"fundingSource": "<string>",
"issuingBank": "<string>"
},
"totalCollected": 123,
"daysActive": 123
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}Authorizations
Path Parameters
Response
Success.
Available options:
ACTIVE, FAILING, PAUSED, CANCELLED, COMPLETED Available options:
WEEKLY, BIWEEKLY, MONTHLY, QUARTERLY, SEMIANNUAL, YEARLY Null means it runs until cancelled.
Consecutive failures within the current cycle.
The subscription is cancelled when this is reached.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The card, masked. The full number and the stored token are never returned.
Show child attributes
Show child attributes
Detail endpoint only. Sum of every pending and confirmed payment.
Detail endpoint only.