Skip to content

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 and AlternativePayment 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 the PaymentId.
  • 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.
PaymentRefundParameters
object
ClientToken
required

Token identifying the client application.

string
>= 1 characters
AccessToken
required

Access token of the client application.

string
>= 1 characters
Client
required

Name and version of the client application.

string
>= 1 characters
EnterpriseId

Unique identifier of the enterprise. Required when using Portfolio Access Tokens, ignored otherwise.

string format: uuid
nullable
PaymentId
required

Unique identifier of specific Payment.

string format: uuid
AccountId
required

Unique identifier of the account (for example Customer) the payment belongs to.

string format: uuid
Reason
required

Refund reason.

string
>= 1 characters
ValueToRefund

Refund amount. If not provided, the whole payment will be refunded.

number format: double
nullable
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"
}

OK

PaymentRefundResult
object
PaymentId
required

Unique identifier of specific Payment.

string format: uuid
RefundId
required

Unique identifier of refund.

string format: uuid
Type
required
Refund type

Type of refund.

CreditCardPayment

AlternativePayment

string
Allowed values: CreditCardPayment AlternativePayment
Amount
required
Currency value (ver 2023-02-02)

Absolute value of the fee.

object
Currency
required
string format: currency
>= 1 characters
Value
required
number format: double
State
required
Payment state

Payment state of the refund.

Charged

Canceled

Pending

Failed

Verifying

string
Allowed values: 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.

ConnectorApiExceptionResult
object
Message
string
nullable
RequestId
string
nullable
Details
nullable

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).

ConnectorApiExceptionResult
object
Message
string
nullable
RequestId
string
nullable
Details
nullable

Error caused by usage of invalid ClientToken, AccessToken, or you may not have the necessary permission to use the endpoint.

ConnectorApiExceptionResult
object
Message
string
nullable
RequestId
string
nullable
Details
nullable

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.

ConnectorApiExceptionResult
object
Message
string
nullable
RequestId
string
nullable
Details
nullable

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

ConnectorApiExceptionResult
object
Message
string
nullable
RequestId
string
nullable
Details
nullable

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.

ConnectorApiExceptionResult
object
Message
string
nullable
RequestId
string
nullable
Details
nullable

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.

ConnectorApiExceptionResult
object
Message
string
nullable
RequestId
string
nullable
Details
nullable