Product widget JWT structure

The <JWT> must contain the encoded and signed content required to create the checkout. The content (before being encoded and signed) should have the following JSON format:

{
  "iss": "<MERCHANT_ID>",
  "sub": 'Merchant',
  "iat": "<CURRENT_TIMESTAMP>",
  "data": {
        "currency": "GBP",
        "merchantPrice": {
          "valueBeforeTax": <ITEM_N/MERCHANT_PRICE/VALUE_BEFORE_TAX>,
          "valueAfterTax": <ITEM_N/MERCHANT_PRICE/VALUE_AFTER_TAX>,
          "taxValue": <ITEM_N/MERCHANT_PRICE/TAX_VALUE>,
          "taxPercentage": <ITEM_N/MERCHANT_PRICE/TAX_PERCENTAGE>
        },
        "variant": {
          "reference": "<ITEM_N/VARIANT/REFERENCE>"
        }
      }
}

Field names marked with * are not supported yet.

Field details

Field
Type
Description

iss

String

Required. This should contain the merchant ID, which will be provided to the merchant ahead of time

iat

Integer

Required. This should be the timestamp when the payload is generated following the UNIX epoc time format

data

Required. Refer to the Data type for more info on its structure.

Data type

Field
Type

merchantReference

String

Required. Merchant reference for the checkout

currency

String

Required. 3 characters currency code following the ISO 4217 (e.g. GBP).

merchantPrice

Required. Refer to the Merchant price type for more info on its structure.

variant

Required. Refer to the Variant type for more info on its structure.

Merchant price type

Field
Type
Description

valueBeforeTax

Float

Required. Merchant price value before tax

valueAfterTax

Float

Required. Merchant price value after tax

taxPercentage

Float

Required. Tax percentage associated with the merchant price

Variant type

Field
Type
Description

reference

String

Required. Merchant reference that identifies uniquely the variant

Encode and sign payload content

To encode and sign the payload content the following is required:

  • Signing algorithm

  • Signing key

This information is shared with the merchant ahead of time

Please refer to the official JWT website for more information about signing/verification libraries.

Last updated

Was this helpful?