Checkout creation

GraphQL query

  • The <ESCAPED_QUERY> must contain the following GraphQL query:

mutation($merchantId: ID!, $payload: String!) {
  createMerchantCheckout(merchantId: $merchantId, payload: $payload) {
    checkout {
      token
    }
    errors {
      code
      field
      message
    }
  }
}
  • Please refer to the JWT structure section for more details about how to the generate the <JWT>

  • The checkout creation:

    • is successful if the response contains a checkout token.

    • is not successful if the response contains a list of errors.

JWT structure

The <JWT> must contain the encoded and signed content required to create the checkout. Read more information about encoding and signing in Authenticated requests.

The content (before being encoded and signed) should have the following JSON format:

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
Description

merchantReference

String

Required. Merchant reference for the checkout

currency

String

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

callbackUrls

Required. Refer to the Callback URLs type for more details on its structure

customerInfo

  • Optional for checkout creation

  • Required for checkout submission.

  • Refer to the Customer info type for more details on its structure

address

  • Optional for checkout creation

  • Required for checkout submission.

  • Refer to the Address type for more details on its structure

previousAddress

  • Optional

  • Refer to the Address type for more details on its structure

paymentInfo

  • Optional for checkout creation

  • Required for checkout submission.

  • Refer to the Payment info type for more details on its structure

items

Required. Refer to the Item type for more details on its structure

Callback URLs type

Field
Type
Description

successRedirect

String

URL to redirect the customer when the checkout was completed successfully

failureRedirect

String

URL to redirect the customer when the checkout was not completed successfully

serverToServer

String

Required. URL for Raylo to perform requests to the merchant server

Customer info type

Field
Type
Description

firstName

String

  • Required for checkout submission.

  • Optional for checkout creation

Customer's first name

lastName

String

  • Optional for checkout creation

  • Required for checkout submission.

Customer's last name

email

String

  • Optional for checkout creation

  • Required for checkout submission.

Customer's email address

mobilePhoneNumber

String

  • Optional for checkout creation

  • Required for checkout submission.

Customer's mobile phone number using either a valid:

  • local format for the country

  • international format (e.g. starting with +<COUNTRY_CODE>)

dateOfBirth

String

  • Optional for checkout creation

  • Required for checkout submission.

Customer's date of birth in the ISO8601 format (YYYY-MM-DD)

Address type

Field
Type
Description

line1

String

Required. Address line 1

line2

String

Address line 2

line3

String

Address line 3

city

String

Required. City

postcode

String

Required. Postcode in a valid format for their country

region

String

Region

countryIsoAlpha2

String

Required. 2 characters country code using the ISO3166

Payment Info type

Field
Type
Description

bankAccountName

String

Required. Customer's bank account name

bankAccountNumber

String

Required. Account number following the local format for the country (e.g. 8 characters in the UK)

bankBranchIdentifier

String

Required. Branch identifier following the local format for the country (e.g. 6 characters in the UK)

directDebitMandateAuthorised

Boolean

Required. Customer's confirmation for Raylo to be authorized to perform direct debits from the customer's bank account

Item type

Field
Type
Description

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.

termLength

Integer

Optional. Lease term length

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

taxValue

Float

Required. Difference between the value before and after tax

Variant type

Field
Type
Description

reference

String

Required. Merchant reference, , sometimes called an SKU, that identifies uniquely the variant.

Last updated

Was this helpful?