Get subscription
GET https://api.ecurring.com/subscriptions/{id}
Retrieve a single subscription by its identifier.
Parameters
Replace {id}
in the URL with the unique identifier of the subscription.
include
string |
Optional - A comma seperated list of relationships to include in the response. Possible values: customer / transactions
|
fields[TYPE]
string |
Optional - A comma seperated list of fields to return as data properties in the response. Known as Sparse Fieldsets.
Replace TYPE with the name of the resource.
|
Response
HTTP/1.1 200 OK
Content-Type: application/vnd.api+json
Data attributes
mandate_code
string |
The unique mandate code which is generated when creating a subscription. |
mandate_accepted
boolean |
Indicates whether the mandate has been accepted. A mandate can be accepted by the customer or automatically by using the API. |
mandate_accepted_date
datetime |
The date on which the mandate has been accepted. In ISO 8601 format. |
start_date
datetime |
The start date of the subscription. Transactions will be planned relative from this date. If the start date is in the future, eCurring won't charge any amounts before the specific date. In ISO 8601 format. |
status
string |
The current status of the subscription. Possible values are active / cancelled / paused / unverified .
|
cancel_date
datetime |
If a subscription has the status cancelled , this indicates the moment at which the subscription has been cancelled. When the date is in the future this indicates when the subscription will automatically be cancelled. In ISO 8601 format.
|
resume_date
datetime |
If a subscription has the status paused , this indicates on which date the subscription will be activated again. In ISO 8601 format.
|
confirmation_page
string |
The URL which allows customers to accept their mandate and activate their subscription. |
confirmation_sent
boolean |
Indicates whether the above confirmation page was sent to the customer, which is the default when a subscription is created without an accepted mandate. |
subscription_webhook_url
string |
Optional - The webhook URL we will call when the status of the subscription changes. Note: The URL must be reachable from the outside. Use a tool like ngrok for testing on your local environment. |
transaction_webhook_url
string |
Optional - The webhook URL we will call when the status of a transaction , scheduled by this subscription, changes. Note: The URL must be reachable from the outside. Use a tool like ngrok for testing on your local environment. |
success_redirect_url
string |
Optional - The URL we will redirect the client to after a succesful activation of the subscription (after the customer approved the mandate). |
metadata
mixed |
Optional - The metadata you provided during subscription creation |
archived
boolean |
Optional - Archived state of the subscription. |
created_at
datetime |
The date on which the subscription was created |
updated_at
datetime |
The date on which the subscription was last updated |
Relationships
subscription-plan
subscription-plan |
The subscription plan which is attached to the subscription |
customer
customer |
The customer which the subscription belongs to |
transactions
transaction |
The transactions of the subscription |
invoices
invoice |
The invoices of the subscription |
Example
{
"links": {
"self": "https://api.ecurring.com/subscriptions/1"
},
"data": {
"type": "subscription",
"id": "1",
"links": {
"self": "https://api.ecurring.com/subscriptions/1"
},
"attributes": {
"mandate_code": "ECUR-1",
"mandate_accepted": true,
"mandate_accepted_date": "2017-21-11T00:00:00+01:00",
"start_date": "2017-21-11T22:11:57+01:00",
"status": "active",
"cancel_date": null,
"resume_date": null,
"confirmation_page": "https://app.ecurring.com/mandate/accept/1/ECUR-1",
"confirmation_sent": false,
"subscription_webhook_url": null,
"transaction_webhook_url": null,
"success_redirect_url": null,
"metadata": {},
"archived": false,
"created_at": "2017-02-01T11:21:09+01:00",
"updated_at": "2017-02-11T00:00:00+01:00"
},
"relationships": {
"subscription-plan": {
"data": {
"type": "subscription-plan",
"id": "1"
}
},
"customer": {
"data": {
"type": "customer",
"id": "1"
}
},
"transactions": {
"links": {
"related": "https://api.ecurring.com/subscriptions/1/transactions"
},
"data": [
{
"type": "transaction",
"id": "02f3c67b-1e1a-4692-8826-14f17f9b2c61"
}
]
}
}
}
}