Create an order that was prepared outside the Bolt ecosystem.
curl --request POST \
--url https://{environment}.boltapp.com/v3/orders \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--header 'X-Publishable-Key: <x-publishable-key>' \
--data '
{
"profile": {
"first_name": "Charlie",
"last_name": "Dunn",
"email": "charlie@example.com",
"phone": "+14085551111"
},
"cart": {
"total": {
"units": 1000,
"currency": "USD"
},
"tax": {
"units": 100,
"currency": "USD"
},
"order_reference": "instore_20240116-878",
"order_description": "Order #878",
"display_id": "20240116-878",
"items": [
{
"name": "Red Fidget Spinner",
"reference": "sku-984",
"description": "Single-packed fidget spinner, red",
"total_amount": {
"units": 1000,
"currency": "USD"
},
"unit_price": 1000,
"quantity": 1,
"image_url": "https://www.example.com/products/984/image.png"
}
],
"shipments": [
{
"cost": {
"units": 10000,
"currency": "USD"
},
"carrier": "FedEx",
"address": {
".tag": "explicit",
"first_name": "Charlie",
"last_name": "Dunn",
"street_address1": "535 Mission St",
"locality": "San Francisco",
"postal_code": "94105",
"region": "CA",
"country_code": "US"
}
}
]
}
}
'import requests
url = "https://{environment}.boltapp.com/v3/orders"
payload = {
"profile": {
"first_name": "Charlie",
"last_name": "Dunn",
"email": "charlie@example.com",
"phone": "+14085551111"
},
"cart": {
"total": {
"units": 1000,
"currency": "USD"
},
"tax": {
"units": 100,
"currency": "USD"
},
"order_reference": "instore_20240116-878",
"order_description": "Order #878",
"display_id": "20240116-878",
"items": [
{
"name": "Red Fidget Spinner",
"reference": "sku-984",
"description": "Single-packed fidget spinner, red",
"total_amount": {
"units": 1000,
"currency": "USD"
},
"unit_price": 1000,
"quantity": 1,
"image_url": "https://www.example.com/products/984/image.png"
}
],
"shipments": [
{
"cost": {
"units": 10000,
"currency": "USD"
},
"carrier": "FedEx",
"address": {
".tag": "explicit",
"first_name": "Charlie",
"last_name": "Dunn",
"street_address1": "535 Mission St",
"locality": "San Francisco",
"postal_code": "94105",
"region": "CA",
"country_code": "US"
}
}
]
}
}
headers = {
"X-Publishable-Key": "<x-publishable-key>",
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Publishable-Key': '<x-publishable-key>',
'X-API-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
profile: {
first_name: 'Charlie',
last_name: 'Dunn',
email: 'charlie@example.com',
phone: '+14085551111'
},
cart: {
total: {units: 1000, currency: 'USD'},
tax: {units: 100, currency: 'USD'},
order_reference: 'instore_20240116-878',
order_description: 'Order #878',
display_id: '20240116-878',
items: [
{
name: 'Red Fidget Spinner',
reference: 'sku-984',
description: 'Single-packed fidget spinner, red',
total_amount: {units: 1000, currency: 'USD'},
unit_price: 1000,
quantity: 1,
image_url: 'https://www.example.com/products/984/image.png'
}
],
shipments: [
{
cost: {units: 10000, currency: 'USD'},
carrier: 'FedEx',
address: {
'.tag': 'explicit',
first_name: 'Charlie',
last_name: 'Dunn',
street_address1: '535 Mission St',
locality: 'San Francisco',
postal_code: '94105',
region: 'CA',
country_code: 'US'
}
}
]
}
})
};
fetch('https://{environment}.boltapp.com/v3/orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{environment}.boltapp.com/v3/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'profile' => [
'first_name' => 'Charlie',
'last_name' => 'Dunn',
'email' => 'charlie@example.com',
'phone' => '+14085551111'
],
'cart' => [
'total' => [
'units' => 1000,
'currency' => 'USD'
],
'tax' => [
'units' => 100,
'currency' => 'USD'
],
'order_reference' => 'instore_20240116-878',
'order_description' => 'Order #878',
'display_id' => '20240116-878',
'items' => [
[
'name' => 'Red Fidget Spinner',
'reference' => 'sku-984',
'description' => 'Single-packed fidget spinner, red',
'total_amount' => [
'units' => 1000,
'currency' => 'USD'
],
'unit_price' => 1000,
'quantity' => 1,
'image_url' => 'https://www.example.com/products/984/image.png'
]
],
'shipments' => [
[
'cost' => [
'units' => 10000,
'currency' => 'USD'
],
'carrier' => 'FedEx',
'address' => [
'.tag' => 'explicit',
'first_name' => 'Charlie',
'last_name' => 'Dunn',
'street_address1' => '535 Mission St',
'locality' => 'San Francisco',
'postal_code' => '94105',
'region' => 'CA',
'country_code' => 'US'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>",
"X-Publishable-Key: <x-publishable-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{environment}.boltapp.com/v3/orders"
payload := strings.NewReader("{\n \"profile\": {\n \"first_name\": \"Charlie\",\n \"last_name\": \"Dunn\",\n \"email\": \"charlie@example.com\",\n \"phone\": \"+14085551111\"\n },\n \"cart\": {\n \"total\": {\n \"units\": 1000,\n \"currency\": \"USD\"\n },\n \"tax\": {\n \"units\": 100,\n \"currency\": \"USD\"\n },\n \"order_reference\": \"instore_20240116-878\",\n \"order_description\": \"Order #878\",\n \"display_id\": \"20240116-878\",\n \"items\": [\n {\n \"name\": \"Red Fidget Spinner\",\n \"reference\": \"sku-984\",\n \"description\": \"Single-packed fidget spinner, red\",\n \"total_amount\": {\n \"units\": 1000,\n \"currency\": \"USD\"\n },\n \"unit_price\": 1000,\n \"quantity\": 1,\n \"image_url\": \"https://www.example.com/products/984/image.png\"\n }\n ],\n \"shipments\": [\n {\n \"cost\": {\n \"units\": 10000,\n \"currency\": \"USD\"\n },\n \"carrier\": \"FedEx\",\n \"address\": {\n \".tag\": \"explicit\",\n \"first_name\": \"Charlie\",\n \"last_name\": \"Dunn\",\n \"street_address1\": \"535 Mission St\",\n \"locality\": \"San Francisco\",\n \"postal_code\": \"94105\",\n \"region\": \"CA\",\n \"country_code\": \"US\"\n }\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Publishable-Key", "<x-publishable-key>")
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{environment}.boltapp.com/v3/orders")
.header("X-Publishable-Key", "<x-publishable-key>")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"profile\": {\n \"first_name\": \"Charlie\",\n \"last_name\": \"Dunn\",\n \"email\": \"charlie@example.com\",\n \"phone\": \"+14085551111\"\n },\n \"cart\": {\n \"total\": {\n \"units\": 1000,\n \"currency\": \"USD\"\n },\n \"tax\": {\n \"units\": 100,\n \"currency\": \"USD\"\n },\n \"order_reference\": \"instore_20240116-878\",\n \"order_description\": \"Order #878\",\n \"display_id\": \"20240116-878\",\n \"items\": [\n {\n \"name\": \"Red Fidget Spinner\",\n \"reference\": \"sku-984\",\n \"description\": \"Single-packed fidget spinner, red\",\n \"total_amount\": {\n \"units\": 1000,\n \"currency\": \"USD\"\n },\n \"unit_price\": 1000,\n \"quantity\": 1,\n \"image_url\": \"https://www.example.com/products/984/image.png\"\n }\n ],\n \"shipments\": [\n {\n \"cost\": {\n \"units\": 10000,\n \"currency\": \"USD\"\n },\n \"carrier\": \"FedEx\",\n \"address\": {\n \".tag\": \"explicit\",\n \"first_name\": \"Charlie\",\n \"last_name\": \"Dunn\",\n \"street_address1\": \"535 Mission St\",\n \"locality\": \"San Francisco\",\n \"postal_code\": \"94105\",\n \"region\": \"CA\",\n \"country_code\": \"US\"\n }\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{environment}.boltapp.com/v3/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Publishable-Key"] = '<x-publishable-key>'
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"profile\": {\n \"first_name\": \"Charlie\",\n \"last_name\": \"Dunn\",\n \"email\": \"charlie@example.com\",\n \"phone\": \"+14085551111\"\n },\n \"cart\": {\n \"total\": {\n \"units\": 1000,\n \"currency\": \"USD\"\n },\n \"tax\": {\n \"units\": 100,\n \"currency\": \"USD\"\n },\n \"order_reference\": \"instore_20240116-878\",\n \"order_description\": \"Order #878\",\n \"display_id\": \"20240116-878\",\n \"items\": [\n {\n \"name\": \"Red Fidget Spinner\",\n \"reference\": \"sku-984\",\n \"description\": \"Single-packed fidget spinner, red\",\n \"total_amount\": {\n \"units\": 1000,\n \"currency\": \"USD\"\n },\n \"unit_price\": 1000,\n \"quantity\": 1,\n \"image_url\": \"https://www.example.com/products/984/image.png\"\n }\n ],\n \"shipments\": [\n {\n \"cost\": {\n \"units\": 10000,\n \"currency\": \"USD\"\n },\n \"carrier\": \"FedEx\",\n \"address\": {\n \".tag\": \"explicit\",\n \"first_name\": \"Charlie\",\n \"last_name\": \"Dunn\",\n \"street_address1\": \"535 Mission St\",\n \"locality\": \"San Francisco\",\n \"postal_code\": \"94105\",\n \"region\": \"CA\",\n \"country_code\": \"US\"\n }\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3Cxr2keCtxju",
"transaction": {
"reference": "2ZF2-WZ3J-WD2Y"
}
}{
".tag": "unprocessable_request",
"message": "We were unable to process your request."
}Orders
Create an order that was prepared outside the Bolt ecosystem.
Create an order that was prepared outside the Bolt ecosystem. Some Bolt-powered flows automatically manage order creation - in those flows the order ID will be provided separately and not through this API.
POST
/
orders
Create an order that was prepared outside the Bolt ecosystem.
curl --request POST \
--url https://{environment}.boltapp.com/v3/orders \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--header 'X-Publishable-Key: <x-publishable-key>' \
--data '
{
"profile": {
"first_name": "Charlie",
"last_name": "Dunn",
"email": "charlie@example.com",
"phone": "+14085551111"
},
"cart": {
"total": {
"units": 1000,
"currency": "USD"
},
"tax": {
"units": 100,
"currency": "USD"
},
"order_reference": "instore_20240116-878",
"order_description": "Order #878",
"display_id": "20240116-878",
"items": [
{
"name": "Red Fidget Spinner",
"reference": "sku-984",
"description": "Single-packed fidget spinner, red",
"total_amount": {
"units": 1000,
"currency": "USD"
},
"unit_price": 1000,
"quantity": 1,
"image_url": "https://www.example.com/products/984/image.png"
}
],
"shipments": [
{
"cost": {
"units": 10000,
"currency": "USD"
},
"carrier": "FedEx",
"address": {
".tag": "explicit",
"first_name": "Charlie",
"last_name": "Dunn",
"street_address1": "535 Mission St",
"locality": "San Francisco",
"postal_code": "94105",
"region": "CA",
"country_code": "US"
}
}
]
}
}
'import requests
url = "https://{environment}.boltapp.com/v3/orders"
payload = {
"profile": {
"first_name": "Charlie",
"last_name": "Dunn",
"email": "charlie@example.com",
"phone": "+14085551111"
},
"cart": {
"total": {
"units": 1000,
"currency": "USD"
},
"tax": {
"units": 100,
"currency": "USD"
},
"order_reference": "instore_20240116-878",
"order_description": "Order #878",
"display_id": "20240116-878",
"items": [
{
"name": "Red Fidget Spinner",
"reference": "sku-984",
"description": "Single-packed fidget spinner, red",
"total_amount": {
"units": 1000,
"currency": "USD"
},
"unit_price": 1000,
"quantity": 1,
"image_url": "https://www.example.com/products/984/image.png"
}
],
"shipments": [
{
"cost": {
"units": 10000,
"currency": "USD"
},
"carrier": "FedEx",
"address": {
".tag": "explicit",
"first_name": "Charlie",
"last_name": "Dunn",
"street_address1": "535 Mission St",
"locality": "San Francisco",
"postal_code": "94105",
"region": "CA",
"country_code": "US"
}
}
]
}
}
headers = {
"X-Publishable-Key": "<x-publishable-key>",
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Publishable-Key': '<x-publishable-key>',
'X-API-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
profile: {
first_name: 'Charlie',
last_name: 'Dunn',
email: 'charlie@example.com',
phone: '+14085551111'
},
cart: {
total: {units: 1000, currency: 'USD'},
tax: {units: 100, currency: 'USD'},
order_reference: 'instore_20240116-878',
order_description: 'Order #878',
display_id: '20240116-878',
items: [
{
name: 'Red Fidget Spinner',
reference: 'sku-984',
description: 'Single-packed fidget spinner, red',
total_amount: {units: 1000, currency: 'USD'},
unit_price: 1000,
quantity: 1,
image_url: 'https://www.example.com/products/984/image.png'
}
],
shipments: [
{
cost: {units: 10000, currency: 'USD'},
carrier: 'FedEx',
address: {
'.tag': 'explicit',
first_name: 'Charlie',
last_name: 'Dunn',
street_address1: '535 Mission St',
locality: 'San Francisco',
postal_code: '94105',
region: 'CA',
country_code: 'US'
}
}
]
}
})
};
fetch('https://{environment}.boltapp.com/v3/orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{environment}.boltapp.com/v3/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'profile' => [
'first_name' => 'Charlie',
'last_name' => 'Dunn',
'email' => 'charlie@example.com',
'phone' => '+14085551111'
],
'cart' => [
'total' => [
'units' => 1000,
'currency' => 'USD'
],
'tax' => [
'units' => 100,
'currency' => 'USD'
],
'order_reference' => 'instore_20240116-878',
'order_description' => 'Order #878',
'display_id' => '20240116-878',
'items' => [
[
'name' => 'Red Fidget Spinner',
'reference' => 'sku-984',
'description' => 'Single-packed fidget spinner, red',
'total_amount' => [
'units' => 1000,
'currency' => 'USD'
],
'unit_price' => 1000,
'quantity' => 1,
'image_url' => 'https://www.example.com/products/984/image.png'
]
],
'shipments' => [
[
'cost' => [
'units' => 10000,
'currency' => 'USD'
],
'carrier' => 'FedEx',
'address' => [
'.tag' => 'explicit',
'first_name' => 'Charlie',
'last_name' => 'Dunn',
'street_address1' => '535 Mission St',
'locality' => 'San Francisco',
'postal_code' => '94105',
'region' => 'CA',
'country_code' => 'US'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>",
"X-Publishable-Key: <x-publishable-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{environment}.boltapp.com/v3/orders"
payload := strings.NewReader("{\n \"profile\": {\n \"first_name\": \"Charlie\",\n \"last_name\": \"Dunn\",\n \"email\": \"charlie@example.com\",\n \"phone\": \"+14085551111\"\n },\n \"cart\": {\n \"total\": {\n \"units\": 1000,\n \"currency\": \"USD\"\n },\n \"tax\": {\n \"units\": 100,\n \"currency\": \"USD\"\n },\n \"order_reference\": \"instore_20240116-878\",\n \"order_description\": \"Order #878\",\n \"display_id\": \"20240116-878\",\n \"items\": [\n {\n \"name\": \"Red Fidget Spinner\",\n \"reference\": \"sku-984\",\n \"description\": \"Single-packed fidget spinner, red\",\n \"total_amount\": {\n \"units\": 1000,\n \"currency\": \"USD\"\n },\n \"unit_price\": 1000,\n \"quantity\": 1,\n \"image_url\": \"https://www.example.com/products/984/image.png\"\n }\n ],\n \"shipments\": [\n {\n \"cost\": {\n \"units\": 10000,\n \"currency\": \"USD\"\n },\n \"carrier\": \"FedEx\",\n \"address\": {\n \".tag\": \"explicit\",\n \"first_name\": \"Charlie\",\n \"last_name\": \"Dunn\",\n \"street_address1\": \"535 Mission St\",\n \"locality\": \"San Francisco\",\n \"postal_code\": \"94105\",\n \"region\": \"CA\",\n \"country_code\": \"US\"\n }\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Publishable-Key", "<x-publishable-key>")
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{environment}.boltapp.com/v3/orders")
.header("X-Publishable-Key", "<x-publishable-key>")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"profile\": {\n \"first_name\": \"Charlie\",\n \"last_name\": \"Dunn\",\n \"email\": \"charlie@example.com\",\n \"phone\": \"+14085551111\"\n },\n \"cart\": {\n \"total\": {\n \"units\": 1000,\n \"currency\": \"USD\"\n },\n \"tax\": {\n \"units\": 100,\n \"currency\": \"USD\"\n },\n \"order_reference\": \"instore_20240116-878\",\n \"order_description\": \"Order #878\",\n \"display_id\": \"20240116-878\",\n \"items\": [\n {\n \"name\": \"Red Fidget Spinner\",\n \"reference\": \"sku-984\",\n \"description\": \"Single-packed fidget spinner, red\",\n \"total_amount\": {\n \"units\": 1000,\n \"currency\": \"USD\"\n },\n \"unit_price\": 1000,\n \"quantity\": 1,\n \"image_url\": \"https://www.example.com/products/984/image.png\"\n }\n ],\n \"shipments\": [\n {\n \"cost\": {\n \"units\": 10000,\n \"currency\": \"USD\"\n },\n \"carrier\": \"FedEx\",\n \"address\": {\n \".tag\": \"explicit\",\n \"first_name\": \"Charlie\",\n \"last_name\": \"Dunn\",\n \"street_address1\": \"535 Mission St\",\n \"locality\": \"San Francisco\",\n \"postal_code\": \"94105\",\n \"region\": \"CA\",\n \"country_code\": \"US\"\n }\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{environment}.boltapp.com/v3/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Publishable-Key"] = '<x-publishable-key>'
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"profile\": {\n \"first_name\": \"Charlie\",\n \"last_name\": \"Dunn\",\n \"email\": \"charlie@example.com\",\n \"phone\": \"+14085551111\"\n },\n \"cart\": {\n \"total\": {\n \"units\": 1000,\n \"currency\": \"USD\"\n },\n \"tax\": {\n \"units\": 100,\n \"currency\": \"USD\"\n },\n \"order_reference\": \"instore_20240116-878\",\n \"order_description\": \"Order #878\",\n \"display_id\": \"20240116-878\",\n \"items\": [\n {\n \"name\": \"Red Fidget Spinner\",\n \"reference\": \"sku-984\",\n \"description\": \"Single-packed fidget spinner, red\",\n \"total_amount\": {\n \"units\": 1000,\n \"currency\": \"USD\"\n },\n \"unit_price\": 1000,\n \"quantity\": 1,\n \"image_url\": \"https://www.example.com/products/984/image.png\"\n }\n ],\n \"shipments\": [\n {\n \"cost\": {\n \"units\": 10000,\n \"currency\": \"USD\"\n },\n \"carrier\": \"FedEx\",\n \"address\": {\n \".tag\": \"explicit\",\n \"first_name\": \"Charlie\",\n \"last_name\": \"Dunn\",\n \"street_address1\": \"535 Mission St\",\n \"locality\": \"San Francisco\",\n \"postal_code\": \"94105\",\n \"region\": \"CA\",\n \"country_code\": \"US\"\n }\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3Cxr2keCtxju",
"transaction": {
"reference": "2ZF2-WZ3J-WD2Y"
}
}{
".tag": "unprocessable_request",
"message": "We were unable to process your request."
}Authorizations
Headers
The publicly shareable identifier used to identify your Bolt merchant division.
A unique identifier for a shopper's device, generated by Bolt. The value is retrieved with Bolt.state.merchantClientId in your frontend context, per-shopper. This header is required for proper attribution of this operation to your analytics reports. Omitting this header may result in incorrect statistics.
Body
application/json