Submit Pending Orders
POST/v2/submit
Submits an order to Bonsai without payment. These orders will not be processed until payment is submitted.
Request
- application/json
Body
required
- Array [
- ]
customer objectrequired
Customer email
Customer's first name
Customer's last name
products object[]required
Possible values: >= 1
Product ID.
The ID of the product variant.
Possible values: >= 1
Quantity of the product variant.
shippingAddress 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.
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
Possible values: [credit card
, external payment
, stripe
]
Payment method that will be used to pay for the order.
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
Note containing extra information for our team
Unique identifier for the cart
Responses
- 200
- 400
- 401
- 404
- 500
- 5XX
Success
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
- Array [
- ]
data object
Email of the customer
shippingAddress 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.
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.
shippingLines object[]required
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.
products object[]required
Product ID.
The ID of the product variant.
Possible values: >= 1
Quantity of the product variant.
The title of the product.
The price of the product.
breakdown objectrequired
The amount of goods refunded
The amount of goods tax refunded
The amount of shipping refunded
The amount of shipping tax refunded
The amount of duties refunded
Possible values: [CAD
, USD
, GBP
, AUD
, EUR
]
Currency of the refund
Public ID of the order.
Order number in the system
Note containing extra information for our team
{
"data": {
"email": "qa@shopbonsai.ca",
"shippingAddress": {
"firstName": "Eddy",
"lastName": "Bonsai",
"address1": "351 E 103rd St",
"address2": "Whitecastle",
"city": "New York",
"country": "US",
"province": "NY",
"phone": "555-625-1199",
"zip": "10029"
},
"shippingLines": [
{
"title": "Small Packet International Air",
"code": "INT.TP",
"price": 20,
"source": "canada_post",
"tax": 12.45
}
],
"products": [
{
"id": "clad6pg5z00eu012gfz7hfm92",
"variantId": "M00679529706740",
"quantity": 1,
"name": "Nike Air Jordan",
"price": 10
}
],
"breakdown": {
"goods": 5,
"goodsTax": 1,
"shipping": 1,
"shippingTax": 1,
"duties": 0,
"currency": "USD"
},
"id": "cldbvy7gt0006hpzo9nyw72ks",
"orderNumber": 54663,
"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"
}
]
}
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"
}
]
}