Subscriptions
Cubed exposes an end point to deal with Subscriptions in real time. The URL structure is similar to our Impressions:
https://subscription-process.withcubed.com/subscription.js?aid=[aid]&tid=[tid]&subid=[subid]&rvn=[rvn]&cid=[cid]
For example:
https://subscription-process.withcubed.com/subscription.js?aid=client1-uk&tid=transaction123&subid=subscription678&rvn=130&cid=customer76
Configuration
Below is an explanation for each query param. Only a handful are required for the request to be successful.
Query Param | Name | Type | Required | Notes |
---|---|---|---|---|
aid | Account Token | String | Yes | This is the Cubed account token, please ask for yours. |
tid | Transaction Id | String | Yes | Transaction Id is used to keep Sales unique in our system. Cubed also uses this to join a Subscription sale that started on a web page, but was approved later. |
subid | Subscription Id | String | No | This is the unique Id from your internal system so we can track a Subcription repeating. This can be the same or different from the Transaction Id. |
rvn | Revenue | Integer | No | Revenue is collected as Britsh pence in Integer format. See our Tag for further information on this. |
cid | Customer Id | String | No | We can use Customer Ids in the Cubed system to help link external and internal data, similar to using Transaction Id. It is not needed as we usually join on Transaction Id, but does give us more data for the Subscription hits we recieve. |
Debugging
We aim to return a JSON http response that will contain validation errors. This means you can also handle issues from your end if needed.
For example, the following URL:
https://subscription-process.withcubed.com/subscription.js
Would return this response:
{
"status": false,
"message": "Validation errors",
"errors":{
"aid": "Required"
}
}