SDK
Javascript
How to
Recipients
Create Recipient

Create Recipient

This method allows you to add a new recipient to your recipient list in Rampable.

Method Signature

async createRecipient(body: CreateRecipientBody): Promise<CreateRecipientResponse>

Parameters

body: CreateRecipientBody - An object with the following properties:

Required Fields

  • name: string - The name for the recipient
  • email: string - The recipient email address
  • address: string - The address of recipient
  • city: string - The city of recipient
  • postCode: string - The post code of recipient
  • bank: object - The bank account information containing:
    • accountName: string - The name of the bank account holder
    • currency: string - The currency of the bank account
    • country: string - The country of the bank account

Optional Fields

  • recipientType: string - The type of recipient (Individual or Business)
  • organizationId: string - Unique identifier for the organization
  • reference: string - Additional reference information
  • bank: object - Additional bank details:
    • bankName: string - The name of the bank
    • accountNumber: string - The bank account number
    • paymentCode: string - The payment code
    • achNumber: string - The ACH number
    • fedwireNumber: string - The Fedwire number
    • ibanNumber: string - The IBAN number
    • accountType: Checking | Savings - The type of bank account

Returns

Promise<CreateRecipientResponse> - The created recipient object.

Example Usage

const recipient = await sdk.rampableRecipient.createRecipient({
  name: "John Doe",
  recipientType: "Individual",
  email: "john.doe@example.com",
  organizationId: "org_123",
  bank: {
    currency: "USD",
    country: "UNITED STATES",
    accountNumber: "23123232123",
    accountName: "John Doe",
    paymentCode: "CODE123",
    bankName: "Example Bank",
    ibanNumber: "1",
    achNumber: "1",
    fedwireNumber: "1",
    accountType: "Checking"
  },
  city: "New York",
  postCode: "10001",
  address: "123 Main St",
  reference: "EMP001"
});

Response Example

{
  "name": "John Doe",
  "recipientType": "Individual",
  "email": "john.doe@example.com",
  "bank": [
    {
      "accountName": "John Doe",
      "bankName": "Example Bank",
      "accountNumber": 23123232123,
      "paymentCode": "CODE123",
      "currency": "USD",
      "country": "UNITED STATES",
      "achNumber": "1",
      "fedwireNumber": "1",
      "ibanNumber": "1",
      "accountType": "Checking",
      "_id": "bank_123"
    }
  ],
  "organizationId": "org_123",
  "userId": "user_123",
  "createdAt": "2024-01-01T00:00:00.000Z",
  "updatedAt": "2024-01-01T00:00:00.000Z",
  "city": "New York",
  "postCode": "10001",
  "address": "123 Main St",
  "reference": "EMP001",
  "id": "recipient_123"
}
ℹ️

The recipient's name and email, along with bank country and currency, are required fields for creating a new recipient.

For more information, see the Rampable Recipients API Documentation (opens in a new tab).