---
api: 'Merchant API'
---

# Pay for an order

Initiate a payment to pay full amount for an order using a customer's saved payment method.

:::note
The `/orders/{order_id}/confirm` endpoint has been deprecated. It will be only supported for already existing implementations.
:::

:::warning
This endpoint is part of a new API, pay attention to the different endpoint URL. 
:::

For more information about how to save and charge payment methods, see: [Charge a customer's saved payment method](/docs/guides/merchant/optimise-checkout/save-payment-methods/charge-saved-payment-method).

The following table shows who can initiate payments on saved payment methods (`initiator` parameter), depending on if the payment method was saved for the customer or the merchant (`savedPaymentMethodFor` parameter):

  |                           | `savePaymentMethodFor: customer` | `savePaymentMethodFor: merchant` |
  | ------------------------- | -------------------------------- | -------------------------------- |
  | **`initiator: customer`** | Allowed                          | Allowed                          |
  | **`initiator: merchant`** | Not allowed                      | Allowed                          |


:::note
Using this endpoint, only merchant initiated payments are supported with Revolut Pay.
:::
          
For more information about customers' payment methods, see the [Retrieve payment method list of a customer](/docs/api/merchant#retrieve-payment-method-list-of-a-customer) operation.

## Endpoint

POST `/api/orders/{order_id}/payments`

## Request body

### Attributes

- `saved_payment_method` (object)
    Object containing information about the saved payment method used to pay for the order.
  - `saved_payment_method.type` (enum)
      Type of saved payment method.
      Possible enum values:

      - `card`
      - `revolut_pay`
  - `saved_payment_method.id` (string)
      Saved payment method ID.
  - `saved_payment_method.initiator` (enum)
      Indicates who is allowed to initiate the payment. 
      
      :::note
      Using this endpoint, only merchant initiated payments are supported with Revolut Pay.
      :::
      Possible enum values:

      - `customer`
      - `merchant`
  - `saved_payment_method.environment` (object)
      Environment object, indicating in which environment the payment was made.
      
      :::warning
      Only required if `initiator: customer`.
      :::
      
      :::note
      Only `browser` is available at the moment.
      :::

## Returns

### 200

Payment initiated

#### Response attributes

- `id` (string)
    The ID of the payment.
- `order_id` (string)
    Permanent order ID used to retrieve, capture, cancel, or refund an order after authorization.
- `payment_method` (object)
    The payment method used to pay for the order.
- `token` (string, optional)
    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.
- `amount` (integer, optional)
    The payment amount in minor units (e.g., cents). The value of this field depends on the payment type and state.
    
    | Payment type | State | Amount value |
    |--------------|-------|--------------|
    | Standard payment | Any | Total payment amount |
    | Pre-authorised payment | `authorisation_started` | New amount being authorised (during increment processing) |
    | Pre-authorised payment | `authorised` | Currently authorised amount (equals `authorised_amount`) |
    
    :::info
    For pre-authorised payments, see the `authorised_amount` field for tracking the currently authorised amount separately.
    :::
- `currency` (string, optional)
    [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
    
    :::info
    For more information about the supported currencies, see: [Help Center](https://help.revolut.com/business/help/merchant-accounts/payments/in-which-currencies-can-i-accept-payments/).
    :::
- `state` (enum, optional)
    The status of the payment.
    Possible enum values:

    - `pending`
    - `authentication_challenge`
    - `authentication_verified`
    - `authorisation_started`
    - `authorisation_passed`
    - `authorised`
    - `capture_started`
    - `captured`
    - `refund_validated`
    - `refund_started`
    - `cancellation_started`
    - `declining`
    - `completing`
    - `cancelling`
    - `failing`
    - `completed`
    - `declined`
    - `soft_declined`
    - `cancelled`
    - `failed`
- `decline_reason` (enum, optional)
    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](/docs/guides/merchant/reference/error-codes/decline-reasons).
    Possible enum values:

    - `3ds_challenge_abandoned`
    - `3ds_challenge_failed_manually`
    - `cardholder_name_missing`
    - `customer_challenge_abandoned`
    - `customer_challenge_failed`
    - `customer_name_mismatch`
    - `do_not_honour`
    - `expired_card`
    - `high_risk`
    - `insufficient_funds`
    - `invalid_address`
    - `invalid_amount`
    - `invalid_card`
    - `invalid_country`
    - `invalid_cvv`
    - `invalid_email`
    - `invalid_expiry`
    - `invalid_merchant`
    - `invalid_phone`
    - `invalid_pin`
    - `issuer_not_available`
    - `pick_up_card`
    - `rejected_by_customer`
    - `restricted_card`
    - `suspected_fraud`
    - `technical_error`
    - `transaction_not_allowed_for_cardholder`
    - `unknown_card`
    - `withdrawal_limit_exceeded`
- `authentication_challenge` (object, optional)
    Details about the authentication challenge that should be performed to complete the authentication process. For more information about Revolut's 3DS solution, see: [3D Secure overview](/docs/guides/merchant/reference/3d-secure).
    
    Only returned if the payment's state is `authentication_challenge`.

## Error responses

| HTTP status code | Description |
| --- | --- |
| 400 | Bad Request |
| 401 | Unauthorized |
| 404 | Not Found |
