Create order
curl --request POST \
--url https://shelfforce.ai/api/v1/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"supplierName": "<string>",
"orderDate": "2023-12-25",
"status": "draft",
"currency": "<string>",
"storeId": "<string>",
"notes": "<string>",
"items": [
{
"quantity": 123,
"inventoryItemId": "<string>",
"sku": "<string>",
"name": "<string>",
"unitPrice": 123
}
]
}
'import requests
url = "https://shelfforce.ai/api/v1/orders"
payload = {
"supplierName": "<string>",
"orderDate": "2023-12-25",
"status": "draft",
"currency": "<string>",
"storeId": "<string>",
"notes": "<string>",
"items": [
{
"quantity": 123,
"inventoryItemId": "<string>",
"sku": "<string>",
"name": "<string>",
"unitPrice": 123
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
supplierName: '<string>',
orderDate: '2023-12-25',
status: 'draft',
currency: '<string>',
storeId: '<string>',
notes: '<string>',
items: [
{
quantity: 123,
inventoryItemId: '<string>',
sku: '<string>',
name: '<string>',
unitPrice: 123
}
]
})
};
fetch('https://shelfforce.ai/api/v1/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://shelfforce.ai/api/v1/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([
'supplierName' => '<string>',
'orderDate' => '2023-12-25',
'status' => 'draft',
'currency' => '<string>',
'storeId' => '<string>',
'notes' => '<string>',
'items' => [
[
'quantity' => 123,
'inventoryItemId' => '<string>',
'sku' => '<string>',
'name' => '<string>',
'unitPrice' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://shelfforce.ai/api/v1/orders"
payload := strings.NewReader("{\n \"supplierName\": \"<string>\",\n \"orderDate\": \"2023-12-25\",\n \"status\": \"draft\",\n \"currency\": \"<string>\",\n \"storeId\": \"<string>\",\n \"notes\": \"<string>\",\n \"items\": [\n {\n \"quantity\": 123,\n \"inventoryItemId\": \"<string>\",\n \"sku\": \"<string>\",\n \"name\": \"<string>\",\n \"unitPrice\": 123\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://shelfforce.ai/api/v1/orders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"supplierName\": \"<string>\",\n \"orderDate\": \"2023-12-25\",\n \"status\": \"draft\",\n \"currency\": \"<string>\",\n \"storeId\": \"<string>\",\n \"notes\": \"<string>\",\n \"items\": [\n {\n \"quantity\": 123,\n \"inventoryItemId\": \"<string>\",\n \"sku\": \"<string>\",\n \"name\": \"<string>\",\n \"unitPrice\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://shelfforce.ai/api/v1/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"supplierName\": \"<string>\",\n \"orderDate\": \"2023-12-25\",\n \"status\": \"draft\",\n \"currency\": \"<string>\",\n \"storeId\": \"<string>\",\n \"notes\": \"<string>\",\n \"items\": [\n {\n \"quantity\": 123,\n \"inventoryItemId\": \"<string>\",\n \"sku\": \"<string>\",\n \"name\": \"<string>\",\n \"unitPrice\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"orderNumber": "<string>",
"status": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Create order
Creates a new purchase order with optional line items.
POST
/
api
/
v1
/
orders
Create order
curl --request POST \
--url https://shelfforce.ai/api/v1/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"supplierName": "<string>",
"orderDate": "2023-12-25",
"status": "draft",
"currency": "<string>",
"storeId": "<string>",
"notes": "<string>",
"items": [
{
"quantity": 123,
"inventoryItemId": "<string>",
"sku": "<string>",
"name": "<string>",
"unitPrice": 123
}
]
}
'import requests
url = "https://shelfforce.ai/api/v1/orders"
payload = {
"supplierName": "<string>",
"orderDate": "2023-12-25",
"status": "draft",
"currency": "<string>",
"storeId": "<string>",
"notes": "<string>",
"items": [
{
"quantity": 123,
"inventoryItemId": "<string>",
"sku": "<string>",
"name": "<string>",
"unitPrice": 123
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
supplierName: '<string>',
orderDate: '2023-12-25',
status: 'draft',
currency: '<string>',
storeId: '<string>',
notes: '<string>',
items: [
{
quantity: 123,
inventoryItemId: '<string>',
sku: '<string>',
name: '<string>',
unitPrice: 123
}
]
})
};
fetch('https://shelfforce.ai/api/v1/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://shelfforce.ai/api/v1/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([
'supplierName' => '<string>',
'orderDate' => '2023-12-25',
'status' => 'draft',
'currency' => '<string>',
'storeId' => '<string>',
'notes' => '<string>',
'items' => [
[
'quantity' => 123,
'inventoryItemId' => '<string>',
'sku' => '<string>',
'name' => '<string>',
'unitPrice' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://shelfforce.ai/api/v1/orders"
payload := strings.NewReader("{\n \"supplierName\": \"<string>\",\n \"orderDate\": \"2023-12-25\",\n \"status\": \"draft\",\n \"currency\": \"<string>\",\n \"storeId\": \"<string>\",\n \"notes\": \"<string>\",\n \"items\": [\n {\n \"quantity\": 123,\n \"inventoryItemId\": \"<string>\",\n \"sku\": \"<string>\",\n \"name\": \"<string>\",\n \"unitPrice\": 123\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://shelfforce.ai/api/v1/orders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"supplierName\": \"<string>\",\n \"orderDate\": \"2023-12-25\",\n \"status\": \"draft\",\n \"currency\": \"<string>\",\n \"storeId\": \"<string>\",\n \"notes\": \"<string>\",\n \"items\": [\n {\n \"quantity\": 123,\n \"inventoryItemId\": \"<string>\",\n \"sku\": \"<string>\",\n \"name\": \"<string>\",\n \"unitPrice\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://shelfforce.ai/api/v1/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"supplierName\": \"<string>\",\n \"orderDate\": \"2023-12-25\",\n \"status\": \"draft\",\n \"currency\": \"<string>\",\n \"storeId\": \"<string>\",\n \"notes\": \"<string>\",\n \"items\": [\n {\n \"quantity\": 123,\n \"inventoryItemId\": \"<string>\",\n \"sku\": \"<string>\",\n \"name\": \"<string>\",\n \"unitPrice\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"orderNumber": "<string>",
"status": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
API key with sf_live_ prefix. Pass as Authorization: Bearer sf_live_...
Headers
Unique key for idempotent requests. If a request with the same key was already processed within the last 24 hours, the cached response is returned with X-Idempotent-Replayed: true.
Example:
"idk_550e8400-e29b-41d4-a716-446655440000"
Body
application/json
Supplier or vendor name
Order date (ISO 8601)
Available options:
draft, pending, confirmed ISO 4217 currency code
Associated store ID
Line items
Show child attributes
Show child attributes
Response
Order created.
Show child attributes
Show child attributes
⌘I