External accountsCreate an external account

Create an external account

Add a bank account the customer sends money to.

The account is checked with the receiving bank network before it is created; a refused one creates nothing. relationship: "first_party" marks the customer's own account, which must be in the customer's name.

curl -X POST "https://sandbox.rasto.co/api/customers/cus_03567dbmmINi56C3sJCM7O/external_accounts" \
  -H "Content-Type: application/json" \
  -H "Api-Version: 2026-08-01" \
  -H "Idempotency-Key: 6f1c9a0e-2b7d-4c3a-9e58-0d4b7a1f2c63" \
  -H "Api-Key: YOUR_API_KEY" \
  -d '{
  "account_holder": {
    "address": {
      "city": "Pune",
      "country": "IN",
      "postal_code": "411001",
      "state": "MH",
      "street_line_1": "12 MG Road"
    },
    "email": "priya@example.com",
    "first_name": "Priya",
    "kind": "individual",
    "last_name": "Rao",
    "nationality": "IN",
    "phone": "+919876543210",
    "relationship": "family"
  },
  "bank_account": {
    "account_kind": "savings",
    "account_number": "123456789012",
    "ifsc": "HDFC0001234"
  },
  "currency": "inr"
}'
{
  "account_holder": {
    "kind": "individual",
    "name": "Priya Rao",
    "relationship": "family"
  },
  "bank_account": {
    "account_kind": "savings",
    "bank_name": "HDFC Bank",
    "ifsc": "HDFC0001234",
    "kind": "in_bank_account",
    "last_4": "9012"
  },
  "created_at": "2026-11-29T18:01:59.251806+00:00",
  "currency": "inr",
  "customer_id": "cus_03567d7njVQ4kHysbZCK51",
  "id": "ea_03567iJcFl4c64mAlyBMzS",
  "object": "external_account",
  "partner_reference_id": null,
  "payment_rail": "rda",
  "status": "active"
}
POST
/api/customers/{customer_id}/external_accounts
POST
Base URLstring

Target server for requests. Edit to use your own host.

API Key (header: Api-Key)
Api-Keystring
Required

Your secret API key, sent in the Api-Key header on every request. Create keys on the dashboard. A sandbox key starts with sk_test_ and works only on https://sandbox.rasto.co; a live key starts with sk_live_ and works only on https://api.rasto.co. A read-only key can call every GET and is refused on anything that changes state. Keep keys on your server: never ship one in a browser or mobile app.

Your secret API key, sent in the Api-Key header on every request. Create keys on the dashboard. A sandbox key starts with sk_test_ and works only on https://sandbox.rasto.co; a live key starts with sk_live_ and works only on https://api.rasto.co. A read-only key can call every GET and is refused on anything that changes state. Keep keys on your server: never ship one in a browser or mobile app.
path
customer_idstring
Required

The customer's id (cus_...).

Content-Typestring
Required

The media type of the request body

Options: application/json
header
Api-Versionstring

The API version to use for this request, as a date (YYYY-MM-DD). Optional: without it you get version 2026-08-01, and that never changes. A later breaking change reaches you only when you send its newer date. Supported: 2026-08-01.

header
Idempotency-Keystring
Required

A value you choose, unique per request (a UUID works), at most 255 characters. Retrying with the same key and the same body replays the first answer instead of acting again. Keys are kept for 24 hours.

currencystring
Required

Required. The currency the account is paid in, as a three-letter code. inr is the only one today, open in sandbox only; any other returns 400 unsupported_currency.

Min length: 3 • Max length: 3
account_holderobject
Required

Required. Who holds the account and how they relate to the customer.

bank_accountobject
Required

Required. The account's details, in the fields its country uses. A field that does not fit returns 422 invalid_parameter.

partner_reference_idstring

Your own id for this external account, 1 to 255 characters. It is unique per environment (409 partner_reference_id_exists on a repeat) and list endpoints filter by it. Optional.

Min length: 1 • Max length: 255 • Pattern: ^[^\x00]*$
Request Preview
Response

Response will appear here after sending the request

Authentication

header
Api-Keystring
Required

API Key for authentication. Your secret API key, sent in the Api-Key header on every request. Create keys on the dashboard. A sandbox key starts with sk_test_ and works only on https://sandbox.rasto.co; a live key starts with sk_live_ and works only on https://api.rasto.co. A read-only key can call every GET and is refused on anything that changes state. Keep keys on your server: never ship one in a browser or mobile app.

Path Parameters

customer_idstring
Required

The customer's id (cus_...).

Example:
cus_03567dbmmINi56C3sJCM7O

Headers

Api-Versionstring

The API version to use for this request, as a date (YYYY-MM-DD). Optional: without it you get version 2026-08-01, and that never changes. A later breaking change reaches you only when you send its newer date. Supported: 2026-08-01.

Example:
2026-08-01
Idempotency-Keystring
Required

A value you choose, unique per request (a UUID works), at most 255 characters. Retrying with the same key and the same body replays the first answer instead of acting again. Keys are kept for 24 hours.

Example:
6f1c9a0e-2b7d-4c3a-9e58-0d4b7a1f2c63

Body

application/json
currencystring
Required

Required. The currency the account is paid in, as a three-letter code. inr is the only one today, open in sandbox only; any other returns 400 unsupported_currency.

account_holderobject
Required

Required. Who holds the account and how they relate to the customer.

bank_accountobject
Required

Required. The account's details, in the fields its country uses. A field that does not fit returns 422 invalid_parameter.

partner_reference_idstring

Your own id for this external account, 1 to 255 characters. It is unique per environment (409 partner_reference_id_exists on a repeat) and list endpoints filter by it. Optional.

Responses