Bolt Developer

Welcome to the Bolt developer hub. You'll find comprehensive guides and documentation to help you start working with Bolt as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    Docs

1. Create order_token

Create Order

Create an order using the POST /merchant/orders endpoint. Given below is an example to create an order. Click HERE to read more.

Make sure to add all the necessary POST HTTP Headers in the request as explained in "Calling Bolt REST API"

Once you create an order successfully, all you need is the token from the response

Checkpoint

Ensure that all the following are true

  • POST /merchant/orders returns a HTTP 200
  • The response contains token
  • The total_amount and tax_amount are in cents.
Items
  • The items in the response match the items in the request
    • The unit_price, total_amount and tax_amount are in cents.
    • Every item has an image_url, name and description
    • The total_amount = (quantity * unit_price) + tax_amount
Shipments
  • The shipments contains a shipping_address and a shipping_method
    • The tax_amount and cost in shipments are in cents
    • The shipping_method, service and expedited match that in the request
Discounts
  • The discounts is a list of discount objects. Each object contains the following fields.
    • amount: (integer) The discount amount in cents. This amount must be deducted from the cart total.
    • reference: (string) The discount reference string.
    • description: (string) The textual description of the discount.
    • details_url: (string, optional) The URL for additional details about the discount.
Totals
  • The orders total_amount must equal the sum of tax_amount, all item totals and shipping costs
  • Every cent should be accounted for

Example

Suppose we want to create the following order

Database Order ID
Database Cart ID
Website
Order ID shown to customer

12345

54321

98543

Shipping Address
Shipping Option

Tom Williams
111 Random Road
Unit 123
San Francisco,
CA-94101

Email: aaa@test.com
Phone: +1-123-456-7890

USPS
Same Day Expedited Shipping

Item
Unit Price
Quantity
Total

Nike Jordan Shirt
Black Size M

$29.99

2

$59.98

Adidas Shoes
Blue Size 10

$87.00

1

$87.00

Sub-total

$146.98

Discount
Code: 20OFF

$20.00

Tax

$10.33

Shipping

$10.00

Total

$146.65

{
  "cart": {
    "order_description": "Order #98543",
    "order_reference": "12345",
    "display_id": "98543",
    "cart_url": "https://www.mystore.com/cart?order_reference=12345",
    "currency": "USD",
    "total_amount": 13731,
    "tax_amount": 1033,
    "items": [
      {
        "name": "Nike Jordan Shirt - Black Size M",
        "description": "Shirt - Black Size M",
        "options": "Black Size M",
        "unit_price": 2999,
        "quantity": 2,
        "total_amount": 5998,
        "tax_amount": 511,
        "sku": "aabbcc12345",
        "brand": "Jordan",
        "manufacturer": "Nike",
        "category": "Apparel",
        "color": "Black",
        "size": "M",
        "weight": 12,
        "weight_unit": "ounces",
        "image_url": "https://www.mystore.com/nike_jordan_shirt"
      },
      {
        "name": "Adidas Shoes - Blue Size 10",
        "description": "Adidas Shoes - Blue Size 10",
        "options": "Blue Size M",
        "unit_price": 8700,
        "quantity": 1,
        "total_amount": 8700,
        "tax_amount": 500,
        "sku": "bcdfg12345",
        "brand": "Adidas",
        "manufacturer": "Adidas",
        "category": "Apparel",
        "color": "Blue",
        "size": "10",
        "weight": 14,
        "weight_unit": "ounces",
        "image_url": "https://www.mystore.com/adidas_shoes"
      }
    ],
    "discounts": [{
      "amount": 2000,
      "description": "Code: 20OFF"
    }]
  }
}
{
    "token": "a3b2bcb6d83087cb4ee09cd6e87c534101b3a5aae4c378292675b718a3d95fc3",
    "cart": {
        "order_description": "Order #98543",
        "order_reference": "12345",
        "display_id": "98543",
        "cart_url": "https://www.mystore.com/cart?order_reference=12345",
        "currency": {
            "currency": "USD",
            "currency_symbol": "$"
        },
        "subtotal_amount": {
            "amount": 14698,
            "currency": "USD",
            "currency_symbol": "$"
        },
        "total_amount": {
            "amount": 13731,
            "currency": "USD",
            "currency_symbol": "$"
        },
        "tax_amount": {
            "amount": 1033,
            "currency": "USD",
            "currency_symbol": "$"
        },
        "discount_amount": {
            "amount": 2000,
            "currency": "USD",
            "currency_symbol": "$"
        },
        "items": [
            {
                "reference": "",
                "name": "Nike Jordan Shirt - Black Size M",
                "description": "Shirt - Black Size M",
                "options": "Black Size M",
                "total_amount": {
                    "amount": 5998,
                    "currency": "USD",
                    "currency_symbol": "$"
                },
                "unit_price": {
                    "amount": 2999,
                    "currency": "USD",
                    "currency_symbol": "$"
                },
                "tax_amount": {
                    "amount": 511,
                    "currency": "USD",
                    "currency_symbol": "$"
                },
                "quantity": 2,
                "sku": "aabbcc12345",
                "brand": "Jordan",
                "manufacturer": "Nike",
                "category": "Apparel",
                "color": "Black",
                "size": "M",
                "weight": {
                    "weight": 12,
                    "unit": "ounces"
                },
                "image_url": "https://www.mystore.com/nike_jordan_shirt",
                "type": "unknown",
                "taxable": true,
                "properties": []
            },
            {
                "reference": "",
                "name": "Adidas Shoes - Blue Size 10",
                "description": "Adidas Shoes - Blue Size 10",
                "options": "Blue Size M",
                "total_amount": {
                    "amount": 8700,
                    "currency": "USD",
                    "currency_symbol": "$"
                },
                "unit_price": {
                    "amount": 8700,
                    "currency": "USD",
                    "currency_symbol": "$"
                },
                "tax_amount": {
                    "amount": 500,
                    "currency": "USD",
                    "currency_symbol": "$"
                },
                "quantity": 1,
                "sku": "bcdfg12345",
                "brand": "Adidas",
                "manufacturer": "Adidas",
                "category": "Apparel",
                "color": "Blue",
                "size": "10",
                "weight": {
                    "weight": 14,
                    "unit": "ounces"
                },
                "image_url": "https://www.mystore.com/adidas_shoes",
                "type": "unknown",
                "taxable": true,
                "properties": []
            }
        ],
        "discounts": [
            {
                "amount": {
                    "amount": 2000,
                    "currency": "USD",
                    "currency_symbol": "$"
                },
                "description": "Code: 20OFF"
            }
        ]
    },
    "external_data": {}
}

Debugging

  • Make sure you are using the API_KEY to create the order
  • Make sure you are calling the right API_URL. Using a sandbox API key to call production API or vice versa will always fail.
  • Make sure you are setting all the headers in the request.
  • If the response is a HTTP 422 or a HTTP 500, please contact Bolt's development support

1. Create order_token


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.