Skip to main content
GET
/
v1
/
customers
/
{Customer}
/
subscriptions
/
{Subscription}
Get Customer Subscription
curl --request GET \
  --url https://api.ecrypt.com/v1/customers/{Customer}/subscriptions/{Subscription} \
  --header 'x-api-key: <api-key>'
import requests

url = "https://api.ecrypt.com/v1/customers/{Customer}/subscriptions/{Subscription}"

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://api.ecrypt.com/v1/customers/{Customer}/subscriptions/{Subscription}', 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://api.ecrypt.com/v1/customers/{Customer}/subscriptions/{Subscription}",
  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://api.ecrypt.com/v1/customers/{Customer}/subscriptions/{Subscription}"

	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://api.ecrypt.com/v1/customers/{Customer}/subscriptions/{Subscription}")
  .header("x-api-key", "<api-key>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.ecrypt.com/v1/customers/{Customer}/subscriptions/{Subscription}")

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
{
  "customerSubscriptionId": "<string>",
  "installments": 123,
  "taxAmount": 123,
  "shippingAmount": 123,
  "surchargeAmount": 123,
  "totalAmount": 123,
  "startDate": "2023-11-07T05:31:56Z",
  "created": "2023-11-07T05:31:56Z",
  "status": "<string>",
  "bills": [
    {
      "due": "2023-11-07T05:31:56Z",
      "transactionId": 123,
      "status": "<string>"
    }
  ]
}
{
  "requestId": "000000000000000000000",
  "errors": [
    {
      "type": "<string>",
      "message": "<unknown>"
    }
  ]
}

Authorizations

x-api-key
string
header
required

Authorization by x-api-key inside request's header

Path Parameters

Customer
string
default:00000000-0000-0000-0000-000000000000
required

Customer is the Ecrypt customer identifier.

Example: 00000000-0000-0000-0000-000000000000

Required string length: 8 - 64
Pattern: ^[0-9A-Za-z-]*$
Subscription
string
default:00000000-0000-0000-0000-000000000000
required

Subscription is the Ecrypt subscription identifier.

Example: 00000000-0000-0000-0000-000000000000

Required string length: 8 - 64
Pattern: ^[0-9A-Za-z-]*$

Response

object | null

OK

customerSubscriptionId
string
installments
integer<int32> | null
cycleUnit
enum<integer>
Available options:
10,
20,
30,
50,
52,
70,
71,
73,
79,
90,
95
taxAmount
number<decimal>
shippingAmount
number<decimal>
surchargeAmount
number<decimal> | null
totalAmount
number<decimal>
startDate
string<date-time>
created
string<date-time>
status
string
bills
(object | null)[] | null