Instore (Capture using Gateway Reference)

Overview

This API call provides captures in store orders that have just been authorized. You will need to use the PayBright Gateway Reference, also known as the Contract Key, to capture this order.

If you recieve a 200 code response, along with the x_result 'success', you have successfully captured this order. If you recieve a 400 error, or the x_result returned is not 'success', you have not captured the application.

📘

Auth then Capture

This API should only be used when the merchant would like to execute two distinct authorization and capture events.

Capturing the Order

Our In Store APIs use Basic Authorization, You can use create the Authorization Key using the API Key and Token shared with you by PayBright.

🚧

Security Token

Authorization Key will be a Base 64 encoding of APIKey:APIToken string e.g.

If API Key == txtzmjUfVsfEctvnBCjW and API Token == fd5jyxjSLLNwFPZTCfko
Then the formatting will be txtzmjUfVsfEctvnBCjW:fd5jyxjSLLNwFPZTCfko

Use https://www.base64encode.org/ for testing the Base64 encoding you create

In this example, this will result in the Key being:
dHh0em1qVWZWc2ZFY3R2bkJDalc6ZmQ1anl4alNMTE53RlBaVENma28=

Body of this API contains the required parameters to capture.

📘

v.2 Updated API URL

The new API url for Instore (Capture using Gateway Reference) is:
Sandbox:
https://sandbox.api.paybright.com/api/v2/instore/{GatewayReference}/capture/
Production:
https://api.paybright.com/api/v2/instore/{GatewayReference}/capture/

curl --location --request POST 'https://sandbox.api.paybright.com/api/v2/instore/68107/capture/' \
--header 'Authorization: Basic dHh0em1qVWZWc2ZFY3R2bkJDalc6ZmQ1anl4alNMTE53RlBaVENma28=' \
--header 'Content-Type: application/json' \
--data-raw '{
  "x_account_id": "WVejbO48xRDKuSEY5fzd7dOtJRpvnzOVGT5fyht4abNUgn8cRQ",
  "x_amount": "400",
  "x_reference": "f11bc1c1-57d5-47fd-bfee-561ba351893b",
  "x_currency": "CAD",
  "x_test": true
}'

Response

You will recieve a response letting you know if the capture was successful, along with a few other select values.

{
    "x_account_id": "WVejbO48xRDKuSEY5fzd7dOtJRpvnzOVGT5fyht4abNUgn8cRQ",
    "x_reference": "f11bc1c1-57d5-47fd-bfee-561ba351893b",
    "x_currency": "CAD",
    "x_test": "true",
    "x_amount": "400.00",
    "x_gateway_reference": "68107",
    "x_timestamp": "2021-05-06T18:14:21Z",
    "x_result": "Completed",
    "x_message": "Success"
}

This will also result in the contract turning from PENDING to Complete or FINAL.