Refund payment
POST /api/connector/v1/payments/refund
Refunds a specified payment on a specified account. A reason must be provided. Optionally, specify an amount for a partial refund. This operation supports Portfolio Access Tokens.
- Payment types: Only
CreditCardPayment
andAlternativePayment
can be refunded. Other payment types will fail. - Refund information: The refund is a payment itself. To get more information, use Get all payments with the
RefundId
as thePaymentId
. - Potential failures: This operation initiates the refund process, but refunds can fail if the payment is in a
Pending
state and fails processing. To check the status of a pending payment, including refunds, use Get all payments.
Request Body
Section titled “Request Body ”object
Token identifying the client application.
Access token of the client application.
Name and version of the client application.
Unique identifier of the enterprise. Required when using Portfolio Access Tokens, ignored otherwise.
Unique identifier of specific Payment.
Unique identifier of the account (for example Customer) the payment belongs to.
Refund reason.
Refund amount. If not provided, the whole payment will be refunded.
Example
{ "ClientToken": "E0D439EE522F44368DC78E1BFB03710C-D24FB11DBE31D4621C4817E028D9E1D", "AccessToken": "C66EF7B239D24632943D115EDE9CB810-EA00F8FD8294692C940F6B5A8F9453D", "Client": "Sample Client 1.0.0", "PaymentId": "f6313945-94c1-4e27-b402-031c2a8c989f", "AccountId": "fadd5bb6-b428-45d5-94f8-fd0d89fece6d", "Reason": "Sample reason", "ValueToRefund": 110.5, "EnterpriseId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"}
Responses
Section titled “ Responses ”OK
object
Unique identifier of specific Payment.
Unique identifier of refund.
Type of refund.
CreditCardPayment
AlternativePayment
Absolute value of the fee.
object
Payment state of the refund.
Charged
Canceled
Pending
Failed
Verifying
Example
{ "PaymentId": "f6313945-94c1-4e27-b402-031c2a8c989f", "RefundId": "1d65c488-111a-4719-b3ea-e1a9969c6069", "Type": "CreditCardPayment", "Amount": { "Currency": "GBP", "Value": 100 }, "State": "Pending"}
Server has successfully fulfilled the request and there is no additional information to send back.
object
Error caused by the client app, e.g. in case of malformed request or invalid identifier of a resource. In most cases, such an error signifies a bug in the client app (consumer of the API).
object
Error caused by usage of invalid ClientToken, AccessToken, or you may not have the necessary permission to use the endpoint.
object
Server error that should be reported to the end user of the client app. Happens for example when the server-side validation fails or when a business-logic check is violated.
object
Error caused by heavy request that takes too long to process (typically tens of seconds). To get around this, request data in smaller batches. For more information, see Request timeouts
object
Error caused by too many requests sent in a given amount of time. Response contains Retry-After
header indicating how long the user agent should wait before making a follow-up request. For more information, see Request limits.
object
Unexpected error on the Mews side. This may be due to a software fault. If such a situation occurs, the error will be logged and the development team notified, however you can raise an issue through GitHub on our documentation repository.