Payment-Reject-v2

From Barion Documentation
Jump to navigation Jump to search
POST /v2/Payment/Reject

The /payment/reject API endpoint is used to cancel a payment in the Barion system before the payer completes it. After a successful call, the payer can no longer pay it.

Prerequisites before use:

v2 This API endpoint is available in API v2 only.

Authentication

Barion Shop Authentication

Use cases

This API endpoint is designed to be used in the following scenarios:

Only payments in Prepared status can be rejected, meaning the payer has not completed them yet. The result is the same as when the payer clicks "Back to shop without payment" on the Barion Smart Gateway:

  • the payment status becomes Canceled,
  • its unpaid transactions become Rejected,
  • Barion sends a callback to the shop.

Use other endpoints for payments in other stages:

Input properties

Property name Property type Limitations and constraints Description
POSKey Guid
  • Required
The secret API key of the shop, generated by Barion. This lets the shop authenticate through the Barion API, but does not provide access to the account owning the shop itself.
PaymentId Guid
  • Required
  • The payment must be in Prepared status
The identifier of the payment to reject, as returned by Payment/Start. If the payment is already Canceled or Expired, or is in any other status, the call returns an error.

Output properties

Property name Property type Description
PaymentId Guid The identifier of the payment, the same as in the request.
IsSuccessful bool true if the payment was rejected successfully.