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"
}'
import requests
import json
url = "https://sandbox.rasto.co/api/customers/cus_03567dbmmINi56C3sJCM7O/external_accounts"
headers = {
"Content-Type": "application/json",
"Api-Version": "2026-08-01",
"Idempotency-Key": "6f1c9a0e-2b7d-4c3a-9e58-0d4b7a1f2c63",
"Api-Key": "YOUR_API_KEY"
}
data = {
"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"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://sandbox.rasto.co/api/customers/cus_03567dbmmINi56C3sJCM7O/external_accounts", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Api-Version": "2026-08-01",
"Idempotency-Key": "6f1c9a0e-2b7d-4c3a-9e58-0d4b7a1f2c63",
"Api-Key": "YOUR_API_KEY"
},
body: JSON.stringify({
"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"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"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"
}`)
req, err := http.NewRequest("POST", "https://sandbox.rasto.co/api/customers/cus_03567dbmmINi56C3sJCM7O/external_accounts", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Api-Version", "2026-08-01")
req.Header.Set("Idempotency-Key", "6f1c9a0e-2b7d-4c3a-9e58-0d4b7a1f2c63")
req.Header.Set("Api-Key", "YOUR_API_KEY")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://sandbox.rasto.co/api/customers/cus_03567dbmmINi56C3sJCM7O/external_accounts')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Api-Version'] = '2026-08-01'
request['Idempotency-Key'] = '6f1c9a0e-2b7d-4c3a-9e58-0d4b7a1f2c63'
request['Api-Key'] = 'YOUR_API_KEY'
request.body = '{
"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"
}'
response = http.request(request)
puts response.body
{
"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"
}
{
"error": {
"code": "missing_api_key",
"kind": "authentication_error",
"message": "Provide your secret key in the Api-Key header.",
"param": null,
"request_id": "req_03567l4d4IRC5BGZzvNQgw"
}
}
{
"error": {
"code": "external_account_exists",
"kind": "invalid_request_error",
"message": "This customer already has this account: ea_03567iJcFl4c64mAlyBMzS.",
"param": null,
"request_id": "req_03567iNrLvo55MHtFwpEAW"
}
}
{
"error": {
"code": "invalid_parameter",
"kind": "invalid_request_error",
"message": "Field required",
"param": "currency",
"request_id": "req_03567l4dSOWrEd72d5Vbkb"
}
}
{
"error": {
"code": "rate_limited",
"kind": "rate_limit_error",
"message": "Too many requests. Back off and retry after the indicated delay.",
"param": null,
"request_id": "req_03567l4d4IRC5BGZzvNQgw"
}
}
{
"error": {
"code": "upstream_error",
"kind": "api_error",
"message": "The request could not be completed right now. Nothing was charged or changed; retry shortly, and contact support if it persists.",
"param": null,
"request_id": "req_03567l4d4IRC5BGZzvNQgw"
}
}
/api/customers/{customer_id}/external_accountsTarget server for requests. Edit to use your own host.
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.
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.The customer's id (cus_...).
The media type of the request body
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.
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.
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.
Required. Who holds the account and how they relate to the customer.
Required. The account's details, in the fields its country uses. A field that does not fit returns 422 invalid_parameter.
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.
Request Preview
Response
Response will appear here after sending the request
Authentication
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
Headers
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.
2026-08-01A 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.
6f1c9a0e-2b7d-4c3a-9e58-0d4b7a1f2c63Body
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.
Required. Who holds the account and how they relate to the customer.
Required. The account's details, in the fields its country uses. A field that does not fit returns 422 invalid_parameter.
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.