Merchant API
Refund an order
api
post
/api/1.0/orders/{order_id}/refund

Refund an order

Issue a refund for a completed order. A refund can be either full or partial. Funds are refunded to the customer's original payment method.

The refund operation creates a new order that represents such refund.

You can initiate a refund for an order only when it is in the COMPLETED state.

Authorization

Each Merchant API request must contain an authorization header in the following format to make a call:

'Authorization: Bearer <yourSecretApiKey>'

Before you start, ensure that you've successfully applied for a Merchant Account in your Revolut Business Account.

The Public key is on the same path in your Revolut Business account as the Secret key. There are two different functions for each:

  • Public key should be provided with payment methods at checkout
  • Secret key is used as a part of the authorization header for all server calls, e.g., creating order

Complete the following steps to generate the Production API keys (Secret, Public):

  1. Log in to your Revolut Business portal.
  2. On the top left corner, click your account name, click APIs then select Merchant API.
  3. Under the Production API Secret key and Production API Public key sections you will find the API keys needed. If it's your first time on this page, you will need to click the Generate button to create your unique API keys.

You can also use this link to directly open the Merchant API page.

Merchant API - Settings

note

Use these keys only for the production environment. For the Revolut Business Sandbox environment, use the sandbox API keys.

SSL

note

This authentication protocol is used exclusively when using Fast checkout.

Connection over HTTPS is using SSL authentication. For successful authentication, your system's certificate should be issued by a Public Certificate Authority (PCA) and your system should trust Revolut's public certificate.

Revolut-Pay-Payload-Signature

note

This authentication protocol is used exclusively when using Fast checkout.

Data integrity and authorship will be verified using a payload-based signature. The response of a successful URL registration for address validation (see: Register address validation for Fast checkout) will contain a secret signing key.

The signing key will be used by Revolut to compute a Hash-based Message Authentication Code (HMAC) payload signature whenever the registered URL is called, which should be verified by your backend.

Request

Path Parameters
Path Parameters

The ID of the Order object.

Request body
Body object

The amount of the refund (minor currency unit). For example, enter 7034 for €70.34 in the field.

This amount can't exceed the remaining amount of the original order. To get the refundable amount, subtract the value of the refunded_amount from the value of the order_amount in the original order. See Retrieve an order.

The description of the refund.

Merchant order ID for external reference.

Use this field to set the ID that your own system can use to easily track orders.

Possible values: <= 50

Additional information to track your orders in your system, by providing custom metadata.

Restrictions:

  • Max length of metadata values: 500
  • Format of metadata keys: ^[a-zA-Z][a-zA-Z\\d_]{0,39}$

Response

OK

Response body
Body object

Permanent order ID used to retrieve, capture, cancel, or refund an order after authorization.

Temporary ID for the order.

It expires when the payment is authorized.

Possible values: [PAYMENT, REFUND, CHARGEBACK]

The type of the order.

Possible values: [PENDING, PROCESSING, AUTHORISED, COMPLETED, CANCELLED, FAILED]

The state of the order.

info

For more information about the order lifecycle, see: Order and payment lifecycle.

The date and time the order was created.

The date and time the order was last updated.

The date and time the order was completed.

The description of the order.

The capture mode of the order. AUTOMATIC is used by default.

  • AUTOMATIC: The order is captured automatically after payment authorization.
  • MANUAL: The order is not captured automatically. You must manually capture the order later.

For more information, see Capture an order.

ISO 4217 currency code in upper case. All payments made towards this order are settled in this currency.

Merchant order ID for external reference.

Use this field to set the ID that your own system can use to easily track orders.

The ID of the customer associated with this order.

The email of the customer.

The phone number of the customer.

The amount and currency of the order.

The amount of the order (minor currency unit). For example, enter 7034 for €70.34 in the field.

The currency of the order. ISO 4217 currency code in upper case.

The amount and currency outstanding to be paid for this order.

The amount of the order (minor currency unit) that is outstanding. For example, enter 7034 for €70.34 in the field.

The currency of the amount that is outstanding. ISO 4217 currency code in upper case.

The amount and currency of the refunded order.

The amount of the refunded order (minor currency unit). For example, enter 7034 for €70.34 in the field.

The currency of the refunded order. ISO 4217 currency code in upper case.

Street line 1 information.

Street line 2 information.

The region associated with the address.

The city associated with the address.

The country associated with the address.

The postcode associated with the address.

The details of all the payments that have been made towards this order (successful or unsuccessful).

The ID of the payment.

