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

# Create payment

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

Create a new payment instruction for a customer.
This endpoint lets you create payments with recipient payout details and transaction information.

**FX Conversion:**

* If you need to convert currency, provide a `quote_id` from an active quote. The quote must be active and not expired.
* If no currency conversion is needed (same currency payment), do not send `quote_id`.

**Requirements:**

* Recipient details must be valid and active
* If `quote_id` is provided, the quote must be active and not expired

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

The following diagram illustrates the Confirmation of Payee (CoP) or Verification of Payee (VoP) handling flow for this endpoint:

```mermaid
graph TD
    A[User] -->|"POST /v3/customers/{customer_id}/payments"| B[Create Payment]
    B -->|Success| C[Payment Complete]
    B -->|"CoP/VoP failure"| D[Error: CoP/VoP Error]
    D --> E[Display error and options to user]
    E -->|User chooses to update details| F[User updates payment details]
    F -->|"POST /v3/customers/{customer_id}/payments"| B
    E -->|User chooses to override or accept suggestion| G[User confirms action]
    G -->|"POST /v3/customers/{customer_id}/payments with confirm_recipient"| B
```

Reference: https://docs.redpincompany.com/api-reference/customers/api-integration/payments/create-payment

## 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 identifier for the customer who will initiate the payment transaction.

### Body (application/json)

This endpoint expects a CreatePaymentRequest.

- `purpose_of_transaction` (enum, required) — Purpose of the transaction. Must be one of the predefined values. **Validation Rules:** - Must be provided and cannot be null or empty - Must be one of the allowed enum values - Case sensitive - must match exactly
  - Allowed values: `PENSION`, `STUDY_FEES`, `CAR_BOAT_PLANE`, `EMIGRATION`, `LAND`, `MORTGAGE`, `BILL_PAYMENTS`, `BUILDING_REPAIRS_PROPERTY_MAINTENANCE`, `PROPERTY_SALE`, `LIVING_FUNDS`, `OTHERS`, `BUSINESS_INVOICES`, `BUYING_PRODUCTS_SERVICES`, `CHARITABLE_DONATION`, `FREIGHT`, `INVESTMENT`, `PROPERTY_PURCHASE`, `SALARY`, `TRAVEL_EXPENSES`, `INHERITANCE`, `SENDING_TO_FAMILY`, `EXPORT_PROCEEDS`, `ECOMMERCE_SALE`
- `amount` (CreatePaymentRequestAmount, required) — Amount to be paid out in the destination currency. If currency conversion is needed, provide a `quote_id` for the conversion. If no conversion is needed, the amount will be paid directly. Must be an object with currency and value fields. Example: \{"currency": "GBP", "value": 50000.00}
- `recipient_details` (list of RecipientDetail, required) — Container for recipient details. **Validation Rules:** - Must contain at least one recipient - Cannot be null or empty - Sum of all recipient amounts must equal the payment amount
- `client_reference_id` (string, optional) — Your reference for this payment for reconciliation purposes. **Validation Rules:** - **Required when:** `is_third_party_payment: true` - **Optional when:** `is_third_party_payment: false` - **Uniqueness:** Enforced only for third-party payments — must be unique per customer (per `customer_id`); duplicates for the same customer will be rejected. - **Maximum length:** 36 characters.
- `quote_id` (string, optional) — Quote ID associated with this payment for FX conversion. **Required when:** Currency conversion is needed (different currencies between source and destination). **Do not send when:** No currency conversion is needed (same currency payment). Omit this field entirely. **Validation Rules:** - If provided, the quote must exist and be in an active state for payment processing - Quote must not be expired **Reference:** This should be an active quote_id obtained from the [Create Quote API](/api-reference/customers/api-integration/quotes/create-quote).
- `is_third_party_payment` (boolean, optional, default: false) — Determines whether this payment is processed for a third-party client or directly from your wallet. ## How It Works **For Third Party Payments** (`is_third_party_payment: true`): * client\_reference\_id must be provided * A valid client\_customer\_ref must be provided * The system uses this to map the payment to the correct client account for fund segregation. * Bank instructions available via [Get Bank Transfer Instructions](/v3/customers/\{customer_id}/payments/\{payment_id}/bank-transfer-instructions) endpoint **For Payment From Wallet** (`is_third_party_payment: false`): * The system processes the transaction using available general wallet balance * No fund segregation or reference matching occurs * If insufficient wallet funds are available, the system waits for any incoming funds up to the specified deadline
- `client_customer_ref` (string, optional) — The unique reference identifier of the third party client for whom this payment is being made. This must match a `client_customer_ref` from a previously onboarded third party. The system uses this to identify the client. **Required when:** `is_third_party_payment: true` **Optional when:** `is_third_party_payment: false`
- `confirm_recipient` (ConfirmRecipient, optional) — Container for confirmation of recipient details. It is required only if CoP check has failed in first iteration.

## Response

### 201

Payment created successfully

- `payment_id` (string, required) — Unique transaction identifier. Generated after payment creation and used to track and reference the payment throughout its lifecycle.
- `instruction_number` (string, required) — Instruction number assigned by the API when the payment is created.
- `amount` (CreatePaymentResponseAmount, required) — The total amount to be credited across all recipient bank accounts, denominated in the recipient's bank account currency.
- `recipient_details` (list of PaymentRecipientDetails, required) — Container for recipient details.
- `status` (enum, required) — Current status of the payment. Refer to the [Payment Status Events](/api-reference/webhooks/payments/webhook-payment-status-updated) section for more details about the statuses.
  - Allowed values: `AWAITING_FUNDS`, `RECEIVED_FUNDS`, `FX_COMPLETED`, `PAYOUT_INITIATED`, `PAYOUT_CREDITED`, `BOUNCED_BACK`, `PAYMENT_COMPLETED`, `PROCESSING`, `CANCELLED`
- `created_datetime` (datetime, required) — Timestamp when the payment was created.

## Errors

### 400 Bad Request Error

Bad request - validation errors, invalid parameters, or duplicate client reference

- `CreatePaymentRequestBadRequestError`
  - COPErrorResponse
  - ErrorResponse

### 404 Not Found Error

Quote does not exist

