Get subscription¶
Warning
The v1 API has been deprecated. The v1 API will be supported for the foreseeable future, at least until July 2023. However, new features will only be added to the v2 API.
The documentation for retrieving subscriptions in the new v2 API can be found here. For more information on the v2 API, refer to our v2 migration guide.
GET
https://api.mollie.com/v1/customers/*customerId*/subscriptions/*id*
Retrieve a subscription by its ID and its customer’s ID.
Parameters¶
Replace customerId
in the endpoint URL by the customer’s ID, and replace id
by the subscription’s ID. For
example /v1/customers/cst_8wmqcHMN4U/subscriptions/sub_rVKGtNd6s3
.
Access token parameters¶
If you are using organization access tokens or are creating an
OAuth app, the testmode
query string parameter is also available.
true
to retrieve a test mode subscription.Response¶
200
application/json
resource
stringsubscription
for this endpoint.id
stringsub_rVKGtNd6s3
.customerId
stringcst_8wmqcHMN4U
.mode
stringThe mode used to create this subscription. Mode determines whether the subscription’s payments are real or test payments.
Possible values: live
test
createdDatetime
datetimestatus
stringThe subscription’s current status, depends on whether the customer has a pending, valid or invalid mandate.
Possible values: pending
active
cancelled
suspended
completed
amount
decimaltimes
integerinterval
stringInterval to wait between charges, for example 1 month
or 14 days
.
Possible values: ... months
... weeks
... days
startDate
dateYYYY-MM-DD
format.description
stringmethod
stringThe payment method used for this subscription, either forced on creation or null
if any of the customer’s valid
mandates may be used.
Possible values: creditcard
directdebit
paypal
null
cancelledDatetime
datetimelinks
objectAn object with URLs important to the subscription.
webhookUrl
stringExample¶
Request¶
1 2 | curl -X GET https://api.mollie.com/v1/customers/cst_stTC2WHAuS/subscriptions/sub_rVKGtNd6s3 \ -H "Authorization: Bearer test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM" |
Response¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | HTTP/1.1 200 OK Content-Type: application/json { "resource": "subscription", "id": "sub_rVKGtNd6s3", "customerId": "cst_stTC2WHAuS", "mode": "live", "createdDatetime": "2016-06-01T12:23:34.0Z", "status": "active", "amount": "25.00", "times": 4, "interval": "3 months", "description": "Quarterly payment", "method": null, "cancelledDatetime": null, "links": { "webhookUrl": "https://webshop.example.org/payments/webhook" } } |