Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

API

URLs

...

Authorization

Every interaction with the API needs an Authorization Token. The token is generated per user. Set the following as a header for the request.

Upgrade

Subscriptions can be upgraded if the new subscription product is sold by the same vendor. 

...

Code Block
titleHeader
x-api-key : {token}
Content-Type : application/json
  • {token} -  the individual api token

Change Subscription Plan

 To obtain the subscription id of a purchase please configure an ITNS call (webhook) within the product itself. Please store the subscription id on your servers after receiving the webhook. The subscription id within the webhook is called aboid.

Code Block
titleRequest
POST /subscriptions/{subscription}/changeplan?product_id={product_id}

  • {subscription} - The id of the subscription to upgrade


Code Block
languagejfx
titleBody
linenumberstrue
{
	"product_id" : {product_id}
}
  • {product_id} - The id of the product you wish to subscribe to

Code Block
titleResponse - Success
linenumberstrue
{
  "data": {
    "id": 19,
    "amount": 50000,
    "recurring_amount": 50000,
    "currency": "EUR",
    "starts_at": "2017-01-30T00:00:00+0100",
    "ends_at": "2017-01-30T00:00:00+0100",
    "due_at": "2017-03-02T00:00:00+0100",
    "purchased_at": "2017-01-30T14:09:44+0100",
    "min_cancel_date": "2017-01-29T11:32:10+0100",
    "transacted_at": "2017-01-30T00:00:00+0100"
  }
}


Code Block
titleResponse - Error
linenumberstrue
# Wrong product id given
Status: 404
Message: Product resource not found


# Wrong subscription id given
Status: 404
Message: Subscription resource not found