- `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

### CreatePaymentRequestAmount

Amount to be paid out in the destination currency. If currency conversion is needed, provide a `quote_id` for the conversion. If no conversion is needed, the amount will be paid directly. Must be an object with currency and value fields. Example: \{"currency": "GBP", "value": 50000.00}

- `currency` (string, required) — Three-letter ISO 4217 currency code as specified in the recipient's bank details. **Reference:** [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)
- `value` (double, required) — The expected total amount to be credited across all recipient bank accounts.

### RecipientDetail

- `amount` (RecipientDetailAmount, required) — Amount to be exchanged and disbursed in the destination currency to the recipient's account.
- `recipient_id` (string, required) — The recipient id used to identify this recipient. **Reference:** This ID should correspond to a valid recipient from the [GET Recipient Details](/api-reference/customers/api-integration/payments/get-recipient) endpoint.
- `payment_reference` (string, required) — Reference or note specific to this recipient's portion of the payment. This value will appear on the recipient's bank statement.
- `purpose_of_transaction` (enum, required) — Purpose of the transaction.
  - Allowed values: `PROPERTY_PURCHASE`, `BUSINESS_INVOICES`, `PENSION`, `STUDY_FEES`, `CAR_BOAT_PLANE`, `EMIGRATION`, `LAND`, `MORTGAGE`, `BILL_PAYMENTS`, `BUILDING_REPAIRS_PROPERTY_MAINTENANCE`, `PROPERTY_SALE`, `LIVING_FUNDS`, `OTHERS`, `BUYING_PRODUCTS_SERVICES`, `CHARITABLE_DONATION`, `FREIGHT`, `INVESTMENT`, `PROPERTY_PURCHASE`, `SALARY`, `TRAVEL_EXPENSES`, `INHERITANCE`, `SENDING_TO_FAMILY`, `EXPORT_PROCEEDS`, `ECOMMERCE_SALE`
- `confirm_recipient` (ConfirmRecipient, 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)

### ConfirmRecipient

- `customer_action` (string, required) — Customer's decision on how to handle the Confirmation of Payee (CoP) or Verification of Payee (VoP) mismatch: - `override`: Continue with original details despite the mismatch Note: The `update` action is not supported in this API.
- `request_identifier` (string, required) — Request identifier received in the CoP/VoP error response from the previous iteration
- `event_id` (string, required) — Event ID received in the CoP/VoP error response from the previous iteration

### CreatePaymentResponseAmount

The total amount to be credited across all recipient bank accounts, denominated in the recipient's bank account currency.

- `currency` (string, required) — 3-letter ISO currency code
- `value` (double, required) — Amount in the specified currency

### PaymentRecipientDetails

- `recipient_id` (string, required) — Unique recipient reference id which can be used to identify/retrieve recipient in future.
- `recipient_name` (string, required) — Name of the recipient.
- `amount` (PaymentRecipientDetailsAmount, required) — The amount that has been credited to this specific recipient's bank account. **Purpose:** This represents the exact amount credited to the recipient's account in their local currency.
- `payment_reference` (string, required) — A note or reference that identifies this payment for the recipient. This text will show up on the recipient's bank statement to help them recognize the payment.
- `country` (string, required) — ISO 3166-1 alpha-3 country code representing the recipient's country.

### COPErrorResponse

- `code` (string, required)
- `description` (string, required)
- `type` (enum, required) — 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`
- `details` (list of CopErrorResponseDetailsItems, required)

### ErrorResponse

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

### RecipientDetailAmount

Amount to be exchanged and disbursed in the destination currency to the recipient's account.

- `currency` (string, required) — The currency in which the recipient's bank account will ultimately be funded. **Reference:** [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)
- `value` (double, required) — Amount to be disbursed

### PaymentRecipientDetailsAmount

The amount that has been credited to this specific recipient's bank account. **Purpose:** This represents the exact amount credited to the recipient's account in their local currency.

### CopErrorResponseDetailsItems

- `code` (string, required)
- `event_id` (string, required)
- `suggested_name` (string, optional)
- `identifier` (string, optional)

## Examples

### Single Recipient Third-Party Payment

**Request**

```json
{
  "purpose_of_transaction": "PROPERTY_PURCHASE",
  "amount": {
    "currency": "GBP",
    "value": 50000
  },
  "recipient_details": [
    {
      "amount": {
        "currency": "GBP",
        "value": 50000
      },
      "recipient_id": "REC-001",
      "payment_reference": "PROPERTY_PURCHASE_PAYMENT",
      "purpose_of_transaction": "PROPERTY_PURCHASE"
    }
  ],
  "client_reference_id": "REF120532",
  "quote_id": "548eb44b-5e1b-45fb-86eb-88eb5bcaa781",
  "is_third_party_payment": true,
  "client_customer_ref": "CUST-001",
  "payment_reference": "PAY-2024-001"
}
```

**Response**

```json
{
  "payment_id": "PAY-2024-001",
  "instruction_number": "CUST-001-0001",
  "amount": {
    "currency": "AUD",
    "value": 50000
  },
  "recipient_details": [
    {
      "recipient_id": "REC-001",
      "recipient_name": "John Smith",
      "amount": {
        "currency": "AUD",
        "value": 50000
      },
      "payment_reference": "PROPERTY_PURCHASE_PAYMENT",
      "country": "GBR"
    }
  ],
  "status": "AWAITING_FUNDS",
  "created_datetime": "2024-01-15T10:30:00Z"
}
```

**SDK Code**

```python Single Recipient Third-Party Payment
import requests

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

payload = {
    "purpose_of_transaction": "PROPERTY_PURCHASE",
    "amount": {
        "currency": "GBP",
        "value": 50000
    },
    "recipient_details": [
        {
            "amount": {
                "currency": "GBP",
                "value": 50000
            },
            "recipient_id": "REC-001",
            "payment_reference": "PROPERTY_PURCHASE_PAYMENT",
            "purpose_of_transaction": "PROPERTY_PURCHASE"
        }
    ],
    "client_reference_id": "REF120532",
    "quote_id": "548eb44b-5e1b-45fb-86eb-88eb5bcaa781",
    "is_third_party_payment": True,
    "client_customer_ref": "CUST-001",
    "payment_reference": "PAY-2024-001"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Single Recipient Third-Party Payment
const url = 'https://sandbox.currenciesdirect.com/v3/customers/cust_123456789/payments';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"purpose_of_transaction":"PROPERTY_PURCHASE","amount":{"currency":"GBP","value":50000},"recipient_details":[{"amount":{"currency":"GBP","value":50000},"recipient_id":"REC-001","payment_reference":"PROPERTY_PURCHASE_PAYMENT","purpose_of_transaction":"PROPERTY_PURCHASE"}],"client_reference_id":"REF120532","quote_id":"548eb44b-5e1b-45fb-86eb-88eb5bcaa781","is_third_party_payment":true,"client_customer_ref":"CUST-001","payment_reference":"PAY-2024-001"}'
};

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

```go Single Recipient Third-Party Payment
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"purpose_of_transaction\": \"PROPERTY_PURCHASE\",\n  \"amount\": {\n    \"currency\": \"GBP\",\n    \"value\": 50000\n  },\n  \"recipient_details\": [\n    {\n      \"amount\": {\n        \"currency\": \"GBP\",\n        \"value\": 50000\n      },\n      \"recipient_id\": \"REC-001\",\n      \"payment_reference\": \"PROPERTY_PURCHASE_PAYMENT\",\n      \"purpose_of_transaction\": \"PROPERTY_PURCHASE\"\n    }\n  ],\n  \"client_reference_id\": \"REF120532\",\n  \"quote_id\": \"548eb44b-5e1b-45fb-86eb-88eb5bcaa781\",\n  \"is_third_party_payment\": true,\n  \"client_customer_ref\": \"CUST-001\",\n  \"payment_reference\": \"PAY-2024-001\"\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 Single Recipient Third-Party Payment
require 'uri'
require 'net/http'

