Creating a Session

Follow these steps to successfully complete a session request.
  1. Include any of these optional fields in the request:

    ADDITIONAL INFORMATION

    apSessionService_paymentMethod_name
    Set to
    N
    .
    billTo_street2
    Replace the
    #
    character with a sequential number starting from
    0
    .
    Replace the
    #
    character with a sequential number starting from
    0
    .
    Replace the
    #
    character with a sequential number starting from
    0
    .
    Replace the
    #
    character with a sequential number starting from
    0
    .
    Replace the
    #
    character with a sequential number starting from
    0
    .
    Replace the
    #
    character with a sequential number starting from
    0
    .
    When this field is included in the request, the
    purchaseTotals_grandTotalAmount
    field is no longer required.
    Replace the
    #
    character with a sequential number starting from
    0
    .
  2. Store the value in the
    processorToken
    field from the session response. You must include this value in the follow-on authorization request.

    ADDITIONAL INFORMATION

    <processorToken>
    5f97d636-85d1-486b-a1de-96111938ec61
    </processorToken>
  3. Redirect the customer to the returned Afterpay or Clearpay URL contained in the
    merchantURL
    response field.

    ADDITIONAL INFORMATION

    <merchantURL>
    https://portal.afterpay.com/us/checkout/?token=002.suuh2tq1gfvthg0180il0928fjkhg1p4ufg4savhihcvm9uj
    </merchantURL>
  4. When the customer completes the checkout using their Afterpay or Clearpay credentials, Afterpay or Clearpay redirects the customer to the success URL specified in the session request. You can now send an authorization request.
  5. When you send the authorization request, set the
    apAuthService_preapprovalToken
    field to the
    processorToken
    field value you stored from the session response.