curl --request POST \
--url https://api.skulabs.com/purchase_order/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"number": "<string>",
"store_id": "507f1f77bcf86cd799439011",
"distributor_id": "<string>",
"warehouse_id": "<string>",
"items": [
{
"item_id": "<string>",
"kit_id": "<string>",
"sku": "<string>",
"name": "<string>",
"quantity": 123,
"received": 123,
"cost": 123,
"rate": 123,
"serial_numbers": [
"<string>"
],
"description": "<string>",
"unit": "<string>"
}
],
"subtotal": 123,
"tax": 123,
"tax_per": 123,
"total": 123,
"memo": "<string>",
"terms": "<string>",
"shipping": 123,
"method": "<string>",
"discount": 123,
"discount_per": 123,
"dropship_address": {},
"due_date": "2025-01-15",
"dropshipped": true
}
'import requests
url = "https://api.skulabs.com/purchase_order/create"
payload = {
"number": "<string>",
"store_id": "507f1f77bcf86cd799439011",
"distributor_id": "<string>",
"warehouse_id": "<string>",
"items": [
{
"item_id": "<string>",
"kit_id": "<string>",
"sku": "<string>",
"name": "<string>",
"quantity": 123,
"received": 123,
"cost": 123,
"rate": 123,
"serial_numbers": ["<string>"],
"description": "<string>",
"unit": "<string>"
}
],
"subtotal": 123,
"tax": 123,
"tax_per": 123,
"total": 123,
"memo": "<string>",
"terms": "<string>",
"shipping": 123,
"method": "<string>",
"discount": 123,
"discount_per": 123,
"dropship_address": {},
"due_date": "2025-01-15",
"dropshipped": True
}
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({
number: '<string>',
store_id: '507f1f77bcf86cd799439011',
distributor_id: '<string>',
warehouse_id: '<string>',
items: [
{
item_id: '<string>',
kit_id: '<string>',
sku: '<string>',
name: '<string>',
quantity: 123,
received: 123,
cost: 123,
rate: 123,
serial_numbers: ['<string>'],
description: '<string>',
unit: '<string>'
}
],
subtotal: 123,
tax: 123,
tax_per: 123,
total: 123,
memo: '<string>',
terms: '<string>',
shipping: 123,
method: '<string>',
discount: 123,
discount_per: 123,
dropship_address: {},
due_date: '2025-01-15',
dropshipped: true
})
};
fetch('https://api.skulabs.com/purchase_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://api.skulabs.com/purchase_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([
'number' => '<string>',
'store_id' => '507f1f77bcf86cd799439011',
'distributor_id' => '<string>',
'warehouse_id' => '<string>',
'items' => [
[
'item_id' => '<string>',
'kit_id' => '<string>',
'sku' => '<string>',
'name' => '<string>',
'quantity' => 123,
'received' => 123,
'cost' => 123,
'rate' => 123,
'serial_numbers' => [
'<string>'
],
'description' => '<string>',
'unit' => '<string>'
]
],
'subtotal' => 123,
'tax' => 123,
'tax_per' => 123,
'total' => 123,
'memo' => '<string>',
'terms' => '<string>',
'shipping' => 123,
'method' => '<string>',
'discount' => 123,
'discount_per' => 123,
'dropship_address' => [
],
'due_date' => '2025-01-15',
'dropshipped' => true
]),
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://api.skulabs.com/purchase_order/create"
payload := strings.NewReader("{\n \"number\": \"<string>\",\n \"store_id\": \"507f1f77bcf86cd799439011\",\n \"distributor_id\": \"<string>\",\n \"warehouse_id\": \"<string>\",\n \"items\": [\n {\n \"item_id\": \"<string>\",\n \"kit_id\": \"<string>\",\n \"sku\": \"<string>\",\n \"name\": \"<string>\",\n \"quantity\": 123,\n \"received\": 123,\n \"cost\": 123,\n \"rate\": 123,\n \"serial_numbers\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"unit\": \"<string>\"\n }\n ],\n \"subtotal\": 123,\n \"tax\": 123,\n \"tax_per\": 123,\n \"total\": 123,\n \"memo\": \"<string>\",\n \"terms\": \"<string>\",\n \"shipping\": 123,\n \"method\": \"<string>\",\n \"discount\": 123,\n \"discount_per\": 123,\n \"dropship_address\": {},\n \"due_date\": \"2025-01-15\",\n \"dropshipped\": true\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://api.skulabs.com/purchase_order/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"number\": \"<string>\",\n \"store_id\": \"507f1f77bcf86cd799439011\",\n \"distributor_id\": \"<string>\",\n \"warehouse_id\": \"<string>\",\n \"items\": [\n {\n \"item_id\": \"<string>\",\n \"kit_id\": \"<string>\",\n \"sku\": \"<string>\",\n \"name\": \"<string>\",\n \"quantity\": 123,\n \"received\": 123,\n \"cost\": 123,\n \"rate\": 123,\n \"serial_numbers\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"unit\": \"<string>\"\n }\n ],\n \"subtotal\": 123,\n \"tax\": 123,\n \"tax_per\": 123,\n \"total\": 123,\n \"memo\": \"<string>\",\n \"terms\": \"<string>\",\n \"shipping\": 123,\n \"method\": \"<string>\",\n \"discount\": 123,\n \"discount_per\": 123,\n \"dropship_address\": {},\n \"due_date\": \"2025-01-15\",\n \"dropshipped\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.skulabs.com/purchase_order/create")
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 \"number\": \"<string>\",\n \"store_id\": \"507f1f77bcf86cd799439011\",\n \"distributor_id\": \"<string>\",\n \"warehouse_id\": \"<string>\",\n \"items\": [\n {\n \"item_id\": \"<string>\",\n \"kit_id\": \"<string>\",\n \"sku\": \"<string>\",\n \"name\": \"<string>\",\n \"quantity\": 123,\n \"received\": 123,\n \"cost\": 123,\n \"rate\": 123,\n \"serial_numbers\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"unit\": \"<string>\"\n }\n ],\n \"subtotal\": 123,\n \"tax\": 123,\n \"tax_per\": 123,\n \"total\": 123,\n \"memo\": \"<string>\",\n \"terms\": \"<string>\",\n \"shipping\": 123,\n \"method\": \"<string>\",\n \"discount\": 123,\n \"discount_per\": 123,\n \"dropship_address\": {},\n \"due_date\": \"2025-01-15\",\n \"dropshipped\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"_id": "507f1f77bcf86cd799439011",
"number": "<string>",
"errors": [
"<string>"
],
"add_results": [
null
],
"skulabs_warning": {}
}{
"error": {
"message": "<string>",
"statusCode": 123,
"code": "<string>",
"overview": "<string>",
"origin": "<string>",
"skulabsTraceId": "<string>",
"user_error": true
}
}{
"error": {
"message": "<string>",
"statusCode": 123,
"code": "<string>",
"overview": "<string>",
"origin": "<string>",
"skulabsTraceId": "<string>",
"user_error": true
}
}{
"error": {
"message": "<string>",
"statusCode": 123,
"code": "<string>",
"overview": "<string>",
"origin": "<string>",
"skulabsTraceId": "<string>",
"user_error": true
}
}{
"error": {
"message": "<string>",
"statusCode": 123,
"code": "<string>",
"overview": "<string>",
"origin": "<string>",
"skulabsTraceId": "<string>",
"user_error": true
}
}{
"error": {
"message": "<string>",
"statusCode": 123,
"code": "<string>",
"overview": "<string>",
"origin": "<string>",
"skulabsTraceId": "<string>",
"user_error": true
}
}Purchase Order - Create
August 2023: Now supports item_id, kit_id, sku (SKULabs Kit or Item), mpn (Supplier MPN), or barcode (SKULabs Kit or Item barcode) as lookup fields in the item array.
curl --request POST \
--url https://api.skulabs.com/purchase_order/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"number": "<string>",
"store_id": "507f1f77bcf86cd799439011",
"distributor_id": "<string>",
"warehouse_id": "<string>",
"items": [
{
"item_id": "<string>",
"kit_id": "<string>",
"sku": "<string>",
"name": "<string>",
"quantity": 123,
"received": 123,
"cost": 123,
"rate": 123,
"serial_numbers": [
"<string>"
],
"description": "<string>",
"unit": "<string>"
}
],
"subtotal": 123,
"tax": 123,
"tax_per": 123,
"total": 123,
"memo": "<string>",
"terms": "<string>",
"shipping": 123,
"method": "<string>",
"discount": 123,
"discount_per": 123,
"dropship_address": {},
"due_date": "2025-01-15",
"dropshipped": true
}
'import requests
url = "https://api.skulabs.com/purchase_order/create"
payload = {
"number": "<string>",
"store_id": "507f1f77bcf86cd799439011",
"distributor_id": "<string>",
"warehouse_id": "<string>",
"items": [
{
"item_id": "<string>",
"kit_id": "<string>",
"sku": "<string>",
"name": "<string>",
"quantity": 123,
"received": 123,
"cost": 123,
"rate": 123,
"serial_numbers": ["<string>"],
"description": "<string>",
"unit": "<string>"
}
],
"subtotal": 123,
"tax": 123,
"tax_per": 123,
"total": 123,
"memo": "<string>",
"terms": "<string>",
"shipping": 123,
"method": "<string>",
"discount": 123,
"discount_per": 123,
"dropship_address": {},
"due_date": "2025-01-15",
"dropshipped": True
}
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({
number: '<string>',
store_id: '507f1f77bcf86cd799439011',
distributor_id: '<string>',
warehouse_id: '<string>',
items: [
{
item_id: '<string>',
kit_id: '<string>',
sku: '<string>',
name: '<string>',
quantity: 123,
received: 123,
cost: 123,
rate: 123,
serial_numbers: ['<string>'],
description: '<string>',
unit: '<string>'
}
],
subtotal: 123,
tax: 123,
tax_per: 123,
total: 123,
memo: '<string>',
terms: '<string>',
shipping: 123,
method: '<string>',
discount: 123,
discount_per: 123,
dropship_address: {},
due_date: '2025-01-15',
dropshipped: true
})
};
fetch('https://api.skulabs.com/purchase_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://api.skulabs.com/purchase_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([
'number' => '<string>',
'store_id' => '507f1f77bcf86cd799439011',
'distributor_id' => '<string>',
'warehouse_id' => '<string>',
'items' => [
[
'item_id' => '<string>',
'kit_id' => '<string>',
'sku' => '<string>',
'name' => '<string>',
'quantity' => 123,
'received' => 123,
'cost' => 123,
'rate' => 123,
'serial_numbers' => [
'<string>'
],
'description' => '<string>',
'unit' => '<string>'
]
],
'subtotal' => 123,
'tax' => 123,
'tax_per' => 123,
'total' => 123,
'memo' => '<string>',
'terms' => '<string>',
'shipping' => 123,
'method' => '<string>',
'discount' => 123,
'discount_per' => 123,
'dropship_address' => [
],
'due_date' => '2025-01-15',
'dropshipped' => true
]),
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://api.skulabs.com/purchase_order/create"
payload := strings.NewReader("{\n \"number\": \"<string>\",\n \"store_id\": \"507f1f77bcf86cd799439011\",\n \"distributor_id\": \"<string>\",\n \"warehouse_id\": \"<string>\",\n \"items\": [\n {\n \"item_id\": \"<string>\",\n \"kit_id\": \"<string>\",\n \"sku\": \"<string>\",\n \"name\": \"<string>\",\n \"quantity\": 123,\n \"received\": 123,\n \"cost\": 123,\n \"rate\": 123,\n \"serial_numbers\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"unit\": \"<string>\"\n }\n ],\n \"subtotal\": 123,\n \"tax\": 123,\n \"tax_per\": 123,\n \"total\": 123,\n \"memo\": \"<string>\",\n \"terms\": \"<string>\",\n \"shipping\": 123,\n \"method\": \"<string>\",\n \"discount\": 123,\n \"discount_per\": 123,\n \"dropship_address\": {},\n \"due_date\": \"2025-01-15\",\n \"dropshipped\": true\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://api.skulabs.com/purchase_order/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"number\": \"<string>\",\n \"store_id\": \"507f1f77bcf86cd799439011\",\n \"distributor_id\": \"<string>\",\n \"warehouse_id\": \"<string>\",\n \"items\": [\n {\n \"item_id\": \"<string>\",\n \"kit_id\": \"<string>\",\n \"sku\": \"<string>\",\n \"name\": \"<string>\",\n \"quantity\": 123,\n \"received\": 123,\n \"cost\": 123,\n \"rate\": 123,\n \"serial_numbers\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"unit\": \"<string>\"\n }\n ],\n \"subtotal\": 123,\n \"tax\": 123,\n \"tax_per\": 123,\n \"total\": 123,\n \"memo\": \"<string>\",\n \"terms\": \"<string>\",\n \"shipping\": 123,\n \"method\": \"<string>\",\n \"discount\": 123,\n \"discount_per\": 123,\n \"dropship_address\": {},\n \"due_date\": \"2025-01-15\",\n \"dropshipped\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.skulabs.com/purchase_order/create")
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 \"number\": \"<string>\",\n \"store_id\": \"507f1f77bcf86cd799439011\",\n \"distributor_id\": \"<string>\",\n \"warehouse_id\": \"<string>\",\n \"items\": [\n {\n \"item_id\": \"<string>\",\n \"kit_id\": \"<string>\",\n \"sku\": \"<string>\",\n \"name\": \"<string>\",\n \"quantity\": 123,\n \"received\": 123,\n \"cost\": 123,\n \"rate\": 123,\n \"serial_numbers\": [\n \"<string>\"\n ],\n \"description\": \"<string>\",\n \"unit\": \"<string>\"\n }\n ],\n \"subtotal\": 123,\n \"tax\": 123,\n \"tax_per\": 123,\n \"total\": 123,\n \"memo\": \"<string>\",\n \"terms\": \"<string>\",\n \"shipping\": 123,\n \"method\": \"<string>\",\n \"discount\": 123,\n \"discount_per\": 123,\n \"dropship_address\": {},\n \"due_date\": \"2025-01-15\",\n \"dropshipped\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"_id": "507f1f77bcf86cd799439011",
"number": "<string>",
"errors": [
"<string>"
],
"add_results": [
null
],
"skulabs_warning": {}
}{
"error": {
"message": "<string>",
"statusCode": 123,
"code": "<string>",
"overview": "<string>",
"origin": "<string>",
"skulabsTraceId": "<string>",
"user_error": true
}
}{
"error": {
"message": "<string>",
"statusCode": 123,
"code": "<string>",
"overview": "<string>",
"origin": "<string>",
"skulabsTraceId": "<string>",
"user_error": true
}
}{
"error": {
"message": "<string>",
"statusCode": 123,
"code": "<string>",
"overview": "<string>",
"origin": "<string>",
"skulabsTraceId": "<string>",
"user_error": true
}
}{
"error": {
"message": "<string>",
"statusCode": 123,
"code": "<string>",
"overview": "<string>",
"origin": "<string>",
"skulabsTraceId": "<string>",
"user_error": true
}
}{
"error": {
"message": "<string>",
"statusCode": 123,
"code": "<string>",
"overview": "<string>",
"origin": "<string>",
"skulabsTraceId": "<string>",
"user_error": true
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
PO number
Store ID
"507f1f77bcf86cd799439011"
Distributor ID
Warehouse ID
Line items
Show child attributes
Show child attributes
Subtotal
Tax amount
Tax percentage
Total
Memo
Payment terms
Shipping cost
Payment method
Discount amount
Discount percentage
Dropship address
Initial PO status
closed, created, receiving, acknowledged, sent, edited, transit, accepting Due date
"2025-01-15"
Dropshipped flag
Response
Purchase order created
Whether the operation succeeded
ID of the created purchase order
"507f1f77bcf86cd799439011"
PO number (may be auto-generated)
Array of validation error messages
Results from auto-adding serial numbers (pallet processing)
Non-fatal warning from background operations