Create a Widget token

Before using any of the widgets, a widget token must be aquired. This is done by sending a POST request to the widget endpoint on the backend channel. The response contains the token to use when rendering the widget and an expiry date when the token is no longer valid.

Important

The widget token should be reused for all widgets until it expires. Failing to do so will put our system under an unnecessary performance load, and might lead to a temporary shutdown of the feature for you.

/*
POST /widget HTTP/1.1
Host: checkout-api-uat.collector.se
Content-Type: application/json
Authorization: SharedKey bXlVc2VybmFtZTpmN2E1ODA4MGQzZTk0M2VmNWYyMTZlMDE...
*/
{
"storeId": 123
}

Request headers

HeaderRequiredExplanation
AuthorizationYesInstructions on how to generate the authorization header value can be found here.
Note that the authorization header is generated with the access credentials (usename and shared access key) received from Collector Merchant Services.

Request Body Properties

PropertyRequiredExplanation
storeIdYesReceived from Collector Merchant Services.

Response

PropertyExplanation
widgetTokenThe token used to render the widget.
expiresAtThe timestamp when the token expires and can no longer be used.