# REST API Integration
# Get Subscriptions List
This API returns a list of all the active subscriptions for a specific developer appId across all merchants in cases where the businessId parameter is not present.
Example:
Request URL - https://billing.poynt.net/apps/{appId}/subscriptions
Optional query params:
- businessId - merchant business ID
- start - pagination start value in ISO 8601 (opens new window) format
- count - pagination count
Example:
curl -X GET https://billing.poynt.net/apps/urn:aid:24c6e3d4-19e4-45c8-8231-6af2089dc694/subscriptions?businessId=2bd73f40-60ff-4ced-aafd-66f270a2972c
-H 'authorization: Bearer <access-token>'
-H 'cache-control: no-cache'
-H 'content-type: application/json'
Sample Response:
{
"list": [
{
"createdAt": "2018-06-09T02:44:22Z",
"updatedAt": "2018-06-10T02:44:23Z",
"startAt": "2018-06-09T00:00:00Z",
"businessId": "2bd73f40-60ff-4ced-aafd-66f270a2972c",
"appId": "urn:aid:24c6e3d4-19e4-45c8-8231-6af2089dc694",
"subscriptionId": "569b915f-2631-4cfb-ba36-fd23f9871e13",
"phase": "FULL",
"planId": "31b0f62f-da70-4bd3-880d-f98b40a05283",
"bundleId": "a8d8af83-06fc-4136-b0c5-2064b5a22f46",
"status": "ACTIVE"
},
{
"createdAt": "2018-06-11T19:27:45Z",
"updatedAt": "2018-06-11T19:27:45Z",
"startAt": "2018-06-11T00:00:00Z",
"businessId": "2bd73f40-60ff-4ced-aafd-66f270a2972c",
"appId": "urn:aid:24c6e3d4-19e4-45c8-8231-6af2089dc694",
"subscriptionId": "5edfded9-49fb-464c-922e-cf662734055f",
"phase": "TRIAL",
"planId": "eba1e538-52c8-4a4e-a73a-3650340de984",
"bundleId": "692f9ad6-409c-4035-9e1a-a0ea2bdbdf03",
"status": "ACTIVE"
}
],
"start": 0,
"total": 2,
"count": 2
}
# Get Specific Subscription Information
This can used to obtain additional details about a specific subscription from the Subscription Resource URL:
Sample Request:
Request URL - {endpoint}/apps/{appId}/subscriptions/{subscriptionId}
curl -X GET \
https://billing.poynt.net/apps/urn:aid:24c6e3d4-19e4-45c8-8231-6af2089dc694/subscriptions/5edfded9-49fb-464c-922e-cf662734055f \
-H 'authorization: Bearer <access-token>' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
Sample Response:
{
"createdAt": "2018-06-11T19:27:45Z",
"updatedAt": "2018-06-11T19:27:45Z",
"startAt": "2018-06-11T00:00:00Z",
"businessId": "2bd73f40-60ff-4ced-aafd-66f270a2972c",
"appId": "urn:aid:24c6e3d4-19e4-45c8-8231-6af2089dc694",
"subscriptionId": "5edfded9-49fb-464c-922e-cf662734055f",
"phase": "TRIAL",
"planId": "eba1e538-52c8-4a4e-a73a-3650340de984",
"bundleId": "692f9ad6-409c-4035-9e1a-a0ea2bdbdf03",
"status": "ACTIVE"
}
# Get Specific Plan Information
This can be used to obtain all the plan details for a particular app using the appId:
Sample Request:
Request URL - {endpoint}/apps/{appId}/plans
curl -X GET \
https://billing.poynt.net/apps/urn:aid:24c6e3d4-19e4-45c8-8231-6af2089dc694/plans \
-H 'authorization: Bearer <access-token>' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
Sample Response:
{
"list": [
{
"createdAt": "2018-06-08T18:28:12Z",
"updatedAt": "2018-06-08T18:28:12Z",
"amounts": [
{
"country": "US",
"currency": "USD",
"value": 100
}
],
"interval": "DAY",
"trialPeriodDays": 0,
"startPolicy": "IMMEDIATE",
"cancelPolicy": "IMMEDIATE",
"appId": "urn:aid:24c6e3d4-19e4-45c8-8231-6af2089dc694",
"amount": 100,
"planId": "2ed4c39f-ddf7-4294-9c10-aab16e8710b8",
"scope": "BUSINESS",
"description": "BillingTestDev $1",
"status": "ACTIVE",
"name": "BillingTestDev $1"
},
{
"createdAt": "2018-06-09T02:43:32Z",
"updatedAt": "2018-06-09T02:43:32Z",
"amounts": [
{
"country": "US",
"currency": "USD",
"value": 200
}
],
"interval": "DAY",
"trialPeriodDays": 1,
"startPolicy": "IMMEDIATE",
"cancelPolicy": "IMMEDIATE",
"appId": "urn:aid:24c6e3d4-19e4-45c8-8231-6af2089dc694",
"amount": 200,
"planId": "31b0f62f-da70-4bd3-880d-f98b40a05283",
"scope": "BUSINESS",
"description": "BillingTest Dev $2 with Trial 1 day",
"status": "ACTIVE",
"name": "BillingTest Dev $2 with Trial 1 day"
},
{
"createdAt": "2018-06-11T19:10:33Z",
"updatedAt": "2018-06-11T19:10:33Z",
"amounts": [
{
"country": "US",
"currency": "USD",
"value": 10000
}
],
"interval": "DAY",
"trialPeriodDays": 1,
"startPolicy": "IMMEDIATE",
"cancelPolicy": "IMMEDIATE",
"appId": "urn:aid:24c6e3d4-19e4-45c8-8231-6af2089dc694",
"amount": 10000,
"planId": "eba1e538-52c8-4a4e-a73a-3650340de984",
"scope": "BUSINESS",
"description": "BillingTest Dev $100 with Trial 1 day",
"status": "ACTIVE",
"name": "BillingTest Dev $100 with Trial 1 day"
}
],
"start": 0,
"total": 3,
"count": 3
}
# Next Steps
The Subscription information on activations and deletions allows you to get the merchant's current subscription status, upsell services/plans or provide technical support.