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

3. Shipping and Tax API

Skip for payments only integration

If you are not implementing multi step checkout or "Quick Checkout", you can skip this implementation

This hook end point must be implemented to support shipping and tax calculations for multi step checkout. Bolt will call this hook to get shipping options and tax rates during checkout

Requirements

Checkpoint

First contact Bolt to register your shipping and tax endpoint
Install one of REST API clients like Insomnia or Postman

Ensure that the following are true

  • Make a request to /v1/shipping_and_tax using API_KEY
  • Follow Calling Bolt REST API to make sure you are setting all the POST headers
  • Send a request as shown below. If your keys are right, Bolt will immediately make a request to your end point with the parameters and signature
  • If your implementation is all good, you should see a HTTP 200 response with a sample response as shown below.
{  
   "shipping_address":{  
      "street_address1":"1235D Howard Street",
      "street_address2":"Unit D",
      "locality":"San Francisco",
      "region":"California",
      "postal_code":"94103",
      "country":"United States",
      "country_code":"US",
      "first_name":"Jane",
      "last_name":"Doe",
      "company":"Random Inc.",
      "phone": "111-222-3344",
      "email":"abc@test.com"
   },
   "cart":{  
      "total_amount":15036,
     "order_reference":"1923",
      "tax_amount":15,
      "shipments":[  

      ],
      "currency":"USD",
      "items":[  
         {  
            "name":"Item1",
            "reference":"1",
            "description":"Item1 is everything you'd expect from something called Item1",
            "sku":"SK-1",
            "total_amount":5908,
            "unit_price":844,
            "image_url":"https://placeimg.com/30/30/animals/grayscale",
            "currency":"USD",
            "quantity":7,
            "tax_amount":0
         },
         {  
            "name":"Item3",
            "reference":"3",
            "description":"Item3, the new gold standard for items",
            "sku":"SK-3",
            "total_amount":8917,
            "unit_price":8917,
            "image_url":"https://placeimg.com/30/30/animals/grayscale",
            "currency":"USD",
            "quantity":1,
            "tax_amount":0
         },
         {  
            "name":"Item4",
            "reference":"4",
            "description":"you haven't lived until you've tried Item4",
            "sku":"SK-4",
            "total_amount":196,
            "unit_price":28,
            "image_url":"https://placeimg.com/30/30/animals/grayscale",
            "currency":"USD",
            "quantity":7,
            "tax_amount":0
         }
      ],
      "display_id":"792417"
   }
}
{  
   "shipping_options":[  
      {  
         "service":"Ground Shipping (5-7 Business Days)",
         "cost": 100,
         "tax_amount": 8,
         "reference": "1"
      },
      {  
         "service":"Overnight (1 Business Day)",
         "cost": 35000,  
         "tax_amount": 2538,
         "reference": "1"
      }
   ],
   "tax_result":{  
      "rate":725,
      "rate_shipping": 725,
      "amount":1088,
      "items":[  
         {  
            "rate":725,
            "amount":428
         },
         {  
            "rate":725,
            "amount":646
         },
         {  
            "rate":725,
            "amount":14
         }
      ]
   }
}

Debugging

  • Make sure you are using the PUBLISHABLE_KEY when testing this endpoint
  • Make sure you are calling the right API_URL. Using a sandbox publishable key to call production API or vice versa will always fail.
  • Make sure you are setting all the headers in the request.
  • Make sure that whenever you make a request to /v1/shipping_and_tax, you immediately get a request to your endpoint from Bolt
  • To verify the signature, make sure you are using the SIGNING_SECRET
  • If the response is a HTTP 422 or a HTTP 500, please contact Bolt's development support

3. Shipping and Tax API


Suggested Edits are limited on API Reference Pages

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