Difference between revisions of "Payment-Refund-v2"

From Barion Documentation
Jump to navigation Jump to search
(Output properties)
(Possible error responses)
Line 67: Line 67:
 
|-
 
|-
 
| ModelValidationError || This happens when some of the input properties fail the basic validation. For example a string property exceeds its allowed length.
 
| ModelValidationError || This happens when some of the input properties fail the basic validation. For example a string property exceeds its allowed length.
 +
|-
 +
| NotExistingPaymentId || The specified payment id is invalid.
 +
|-
 +
| SuspendedUserTriedToRefund || You are not allowed to refund a payment if you are suspended.
 +
|-
 +
| TheSourceAndDestinationAccountsAreMatched || Very rare error, this happens in case the payment was payed by the shop owner.
 
|-
 
|-
 
|}
 
|}

Revision as of 16:41, 21 January 2020

Barion API: Execute the refund of a payment

POST /v2/Payment/Refund

The /payment/refund API endpoint is used to execute a refund of an existing, completed payment.

Prerequisites before use:


v2 This API endpoint is available in API v2 only.

Use cases

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

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 to authenticate through the Barion API, but does not provide access to the account owning the shop itself.
PaymentId Guid
  • Required
The identifier of the payment in the Barion system.
TransactionsToRefund TransactionToRefund[]
  • Required
An array containing the payment transactions to refund.

Output properties

Property name Property type Description
PaymentId Guid The identifier of the payment in the Barion system.
RefundedTransactions RefundedTransaction[] An array containing information about the refunded transactions.

Possible error responses

Error code Description
ModelValidationError This happens when some of the input properties fail the basic validation. For example a string property exceeds its allowed length.
NotExistingPaymentId The specified payment id is invalid.
SuspendedUserTriedToRefund You are not allowed to refund a payment if you are suspended.
TheSourceAndDestinationAccountsAreMatched Very rare error, this happens in case the payment was payed by the shop owner.