curl -sS -X POST 'https://apipub.firstbasehq.com/api/v1/orders' \
-H 'Authorization: ApiKey YOUR_API_KEY' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"shippingAddress": {
"addressLine1": 123,
"addressLine2": "Apartment B",
"administrativeArea": "California",
"countryCode": "US",
"dependentLocality": "Mission Bay",
"locality": "San Francisco",
"postalCode": 94158,
"sortingCode": "94158-1234",
"phoneNumber": "+1-415-555-1234"
},
"personId": "123e4567-e89b-12d3-a456-426614174000",
"officeId": "123e4567-e89b-12d3-a456-426614174001",
"deliverToPersonId": "123e4567-e89b-12d3-a456-426614174002",
"deliverToOfficeId": "123e4567-e89b-12d3-a456-426614174003",
"skus": [
{
"id": "123e4567-e89b-12d3-a456-426614174000"
}
]
}'import requests
url = "https://apipub.firstbasehq.com/api/v1/orders"
payload = { "skus": [{ "id": "123e4567-e89b-12d3-a456-426614174000" }] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({skus: [{id: '123e4567-e89b-12d3-a456-426614174000'}]})
};
fetch('https://apipub.firstbasehq.com/api/v1/orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"orderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"itemIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}Create order
Places a new order for one or more SKUs, delivered to either a person or an office. Exactly one of personId or officeId must be provided. Shipping address is auto-resolved from the recipient when not explicitly supplied. Returns the newly created order, including its ID and initial status.
curl -sS -X POST 'https://apipub.firstbasehq.com/api/v1/orders' \
-H 'Authorization: ApiKey YOUR_API_KEY' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"shippingAddress": {
"addressLine1": 123,
"addressLine2": "Apartment B",
"administrativeArea": "California",
"countryCode": "US",
"dependentLocality": "Mission Bay",
"locality": "San Francisco",
"postalCode": 94158,
"sortingCode": "94158-1234",
"phoneNumber": "+1-415-555-1234"
},
"personId": "123e4567-e89b-12d3-a456-426614174000",
"officeId": "123e4567-e89b-12d3-a456-426614174001",
"deliverToPersonId": "123e4567-e89b-12d3-a456-426614174002",
"deliverToOfficeId": "123e4567-e89b-12d3-a456-426614174003",
"skus": [
{
"id": "123e4567-e89b-12d3-a456-426614174000"
}
]
}'import requests
url = "https://apipub.firstbasehq.com/api/v1/orders"
payload = { "skus": [{ "id": "123e4567-e89b-12d3-a456-426614174000" }] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({skus: [{id: '123e4567-e89b-12d3-a456-426614174000'}]})
};
fetch('https://apipub.firstbasehq.com/api/v1/orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"orderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"itemIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}Authorizations
Prefix the value with "ApiKey" to indicate the custom authorization type
Body
Request body for creating a new order. Either personId or officeId must be provided, but not both.
A list of SKUs (items) to include in the order.
Show child attributes
Show child attributes
The shipping address for the order. If not provided, it will be auto-resolved from the deliverToOffice address, the person's address (personId), or the office's address (officeId) — in that priority order.
Show child attributes
Show child attributes
The ID of the person receiving the order. Either this or officeId must be set, but not both.
"123e4567-e89b-12d3-a456-426614174000"
The ID of the office receiving the order. Either this or personId must be set, but not both.
"123e4567-e89b-12d3-a456-426614174001"
The ID of the person to whom the order should be delivered. Used to auto-resolve the shipping address when shippingAddress is not provided.
"123e4567-e89b-12d3-a456-426614174002"
The ID of the office to which the order should be delivered. Used to auto-resolve the shipping address when shippingAddress is not provided.
"123e4567-e89b-12d3-a456-426614174003"