POST
/
v1
/
customers
import Straddle from '@straddleio/straddle';

const client = new Straddle({
  apiKey: process.env['STRADDLE_API_KEY'], // This is the default and can be omitted
});

async function main() {
  const customerV1 = await client.customers.create({
    device: { ip_address: '192.168.1.1' },
    email: 'ron.swanson@pawnee.com',
    name: 'Ron Swanson',
    phone: '+12128675309',
    type: 'individual',
  });

  console.log(customerV1.data);
}

main();
{
  "meta": {
    "api_request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "api_request_timestamp": "2023-11-07T05:31:56Z"
  },
  "response_type": "object",
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "Ron Swanson",
    "type": "individual",
    "email": "ron.swanson@pawnee.com",
    "phone": "+12128675309",
    "external_id": "<string>",
    "status": "verified",
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z",
    "address": {
      "address1": "123 Main St",
      "address2": null,
      "city": "Anytown",
      "state": "CA",
      "zip": "94105"
    },
    "compliance_profile": {
      "dob": "<string>",
      "ssn": "<string>",
      "ein": "<string>",
      "legal_business_name": "<string>",
      "website": "<string>"
    },
    "device": {
      "ip_address": "192.168.1.1"
    },
    "metadata": {}
  }
}

Authorizations

Authorization
string
header
required

Use your Straddle API Key in the Authorization header as Bearer <token> to authorize API requests.

Headers

Straddle-Account-Id
string

For use by platforms to specify an account id and set scope of a request.

Request-Id
string

Optional client generated identifier to trace and debug a request.

Correlation-Id
string

Optional client generated identifier to trace and debug a series of requests.

Body

name
string
required

Full name of the individual or business name.

type
enum<string>
required
Available options:
individual,
business
email
string
required

The customer's email address.

phone
string
required

The customer's phone number in E.164 format. Mobile number is preferred.

device
object
required
address
object | null

An object containing the customer's address. This is optional, but if provided, all required fields must be present.

compliance_profile
object

An object containing the customer's compliance profile. This is optional, but if provided, all required fields must be present for the appropriate customer type.

external_id
string | null

Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems.

metadata
object | null

Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the customer in a structured format.

Response

201
text/plain
Created
meta
object
required

Metadata about the API request, including an identifier and timestamp.

response_type
enum<string>
required

Indicates the structure of the returned content.

  • "object" means the data field contains a single JSON object.
  • "array" means the data field contains an array of objects.
  • "error" means the data field contains an error object with details of the issue.
  • "none" means no data is returned.
Available options:
object,
array,
error,
none
data
object
required