Terminating the subscription via an API call

In order to use unsubscribe API you would need to send a post request to https://subscriptions-jwt.fortumo.io/subscriptions/cancel and include "Bearer" parameter in the request header as instructed here. After successful subscription termination users will receive a confirmation message and Fortumo will send your server a notification as well. Please note that in order to use this API please get in touch with your account manager.

Request parameters
Parameter Type Required Description
subscription_uuid String Mandatory The uuid of the subscription you wish to cancel, e.g. fbc53c9a-0040-4303-9b91-eb3d305be0d7
merchant String Mandatory Your merchant id. e.g: 93d9523134eee0f22716e49093af881a
1
2
3
4
5
6
7
8
9
POST /subscriptions/cancel HTTP/1.1
Host: subscriptions-jwt.fortumo.io
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9....CgVKRghGWI6-QjMv8JpJi1GarWaQ06CG9d0c1PDFek

{
  	"subscription_uuid": "fbc53c9a-0040-4303-9b91-eb3d305be0d7",
  	"merchant": "93d9523134eee0f22716e49093af881a"
}

Callback triggered on status change

After a successful unsubscribe a callback is sent to merchant notifying the relevant status change.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
POST https://merchant-callback.url/ HTTP/1.1
Content-Type: application/json

{
    "subscription_uuid":"fbc53c9a-0040-4303-9b91-eb3d305be0d7",
    "charging_token":"8c6799cf-e888-43s7-994e-1c328b8e8a6d:7fb7daba",
    "merchant":"93d9523134eee0f22716e49093af881a",
    "operation_reference":"unsubscribe_ref1",
    "subscription_status":"cancelled",
    "billing_status":"charged",
    "service_starts_at":"2018-04-23T09:52:43.086Z",
    "service_ends_at":"2018-07-02T09:52:43.086Z",
    "consumer_identity":"e1903198-6d03-32be-a3d8-374e3d87dd65",
    "error":{},
    "timestamp":"2018-06-29T07:49:09.052Z",
    "price":{
        "amount":4.99,
        "currency":"EUR"
    },
    "action":"cancellation",
    "unsubscribe_url":"https://fortumo.eu/u/wRB1dCwNWWmm"
}
Help us improve our Merchants Portal. Was this article helpful?