Cancel a Subscription
PUT
/subscriptions/
const url = 'http://pay.caspeco.net/subscriptions/';const options = { method: 'PUT', headers: { Location: 'http://pay.caspeco.net/v1/subscriptions/', Host: 'pay.caspeco.net', Date: 'Tue, 15 Nov 2014 08:12:31 GMT', Digest: 'SHA-256=7oaYBB1oQVPy1BvP2ndYtxdD5EWNynt9lxCHzOdXb1A=', 'Content-Type': 'application/json' }, body: '{"Id":"b87ca816-cbe2-47c3-9b01-d90a8a88f770"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url http://pay.caspeco.net/subscriptions/ \ --header 'Content-Type: application/json' \ --header 'Date: Tue, 15 Nov 2014 08:12:31 GMT' \ --header 'Digest: SHA-256=7oaYBB1oQVPy1BvP2ndYtxdD5EWNynt9lxCHzOdXb1A=' \ --header 'Host: pay.caspeco.net' \ --header 'Location: http://pay.caspeco.net/v1/subscriptions/' \ --data '{ "Id": "b87ca816-cbe2-47c3-9b01-d90a8a88f770" }'Cancel a subscription with sepcific parameters
Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Location
Host
string
E.g. pay.caspeco.net
Example
pay.caspeco.netDate
string
E.g. Tue, 15 Nov 2014 08:12:31 GMT
Example
Tue, 15 Nov 2014 08:12:31 GMTDigest
string
E.g. SHA-256=7oaYBB1oQVPy1BvP2ndYtxdD5EWNynt9lxCHzOdXb1A=
Example
SHA-256=7oaYBB1oQVPy1BvP2ndYtxdD5EWNynt9lxCHzOdXb1A=Request Body
Section titled “Request Body”Media typeapplication/json
object
Id
string
Example
{ "Id": "b87ca816-cbe2-47c3-9b01-d90a8a88f770"}Responses
Section titled “Responses”Created
Media typeapplication/json
object
BuyerId
integer
MerchantId
integer
SubscriptionId
string
Charges
Array<object>
object
Id
string
Captured
boolean
Refunded
boolean
Amount
decimal
Currency
string
Merchant
integer
Customer
string
Order
string
OrderDescription
string
CreatedDate
string
LastCharge
string
NextCharge
string
Status
string
OrderNumber
string
PlanId
string
Examples
Exampleresponse
{ "BuyerId": 12922, "MerchantId": 1215, "SubscriptionId": "owjdaosdjq832u3jei", "Charges": [ { "Id": "aaa111", "Captured": true, "Refunded": false, "Amount": 10000, "Currency": "SEK", "Merchant": 1234, "Customer": "9d211740", "Order": "ABC123", "OrderDescription": "Silverpaketet" } ], "CreatedDate": "2016-03-31", "LastCharge": "2016-03-31", "NextCharge": "2016-03-31", "Status": "Firstfailed", "OrderNumber": "12312300", "PlanId": "64f7d444-67f3-47b9-b4b3-7207a4043d9a"}