url = URI("https://sandbox.currenciesdirect.com/v3/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  \"purpose_of_transaction\": \"PROPERTY_PURCHASE\",\n  \"amount\": {\n    \"currency\": \"GBP\",\n    \"value\": 50000\n  },\n  \"recipient_details\": [\n    {\n      \"amount\": {\n        \"currency\": \"GBP\",\n        \"value\": 50000\n      },\n      \"recipient_id\": \"REC-001\",\n      \"payment_reference\": \"PROPERTY_PURCHASE_PAYMENT\",\n      \"purpose_of_transaction\": \"PROPERTY_PURCHASE\"\n    }\n  ],\n  \"client_reference_id\": \"REF120532\",\n  \"quote_id\": \"548eb44b-5e1b-45fb-86eb-88eb5bcaa781\",\n  \"is_third_party_payment\": true,\n  \"client_customer_ref\": \"CUST-001\",\n  \"payment_reference\": \"PAY-2024-001\"\n}"

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

```java Single Recipient Third-Party Payment
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://sandbox.currenciesdirect.com/v3/customers/cust_123456789/payments")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"purpose_of_transaction\": \"PROPERTY_PURCHASE\",\n  \"amount\": {\n    \"currency\": \"GBP\",\n    \"value\": 50000\n  },\n  \"recipient_details\": [\n    {\n      \"amount\": {\n        \"currency\": \"GBP\",\n        \"value\": 50000\n      },\n      \"recipient_id\": \"REC-001\",\n      \"payment_reference\": \"PROPERTY_PURCHASE_PAYMENT\",\n      \"purpose_of_transaction\": \"PROPERTY_PURCHASE\"\n    }\n  ],\n  \"client_reference_id\": \"REF120532\",\n  \"quote_id\": \"548eb44b-5e1b-45fb-86eb-88eb5bcaa781\",\n  \"is_third_party_payment\": true,\n  \"client_customer_ref\": \"CUST-001\",\n  \"payment_reference\": \"PAY-2024-001\"\n}")
  .asString();
```

```php Single Recipient Third-Party Payment
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox.currenciesdirect.com/v3/customers/cust_123456789/payments', [
  'body' => '{
  "purpose_of_transaction": "PROPERTY_PURCHASE",
  "amount": {
    "currency": "GBP",
    "value": 50000
  },
  "recipient_details": [
    {
      "amount": {
        "currency": "GBP",
        "value": 50000
      },
      "recipient_id": "REC-001",
      "payment_reference": "PROPERTY_PURCHASE_PAYMENT",
      "purpose_of_transaction": "PROPERTY_PURCHASE"
    }
  ],
  "client_reference_id": "REF120532",
  "quote_id": "548eb44b-5e1b-45fb-86eb-88eb5bcaa781",
  "is_third_party_payment": true,
  "client_customer_ref": "CUST-001",
  "payment_reference": "PAY-2024-001"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Single Recipient Third-Party Payment
using RestSharp;

var client = new RestClient("https://sandbox.currenciesdirect.com/v3/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  \"purpose_of_transaction\": \"PROPERTY_PURCHASE\",\n  \"amount\": {\n    \"currency\": \"GBP\",\n    \"value\": 50000\n  },\n  \"recipient_details\": [\n    {\n      \"amount\": {\n        \"currency\": \"GBP\",\n        \"value\": 50000\n      },\n      \"recipient_id\": \"REC-001\",\n      \"payment_reference\": \"PROPERTY_PURCHASE_PAYMENT\",\n      \"purpose_of_transaction\": \"PROPERTY_PURCHASE\"\n    }\n  ],\n  \"client_reference_id\": \"REF120532\",\n  \"quote_id\": \"548eb44b-5e1b-45fb-86eb-88eb5bcaa781\",\n  \"is_third_party_payment\": true,\n  \"client_customer_ref\": \"CUST-001\",\n  \"payment_reference\": \"PAY-2024-001\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Single Recipient Third-Party Payment
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "purpose_of_transaction": "PROPERTY_PURCHASE",
  "amount": [
    "currency": "GBP",
    "value": 50000
  ],
  "recipient_details": [
    [
      "amount": [
        "currency": "GBP",
        "value": 50000
      ],
      "recipient_id": "REC-001",
      "payment_reference": "PROPERTY_PURCHASE_PAYMENT",
      "purpose_of_transaction": "PROPERTY_PURCHASE"
    ]
  ],
  "client_reference_id": "REF120532",
  "quote_id": "548eb44b-5e1b-45fb-86eb-88eb5bcaa781",
  "is_third_party_payment": true,
  "client_customer_ref": "CUST-001",
  "payment_reference": "PAY-2024-001"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox.currenciesdirect.com/v3/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()
```

### Multi Recipient Third-Party Payment

**Request**

```json
{
  "purpose_of_transaction": "PROPERTY_PURCHASE",
  "amount": {
    "currency": "GBP",
    "value": 75000
  },
  "recipient_details": [
    {
      "amount": {
        "currency": "GBP",
        "value": 50000
      },
      "recipient_id": "REC-001",
      "payment_reference": "PROPERTY_DOWN_PAYMENT",
      "purpose_of_transaction": "PROPERTY_PURCHASE"
    },
    {
      "amount": {
        "currency": "GBP",
        "value": 25000
      },
      "recipient_id": "REC-002",
      "payment_reference": "PROPERTY_CLOSING_COSTS",
      "purpose_of_transaction": "BILL_PAYMENTS"
    }
  ],
  "client_reference_id": "REF120532",
  "quote_id": "548eb44b-5e1b-45fb-86eb-88eb5bcaa781",
  "is_third_party_payment": true,
  "client_customer_ref": "CUST-001",
  "payment_reference": "PAY-2024-002"
}
```

**Response**

```json
{
  "payment_id": "PAY-2024-002",
  "instruction_number": "CUST-001-0002",
  "amount": {
    "currency": "AUD",
    "value": 75000
  },
  "recipient_details": [
    {
      "recipient_id": "REC-001",
      "recipient_name": "John Smith",
      "amount": {
        "currency": "AUD",
        "value": 50000
      },
      "payment_reference": "PROPERTY_DOWN_PAYMENT",
      "country": "GBR"
    },
    {
      "recipient_id": "REC-002",
      "recipient_name": "Jane Doe",
      "amount": {
        "currency": "AUD",
        "value": 25000
      },
      "payment_reference": "PROPERTY_CLOSING_COSTS",
      "country": "GBR"
    }
  ],
  "status": "AWAITING_FUNDS",
  "created_datetime": "2024-01-15T10:35:00Z"
}
```

**SDK Code**

```python Multi Recipient Third-Party Payment
import requests

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

payload = {
    "purpose_of_transaction": "PROPERTY_PURCHASE",
    "amount": {
        "currency": "GBP",
        "value": 75000
    },
    "recipient_details": [
        {
            "amount": {
                "currency": "GBP",
                "value": 50000
            },
            "recipient_id": "REC-001",
            "payment_reference": "PROPERTY_DOWN_PAYMENT",
            "purpose_of_transaction": "PROPERTY_PURCHASE"
        },
        {
            "amount": {
                "currency": "GBP",
                "value": 25000
            },
            "recipient_id": "REC-002",
            "payment_reference": "PROPERTY_CLOSING_COSTS",
            "purpose_of_transaction": "BILL_PAYMENTS"
        }
    ],
    "client_reference_id": "REF120532",
    "quote_id": "548eb44b-5e1b-45fb-86eb-88eb5bcaa781",
    "is_third_party_payment": True,
    "client_customer_ref": "CUST-001",
    "payment_reference": "PAY-2024-002"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Multi Recipient Third-Party Payment
const url = 'https://sandbox.currenciesdirect.com/v3/customers/cust_123456789/payments';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"purpose_of_transaction":"PROPERTY_PURCHASE","amount":{"currency":"GBP","value":75000},"recipient_details":[{"amount":{"currency":"GBP","value":50000},"recipient_id":"REC-001","payment_reference":"PROPERTY_DOWN_PAYMENT","purpose_of_transaction":"PROPERTY_PURCHASE"},{"amount":{"currency":"GBP","value":25000},"recipient_id":"REC-002","payment_reference":"PROPERTY_CLOSING_COSTS","purpose_of_transaction":"BILL_PAYMENTS"}],"client_reference_id":"REF120532","quote_id":"548eb44b-5e1b-45fb-86eb-88eb5bcaa781","is_third_party_payment":true,"client_customer_ref":"CUST-001","payment_reference":"PAY-2024-002"}'
};

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

```go Multi Recipient Third-Party Payment
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"purpose_of_transaction\": \"PROPERTY_PURCHASE\",\n  \"amount\": {\n    \"currency\": \"GBP\",\n    \"value\": 75000\n  },\n  \"recipient_details\": [\n    {\n      \"amount\": {\n        \"currency\": \"GBP\",\n        \"value\": 50000\n      },\n      \"recipient_id\": \"REC-001\",\n      \"payment_reference\": \"PROPERTY_DOWN_PAYMENT\",\n      \"purpose_of_transaction\": \"PROPERTY_PURCHASE\"\n    },\n    {\n      \"amount\": {\n        \"currency\": \"GBP\",\n        \"value\": 25000\n      },\n      \"recipient_id\": \"REC-002\",\n      \"payment_reference\": \"PROPERTY_CLOSING_COSTS\",\n      \"purpose_of_transaction\": \"BILL_PAYMENTS\"\n    }\n  ],\n  \"client_reference_id\": \"REF120532\",\n  \"quote_id\": \"548eb44b-5e1b-45fb-86eb-88eb5bcaa781\",\n  \"is_third_party_payment\": true,\n  \"client_customer_ref\": \"CUST-001\",\n  \"payment_reference\": \"PAY-2024-002\"\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 Multi Recipient Third-Party Payment
require 'uri'
require 'net/http'

url = URI("https://sandbox.currenciesdirect.com/v3/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  \"purpose_of_transaction\": \"PROPERTY_PURCHASE\",\n  \"amount\": {\n    \"currency\": \"GBP\",\n    \"value\": 75000\n  },\n  \"recipient_details\": [\n    {\n      \"amount\": {\n        \"currency\": \"GBP\",\n        \"value\": 50000\n      },\n      \"recipient_id\": \"REC-001\",\n      \"payment_reference\": \"PROPERTY_DOWN_PAYMENT\",\n      \"purpose_of_transaction\": \"PROPERTY_PURCHASE\"\n    },\n    {\n      \"amount\": {\n        \"currency\": \"GBP\",\n        \"value\": 25000\n      },\n      \"recipient_id\": \"REC-002\",\n      \"payment_reference\": \"PROPERTY_CLOSING_COSTS\",\n      \"purpose_of_transaction\": \"BILL_PAYMENTS\"\n    }\n  ],\n  \"client_reference_id\": \"REF120532\",\n  \"quote_id\": \"548eb44b-5e1b-45fb-86eb-88eb5bcaa781\",\n  \"is_third_party_payment\": true,\n  \"client_customer_ref\": \"CUST-001\",\n  \"payment_reference\": \"PAY-2024-002\"\n}"

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

```java Multi Recipient Third-Party Payment
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://sandbox.currenciesdirect.com/v3/customers/cust_123456789/payments")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"purpose_of_transaction\": \"PROPERTY_PURCHASE\",\n  \"amount\": {\n    \"currency\": \"GBP\",\n    \"value\": 75000\n  },\n  \"recipient_details\": [\n    {\n      \"amount\": {\n        \"currency\": \"GBP\",\n        \"value\": 50000\n      },\n      \"recipient_id\": \"REC-001\",\n      \"payment_reference\": \"PROPERTY_DOWN_PAYMENT\",\n      \"purpose_of_transaction\": \"PROPERTY_PURCHASE\"\n    },\n    {\n      \"amount\": {\n        \"currency\": \"GBP\",\n        \"value\": 25000\n      },\n      \"recipient_id\": \"REC-002\",\n      \"payment_reference\": \"PROPERTY_CLOSING_COSTS\",\n      \"purpose_of_transaction\": \"BILL_PAYMENTS\"\n    }\n  ],\n  \"client_reference_id\": \"REF120532\",\n  \"quote_id\": \"548eb44b-5e1b-45fb-86eb-88eb5bcaa781\",\n  \"is_third_party_payment\": true,\n  \"client_customer_ref\": \"CUST-001\",\n  \"payment_reference\": \"PAY-2024-002\"\n}")
  .asString();
```

```php Multi Recipient Third-Party Payment
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox.currenciesdirect.com/v3/customers/cust_123456789/payments', [
  'body' => '{
  "purpose_of_transaction": "PROPERTY_PURCHASE",
  "amount": {
    "currency": "GBP",
    "value": 75000
  },
  "recipient_details": [
    {
      "amount": {
        "currency": "GBP",
        "value": 50000
      },
      "recipient_id": "REC-001",
      "payment_reference": "PROPERTY_DOWN_PAYMENT",
      "purpose_of_transaction": "PROPERTY_PURCHASE"
    },
    {
      "amount": {
        "currency": "GBP",
        "value": 25000
      },
      "recipient_id": "REC-002",
      "payment_reference": "PROPERTY_CLOSING_COSTS",
      "purpose_of_transaction": "BILL_PAYMENTS"
    }
  ],
  "client_reference_id": "REF120532",
  "quote_id": "548eb44b-5e1b-45fb-86eb-88eb5bcaa781",
  "is_third_party_payment": true,
  "client_customer_ref": "CUST-001",
  "payment_reference": "PAY-2024-002"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Multi Recipient Third-Party Payment
using RestSharp;

var client = new RestClient("https://sandbox.currenciesdirect.com/v3/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  \"purpose_of_transaction\": \"PROPERTY_PURCHASE\",\n  \"amount\": {\n    \"currency\": \"GBP\",\n    \"value\": 75000\n  },\n  \"recipient_details\": [\n    {\n      \"amount\": {\n        \"currency\": \"GBP\",\n        \"value\": 50000\n      },\n      \"recipient_id\": \"REC-001\",\n      \"payment_reference\": \"PROPERTY_DOWN_PAYMENT\",\n      \"purpose_of_transaction\": \"PROPERTY_PURCHASE\"\n    },\n    {\n      \"amount\": {\n        \"currency\": \"GBP\",\n        \"value\": 25000\n      },\n      \"recipient_id\": \"REC-002\",\n      \"payment_reference\": \"PROPERTY_CLOSING_COSTS\",\n      \"purpose_of_transaction\": \"BILL_PAYMENTS\"\n    }\n  ],\n  \"client_reference_id\": \"REF120532\",\n  \"quote_id\": \"548eb44b-5e1b-45fb-86eb-88eb5bcaa781\",\n  \"is_third_party_payment\": true,\n  \"client_customer_ref\": \"CUST-001\",\n  \"payment_reference\": \"PAY-2024-002\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Multi Recipient Third-Party Payment
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "purpose_of_transaction": "PROPERTY_PURCHASE",
  "amount": [
    "currency": "GBP",
    "value": 75000
  ],
  "recipient_details": [
    [
      "amount": [
        "currency": "GBP",
        "value": 50000
      ],
      "recipient_id": "REC-001",
      "payment_reference": "PROPERTY_DOWN_PAYMENT",
      "purpose_of_transaction": "PROPERTY_PURCHASE"
    ],
    [
      "amount": [
        "currency": "GBP",
        "value": 25000
      ],
      "recipient_id": "REC-002",
      "payment_reference": "PROPERTY_CLOSING_COSTS",
      "purpose_of_transaction": "BILL_PAYMENTS"
    ]
  ],
  "client_reference_id": "REF120532",
  "quote_id": "548eb44b-5e1b-45fb-86eb-88eb5bcaa781",
  "is_third_party_payment": true,
  "client_customer_ref": "CUST-001",
  "payment_reference": "PAY-2024-002"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox.currenciesdirect.com/v3/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()
```

### COP Confirm Recipient Third-Party Payment

**Request**

```json
{
  "purpose_of_transaction": "PROPERTY_PURCHASE",
  "amount": {
    "currency": "GBP",
    "value": 50000
  },
  "recipient_details": [
    {
      "amount": {
        "currency": "GBP",
        "value": 50000
      },
      "recipient_id": "REC-001",
      "payment_reference": "PROPERTY_PURCHASE_PAYMENT",
      "purpose_of_transaction": "PROPERTY_PURCHASE"
    }
  ],
  "client_reference_id": "REF120532",
  "quote_id": "548eb44b-5e1b-45fb-86eb-88eb5bcaa781",
  "is_third_party_payment": true,
  "client_customer_ref": "CUST-001",
  "confirm_recipient": {
    "customer_action": "override",
    "request_identifier": "123456789",
    "event_id": "AG-435435454435"
  },
  "payment_reference": "PAY-2024-003"
}
```

**Response**

```json
{
  "payment_id": "PAY-2024-003",
  "instruction_number": "CUST-001-0003",
  "amount": {
    "currency": "AUD",
    "value": 50000
  },
  "recipient_details": [
    {
      "recipient_id": "REC-001",
      "recipient_name": "John Smith",
      "amount": {
        "currency": "AUD",
        "value": 50000
      },
      "payment_reference": "PROPERTY_PURCHASE_PAYMENT",
      "country": "GBR"
    }
  ],
  "status": "AWAITING_FUNDS",
  "created_datetime": "2024-01-15T10:40:00Z"
}
```

**SDK Code**

```python COP Confirm Recipient Third-Party Payment
import requests

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

payload = {
    "purpose_of_transaction": "PROPERTY_PURCHASE",
    "amount": {
        "currency": "GBP",
        "value": 50000
    },
    "recipient_details": [
        {
            "amount": {
                "currency": "GBP",
                "value": 50000
            },
            "recipient_id": "REC-001",
            "payment_reference": "PROPERTY_PURCHASE_PAYMENT",
            "purpose_of_transaction": "PROPERTY_PURCHASE"
        }
    ],
    "client_reference_id": "REF120532",
    "quote_id": "548eb44b-5e1b-45fb-86eb-88eb5bcaa781",
    "is_third_party_payment": True,
    "client_customer_ref": "CUST-001",
    "confirm_recipient": {
        "customer_action": "override",
        "request_identifier": "123456789",
        "event_id": "AG-435435454435"
    },
    "payment_reference": "PAY-2024-003"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript COP Confirm Recipient Third-Party Payment
const url = 'https://sandbox.currenciesdirect.com/v3/customers/cust_123456789/payments';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"purpose_of_transaction":"PROPERTY_PURCHASE","amount":{"currency":"GBP","value":50000},"recipient_details":[{"amount":{"currency":"GBP","value":50000},"recipient_id":"REC-001","payment_reference":"PROPERTY_PURCHASE_PAYMENT","purpose_of_transaction":"PROPERTY_PURCHASE"}],"client_reference_id":"REF120532","quote_id":"548eb44b-5e1b-45fb-86eb-88eb5bcaa781","is_third_party_payment":true,"client_customer_ref":"CUST-001","confirm_recipient":{"customer_action":"override","request_identifier":"123456789","event_id":"AG-435435454435"},"payment_reference":"PAY-2024-003"}'
};

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

```go COP Confirm Recipient Third-Party Payment
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"purpose_of_transaction\": \"PROPERTY_PURCHASE\",\n  \"amount\": {\n    \"currency\": \"GBP\",\n    \"value\": 50000\n  },\n  \"recipient_details\": [\n    {\n      \"amount\": {\n        \"currency\": \"GBP\",\n        \"value\": 50000\n      },\n      \"recipient_id\": \"REC-001\",\n      \"payment_reference\": \"PROPERTY_PURCHASE_PAYMENT\",\n      \"purpose_of_transaction\": \"PROPERTY_PURCHASE\"\n    }\n  ],\n  \"client_reference_id\": \"REF120532\",\n  \"quote_id\": \"548eb44b-5e1b-45fb-86eb-88eb5bcaa781\",\n  \"is_third_party_payment\": true,\n  \"client_customer_ref\": \"CUST-001\",\n  \"confirm_recipient\": {\n    \"customer_action\": \"override\",\n    \"request_identifier\": \"123456789\",\n    \"event_id\": \"AG-435435454435\"\n  },\n  \"payment_reference\": \"PAY-2024-003\"\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 COP Confirm Recipient Third-Party Payment
require 'uri'
require 'net/http'

url = URI("https://sandbox.currenciesdirect.com/v3/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  \"purpose_of_transaction\": \"PROPERTY_PURCHASE\",\n  \"amount\": {\n    \"currency\": \"GBP\",\n    \"value\": 50000\n  },\n  \"recipient_details\": [\n    {\n      \"amount\": {\n        \"currency\": \"GBP\",\n        \"value\": 50000\n      },\n      \"recipient_id\": \"REC-001\",\n      \"payment_reference\": \"PROPERTY_PURCHASE_PAYMENT\",\n      \"purpose_of_transaction\": \"PROPERTY_PURCHASE\"\n    }\n  ],\n  \"client_reference_id\": \"REF120532\",\n  \"quote_id\": \"548eb44b-5e1b-45fb-86eb-88eb5bcaa781\",\n  \"is_third_party_payment\": true,\n  \"client_customer_ref\": \"CUST-001\",\n  \"confirm_recipient\": {\n    \"customer_action\": \"override\",\n    \"request_identifier\": \"123456789\",\n    \"event_id\": \"AG-435435454435\"\n  },\n  \"payment_reference\": \"PAY-2024-003\"\n}"

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

```java COP Confirm Recipient Third-Party Payment
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://sandbox.currenciesdirect.com/v3/customers/cust_123456789/payments")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"purpose_of_transaction\": \"PROPERTY_PURCHASE\",\n  \"amount\": {\n    \"currency\": \"GBP\",\n    \"value\": 50000\n  },\n  \"recipient_details\": [\n    {\n      \"amount\": {\n        \"currency\": \"GBP\",\n        \"value\": 50000\n      },\n      \"recipient_id\": \"REC-001\",\n      \"payment_reference\": \"PROPERTY_PURCHASE_PAYMENT\",\n      \"purpose_of_transaction\": \"PROPERTY_PURCHASE\"\n    }\n  ],\n  \"client_reference_id\": \"REF120532\",\n  \"quote_id\": \"548eb44b-5e1b-45fb-86eb-88eb5bcaa781\",\n  \"is_third_party_payment\": true,\n  \"client_customer_ref\": \"CUST-001\",\n  \"confirm_recipient\": {\n    \"customer_action\": \"override\",\n    \"request_identifier\": \"123456789\",\n    \"event_id\": \"AG-435435454435\"\n  },\n  \"payment_reference\": \"PAY-2024-003\"\n}")
  .asString();
```

```php COP Confirm Recipient Third-Party Payment
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox.currenciesdirect.com/v3/customers/cust_123456789/payments', [
  'body' => '{
  "purpose_of_transaction": "PROPERTY_PURCHASE",
  "amount": {
    "currency": "GBP",
    "value": 50000
  },
  "recipient_details": [
    {
      "amount": {
        "currency": "GBP",
        "value": 50000
      },
      "recipient_id": "REC-001",
      "payment_reference": "PROPERTY_PURCHASE_PAYMENT",
      "purpose_of_transaction": "PROPERTY_PURCHASE"
    }
  ],
  "client_reference_id": "REF120532",
  "quote_id": "548eb44b-5e1b-45fb-86eb-88eb5bcaa781",
  "is_third_party_payment": true,
  "client_customer_ref": "CUST-001",
  "confirm_recipient": {
    "customer_action": "override",
    "request_identifier": "123456789",
    "event_id": "AG-435435454435"
  },
  "payment_reference": "PAY-2024-003"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp COP Confirm Recipient Third-Party Payment
using RestSharp;

var client = new RestClient("https://sandbox.currenciesdirect.com/v3/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  \"purpose_of_transaction\": \"PROPERTY_PURCHASE\",\n  \"amount\": {\n    \"currency\": \"GBP\",\n    \"value\": 50000\n  },\n  \"recipient_details\": [\n    {\n      \"amount\": {\n        \"currency\": \"GBP\",\n        \"value\": 50000\n      },\n      \"recipient_id\": \"REC-001\",\n      \"payment_reference\": \"PROPERTY_PURCHASE_PAYMENT\",\n      \"purpose_of_transaction\": \"PROPERTY_PURCHASE\"\n    }\n  ],\n  \"client_reference_id\": \"REF120532\",\n  \"quote_id\": \"548eb44b-5e1b-45fb-86eb-88eb5bcaa781\",\n  \"is_third_party_payment\": true,\n  \"client_customer_ref\": \"CUST-001\",\n  \"confirm_recipient\": {\n    \"customer_action\": \"override\",\n    \"request_identifier\": \"123456789\",\n    \"event_id\": \"AG-435435454435\"\n  },\n  \"payment_reference\": \"PAY-2024-003\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift COP Confirm Recipient Third-Party Payment
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "purpose_of_transaction": "PROPERTY_PURCHASE",
  "amount": [
    "currency": "GBP",
    "value": 50000
  ],
  "recipient_details": [
    [
      "amount": [
        "currency": "GBP",
        "value": 50000
      ],
      "recipient_id": "REC-001",
      "payment_reference": "PROPERTY_PURCHASE_PAYMENT",
      "purpose_of_transaction": "PROPERTY_PURCHASE"
    ]
  ],
  "client_reference_id": "REF120532",
  "quote_id": "548eb44b-5e1b-45fb-86eb-88eb5bcaa781",
  "is_third_party_payment": true,
  "client_customer_ref": "CUST-001",
  "confirm_recipient": [
    "customer_action": "override",
    "request_identifier": "123456789",
    "event_id": "AG-435435454435"
  ],
  "payment_reference": "PAY-2024-003"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox.currenciesdirect.com/v3/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()
```

### Same Currency Payment (No Conversion)

**Request**

```json
{
  "purpose_of_transaction": "PROPERTY_PURCHASE",
  "amount": {
    "currency": "AED",
    "value": 50
  },
  "recipient_details": [
    {
      "amount": {
        "currency": "AED",
        "value": 50
      },
      "recipient_id": "1212811",
      "payment_reference": "PROPERTY_PURCHASE_PAYMENT",
      "purpose_of_transaction": "PROPERTY_PURCHASE"
    }
  ]
}
```

**Response**

```json
{
  "payment_id": "3925192",
  "instruction_number": "0202000010600852-000000593",
  "amount": {
    "currency": "AED",
    "value": 50
  },
  "recipient_details": [
    {
      "recipient_id": "1212812",
      "recipient_name": "John smith",
      "amount": {
        "currency": "AED",
        "value": 50
      },
      "payment_reference": "PROPERTY_PURCHASE_PAYMENT",
      "country": "ARE"
    }
  ],
  "status": "PROCESSING",
  "created_datetime": "2025-12-18T12:41:16.000+00:00"
}
```

**SDK Code**

```python Same Currency Payment (No Conversion)
import requests

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

payload = {
    "purpose_of_transaction": "PROPERTY_PURCHASE",
    "amount": {
        "currency": "AED",
        "value": 50
    },
    "recipient_details": [
        {
            "amount": {
                "currency": "AED",
                "value": 50
            },
            "recipient_id": "1212811",
            "payment_reference": "PROPERTY_PURCHASE_PAYMENT",
            "purpose_of_transaction": "PROPERTY_PURCHASE"
        }
    ]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Same Currency Payment (No Conversion)
const url = 'https://sandbox.currenciesdirect.com/v3/customers/cust_123456789/payments';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"purpose_of_transaction":"PROPERTY_PURCHASE","amount":{"currency":"AED","value":50},"recipient_details":[{"amount":{"currency":"AED","value":50},"recipient_id":"1212811","payment_reference":"PROPERTY_PURCHASE_PAYMENT","purpose_of_transaction":"PROPERTY_PURCHASE"}]}'
};

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

```go Same Currency Payment (No Conversion)
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"purpose_of_transaction\": \"PROPERTY_PURCHASE\",\n  \"amount\": {\n    \"currency\": \"AED\",\n    \"value\": 50\n  },\n  \"recipient_details\": [\n    {\n      \"amount\": {\n        \"currency\": \"AED\",\n        \"value\": 50\n      },\n      \"recipient_id\": \"1212811\",\n      \"payment_reference\": \"PROPERTY_PURCHASE_PAYMENT\",\n      \"purpose_of_transaction\": \"PROPERTY_PURCHASE\"\n    }\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 Same Currency Payment (No Conversion)
require 'uri'
require 'net/http'

url = URI("https://sandbox.currenciesdirect.com/v3/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  \"purpose_of_transaction\": \"PROPERTY_PURCHASE\",\n  \"amount\": {\n    \"currency\": \"AED\",\n    \"value\": 50\n  },\n  \"recipient_details\": [\n    {\n      \"amount\": {\n        \"currency\": \"AED\",\n        \"value\": 50\n      },\n      \"recipient_id\": \"1212811\",\n      \"payment_reference\": \"PROPERTY_PURCHASE_PAYMENT\",\n      \"purpose_of_transaction\": \"PROPERTY_PURCHASE\"\n    }\n  ]\n}"

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

```java Same Currency Payment (No Conversion)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://sandbox.currenciesdirect.com/v3/customers/cust_123456789/payments")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"purpose_of_transaction\": \"PROPERTY_PURCHASE\",\n  \"amount\": {\n    \"currency\": \"AED\",\n    \"value\": 50\n  },\n  \"recipient_details\": [\n    {\n      \"amount\": {\n        \"currency\": \"AED\",\n        \"value\": 50\n      },\n      \"recipient_id\": \"1212811\",\n      \"payment_reference\": \"PROPERTY_PURCHASE_PAYMENT\",\n      \"purpose_of_transaction\": \"PROPERTY_PURCHASE\"\n    }\n  ]\n}")
  .asString();
```

```php Same Currency Payment (No Conversion)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox.currenciesdirect.com/v3/customers/cust_123456789/payments', [
  'body' => '{
  "purpose_of_transaction": "PROPERTY_PURCHASE",
  "amount": {
    "currency": "AED",
    "value": 50
  },
  "recipient_details": [
    {
      "amount": {
        "currency": "AED",
        "value": 50
      },
      "recipient_id": "1212811",
      "payment_reference": "PROPERTY_PURCHASE_PAYMENT",
      "purpose_of_transaction": "PROPERTY_PURCHASE"
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Same Currency Payment (No Conversion)
using RestSharp;

var client = new RestClient("https://sandbox.currenciesdirect.com/v3/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  \"purpose_of_transaction\": \"PROPERTY_PURCHASE\",\n  \"amount\": {\n    \"currency\": \"AED\",\n    \"value\": 50\n  },\n  \"recipient_details\": [\n    {\n      \"amount\": {\n        \"currency\": \"AED\",\n        \"value\": 50\n      },\n      \"recipient_id\": \"1212811\",\n      \"payment_reference\": \"PROPERTY_PURCHASE_PAYMENT\",\n      \"purpose_of_transaction\": \"PROPERTY_PURCHASE\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Same Currency Payment (No Conversion)
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "purpose_of_transaction": "PROPERTY_PURCHASE",
  "amount": [
    "currency": "AED",
    "value": 50
  ],
  "recipient_details": [
    [
      "amount": [
        "currency": "AED",
        "value": 50
      ],
      "recipient_id": "1212811",
      "payment_reference": "PROPERTY_PURCHASE_PAYMENT",
      "purpose_of_transaction": "PROPERTY_PURCHASE"
    ]
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox.currenciesdirect.com/v3/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()
```

### Wallet Payment Request

**Request**

```json
{
  "purpose_of_transaction": "PROPERTY_PURCHASE",
  "amount": {
    "currency": "GBP",
    "value": 50000
  },
  "recipient_details": [
    {
      "amount": {
        "currency": "GBP",
        "value": 50000
      },
      "recipient_id": "REC-001",
      "payment_reference": "PROPERTY_PURCHASE_PAYMENT",
      "purpose_of_transaction": "PROPERTY_PURCHASE"
    }
  ],
  "quote_id": "548eb44b-5e1b-45fb-86eb-88eb5bcaa781",
  "is_third_party_payment": false,
  "payment_reference": "PAY-2024-004"
}
```

**Response**

```json
{
  "payment_id": "PAY-2024-004",
  "instruction_number": "WALLET-0001",
  "amount": {
    "currency": "AUD",
    "value": 50000
  },
  "recipient_details": [
    {
      "recipient_id": "REC-001",
      "recipient_name": "John Smith",
      "amount": {
        "currency": "AUD",
        "value": 50000
      },
      "payment_reference": "PROPERTY_PURCHASE_PAYMENT",
      "country": "GBR"
    }
  ],
  "status": "AWAITING_FUNDS",
  "created_datetime": "2024-01-15T10:45:00Z"
}
```

**SDK Code**

```python Wallet Payment Request
import requests

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

payload = {
    "purpose_of_transaction": "PROPERTY_PURCHASE",
    "amount": {
        "currency": "GBP",
        "value": 50000
    },
    "recipient_details": [
        {
            "amount": {
                "currency": "GBP",
                "value": 50000
            },
            "recipient_id": "REC-001",
            "payment_reference": "PROPERTY_PURCHASE_PAYMENT",
            "purpose_of_transaction": "PROPERTY_PURCHASE"
        }
    ],
    "quote_id": "548eb44b-5e1b-45fb-86eb-88eb5bcaa781",
    "is_third_party_payment": False,
    "payment_reference": "PAY-2024-004"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Wallet Payment Request
const url = 'https://sandbox.currenciesdirect.com/v3/customers/cust_123456789/payments';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"purpose_of_transaction":"PROPERTY_PURCHASE","amount":{"currency":"GBP","value":50000},"recipient_details":[{"amount":{"currency":"GBP","value":50000},"recipient_id":"REC-001","payment_reference":"PROPERTY_PURCHASE_PAYMENT","purpose_of_transaction":"PROPERTY_PURCHASE"}],"quote_id":"548eb44b-5e1b-45fb-86eb-88eb5bcaa781","is_third_party_payment":false,"payment_reference":"PAY-2024-004"}'
};

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

```go Wallet Payment Request
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"purpose_of_transaction\": \"PROPERTY_PURCHASE\",\n  \"amount\": {\n    \"currency\": \"GBP\",\n    \"value\": 50000\n  },\n  \"recipient_details\": [\n    {\n      \"amount\": {\n        \"currency\": \"GBP\",\n        \"value\": 50000\n      },\n      \"recipient_id\": \"REC-001\",\n      \"payment_reference\": \"PROPERTY_PURCHASE_PAYMENT\",\n      \"purpose_of_transaction\": \"PROPERTY_PURCHASE\"\n    }\n  ],\n  \"quote_id\": \"548eb44b-5e1b-45fb-86eb-88eb5bcaa781\",\n  \"is_third_party_payment\": false,\n  \"payment_reference\": \"PAY-2024-004\"\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 Wallet Payment Request
require 'uri'
require 'net/http'

url = URI("https://sandbox.currenciesdirect.com/v3/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  \"purpose_of_transaction\": \"PROPERTY_PURCHASE\",\n  \"amount\": {\n    \"currency\": \"GBP\",\n    \"value\": 50000\n  },\n  \"recipient_details\": [\n    {\n      \"amount\": {\n        \"currency\": \"GBP\",\n        \"value\": 50000\n      },\n      \"recipient_id\": \"REC-001\",\n      \"payment_reference\": \"PROPERTY_PURCHASE_PAYMENT\",\n      \"purpose_of_transaction\": \"PROPERTY_PURCHASE\"\n    }\n  ],\n  \"quote_id\": \"548eb44b-5e1b-45fb-86eb-88eb5bcaa781\",\n  \"is_third_party_payment\": false,\n  \"payment_reference\": \"PAY-2024-004\"\n}"

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

```java Wallet Payment Request
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://sandbox.currenciesdirect.com/v3/customers/cust_123456789/payments")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"purpose_of_transaction\": \"PROPERTY_PURCHASE\",\n  \"amount\": {\n    \"currency\": \"GBP\",\n    \"value\": 50000\n  },\n  \"recipient_details\": [\n    {\n      \"amount\": {\n        \"currency\": \"GBP\",\n        \"value\": 50000\n      },\n      \"recipient_id\": \"REC-001\",\n      \"payment_reference\": \"PROPERTY_PURCHASE_PAYMENT\",\n      \"purpose_of_transaction\": \"PROPERTY_PURCHASE\"\n    }\n  ],\n  \"quote_id\": \"548eb44b-5e1b-45fb-86eb-88eb5bcaa781\",\n  \"is_third_party_payment\": false,\n  \"payment_reference\": \"PAY-2024-004\"\n}")
  .asString();
```

```php Wallet Payment Request
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox.currenciesdirect.com/v3/customers/cust_123456789/payments', [
  'body' => '{
  "purpose_of_transaction": "PROPERTY_PURCHASE",
  "amount": {
    "currency": "GBP",
    "value": 50000
  },
  "recipient_details": [
    {
      "amount": {
        "currency": "GBP",
        "value": 50000
      },
      "recipient_id": "REC-001",
      "payment_reference": "PROPERTY_PURCHASE_PAYMENT",
      "purpose_of_transaction": "PROPERTY_PURCHASE"
    }
  ],
  "quote_id": "548eb44b-5e1b-45fb-86eb-88eb5bcaa781",
  "is_third_party_payment": false,
  "payment_reference": "PAY-2024-004"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Wallet Payment Request
using RestSharp;

var client = new RestClient("https://sandbox.currenciesdirect.com/v3/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  \"purpose_of_transaction\": \"PROPERTY_PURCHASE\",\n  \"amount\": {\n    \"currency\": \"GBP\",\n    \"value\": 50000\n  },\n  \"recipient_details\": [\n    {\n      \"amount\": {\n        \"currency\": \"GBP\",\n        \"value\": 50000\n      },\n      \"recipient_id\": \"REC-001\",\n      \"payment_reference\": \"PROPERTY_PURCHASE_PAYMENT\",\n      \"purpose_of_transaction\": \"PROPERTY_PURCHASE\"\n    }\n  ],\n  \"quote_id\": \"548eb44b-5e1b-45fb-86eb-88eb5bcaa781\",\n  \"is_third_party_payment\": false,\n  \"payment_reference\": \"PAY-2024-004\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Wallet Payment Request
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "purpose_of_transaction": "PROPERTY_PURCHASE",
  "amount": [
    "currency": "GBP",
    "value": 50000
  ],
  "recipient_details": [
    [
      "amount": [
        "currency": "GBP",
        "value": 50000
      ],
      "recipient_id": "REC-001",
      "payment_reference": "PROPERTY_PURCHASE_PAYMENT",
      "purpose_of_transaction": "PROPERTY_PURCHASE"
    ]
  ],
  "quote_id": "548eb44b-5e1b-45fb-86eb-88eb5bcaa781",
  "is_third_party_payment": false,
  "payment_reference": "PAY-2024-004"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox.currenciesdirect.com/v3/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()
```