Possible values: [PROCESSING, AUTHORISED, CAPTURED, COMPLETED, FAILED, DECLINED, CANCELLED]

The state of the payment.

Possible values: [do_not_honour, 3ds_challenge_abandoned, 3ds_challenge_failed, 3ds_challenge_failed_manually, insufficient_funds, transaction_not_allowed_for_cardholder, high_risk, cardholder_name_missing, unknown_card, invalid_card, invalid_email, restricted_card, expired_card, rejected_by_customer, withdrawal_limit_exceeded, pick_up_card, invalid_amount]

The reason for a FAILED or DECLINED payment.

A failed or declined payment can result from multiple reasons. To learn more, check our failure reasons.

The date and time the payment was created.

The date and time the payment was last updated.

Temporary token of the payment used to fetch the reward offer during checkout and link user registrations to the given offers.

The token is only valid for a limited time.

The amount and currency of the payment.

The amount of the payment (minor currency unit). For example, enter 7034 for €70.34 in the field.

The currency of the payment. ISO 4217 currency code in upper case.

The amount and currency of the settled payment.

The amount of the settled payment (minor currency unit). For example, enter 7034 for €70.34 in the field.

The currency of the settled payment. ISO 4217 currency code in upper case.

The details of the payment method used to make the payment.

The ID of the payment method. This value is present only if the payment method was previously saved.

Possible values: [CARD, REVOLUT]

The type of the payment.

The details of the card. Only present for payments with payment_method.type = CARD.

Possible values: [VISA, MASTERCARD]

The type of the card.

Possible values: [CREDIT, DEBIT, PREPAID]

The type of card funding.

The country where the card was issued.

Possible values: >= 6 characters and <= 6 characters

The BIN of the card.

Possible values: >= 4 characters and <= 4 characters

The last four digits of the card.

The expiry date of the card in the format of MM/YY.

The name of the cardholder.

The details of the check for card payment. Only for orders with successful payments.

The details of the 3-D Secure check. Only for orders with successful payments.

Possible values: [VERIFIED, FAILED, CHALLENGE]

The result of 3-D Secure check.

The 3-D Secure version.

Possible values: [MATCH, NOT_MATCH, INCORRECT, NOT_PROCESSED]

The result of CVV verification.

MATCH: CVV matches the card's CVV NOT_MATCH: CVV does not match the card's CVV INCORRECT: CVV format is incorrect for this type of card NOT_PROCESSED: CVV verification was not performed

Possible values: [MATCH, NOT_MATCH, N_A, INVALID]

The result of address verification.

Possible values: [MATCH, NOT_MATCH, N_A, INVALID]

The result of postcode verification.

Possible values: [MATCH, NOT_MATCH, N_A, INVALID]

The result of cardholder verification.

Street line 1 information.

Street line 2 information.

The region associated with the address.

The city associated with the address.

The country associated with the address.

The postcode associated with the address.

Possible values: [LOW, HIGH]

The risk level of the card.

If the risk level is HIGH, the payment might be declined.

The details of the order fee.

Possible values: [FX, ACQUIRING]

The type of the order fee.

The amount and currency of the payment fee.

The amount of the payment fee (minor currency unit). For example, enter 7034 for €70.34 in the field.

The currency of the payment fee. ISO 4217 currency code in upper case.

The details of related orders. You can use the ID of the related order to Retrieve the order information.

The ID of the related order. You can use this ID to get more information about the related order using the Retrieve an order operation.

Possible values: [PAYMENT, REFUND, CHARGEBACK]

The type of the related order.

Possible values: [PENDING, PROCESSING, AUTHORISED, COMPLETED, CANCELLED, FAILED]

The state of the related order.

The amount and currency of the related order.

The amount of the order (minor currency unit). For example, enter 7034 for €70.34 in the field.

The currency of the order. ISO 4217 currency code in upper case.

Possible values: <= 50

Additional information to track your orders in your system, by providing custom metadata.

Restrictions:

  • Max length of metadata values: 500
  • Format of metadata keys: ^[a-zA-Z][a-zA-Z\\d_]{0,39}$

Link to a checkout page hosted by Revolut.

Possible values: <= 2000 characters

The URI of the order stored in the merchant's order management system.

This URI will be included in the order confirmation email for payments made via Revolut Pay. If specified, this URI will override the default link to the merchant's Business website configured in the Revolut Business account.

caution

Restrictions:

  • Max length of merchant_order_uri string: 2000
  • Only valid http:// or https:// domains are accepted
  • Domain cannot be localhost or IP address
Was this page helpful?
Loading...