Using Authorisation and Capture

For payment methods which support separate capture eg cards, the payment is completed in two steps:

  1. Authorisation - When the payment details are verified with the issuer and the funds are reserved(ring fenced).
  2. Capture - When the reserved funds are transferred from the shopper.

By default, payments are captured automatically without delay, immediately after authorisation. However, you can also capture the payment later i.e. once the goods are shipped.

To implement a separate authorisation and capture:

Authorise Payment

Make a POST /pay-ins/checkout request with "transactionType": "Auth":

curl --location --request POST 'https://sandbox.unipaas.com/platform/pay-ins/checkout' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer --PRIVATE_KEY--'
--data '
{
  "currency": "GBP",
  "isMoto": false,
  "amount": 100,
  "country": "GB",
  "email": "[email protected]",
  "transactionType":"Auth"
}
'

Authorization reserves a specific amount on a card for capturing at a later date, usually within seven days.

Capture Payment

In order to do a capture, make a POST /pay-ins/{authorizationId}/capture request:

curl --location --request POST 'https://sandbox.unipaas.com/platform/pay-ins/{authorizationId}/capture' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer --PRIVATE_KEY--'
--data '{"amount":100}'