Tokens

Create a merchant token

Changed on

Creates a short-lived token for the merchant account identified by merchant_code and the requested actions.

Call this endpoint from your backend using a supported authentication method. You must have access to the merchant account. Before returning the token, check that the user signed in to your application is allowed to accept payments for that account.

Pass the returned access_token to the SDK. The token expires 15 minutes after creation; use expires_in for its remaining lifetime. To continue after it expires, create a new token through this endpoint.

post/v0.1/merchants/{merchant_code}/tokens

Request

  • Base URL
    https://api.sumup.com
  • URL
    https://api.sumup.com/v0.1/merchants/{merchant_code}/tokens
  • Auth
    • HTTP bearer
    • or OAuth 2
      Authorization code: https://api.sumup.com/authorize
      Token URL: https://api.sumup.com/token

Path parameters

merchant_codestring required
Example:MC0X0ABC

Unique code of the merchant account that will receive the payments.

Request body

actionsstring[] required

Actions the token allows for this merchant account.

Example request

{
  "actions": [
    "checkout"
  ]
}

Response

Merchant token created. Pass its access_token to the SDK.

access_tokenstring required

Secret token to pass to the SDK. Treat this value as an opaque string; do not parse it or depend on its format.

token_type'Bearer' required

Authentication scheme used by the token. Always Bearer.

expires_ininteger required

Remaining lifetime of the token in seconds when the response is created. Tokens expire 15 minutes after creation. Request a new token when needed.

Example response

{
  "access_token": "MERCHANT_TOKEN",
  "token_type": "Bearer",
  "expires_in": 899
}

Changes