VayuDocumentationIntegrationsAPI ReferenceChange Log
SupportGet started now
API EndpointsCustomers

Create Customer

Create a new Customer.

POST
/customers

Authorization

BearerAuthorizer
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

name*string

The name of the customer

aliases?array<string>

The aliases of the customer used to match events to the customer.

contacts?array<>

The contacts of the customer. Contact marked as primary is the target for invoice sharing.

source?CustomerSource

The source of the customer

legalName?string

The legal name of the customer

taxIds?array<string>

The tax IDs of the customer

status?CustomerStatus

The lifecycle status of the customer. Defaults to Active when omitted on creation.

taxId?string
Deprecated

The tax ID of the customer (deprecated, use taxIds instead)

cloudProviderSettings?

Cloud provider settings for the customer

externalId?string

The external ID of the customer

customerErpId?string

The ID of the customer in the ERP system

address?

The address of the customer

shippingAddress?
salesForceAccountId?string

The ID of the customer in the Salesforce system

externalIntegration?array<>

External integration links for the customer. Each entry links the customer to an external provider entity by its id. Stripe entries are saved on the customer; other providers are linked via the integration registry.

dueDays?string

The due days of the customer

currency?Currency

The billing currency of the customer

customFields?array<>

Custom fields from CRM systems (Salesforce, HubSpot, etc.)

customFieldValues?array<>

The stored custom field values associated with the customer. Read-only: ignored on create and update requests; values are set via customFields.

subsidiary?string

The name of the subsidiary of the customer

totalOutstandingAmount?number

Total outstanding amount across all unpaid invoices (in USD)

openAmount?number

Total amount of invoices with no billing status set (in USD)

overdueAmount?number

Total amount of overdue invoices (in USD)

pendingPaymentAmount?number

Total amount of invoices pending payment (in USD)

paidAmount?number

Total amount of paid invoices (in USD)

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/customers" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{  "customer": {    "name": "string",    "aliases": [],    "contacts": [      {        "name": "string",        "email": "string",        "title": "string",        "phone": "string",        "receiveInvoiceEmail": true      }    ],    "source": "Stripe",    "legalName": "string",    "taxIds": [],    "status": "Active",    "taxId": "string",    "cloudProviderSettings": {      "cloudProvider": "AWS",      "cloudProviderMarketplaceId": "string",      "customerIdentifier": "string"    },    "externalId": "string",    "customerErpId": "string",    "address": {      "country": "string",      "countryCode": "string",      "city": "string",      "addressText": "string",      "state": "string",      "postalCode": "string"    },    "shippingAddress": {      "country": "string",      "countryCode": "string",      "city": "string",      "addressText": "string",      "state": "string",      "postalCode": "string"    },    "salesForceAccountId": "string",    "externalIntegration": [      {        "type": "Stripe",        "id": "cus_123",        "name": "Acme Inc"      }    ],    "dueDays": "END_OF_MONTH",    "currency": "USD",    "customFields": [      {        "integrationSource": "NetSuite",        "integrationEntityType": "Account",        "fieldPath": "string",        "vayuCustomFieldName": "string",        "valueType": "String",        "value": null      }    ],    "customFieldValues": [      {        "customFieldDefinitionId": "string",        "value": "string",        "fieldName": "string"      }    ],    "subsidiary": "string",    "totalOutstandingAmount": 0,    "openAmount": 0,    "overdueAmount": 0,    "pendingPaymentAmount": 0,    "paidAmount": 0,    "id": "string",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  }}
{  "type": "invalid_request_error",  "code": "string",  "message": "string",  "param": "string",  "params": [    {      "param": "string",      "message": "string"    }  ]}
{  "type": "authentication_error",  "code": "authentication_failed",  "message": "string"}
{  "type": "rate_limit_error",  "code": "rate_limit_exceeded",  "message": "string"}
{  "type": "api_error",  "code": "internal_error",  "message": "string"}