> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.redpincompany.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.redpincompany.com/_mcp/server.

# Make a Payment

POST https://sandbox.currenciesdirect.com/v2/customers/{customer_id}/payments
Content-Type: application/json

**Deprecated**: This endpoint is deprecated. Please use [Create Payment](/api-reference/customers/api-integration/payments/create-payment) (v3) instead.

This will initiate the process of sending money to a Recipient. As preparation for this call you could make a GET request to the [Recipients](/api-reference/customers/api-integration/recipients/get-recipients) resource to check that the recipient has not been deleted.

**Payment Processing:**
The payment is processed in the background, meaning the API returns immediately with a success response containing a `payment_id` and initial `status` of "pending". The actual payment processing continues after the response is returned. To check the current status of the payment, make a GET request to the [Review Payments](/api-reference/customers/api-integration/legacy-ap-is/legacy-payments/review-payments) or [View a Payment](/api-reference/customers/api-integration/legacy-ap-is/legacy-payments/view-payment) endpoints.

**Authentication:** [Bearer token required](/api-guide/getting-started/authentication#oauth-20-authentication)

```mermaid
flowchart TD
  A[Actor]

  subgraph I1["Iteration 1"]
      B["POST /v2/customers/{customerId}/payments"]
  end

  subgraph I2["Iteration 2"]
      C["POST /v2/customers/{customerId}/payments<br />(with confirm_recipient section)"]
  end

  D["Create Payment"]
  E(("Success"))
  F(("Stop"))
  G["Error response<br />(code and description)"]
  H["CoP check failed<br />or any other error"]

  A --> B
  A --> C

  B -->|1| D
  C -->|3| D

  D -->|Success| E --> F
  D -->|2| H --> G --> A
```

Reference: https://docs.redpincompany.com/api-reference/customers/api-integration/legacy-ap-is/legacy-payments/create-payment-v-2

## Authentication

- `Authorization` header (bearer token, required) — OAuth 2.0 Bearer token authentication. This API uses OAuth 2.0 Client Credentials flow. Please refer to the [Authentication](/api-guide/getting-started/authentication#oauth-20-authentication) section for detailed information on how to obtain and use your OAuth credentials.

## Servers

- `https://sandbox.currenciesdirect.com` (Sandbox, default)
- `https://api.redpincompany.com` (Production)

## Request

### Path parameters

- `customer_id` (string, required) — Unique Customer Identifier

### Body (application/json)

This endpoint expects a CreatePaymentRequestV2.

- `recipient_id` (string, required) — The Payee ID used to identify this Recipient. **Reference:** [Get Recipients](http://localhost:3000/api-reference/customers/api-integration/recipients/get-recipients#response.body.recipients.recipient_id)
- `purpose_of_transaction` (string, required) — Purpose of the transaction. A list of possible values can be obtained with a GET request to the transaction-purpose resource. **Reference:** [Get Transaction Purposes](/api-reference/customers/api-integration/references/get-transaction-purposes)
- `amount` (double, required) — Amount of the payment.
- `payment_reference` (string, required) — Description to appear on the Recipient's bank statement and should not contain any special character. If recipient is UK based and is a collection account, use payment_reference of recipient. It should not contain any special character.
- `client_reference_id` (string, optional) — Unique reference id that you want to assign to this payment for your own purposes.
- `confirm_recipient` (CreatePaymentRequestV2ConfirmRecipient, optional) — Container for confirmation of recipient details. This object is required only when the initial API call fails due to a [Confirmation of Payee (CoP)](https://www.wearepay.uk/what-we-do/overlay-services/confirmation-of-payee/) or [Verification of Payee (VoP)](https://www.europeanpaymentscouncil.eu/what-we-do/other-schemes/verification-payee) check failure. If the failure is related to CoP/VoP, the API response will include a `details` field containing only the recipients whose CoP/VoP checks failed. Each recipient in `details` field will have a `request_identifier` and `event_id`, which must be used in the subsequent retry request along with the appropriate `customer_action`. Detailed instructions for handling these scenarios can be found in: - [UK Confirmation of Payee (CoP) Guide](/api-guide/regulatory-guides/cop-guide) - [SEPA Verification of Payee (VoP) Guide](/api-guide/regulatory-guides/vop-guide)

## Response

### 200

Ok. A payment was initiated.

- `payment_id` (string, required) — Payment ID
- `instruction_number` (string, required) — Unique client reference to identify this conversion in future. The format will be \{customerId}-\{sequenceNumber}
- `currency_code` (string, required) — Recipient's Currency Code. **Reference:** [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)
- `amount` (double, required) — Amount being debited.
- `recipient_details` (CreatePaymentResponseV2RecipientDetails, required)
- `status` (string, required) — Status of this payment.
- `payment_reference` (string, required) — Description to appear on the Recipient's bank statement.
- `created_datetime` (datetime, required) — Timestamp of the payment
- `payment_date` (date, required) — Date when the payment was completed.

## Errors

### 400 Bad Request Error

Bad request

- `code` (string, required)
- `description` (string, required) — Human-readable error description
- `type` (enum, optional) — Category or type of the error. - `VALIDATION_ERROR`: Error due to invalid input data or format - `AUTHORIZATION_ERROR`: Error related to insufficient permissions - `SYSTEM_ERROR`: Internal system or server errors - `RESOURCE_ERROR`: Error related to resource availability - `BUSINESS_ERROR`: Error related to business logic violations - `DATA_ERROR`: Error related to data inconsistencies or duplication
  - Allowed values: `VALIDATION_ERROR`, `AUTHORIZATION_ERROR`, `SYSTEM_ERROR`, `RESOURCE_ERROR`, `BUSINESS_ERROR`, `DATA_ERROR`
- `field` (string, optional)
- `details` (map from string to any, optional) — Additional details about the error
- `timestamp` (datetime, optional)

### 401 Unauthorized Error

Unauthorized

- `code` (string, required)
- `description` (string, required) — Human-readable error description
- `type` (enum, optional) — Category or type of the error. - `VALIDATION_ERROR`: Error due to invalid input data or format - `AUTHORIZATION_ERROR`: Error related to insufficient permissions - `SYSTEM_ERROR`: Internal system or server errors - `RESOURCE_ERROR`: Error related to resource availability - `BUSINESS_ERROR`: Error related to business logic violations - `DATA_ERROR`: Error related to data inconsistencies or duplication
  - Allowed values: `VALIDATION_ERROR`, `AUTHORIZATION_ERROR`, `SYSTEM_ERROR`, `RESOURCE_ERROR`, `BUSINESS_ERROR`, `DATA_ERROR`
- `field` (string, optional)
- `details` (map from string to any, optional) — Additional details about the error
- `timestamp` (datetime, optional)

### 500 Internal Server Error

Internal server error

- `code` (string, required)
- `description` (string, required) — Human-readable error description
- `type` (enum, optional) — Category or type of the error. - `VALIDATION_ERROR`: Error due to invalid input data or format - `AUTHORIZATION_ERROR`: Error related to insufficient permissions - `SYSTEM_ERROR`: Internal system or server errors - `RESOURCE_ERROR`: Error related to resource availability - `BUSINESS_ERROR`: Error related to business logic violations - `DATA_ERROR`: Error related to data inconsistencies or duplication
  - Allowed values: `VALIDATION_ERROR`, `AUTHORIZATION_ERROR`, `SYSTEM_ERROR`, `RESOURCE_ERROR`, `BUSINESS_ERROR`, `DATA_ERROR`
- `field` (string, optional)
- `details` (map from string to any, optional) — Additional details about the error
- `timestamp` (datetime, optional)

## Types

### CreatePaymentRequestV2ConfirmRecipient

Container for confirmation of recipient details. This object is required only when the initial API call fails due to a [Confirmation of Payee (CoP)](https://www.wearepay.uk/what-we-do/overlay-services/confirmation-of-payee/) or [Verification of Payee (VoP)](https://www.europeanpaymentscouncil.eu/what-we-do/other-schemes/verification-payee) check failure. If the failure is related to CoP/VoP, the API response will include a `details` field containing only the recipients whose CoP/VoP checks failed. Each recipient in `details` field will have a `request_identifier` and `event_id`, which must be used in the subsequent retry request along with the appropriate `customer_action`. Detailed instructions for handling these scenarios can be found in: - [UK Confirmation of Payee (CoP) Guide](/api-guide/regulatory-guides/cop-guide) - [SEPA Verification of Payee (VoP) Guide](/api-guide/regulatory-guides/vop-guide)

- `customer_action` (enum, required) — Enum: override
  - Allowed values: `override`
- `request_identifier` (string, required) — Request identifier received in response of iteration 1
- `event_id` (string, required) — Event id received in response of iteration 1

### CreatePaymentResponseV2RecipientDetails

- `recipient_id` (integer, required) — Unique recipient reference id which can be used to identify/retrieve recipient in future.
- `recipient_name` (string, required) — Name of the Recipient.
- `country_code` (string, required) — Three letter Country Code of the Recipient. **Reference:** [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3)

## Examples

**Request**

```json
{
  "recipient_id": "743512",
  "purpose_of_transaction": "PENSION",
  "amount": 1.91,
  "payment_reference": "saving 225",
  "client_reference_id": "987564823645",
  "confirm_recipient": {
    "customer_action": "override",
    "request_identifier": "123456789",
    "event_id": "AG-435435454435"
  }
}
```

**Response**

```json
{
  "payment_id": "2908362",
  "instruction_number": "0202000005923566-000000011",
  "currency_code": "string",
  "amount": 51749.42,
  "recipient_details": {
    "recipient_id": 743512,
    "recipient_name": "Bob Nighy",
    "country_code": "GBR"
  },
  "status": "PENDING",
  "payment_reference": "saving 225",
  "created_datetime": "2019-01-24T12:38:46Z",
  "payment_date": "2019-01-24"
}
```

**SDK Code**

```shell cURL
curl -X POST https://sandbox.currenciesdirect.com/v2/customers/cust_123456789/payments \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

```

```python make a payment request
import requests

url = "https://sandbox.currenciesdirect.com/v2/customers/cust_123456789/payments"

payload = {
    "recipient_id": "743512",
    "purpose_of_transaction": "PENSION",
    "amount": 1.91,
    "payment_reference": "saving 225",
    "client_reference_id": "987564823645",
    "confirm_recipient": {
        "customer_action": "override",
        "request_identifier": "123456789",
        "event_id": "AG-435435454435"
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript make a payment request
const url = 'https://sandbox.currenciesdirect.com/v2/customers/cust_123456789/payments';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"recipient_id":"743512","purpose_of_transaction":"PENSION","amount":1.91,"payment_reference":"saving 225","client_reference_id":"987564823645","confirm_recipient":{"customer_action":"override","request_identifier":"123456789","event_id":"AG-435435454435"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go make a payment request
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://sandbox.currenciesdirect.com/v2/customers/cust_123456789/payments"

	payload := strings.NewReader("{\n  \"recipient_id\": \"743512\",\n  \"purpose_of_transaction\": \"PENSION\",\n  \"amount\": 1.91,\n  \"payment_reference\": \"saving 225\",\n  \"client_reference_id\": \"987564823645\",\n  \"confirm_recipient\": {\n    \"customer_action\": \"override\",\n    \"request_identifier\": \"123456789\",\n    \"event_id\": \"AG-435435454435\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby make a payment request
require 'uri'
require 'net/http'

url = URI("https://sandbox.currenciesdirect.com/v2/customers/cust_123456789/payments")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"recipient_id\": \"743512\",\n  \"purpose_of_transaction\": \"PENSION\",\n  \"amount\": 1.91,\n  \"payment_reference\": \"saving 225\",\n  \"client_reference_id\": \"987564823645\",\n  \"confirm_recipient\": {\n    \"customer_action\": \"override\",\n    \"request_identifier\": \"123456789\",\n    \"event_id\": \"AG-435435454435\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java make a payment request
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://sandbox.currenciesdirect.com/v2/customers/cust_123456789/payments")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"recipient_id\": \"743512\",\n  \"purpose_of_transaction\": \"PENSION\",\n  \"amount\": 1.91,\n  \"payment_reference\": \"saving 225\",\n  \"client_reference_id\": \"987564823645\",\n  \"confirm_recipient\": {\n    \"customer_action\": \"override\",\n    \"request_identifier\": \"123456789\",\n    \"event_id\": \"AG-435435454435\"\n  }\n}")
  .asString();
```

```php make a payment request
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox.currenciesdirect.com/v2/customers/cust_123456789/payments', [
  'body' => '{
  "recipient_id": "743512",
  "purpose_of_transaction": "PENSION",
  "amount": 1.91,
  "payment_reference": "saving 225",
  "client_reference_id": "987564823645",
  "confirm_recipient": {
    "customer_action": "override",
    "request_identifier": "123456789",
    "event_id": "AG-435435454435"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp make a payment request
using RestSharp;

var client = new RestClient("https://sandbox.currenciesdirect.com/v2/customers/cust_123456789/payments");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"recipient_id\": \"743512\",\n  \"purpose_of_transaction\": \"PENSION\",\n  \"amount\": 1.91,\n  \"payment_reference\": \"saving 225\",\n  \"client_reference_id\": \"987564823645\",\n  \"confirm_recipient\": {\n    \"customer_action\": \"override\",\n    \"request_identifier\": \"123456789\",\n    \"event_id\": \"AG-435435454435\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift make a payment request
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "recipient_id": "743512",
  "purpose_of_transaction": "PENSION",
  "amount": 1.91,
  "payment_reference": "saving 225",
  "client_reference_id": "987564823645",
  "confirm_recipient": [
    "customer_action": "override",
    "request_identifier": "123456789",
    "event_id": "AG-435435454435"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox.currenciesdirect.com/v2/customers/cust_123456789/payments")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```