POST /api/v1/orders is public. It creates a customer, user, subscription in pending_payment, and the first invoice. Send Idempotency-Key. countryCode is NZ or AU. Domain names are the customer’s own hostname, not a hardcoded shop.
Create
Markdown source
---
title: Orders
nav: Orders
group: Core resources
order: 70
---
# Orders
`POST /api/v1/orders` is public. It creates a customer, user, subscription in `pending_payment`, and the first invoice. Send `Idempotency-Key`. `countryCode` is `NZ` or `AU`. Domain names are the customer’s own hostname, not a hardcoded shop.
## Create
```curl
curl -X POST {{API}}/api/v1/orders \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-demo-1" \
-d '{"planCode":"starter","period":"monthly","email":"you@example.com","password":"at-least-8","firstName":"Ada","lastName":"Lovelace","countryCode":"NZ","domainName":"example.com"}'
```
```node
await fetch(`${api}/api/v1/orders`, {
method: "POST",
headers: {
"content-type": "application/json",
"idempotency-key": "order-demo-1",
},
body: JSON.stringify({
planCode: "starter",
period: "monthly",
email,
password,
firstName,
lastName,
countryCode: "NZ",
domainName,
}),
});
```
```python
# POST /api/v1/orders with the same JSON fields
```