Get Subscription Detail
GET
/v2/subscriptions/{id}Authorization
AuthorizationBearer token · headerrequiredMerchant API key scoped to one merchant and environment. Read operations require api:read, normal write operations require api:write, and broadcast mutations also require explicit broadcasts:write.
Path parameters
idstring<uuid>requiredHeader parameters
x-request-idstringOptional caller-provided request correlation ID.
min length 1
Responses
200OK
subscriptionobjectrequiredShow propertiesHide properties
idstring<uuid>requiredmerchantIdstring<uuid>requiredenvironmentstringrequiredAllowed:
sandboxproductioncustomerIdstring<uuid>requiredplanIdstring<uuid>requiredplanSnapshotobjectrequiredShow propertiesHide properties
planIdstring<uuid>requiredplanVersionIdstring<uuid> | anyrequiredShow propertiesHide properties
Any of:
string<uuid>
string<uuid>any
anyplanVersionNumberinteger | anyrequiredShow propertiesHide properties
Any of:
integer
integerany
anyproductIdstring<uuid>requirednamestringrequiredmin length 1 · max length 160
descriptionstring | anyrequiredShow propertiesHide properties
Any of:
string
stringany
anyamountHalalasintegerrequiredmin -9007199254740991 · max 9007199254740991
currencyanyrequiredintervalstringrequiredAllowed:
monthyearcadenceobjectrequiredShow propertiesHide properties
intervalUnitstringrequiredAllowed:
dayweekmonthyearintervalCountintegerrequiredmin -9007199254740991 · max 9007199254740991
trialDaysintegerrequiredmin 0 · max 365
couponobject | anyrequiredShow propertiesHide properties
Any of:
object
Any of:
object
codestringrequiredmax length 64 · matches ^[A-Z0-9_-]{1,64}$
discountTypeanyrequiredpercentOffBpsintegerrequiredmin 1 · max 10000
amountOffHalalasanyobject
codestringrequiredmax length 64 · matches ^[A-Z0-9_-]{1,64}$
discountTypeanyrequiredamountOffHalalasintegerrequiredmin -9007199254740991 · max 2147483647
percentOffBpsanyany
anybillingAnchorPolicystring | anyrequiredShow propertiesHide properties
Any of:
string
stringany
anybillingAnchorAtstring<date-time> | anyrequiredShow propertiesHide properties
Any of:
string<date-time>
string<date-time>any
anycapturedAtstring<date-time>requiredstatusstringrequiredAllowed:
trialingactiverenewinggrace_periodpast_duecanceledrevisionintegerrequiredmin -9007199254740991 · max 9007199254740991
originalBillingAnchorAtstring<date-time>requiredcurrentPeriodStartedAtstring<date-time>requiredcurrentPeriodEndsAtstring<date-time>requirednextBillingAtstring<date-time> | anyrequiredShow propertiesHide properties
Any of:
string<date-time>
string<date-time>any
anyscheduledCancellationAtstring<date-time> | anyrequiredShow propertiesHide properties
Any of:
string<date-time>
string<date-time>any
anytrialStartedAtstring<date-time> | anyrequiredShow propertiesHide properties
Any of:
string<date-time>
string<date-time>any
anytrialEndsAtstring<date-time> | anyrequiredShow propertiesHide properties
Any of:
string<date-time>
string<date-time>any
anygraceStartedAtstring<date-time> | anyrequiredShow propertiesHide properties
Any of:
string<date-time>
string<date-time>any
anygraceEndsAtstring<date-time> | anyrequiredShow propertiesHide properties
Any of:
string<date-time>
string<date-time>any
anycanceledAtstring<date-time> | anyrequiredShow propertiesHide properties
Any of:
string<date-time>
string<date-time>any
anyendedAtstring<date-time> | anyrequiredShow propertiesHide properties
Any of:
string<date-time>
string<date-time>any
anyscheduledCancellationReasonstring | anyrequiredShow propertiesHide properties
Any of:
string
stringany
anycustomerobjectrequiredShow propertiesHide properties
idstring<uuid>requirednamestring | anyrequiredShow propertiesHide properties
Any of:
string
stringany
anyemailstring<email>requiredmobilestring | anyrequiredShow propertiesHide properties
Any of:
string
stringany
anyavatarUrlstring<uri> | anyShow propertiesHide properties
Any of:
string<uri>
string<uri>any
anylocalestringrequiredAllowed:
enarproductobjectrequiredShow propertiesHide properties
idstring<uuid>requirednamestringrequiredmin length 1 · max length 160
paymentMethodobject | anyrequiredShow propertiesHide properties
Any of:
object
methodTypeanyrequiredbrandstring | anyrequiredShow propertiesHide properties
Any of:
string
stringany
anylast4string | anyrequiredShow propertiesHide properties
Any of:
string
stringany
anyexpiryMonthinteger | anyrequiredShow propertiesHide properties
Any of:
integer
integerany
anyexpiryYearinteger | anyrequiredShow propertiesHide properties
Any of:
integer
integerany
anyany
anycommercialTermsobjectrequiredShow propertiesHide properties
currencyanyrequiredamountHalalasintegerrequiredmin 0 · max 9007199254740991
discountHalalasintegerrequiredmin 0 · max 9007199254740991
taxableAmountHalalasintegerrequiredmin 0 · max 9007199254740991
vatRateBpsintegerrequiredmin 0 · max 10000
vatAmountHalalasintegerrequiredmin 0 · max 9007199254740991
totalHalalasintegerrequiredmin 0 · max 9007199254740991
orderobjectrequiredShow propertiesHide properties
countintegerrequiredmin 0 · max 9007199254740991
latestOrderIdstring<uuid> | anyrequiredShow propertiesHide properties
Any of:
string<uuid>
string<uuid>any
anyactivityobjectrequiredShow propertiesHide properties
eventsobject[]requiredShow propertiesHide properties
Array of
objectidstringrequiredmin length 1 · max length 128
eventTypestringrequiredmin length 1 · max length 120
occurredAtstring<date-time>requiredactorKindstring | anyrequiredShow propertiesHide properties
Any of:
string
stringany
anysummarystringrequiredmin length 1 · max length 200
metadataobjectrequiredrequestIdstringmin length 1 · max length 128
correlationIdstringmin length 1 · max length 128
nextCursorstring | anyrequiredShow propertiesHide properties
Any of:
string
stringany
any401Standard Cipay error response.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmin length 1
messagestringrequiredmin length 1
requestIdstringrequiredmin length 1
detailsobject403Standard Cipay error response.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmin length 1
messagestringrequiredmin length 1
requestIdstringrequiredmin length 1
detailsobject404Standard Cipay error response.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmin length 1
messagestringrequiredmin length 1
requestIdstringrequiredmin length 1
detailsobject409Standard Cipay error response.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmin length 1
messagestringrequiredmin length 1
requestIdstringrequiredmin length 1
detailsobject422Standard Cipay error response.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmin length 1
messagestringrequiredmin length 1
requestIdstringrequiredmin length 1
detailsobject429Standard Cipay error response.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmin length 1
messagestringrequiredmin length 1
requestIdstringrequiredmin length 1
detailsobject500Standard Cipay error response.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmin length 1
messagestringrequiredmin length 1
requestIdstringrequiredmin length 1
detailsobjectRequest
curl -X GET "https://api.cipay.net/v2/subscriptions/%3Cuuid%3E" \
-H "Authorization: Bearer YOUR_TOKEN"const response = await fetch("https://api.cipay.net/v2/subscriptions/%3Cuuid%3E", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_TOKEN"
}
});Response
{
"subscription": {
"id": "<uuid>",
"merchantId": "<uuid>",
"environment": "sandbox",
"customerId": "<uuid>",
"planId": "<uuid>",
"planSnapshot": {
"planId": "<uuid>",
"planVersionId": "<uuid>",
"planVersionNumber": 0,
"productId": "<uuid>",
"name": "string",
"description": "string",
"amountHalalas": 0,
"currency": "SAR",
"interval": "month",
"cadence": {
"intervalUnit": "day",
"intervalCount": 0
},
"trialDays": 0,
"coupon": {
"code": "string",
"discountType": "percent",
"percentOffBps": 0,
"amountOffHalalas": "string"
},
"billingAnchorPolicy": "keep_anchor",
"billingAnchorAt": "2024-01-01T00:00:00Z",
"capturedAt": "2024-01-01T00:00:00Z"
},
"status": "trialing",
"revision": 0,
"originalBillingAnchorAt": "2024-01-01T00:00:00Z",
"currentPeriodStartedAt": "2024-01-01T00:00:00Z",
"currentPeriodEndsAt": "2024-01-01T00:00:00Z",
"nextBillingAt": "2024-01-01T00:00:00Z",
"scheduledCancellationAt": "2024-01-01T00:00:00Z",
"trialStartedAt": "2024-01-01T00:00:00Z",
"trialEndsAt": "2024-01-01T00:00:00Z",
"graceStartedAt": "2024-01-01T00:00:00Z",
"graceEndsAt": "2024-01-01T00:00:00Z",
"canceledAt": "2024-01-01T00:00:00Z",
"endedAt": "2024-01-01T00:00:00Z",
"scheduledCancellationReason": "string",
"customer": {
"id": "<uuid>",
"name": "string",
"email": "<email>",
"mobile": "string",
"avatarUrl": "<uri>",
"locale": "en"
},
"product": {
"id": "<uuid>",
"name": "string"
},
"paymentMethod": {
"methodType": "card",
"brand": "string",
"last4": "string",
"expiryMonth": 0,
"expiryYear": 0
},
"commercialTerms": {
"currency": "SAR",
"amountHalalas": 0,
"discountHalalas": 0,
"taxableAmountHalalas": 0,
"vatRateBps": 0,
"vatAmountHalalas": 0,
"totalHalalas": 0
},
"order": {
"count": 0,
"latestOrderId": "<uuid>"
},
"activity": {
"events": [
{
"id": "string",
"eventType": "string",
"occurredAt": "2024-01-01T00:00:00Z",
"actorKind": "user",
"summary": "string",
"metadata": {},
"requestId": "string",
"correlationId": "string"
}
],
"nextCursor": "string"
}
}
}{
"error": {
"code": "string",
"message": "string",
"requestId": "string",
"details": {}
}
}{
"error": {
"code": "string",
"message": "string",
"requestId": "string",
"details": {}
}
}{
"error": {
"code": "string",
"message": "string",
"requestId": "string",
"details": {}
}
}{
"error": {
"code": "string",
"message": "string",
"requestId": "string",
"details": {}
}
}{
"error": {
"code": "string",
"message": "string",
"requestId": "string",
"details": {}
}
}{
"error": {
"code": "string",
"message": "string",
"requestId": "string",
"details": {}
}
}{
"error": {
"code": "string",
"message": "string",
"requestId": "string",
"details": {}
}
}