order.create
curl --request POST \
--url https://merchant-url.com/api/order_create \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"event": "order.create",
"data": {
"order": {
"token": "a2b3dDc4cA5e6fg78Bg9hj0kl",
"user_note": "This item is a gift.",
"external_data": {
"shopify": "VIP shopper"
},
"dynamic_content": {
"shipping_info_notice": "A Notice Message",
"payment_notice": "A Notice Message",
"shipping_notice": "A Notice Message",
"order_notice": "A Notice Message",
"custom_fields": [
{
"external_id": "123456",
"public_id": "i-123456",
"label": "Special Field",
"field_setup": "string",
"checkout_setup": "string",
"position": 1,
"required": true,
"dynamic": false,
"subscribe_to_newsletter": false
}
],
"hide_apm": [],
"gift_option_view": {
"hide_gift_wrap": false,
"hide_gift_message": false
}
}
},
"currency": "USD",
"metadata": {
"key1": "value1",
"key2": "value2"
}
}
}
'import requests
url = "https://merchant-url.com/api/order_create"
payload = {
"event": "order.create",
"data": {
"order": {
"token": "a2b3dDc4cA5e6fg78Bg9hj0kl",
"user_note": "This item is a gift.",
"external_data": { "shopify": "VIP shopper" },
"dynamic_content": {
"shipping_info_notice": "A Notice Message",
"payment_notice": "A Notice Message",
"shipping_notice": "A Notice Message",
"order_notice": "A Notice Message",
"custom_fields": [
{
"external_id": "123456",
"public_id": "i-123456",
"label": "Special Field",
"field_setup": "string",
"checkout_setup": "string",
"position": 1,
"required": True,
"dynamic": False,
"subscribe_to_newsletter": False
}
],
"hide_apm": [],
"gift_option_view": {
"hide_gift_wrap": False,
"hide_gift_message": False
}
}
},
"currency": "USD",
"metadata": {
"key1": "value1",
"key2": "value2"
}
}
}
headers = {
"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-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
event: 'order.create',
data: {
order: {
token: 'a2b3dDc4cA5e6fg78Bg9hj0kl',
user_note: 'This item is a gift.',
external_data: {shopify: 'VIP shopper'},
dynamic_content: {
shipping_info_notice: 'A Notice Message',
payment_notice: 'A Notice Message',
shipping_notice: 'A Notice Message',
order_notice: 'A Notice Message',
custom_fields: [
{
external_id: '123456',
public_id: 'i-123456',
label: 'Special Field',
field_setup: 'string',
checkout_setup: 'string',
position: 1,
required: true,
dynamic: false,
subscribe_to_newsletter: false
}
],
hide_apm: [],
gift_option_view: {hide_gift_wrap: false, hide_gift_message: false}
}
},
currency: 'USD',
metadata: {key1: 'value1', key2: 'value2'}
}
})
};
fetch('https://merchant-url.com/api/order_create', 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://merchant-url.com/api/order_create",
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([
'event' => 'order.create',
'data' => [
'order' => [
'token' => 'a2b3dDc4cA5e6fg78Bg9hj0kl',
'user_note' => 'This item is a gift.',
'external_data' => [
'shopify' => 'VIP shopper'
],
'dynamic_content' => [
'shipping_info_notice' => 'A Notice Message',
'payment_notice' => 'A Notice Message',
'shipping_notice' => 'A Notice Message',
'order_notice' => 'A Notice Message',
'custom_fields' => [
[
'external_id' => '123456',
'public_id' => 'i-123456',
'label' => 'Special Field',
'field_setup' => 'string',
'checkout_setup' => 'string',
'position' => 1,
'required' => true,
'dynamic' => false,
'subscribe_to_newsletter' => false
]
],
'hide_apm' => [
],
'gift_option_view' => [
'hide_gift_wrap' => false,
'hide_gift_message' => false
]
]
],
'currency' => 'USD',
'metadata' => [
'key1' => 'value1',
'key2' => 'value2'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-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://merchant-url.com/api/order_create"
payload := strings.NewReader("{\n \"event\": \"order.create\",\n \"data\": {\n \"order\": {\n \"token\": \"a2b3dDc4cA5e6fg78Bg9hj0kl\",\n \"user_note\": \"This item is a gift.\",\n \"external_data\": {\n \"shopify\": \"VIP shopper\"\n },\n \"dynamic_content\": {\n \"shipping_info_notice\": \"A Notice Message\",\n \"payment_notice\": \"A Notice Message\",\n \"shipping_notice\": \"A Notice Message\",\n \"order_notice\": \"A Notice Message\",\n \"custom_fields\": [\n {\n \"external_id\": \"123456\",\n \"public_id\": \"i-123456\",\n \"label\": \"Special Field\",\n \"field_setup\": \"string\",\n \"checkout_setup\": \"string\",\n \"position\": 1,\n \"required\": true,\n \"dynamic\": false,\n \"subscribe_to_newsletter\": false\n }\n ],\n \"hide_apm\": [],\n \"gift_option_view\": {\n \"hide_gift_wrap\": false,\n \"hide_gift_message\": false\n }\n }\n },\n \"currency\": \"USD\",\n \"metadata\": {\n \"key1\": \"value1\",\n \"key2\": \"value2\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://merchant-url.com/api/order_create")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"event\": \"order.create\",\n \"data\": {\n \"order\": {\n \"token\": \"a2b3dDc4cA5e6fg78Bg9hj0kl\",\n \"user_note\": \"This item is a gift.\",\n \"external_data\": {\n \"shopify\": \"VIP shopper\"\n },\n \"dynamic_content\": {\n \"shipping_info_notice\": \"A Notice Message\",\n \"payment_notice\": \"A Notice Message\",\n \"shipping_notice\": \"A Notice Message\",\n \"order_notice\": \"A Notice Message\",\n \"custom_fields\": [\n {\n \"external_id\": \"123456\",\n \"public_id\": \"i-123456\",\n \"label\": \"Special Field\",\n \"field_setup\": \"string\",\n \"checkout_setup\": \"string\",\n \"position\": 1,\n \"required\": true,\n \"dynamic\": false,\n \"subscribe_to_newsletter\": false\n }\n ],\n \"hide_apm\": [],\n \"gift_option_view\": {\n \"hide_gift_wrap\": false,\n \"hide_gift_message\": false\n }\n }\n },\n \"currency\": \"USD\",\n \"metadata\": {\n \"key1\": \"value1\",\n \"key2\": \"value2\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://merchant-url.com/api/order_create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"event\": \"order.create\",\n \"data\": {\n \"order\": {\n \"token\": \"a2b3dDc4cA5e6fg78Bg9hj0kl\",\n \"user_note\": \"This item is a gift.\",\n \"external_data\": {\n \"shopify\": \"VIP shopper\"\n },\n \"dynamic_content\": {\n \"shipping_info_notice\": \"A Notice Message\",\n \"payment_notice\": \"A Notice Message\",\n \"shipping_notice\": \"A Notice Message\",\n \"order_notice\": \"A Notice Message\",\n \"custom_fields\": [\n {\n \"external_id\": \"123456\",\n \"public_id\": \"i-123456\",\n \"label\": \"Special Field\",\n \"field_setup\": \"string\",\n \"checkout_setup\": \"string\",\n \"position\": 1,\n \"required\": true,\n \"dynamic\": false,\n \"subscribe_to_newsletter\": false\n }\n ],\n \"hide_apm\": [],\n \"gift_option_view\": {\n \"hide_gift_wrap\": false,\n \"hide_gift_message\": false\n }\n }\n },\n \"currency\": \"USD\",\n \"metadata\": {\n \"key1\": \"value1\",\n \"key2\": \"value2\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"event": "order.create",
"status": "success",
"data": {
"display_id": "ID-12345",
"order_received_url": "https://***.com/confirmation/O-100104040"
}
}{
"status": "failure",
"errors": [
{
"code": 2001005,
"data": [
{
"reason": "This product is out of stock."
}
]
}
]
}Order
order.create
This request verifies the pre-authorization of an order, confirming that the order can be successfully created.
POST
/
order_create
order.create
curl --request POST \
--url https://merchant-url.com/api/order_create \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"event": "order.create",
"data": {
"order": {
"token": "a2b3dDc4cA5e6fg78Bg9hj0kl",
"user_note": "This item is a gift.",
"external_data": {
"shopify": "VIP shopper"
},
"dynamic_content": {
"shipping_info_notice": "A Notice Message",
"payment_notice": "A Notice Message",
"shipping_notice": "A Notice Message",
"order_notice": "A Notice Message",
"custom_fields": [
{
"external_id": "123456",
"public_id": "i-123456",
"label": "Special Field",
"field_setup": "string",
"checkout_setup": "string",
"position": 1,
"required": true,
"dynamic": false,
"subscribe_to_newsletter": false
}
],
"hide_apm": [],
"gift_option_view": {
"hide_gift_wrap": false,
"hide_gift_message": false
}
}
},
"currency": "USD",
"metadata": {
"key1": "value1",
"key2": "value2"
}
}
}
'import requests
url = "https://merchant-url.com/api/order_create"
payload = {
"event": "order.create",
"data": {
"order": {
"token": "a2b3dDc4cA5e6fg78Bg9hj0kl",
"user_note": "This item is a gift.",
"external_data": { "shopify": "VIP shopper" },
"dynamic_content": {
"shipping_info_notice": "A Notice Message",
"payment_notice": "A Notice Message",
"shipping_notice": "A Notice Message",
"order_notice": "A Notice Message",
"custom_fields": [
{
"external_id": "123456",
"public_id": "i-123456",
"label": "Special Field",
"field_setup": "string",
"checkout_setup": "string",
"position": 1,
"required": True,
"dynamic": False,
"subscribe_to_newsletter": False
}
],
"hide_apm": [],
"gift_option_view": {
"hide_gift_wrap": False,
"hide_gift_message": False
}
}
},
"currency": "USD",
"metadata": {
"key1": "value1",
"key2": "value2"
}
}
}
headers = {
"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-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
event: 'order.create',
data: {
order: {
token: 'a2b3dDc4cA5e6fg78Bg9hj0kl',
user_note: 'This item is a gift.',
external_data: {shopify: 'VIP shopper'},
dynamic_content: {
shipping_info_notice: 'A Notice Message',
payment_notice: 'A Notice Message',
shipping_notice: 'A Notice Message',
order_notice: 'A Notice Message',
custom_fields: [
{
external_id: '123456',
public_id: 'i-123456',
label: 'Special Field',
field_setup: 'string',
checkout_setup: 'string',
position: 1,
required: true,
dynamic: false,
subscribe_to_newsletter: false
}
],
hide_apm: [],
gift_option_view: {hide_gift_wrap: false, hide_gift_message: false}
}
},
currency: 'USD',
metadata: {key1: 'value1', key2: 'value2'}
}
})
};
fetch('https://merchant-url.com/api/order_create', 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://merchant-url.com/api/order_create",
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([
'event' => 'order.create',
'data' => [
'order' => [
'token' => 'a2b3dDc4cA5e6fg78Bg9hj0kl',
'user_note' => 'This item is a gift.',
'external_data' => [
'shopify' => 'VIP shopper'
],
'dynamic_content' => [
'shipping_info_notice' => 'A Notice Message',
'payment_notice' => 'A Notice Message',
'shipping_notice' => 'A Notice Message',
'order_notice' => 'A Notice Message',
'custom_fields' => [
[
'external_id' => '123456',
'public_id' => 'i-123456',
'label' => 'Special Field',
'field_setup' => 'string',
'checkout_setup' => 'string',
'position' => 1,
'required' => true,
'dynamic' => false,
'subscribe_to_newsletter' => false
]
],
'hide_apm' => [
],
'gift_option_view' => [
'hide_gift_wrap' => false,
'hide_gift_message' => false
]
]
],
'currency' => 'USD',
'metadata' => [
'key1' => 'value1',
'key2' => 'value2'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-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://merchant-url.com/api/order_create"
payload := strings.NewReader("{\n \"event\": \"order.create\",\n \"data\": {\n \"order\": {\n \"token\": \"a2b3dDc4cA5e6fg78Bg9hj0kl\",\n \"user_note\": \"This item is a gift.\",\n \"external_data\": {\n \"shopify\": \"VIP shopper\"\n },\n \"dynamic_content\": {\n \"shipping_info_notice\": \"A Notice Message\",\n \"payment_notice\": \"A Notice Message\",\n \"shipping_notice\": \"A Notice Message\",\n \"order_notice\": \"A Notice Message\",\n \"custom_fields\": [\n {\n \"external_id\": \"123456\",\n \"public_id\": \"i-123456\",\n \"label\": \"Special Field\",\n \"field_setup\": \"string\",\n \"checkout_setup\": \"string\",\n \"position\": 1,\n \"required\": true,\n \"dynamic\": false,\n \"subscribe_to_newsletter\": false\n }\n ],\n \"hide_apm\": [],\n \"gift_option_view\": {\n \"hide_gift_wrap\": false,\n \"hide_gift_message\": false\n }\n }\n },\n \"currency\": \"USD\",\n \"metadata\": {\n \"key1\": \"value1\",\n \"key2\": \"value2\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://merchant-url.com/api/order_create")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"event\": \"order.create\",\n \"data\": {\n \"order\": {\n \"token\": \"a2b3dDc4cA5e6fg78Bg9hj0kl\",\n \"user_note\": \"This item is a gift.\",\n \"external_data\": {\n \"shopify\": \"VIP shopper\"\n },\n \"dynamic_content\": {\n \"shipping_info_notice\": \"A Notice Message\",\n \"payment_notice\": \"A Notice Message\",\n \"shipping_notice\": \"A Notice Message\",\n \"order_notice\": \"A Notice Message\",\n \"custom_fields\": [\n {\n \"external_id\": \"123456\",\n \"public_id\": \"i-123456\",\n \"label\": \"Special Field\",\n \"field_setup\": \"string\",\n \"checkout_setup\": \"string\",\n \"position\": 1,\n \"required\": true,\n \"dynamic\": false,\n \"subscribe_to_newsletter\": false\n }\n ],\n \"hide_apm\": [],\n \"gift_option_view\": {\n \"hide_gift_wrap\": false,\n \"hide_gift_message\": false\n }\n }\n },\n \"currency\": \"USD\",\n \"metadata\": {\n \"key1\": \"value1\",\n \"key2\": \"value2\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://merchant-url.com/api/order_create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"event\": \"order.create\",\n \"data\": {\n \"order\": {\n \"token\": \"a2b3dDc4cA5e6fg78Bg9hj0kl\",\n \"user_note\": \"This item is a gift.\",\n \"external_data\": {\n \"shopify\": \"VIP shopper\"\n },\n \"dynamic_content\": {\n \"shipping_info_notice\": \"A Notice Message\",\n \"payment_notice\": \"A Notice Message\",\n \"shipping_notice\": \"A Notice Message\",\n \"order_notice\": \"A Notice Message\",\n \"custom_fields\": [\n {\n \"external_id\": \"123456\",\n \"public_id\": \"i-123456\",\n \"label\": \"Special Field\",\n \"field_setup\": \"string\",\n \"checkout_setup\": \"string\",\n \"position\": 1,\n \"required\": true,\n \"dynamic\": false,\n \"subscribe_to_newsletter\": false\n }\n ],\n \"hide_apm\": [],\n \"gift_option_view\": {\n \"hide_gift_wrap\": false,\n \"hide_gift_message\": false\n }\n }\n },\n \"currency\": \"USD\",\n \"metadata\": {\n \"key1\": \"value1\",\n \"key2\": \"value2\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"event": "order.create",
"status": "success",
"data": {
"display_id": "ID-12345",
"order_received_url": "https://***.com/confirmation/O-100104040"
}
}{
"status": "failure",
"errors": [
{
"code": 2001005,
"data": [
{
"reason": "This product is out of stock."
}
]
}
]
}Authorizations
Admins and Developers can obtain their Bolt API key from the Bolt Merchant Dashboard.
Headers
Bolt sends a signed HMAC for hook verification
Body
application/json