Skip to main content
POST
Create a customer
Requires the customers:write scope. See Authentication.

Authorizations

Authorization
string
header
required

An API key. Its scopes decide what it may call: customers:read (List and look up customers.) customers:write (Create customers, and Xero contacts where the organisation allows it.) catalogue:read (List plans and charges.) subscriptions:read (List and look up subscriptions.) subscriptions:write (Create subscriptions, change units, end and restore them.) invoices:read (List and look up invoices.)

Headers

Idempotency-Key
string

1 to 255 printable characters. A retry with the same key and body returns the first response.

Required string length: 1 - 255
Example:

"signup_8f3a2c1d"

Body

application/json
code
string
required

The organisation's own reference for the customer. Unique per organisation.

name
string
required

The name the contact is created under in Xero.

Required string length: 1 - 255
email
string<email> | null
Maximum string length: 255
Pattern: ^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$

Response

A customer with this code already existed.