Update subscription¶
Subscription API v1
PUT
*base*/subscription/subscription/*id*
Authentication:API key
Update a subscription.
Parameters¶
enum
optional
|
Subscription status
|
Request examples¶
1 2 3 4 | POST <base>/subscription/1 HTTP/1.1
Content-Type: application/x-www-form-urlencoded
status=active
|
Response¶
200
Content-type: application/json
string
required
|
ok if success, else no . |
||||||||||||||||||||||||||||||||||||
array
required
|
List of subscriptions.
|
||||||||||||||||||||||||||||||||||||
boolean
optional
|
If true , the subscription update was not successful. The status should contain information on why. |
Response example¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | {
"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¶
Subscription not found:
1 2 3 4 | {
"status": "Subscription not found",
"error": true
}
|
Invalid subscription status:
1 2 3 4 | {
"status": "Invalid status provided",
"error": true
}
|
Restore cancelled subscription error:
1 2 3 4 | {
"status": "Cannot restore cancelled subscription",
"error": true
}
|