Create a customer
Returns 201 for a new customer, and 200 if this `reference` already names one with the same details. Different details return 409 `reference_conflict`; use Update a customer to change them. Needs the `receive` capability.
Authorization
KeyID Timestamp Nonce Signature X-Gyvar-Key<token>
Your key id, gyv_k_live_... or gyv_k_sandbox_....
In: header
X-Gyvar-Timestamp<token>
Unix seconds. Must be within 5 minutes of our clock.
In: header
X-Gyvar-Nonce<token>
A unique value per request. Replays are rejected.
In: header
X-Gyvar-Signature<token>
Ed25519 signature over the canonical string. See the Signing guide.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
type?string
Default
"individual"Value in
- "individual"
- "business"
first_name*string
Length
length <= 60last_name*string
Length
length <= 60email?string
Format
emailphone?string
country?string
ISO 3166-1 alpha-2.
reference*string
Your id for this customer, and the idempotency key.
Length
length <= 128Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/customers" \ -H "Content-Type: application/json" \ -d '{ "reference": "user_8812", "first_name": "Ama", "last_name": "Mensah", "email": "ama@example.com", "country": "GH" }'{ "data": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "reference": "string", "type": "individual", "first_name": "string", "last_name": "string", "email": "string", "phone": "string", "country": "string", "tags": [ "string" ], "archived": true, "created_at": "2019-08-24T14:15:22Z", "totals": { "received": [ { "asset": "string", "amount_minor": 0, "count": 0 } ], "sent": [ { "asset": "string", "amount_minor": 0, "count": 0 } ], "delivered": [ { "currency": "string", "amount_minor": 0, "count": 0 } ] } }}