Payment-Reject-v2
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:
- Creating an account in Barion
- Creating a shop in Barion
- Calling the Barion API
- Initializing a payment
v2 This API endpoint is available in API v2 only.
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:
- to release an authorized delayed capture payment, use Payment/CancelAuthorization,
- to return money from a completed payment, use Payment/Refund.
Input properties
| Property name | Property type | Limitations and constraints | Description |
|---|---|---|---|
| POSKey | Guid |
|
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 |
|
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.
|