Void
Use Void API to cancel an authorized PayBright transaction
Cancelling an Authorized Transaction
To cancel or delete an authorized PayBright transaction, you can use the x_gateway_reference to void it (for example, when a customer decides to cancel their order before it is captured or fulfilled). Voiding an authorized charge permanently cancels a loan.
Tip: A void can also be performed from the PayBright portal in addition to calling the API. The Void API only works if you are calling two different APIs for Auth and Capture.
We currently do not support partial voids; please perform a partial capture instead.
Refer to the API Reference guide for a description of the contents in the API and to identify the mandatory fields.
To void a transaction, you will need to create the signature using the API Key and API Token shared with you by the PayBright team.
curl --location --request POST 'https://sandbox.paybright.com/checkout/api2.aspx' \
--header 'Content-Type: application/json' \
--header 'Cookie: ASP.NET_SessionId=zye0eb5paobfolj3kthgj2fk' \
--data-raw '{
"x_account_id": "Z9s7Yt0Txsqbbx",
"x_amount": 1000.00,
"x_currency": "CAD",
"x_reference": 19783,
"x_gateway_reference": 123,
"x_transaction_type": "void",
"x_signature": "3a59e201a9b8692702b8c41dcba476d4a46e5f5c",
"x_test": true,
"x_url_callback": "https://mystore.io/ping/1"
}'
PayBright will send a response of void API call as a POST request to x_url_callback and a second response to the initial request. The x_result field in the response will return the status of void call which can be either 'completed' or 'failed.'
Tip: The call-back URL shall be able to process the POST request and return a 200 OK in the response. Failure to do so will result in synchronization issues between PayBright and your store.
You should receive a response that looks like this:
x_account_id=Z9s7Yt0Txsqbbx&x_amount=1000.00&
x_currency=CAD&x_gateway_reference=123
&x_message=Success
&x_reference=19783
&x_result=Completed
&x_test=true
&x_transaction_type=void
&x_timestamp=2020-07-21T12:16:35Z
&x_signature=c1787a157335e656c1d631b3802b2c93e4321ec08914eb968312d5eab1fa64c8
Please check the API Reference for more Void API details.
Updated about 4 years ago