Submit Orders
POST/V1/submit
Submits an order to Bonsai for processing. Be careful as these orders will be processed unless Bonsai gets contacted to cancel! - To submit orders in Test Mode, please read our Test Orders Guide
Request
- application/json
Body
required
- Array [
- ]
customer objectrequired
Customer email address. We will be using this email to update the customer about their order
Customer first name.
Customer last name.
products object[]required
Possible values: >= 1
ID of the product
ID of the product variant.
Possible values: >= 1
Quantity of the product variant in the cart
shipping_address objectrequired
Customer first name.
Customer last name.
The street address of the shipping address.
An optional additional field for the street address of the shipping address.
The city, town, or village of the shipping address.
The two-letter code (ISO 3166-1 format) for the country of the shipping address.
Full name.
The two-letter abbreviation of the region of the shipping address.
The phone number at the shipping address.
The postal code (zip, postcode, Eircode, …) of the shipping address.
payment objectrequired
Payment information for an order
Possible values: [credit card
, external payment
, stripe
]
Payment method used to pay for the order.
Payment token for the order. Each payment token may be used for 1 order.
Possible values: [CAD
, USD
, GBP
, AUD
, EUR
]
ISO currency code for the currency that customer payment was taken in.
amounts object
Amounts for the order. Required only for external payment
method.
Total amount of shipping costs, in target currency (ex. USD).;
The amount of taxes to be paid, in target currency (ex. USD).
The amount of goods to be paid, in target currency (ex. USD).
ID of the order provided to Bonsai by the party who placed the order. This can be anything you like, but should be unique per order.
misc object
Miscellaneous data for the order. For example, analytics data.
data objectrequired
Unique identifier for the cart
Note containing extra information for our team
Responses
- 200
- 400
- 401
- 402
- 404
- 500
- 5XX
Success
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
- Array [
- ]
data object
Email of the customer
shipping_address object
Customer first name.
Customer last name.
The street address of the shipping address.
An optional additional field for the street address of the shipping address.
The city, town, or village of the shipping address.
The two-letter code (ISO 3166-1 format) for the country of the shipping address.
Full name.
The two-letter abbreviation of the region of the shipping address.
The phone number at the shipping address.
The postal code (zip, postcode, Eircode, …) of the shipping address.
shipping_lines object[]
The title of the shipping method.
A reference to the shipping method.
The price of this shipping method in the shop currency. Can not be negative.
The source of the shipping method.
Taxes for a specific shipping line.
line_items object[]
The title of the product.
Unique product identifier.
variant sku.
The ID of the product variant.
Public id of product. These will be the public ids of products requested when placing the order.
The price of the item before discounts have been applied in the shop currency.
The number of items that were purchased.
Indicate whether product requires shipping.
properties object
Name of product property.
Value of product property.
Total amount of taxes to be paid.
Total amount of duties to be paid.
Total amount for entire order.
Public id of customer order.
This is the public ID of the partner that the sale will be attributed to.
Order number in the system
Customer payment method details. This detail can be shown to the customer.
Note containing extra information for our team
{
"data": {
"email": "qa@shopbonsai.ca",
"shipping_address": {
"first_name": "Eddy",
"last_name": "Bonsai",
"address1": "351 E 103rd St",
"address2": "Whitecastle",
"city": "New York",
"country": "US",
"name": "Eddy Bonsai",
"province": "NY",
"phone": "555-625-1199",
"zip": "10029"
},
"shipping_lines": [
{
"title": "Small Packet International Air",
"code": "INT.TP",
"price": 20,
"source": "canada_post",
"tax": 12.45
}
],
"line_items": [
{
"name": "Nike Air Jordan",
"product_id": "7513594",
"variant_sku": "7513594",
"variant_id": "4264112",
"public_id": "cjld2cyuq0000t3rmniod1foy",
"price": 10,
"quantity": 1,
"requires_shipping": true,
"properties": {
"name": "custom engraving",
"value": "Happy Birthday Mom!"
}
}
],
"total_tax": 12.25,
"total_duties": 20.12,
"total_price": 120.25,
"public_id": "cjld2cyuq0000t3rmniod1foy",
"partner_id": "ck865cyk00000xlzo0ftpawme",
"orderNumber": 54663,
"stripeClientSecrets": [
"pi_1DoS1i2eZvKYlo2CXgQLdndX_secret_jYJLrdftGY4odNdK6RIJzMeXO"
],
"payment_description": "visa ending in 4242",
"note": "Fulfil only if white colour was selected. Or reach out to our support"
}
}
400 - Bad request
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
errors object[]
Unique identifier for error. Can be used for tracing across services.
HTTP status code.
Unique code for specific error.
Short description what the error entails.
detail objectrequired
Useful details related to the error
{
"errors": [
{
"id": "123e4567-e89b-12d3-a456-426655440000",
"status": 400,
"code": "OUT_OF_STOCK",
"title": "The product is out of stock",
"detail": {
"publicId": "clad6pg5z00ru012gfz7hfm92",
"variantId": "M00679529706740"
}
}
]
}
401 - Unauthorized
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
errors object[]
{
"errors": [
{
"status": 401,
"detail": "",
"title": "Authentication information is missing or invalid"
}
]
}
402 - Payment required
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
errors object[]
Unique identifier for error. Can be used for tracing across services.
HTTP status code.
Unique code for specific error.
Short description what the error entails.
detail objectrequired
Useful details related to the error
{
"errors": [
{
"id": "123e4567-e89b-12d3-a456-426655440000",
"status": 402,
"code": "PAYMENT_REQUIRED",
"title": "Payment is required for this order",
"detail": {
"message": "Your card was declined."
}
}
]
}
404 - Not found
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
errors object[]
Unique identifier for error. Can be used for tracing across services.
HTTP status code.
Unique code for specific error.
Short description what the error entails.
detail objectrequired
Useful details related to the error
{
"errors": [
{
"id": "123e4567-e89b-12d3-a456-426655440000",
"status": 404,
"code": "VARIANT_DOES_NOT_EXIST",
"title": "Variant does not exist",
"detail": {
"publicId": "clad6pg5z00ru012gfz7hfm92",
"variantId": "M00679529706740"
}
}
]
}
500 - Internal server error
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
errors object[]
Unique identifier for error. Can be used for tracing across services.
HTTP status code.
Unique code for specific error.
Short description what the error entails.
detail objectrequired
Useful details related to the error
customer object
{
"errors": [
{
"id": "123e4567-e89b-12d3-a456-426655440000",
"status": 500,
"code": "STRIPE_ERROR",
"title": "Error during a Stripe operation",
"detail": {
"stripeToken": "tok_1EJ2Zp2eZvKYlo2Cg2g2g2g2",
"customer": {
"email": "qa@shopbonsai.ca",
"first_name": "Eddy",
"last_name": "Bonsai"
},
"message": "Your card was declined."
}
}
]
}
500 - Unknown error
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
errors object[]
{
"errors": [
{
"status": 500,
"detail": "",
"title": "Unknown error"
}
]
}