Subscription API - Get subscription
Get subscription
GET *base*/subscription/subscriptions/*id*
Authentication : API Key
Return subscription by specified id.
Parameters
Customer id.
Request example
GET <base>/subscription/1 HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Response
200
Content-type: application/json
ok
if success, else a message explaining what went wrong.
List of subscriptions
The status of the subscription.
The ID of the subscription.
The total value of the subscription.
The shipping value of the subscription.
The total amount of products in the subscription.
The currency that the subscription was registered with, SEK
, USD
, EUR
, etc.
An address object with the customer information.
The name of the customer.
The customer's address information.
The country of the customer. ISO-Alpha-2 (SE
, US
, GB
etc)
The date in Y-m-d H-i-s
format when the subscription was created.
The date in Y-m-d
format when the subscription starts.
The date in Y-m-d
format when the subscription has next shipping.
The interval between each subscription. Depending on intervaltype
it will be months or days.
The type of interval for the subscription
Month
interval is in months.Day
interval is in days.
Subscription price list id.
List of subscription packages. Contains packages IDs.
Subscription customer id
Response examples
HTTP/1.1 200 OK
Content-type: application/json
{
"status": "ok",
"subscriptions": [
{
"status": "active",
"id": 3,
"amount": "900.00",
"shipping": "20.00",
"itemCount": 2,
"currency": "SEK",
"createdAt": "2020-05-05 15:00:00",
"startDate": "2020-05-05",
"nextOrderDate": "2020-05-06",
"interval": 14,
"intervalType": "Day",
"pricelist": "19",
"packages": ["1"],
"address": {
"firstName": "Kalle",
"lastName": "Anka",
"phoneNumber": "+4687203333",
"address1": "Malarvarvsbacken 8",
"address2": "c/o Young Skilled AB",
"zipCode": "11733",
"city": "Stockholm",
"state": "",
"country": "SE"
},
"customer": "132",
}
]
}
Error examples
{
"status": "Subscription not found",
"error": true
}