---
title: "Creating an AFT Payment"
source_url: https://docs.rapyd.net/en/creating-an-aft-payment.html
lang: en
---

# Creating an AFT Payment

Create an [account funding transaction (AFT)](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_aft "Account Funding Transaction"). This API call transfers money directly from the customer's card to your Rapyd Wallet. When you receive the funds, it is your responsibility to credit the customer properly in your own accounts.

This procedure is relevant to the following types of merchants:

- Foreign exchange platforms
- Digital wallet services
- High-risk fintech platforms for securities, contracts for difference (CFDs), options, or derivatives.

> **Note:**
>
> The AFT feature is in beta testing. To enable this feature, contact [Rapyd Client Support](https://support.rapyd.net).
>
> Relevant to payment method types that support this feature.

How

This procedure includes the following steps:

- [Create Customer](https://docs.rapyd.net/en/creating-an-aft-payment.md#UUID-de7bb7a4-b596-ead4-6455-dd23452d30bb_section-idm13538006193072 "Create Customer")
- [Transfer Funds from Card to Client Wallet](https://docs.rapyd.net/en/creating-an-aft-payment.md#UUID-de7bb7a4-b596-ead4-6455-dd23452d30bb_N1769075950239 "Transfer Funds from Card to Client Wallet")

### Create Customer

For all AFT transactions, certain personal information is required for the customer. Some payment methods allow you to include this information directly in the request to create payment. If not, then you must include the ID of the 'customer' object that contains this information. You can create the 'customer' object with this information, or add it later using [Update Customer](https://docs.rapyd.net/en/update-customer.md "Update Customer"). This example illustrates how to do this using [Create Customer](https://docs.rapyd.net/en/create-customer.md "Create Customer").

1. Run [Create Customer](https://docs.rapyd.net/en/create-customer.md "Create Customer") with the following parameters:

   - `address.line_1` - Building number and street name. **Required.**
   - `address.city` - City portion of the address. A valid value can include 13 characters or less. **Required**.
   - `address.country` - The two-letter ISO 3166-1 ALPHA-2 code for the country. **Required.**
   - `address.name` - Full name of the customer. **Required.**
   - `address.state` - Political subdivision of the customer's country, such as state or province. ISO 3166-2 code. **Required for US customers.**
   - `birth_country` - Country where the customer was born. Two-letter ISO 3166-1 ALPHA-2 code for the country. Recommended.
   - `date_of_birth` - Date of birth of the customer. Format: DD/MM/YYYY. **Required.**
   - `email` - Customer's email address. Recommended.
   - `nationality` - The country of the customer's primary citizenship. Two-letter ISO 3166-1 ALPHA-2 code for the country. Recommended.
   - `occupation` - Occupation of the customer. Maximum: 35 characters. Recommended.

   - - Request

       - ```curl
         curl -X post 'https://api.rapyd.net/v1/customers' \
         -H 'access_key: your-access-key-here' \
         -H 'Content-Type: application/json' \
         -H 'idempotency: your-idempotency-parameter-here' \
         -H 'salt: your-random-string-here' \
         -H 'signature: your-calculated-signature-here' \
         -H 'timestamp: your-unix-timestamp-here' \
         --data-raw '{
             "name": "John Doe",
             "addresses": [{
                 "name": "John Doe",
                 "line_1": "123 First Street",
                 "city": "Anytown",
                 "country": "IS",
                 "zip": "12345"
             }],
             "birth_country": "IS",
             "date_of_birth": "15/01/2001",
             "email": "johndoe@rapyd.net",
             "ewallet": "ewallet_3da471747970b566030d10ca6d46a38c",
             "nationality": "IS",
             "occupation": "Student"
         }'
         ```
   - - Response

       - ```json
         {
             "status": {
                 "error_code": "",
                 "status": "SUCCESS",
                 "message": "",
                 "response_code": "",
                 "operation_id": "c7866b36-3914-4135-b52e-eff6dbb4150b"
             },
             "data": {
                 "id": "cus_d81ea43f7bd24e2f647da79f32b9d2d0",
                 "delinquent": false,
                 "discount": null,
                 "name": "John Doe",
                 "default_payment_method": "",
                 "description": "",
                 "email": "johndoe@rapyd.net",
                 "phone_number": "",
                 "invoice_prefix": "",
                 "addresses": [
                     {
                         "id": "address_0e2384004f0e916f1fb633bddb7526a6",
                         "name": "John Doe",
                         "line_1": "123 First Street",
                         "line_2": "",
                         "line_3": "",
                         "city": "Anytown",
                         "state": "",
                         "country": "IS",
                         "zip": "12345",
                         "phone_number": "",
                         "metadata": {},
                         "canton": "",
                         "district": "",
                         "created_at": 1769007140
                     }
                 ],
                 "payment_methods": null,
                 "subscriptions": null,
                 "created_at": 1769007140,
                 "metadata": {},
                 "business_vat_id": "",
                 "ewallet": "ewallet_3da471747970b566030d10ca6d46a38c",
                 "occupation": "Student",
                 "birth_country": "IS",
                 "date_of_birth": "15/01/2001",
                 "nationality": "IS"
             }
         }
         ```

### Transfer Funds from Card to Client Wallet

This step creates an AFT payment that transfers money from the customer's card to the merchant's client wallet.

1. Run [Create Payment](https://docs.rapyd.net/en/create-payment.md "Create Payment") with the following parameters:

   - `customer` - Set the ID of the customer, a string starting with **customer_**.
   - In the `payment_method_options` object, set the following parameters:

     - `aft` - Set to **true**.
     - `is_direct_purchase` - Set to one of the following values:

       - **true** - The transaction is intended to immediately provide an asset to the customer.
       - **false** - The transaction is intended for pre-funding an account for later purchase of assets.
     - `purpose_code` - Set to one of the following values:

       - **crowd_lending**
       - **education**
       - **emergency_need**
       - **family_support**
       - **gifts**
       - **high_risk_securities** - Represents securities, options, derivatives and foreign exchange.
       - **hospitalization_and_medical_treatment**
       - **other**
       - **regular_labor_transfers**
       - **salary**
       - **savings**
       - **travel_and_tourism**

   - - Request

       - ```curl
         curl -X post 'https://api.rapyd.net/v1/payments' \
         -H 'access_key: your-access-key-here' \
         -H 'Content-Type: application/json' \
         -H 'idempotency: your-idempotency-parameter-here' \
         -H 'salt: your-random-string-here' \
         -H 'signature: your-calculated-signature-here' \
         -H 'timestamp: your-unix-timestamp-here' \
         --data-raw '{
             "amount": 100,
             "currency": "EUR",
             "customer": "cus_d81ea43f7bd24e2f647da79f32b9d2d0",
             "payment_method": {
                 "type": "at_mastercard_card",
                 "fields": {
                     "number": "4111111111111111",
                     "expiration_month": "12",
                     "expiration_year": "30",
                     "name": "John Doe",
                     "cvv": "345"
                 }
             },
             "payment_method_options": {
                 "aft": true,
                 "purpose_code": "high_risk_securities",
                 "is_direct_purchase": true
             }
         }'
         ```
   - - Response

       - ```json
         {
             "status": {
                 "error_code": "",
                 "status": "SUCCESS",
                 "message": "",
                 "response_code": "",
                 "operation_id": "a4d01997-c988-4747-b730-130d800ada31"
             },
             "data": {
                 "id": "payment_0989e69672a242d605da6744d73581f9",
                 "amount": 100,
                 "original_amount": 100,
                 "is_partial": false,
                 "currency_code": "EUR",
                 "country_code": "AT",
                 "status": "CLO",
                 "description": "",
                 "merchant_reference_id": "",
                 "customer_token": "cus_d81ea43f7bd24e2f647da79f32b9d2d0",
                 "payment_method": null,
                 "payment_method_data": {
                     "id": card_38f74ed0a42211b2c9a08aa945074875,
                     "type": "at_mastercard_card",
                     "category": "card",
                     "metadata": null,
                     "image": "",
                     "webhook_url": "",
                     "supporting_documentation": "",
                     "next_action": "not_applicable",
                     "name": "John Doe",
                     "last4": "1111",
                     "acs_check": "unchecked",
                     "cvv_check": "unchecked",
                     "bin_details": {
                         "type": "CREDIT",
                         "brand": "VISA",
                         "level": "CLASSIC",
                         "country": "NL",
                         "bin_number": "411111"
                     },
                     "expiration_year": "31",
                     "expiration_month": "11",
                     "fingerprint_token": "ocfp_c6abbccb3440fcb0fc34ae14126607fa",
                     "network_reference_id": "000000111222999",			
                     "payment_account_reference": "V0010013018036782991622965076"
                 },
                 "auth_code": 003603,
                 "expiration": 1748504528,
                 "captured": true,
                 "refunded": false,
                 "refunded_amount": 0,
                 "receipt_email": "",
                 "redirect_url": "",
                 "complete_payment_url": "https://complete.example.net",
                 "error_payment_url": "https://error.example.net",
                 "receipt_number": "",
                 "flow_type": "",
                 "address": null,
                 "statement_descriptor": "Doc Team",
                 "transaction_id": "",
                 "created_at": 1747899728,
                 "metadata": null,
                 "failure_code": "",
                 "failure_message": "",
                 "paid": true,
                 "paid_at": 1747899729,
                 "dispute": null,
                 "refunds": null,
                 "order": null,
                 "outcome": null,
                 "visual_codes": {},
                 "textual_codes": {},
                 "instructions": {},
                 "ewallet_id": "ewallet_c1943cfeda5f98247ab117e5d2648861",
                 "ewallets": [
                     {
                         "ewallet_id": "ewallet_c1943cfeda5f98247ab117e5d2648861",
                         "amount": 100,
                         "percent": 100,
                         "refunded_amount": 0
                     }
                 ],
                 "payment_method_options": {
                     "aft": true,
                     "purpose_code": "high_risk_securities",
                     "is_direct_purchase": true
                 },
                 "payment_method_type": "nl_mastercard_card",
                 "payment_method_type_category": "card",
                 "fx_rate": 1,
                 "merchant_requested_currency": null,
                 "merchant_requested_amount": null,
                 "fixed_side": "",
                 "payment_fees": null,
                 "invoice": "",
                 "escrow": null,
                 "group_payment": "",
                 "cancel_reason": null,
                 "initiation_type": "customer_present",
                 "mid": "mid_7b624b32f161313347d554138d81858",
                 "next_action": "not_applicable",
                 "error_code": "",
                 "remitter_information": {},
                 "save_payment_method": false,
                 "merchant_advice_code": null,
                 "merchant_advice_message": null,
                 "transaction_link_id": null
             }
         }
         ```
