curl --request POST \
--url https://partners.dekhq.com/api/partners/v1/order-submissions \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"orderName": "Spring team order",
"purchaseOrderNumber": "PO-10042",
"shippingMethod": "ship",
"shipTo": {
"company": "Example Co",
"firstName": "Sam",
"lastName": "Sample",
"address1": "200 Sample St",
"city": "Riverton",
"region": "WY",
"postalCode": "82501",
"country": "US"
},
"requestedInHandsDate": "2026-03-02",
"inboundTracking": [
"1Z999AA10123456784"
],
"lines": [
{
"ref": "L1",
"garment": {
"styleId": "0b4a2a9e-1c1d-4e6f-9a10-2b3c4d5e6f70",
"colorId": "7c1e5a3b-2d4f-4a6b-8c9d-0e1f2a3b4c5d"
},
"suppliedBy": "customer",
"sizes": [
{
"size": "M",
"quantity": 24
},
{
"size": "L",
"quantity": 12
}
],
"clientSku": "TEE-BLK"
},
{
"ref": "L2",
"garment": {
"brand": "Patagonia",
"styleNumber": "25528",
"colorName": "Stone Grey",
"productName": "Better Sweater Jacket"
},
"suppliedBy": "customer",
"sizes": [
{
"size": "L",
"quantity": 6
}
]
}
],
"decorations": [
{
"method": "SP",
"locationCode": "FF",
"size": {
"width": 10,
"height": 12
},
"inks": [
{
"name": "White",
"pms": "WHITE"
}
],
"artUploadId": "upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F",
"lineRefs": [
"L1",
"L2"
]
}
],
"expectedTotal": "412.50"
}
'import requests
url = "https://partners.dekhq.com/api/partners/v1/order-submissions"
payload = {
"orderName": "Spring team order",
"purchaseOrderNumber": "PO-10042",
"shippingMethod": "ship",
"shipTo": {
"company": "Example Co",
"firstName": "Sam",
"lastName": "Sample",
"address1": "200 Sample St",
"city": "Riverton",
"region": "WY",
"postalCode": "82501",
"country": "US"
},
"requestedInHandsDate": "2026-03-02",
"inboundTracking": ["1Z999AA10123456784"],
"lines": [
{
"ref": "L1",
"garment": {
"styleId": "0b4a2a9e-1c1d-4e6f-9a10-2b3c4d5e6f70",
"colorId": "7c1e5a3b-2d4f-4a6b-8c9d-0e1f2a3b4c5d"
},
"suppliedBy": "customer",
"sizes": [
{
"size": "M",
"quantity": 24
},
{
"size": "L",
"quantity": 12
}
],
"clientSku": "TEE-BLK"
},
{
"ref": "L2",
"garment": {
"brand": "Patagonia",
"styleNumber": "25528",
"colorName": "Stone Grey",
"productName": "Better Sweater Jacket"
},
"suppliedBy": "customer",
"sizes": [
{
"size": "L",
"quantity": 6
}
]
}
],
"decorations": [
{
"method": "SP",
"locationCode": "FF",
"size": {
"width": 10,
"height": 12
},
"inks": [
{
"name": "White",
"pms": "WHITE"
}
],
"artUploadId": "upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F",
"lineRefs": ["L1", "L2"]
}
],
"expectedTotal": "412.50"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
orderName: 'Spring team order',
purchaseOrderNumber: 'PO-10042',
shippingMethod: 'ship',
shipTo: {
company: 'Example Co',
firstName: 'Sam',
lastName: 'Sample',
address1: '200 Sample St',
city: 'Riverton',
region: 'WY',
postalCode: '82501',
country: 'US'
},
requestedInHandsDate: '2026-03-02',
inboundTracking: ['1Z999AA10123456784'],
lines: [
{
ref: 'L1',
garment: {
styleId: '0b4a2a9e-1c1d-4e6f-9a10-2b3c4d5e6f70',
colorId: '7c1e5a3b-2d4f-4a6b-8c9d-0e1f2a3b4c5d'
},
suppliedBy: 'customer',
sizes: [{size: 'M', quantity: 24}, {size: 'L', quantity: 12}],
clientSku: 'TEE-BLK'
},
{
ref: 'L2',
garment: {
brand: 'Patagonia',
styleNumber: '25528',
colorName: 'Stone Grey',
productName: 'Better Sweater Jacket'
},
suppliedBy: 'customer',
sizes: [{size: 'L', quantity: 6}]
}
],
decorations: [
{
method: 'SP',
locationCode: 'FF',
size: {width: 10, height: 12},
inks: [{name: 'White', pms: 'WHITE'}],
artUploadId: 'upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F',
lineRefs: ['L1', 'L2']
}
],
expectedTotal: '412.50'
})
};
fetch('https://partners.dekhq.com/api/partners/v1/order-submissions', 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://partners.dekhq.com/api/partners/v1/order-submissions",
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([
'orderName' => 'Spring team order',
'purchaseOrderNumber' => 'PO-10042',
'shippingMethod' => 'ship',
'shipTo' => [
'company' => 'Example Co',
'firstName' => 'Sam',
'lastName' => 'Sample',
'address1' => '200 Sample St',
'city' => 'Riverton',
'region' => 'WY',
'postalCode' => '82501',
'country' => 'US'
],
'requestedInHandsDate' => '2026-03-02',
'inboundTracking' => [
'1Z999AA10123456784'
],
'lines' => [
[
'ref' => 'L1',
'garment' => [
'styleId' => '0b4a2a9e-1c1d-4e6f-9a10-2b3c4d5e6f70',
'colorId' => '7c1e5a3b-2d4f-4a6b-8c9d-0e1f2a3b4c5d'
],
'suppliedBy' => 'customer',
'sizes' => [
[
'size' => 'M',
'quantity' => 24
],
[
'size' => 'L',
'quantity' => 12
]
],
'clientSku' => 'TEE-BLK'
],
[
'ref' => 'L2',
'garment' => [
'brand' => 'Patagonia',
'styleNumber' => '25528',
'colorName' => 'Stone Grey',
'productName' => 'Better Sweater Jacket'
],
'suppliedBy' => 'customer',
'sizes' => [
[
'size' => 'L',
'quantity' => 6
]
]
]
],
'decorations' => [
[
'method' => 'SP',
'locationCode' => 'FF',
'size' => [
'width' => 10,
'height' => 12
],
'inks' => [
[
'name' => 'White',
'pms' => 'WHITE'
]
],
'artUploadId' => 'upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F',
'lineRefs' => [
'L1',
'L2'
]
]
],
'expectedTotal' => '412.50'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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://partners.dekhq.com/api/partners/v1/order-submissions"
payload := strings.NewReader("{\n \"orderName\": \"Spring team order\",\n \"purchaseOrderNumber\": \"PO-10042\",\n \"shippingMethod\": \"ship\",\n \"shipTo\": {\n \"company\": \"Example Co\",\n \"firstName\": \"Sam\",\n \"lastName\": \"Sample\",\n \"address1\": \"200 Sample St\",\n \"city\": \"Riverton\",\n \"region\": \"WY\",\n \"postalCode\": \"82501\",\n \"country\": \"US\"\n },\n \"requestedInHandsDate\": \"2026-03-02\",\n \"inboundTracking\": [\n \"1Z999AA10123456784\"\n ],\n \"lines\": [\n {\n \"ref\": \"L1\",\n \"garment\": {\n \"styleId\": \"0b4a2a9e-1c1d-4e6f-9a10-2b3c4d5e6f70\",\n \"colorId\": \"7c1e5a3b-2d4f-4a6b-8c9d-0e1f2a3b4c5d\"\n },\n \"suppliedBy\": \"customer\",\n \"sizes\": [\n {\n \"size\": \"M\",\n \"quantity\": 24\n },\n {\n \"size\": \"L\",\n \"quantity\": 12\n }\n ],\n \"clientSku\": \"TEE-BLK\"\n },\n {\n \"ref\": \"L2\",\n \"garment\": {\n \"brand\": \"Patagonia\",\n \"styleNumber\": \"25528\",\n \"colorName\": \"Stone Grey\",\n \"productName\": \"Better Sweater Jacket\"\n },\n \"suppliedBy\": \"customer\",\n \"sizes\": [\n {\n \"size\": \"L\",\n \"quantity\": 6\n }\n ]\n }\n ],\n \"decorations\": [\n {\n \"method\": \"SP\",\n \"locationCode\": \"FF\",\n \"size\": {\n \"width\": 10,\n \"height\": 12\n },\n \"inks\": [\n {\n \"name\": \"White\",\n \"pms\": \"WHITE\"\n }\n ],\n \"artUploadId\": \"upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F\",\n \"lineRefs\": [\n \"L1\",\n \"L2\"\n ]\n }\n ],\n \"expectedTotal\": \"412.50\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Basic <encoded-value>")
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://partners.dekhq.com/api/partners/v1/order-submissions")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"orderName\": \"Spring team order\",\n \"purchaseOrderNumber\": \"PO-10042\",\n \"shippingMethod\": \"ship\",\n \"shipTo\": {\n \"company\": \"Example Co\",\n \"firstName\": \"Sam\",\n \"lastName\": \"Sample\",\n \"address1\": \"200 Sample St\",\n \"city\": \"Riverton\",\n \"region\": \"WY\",\n \"postalCode\": \"82501\",\n \"country\": \"US\"\n },\n \"requestedInHandsDate\": \"2026-03-02\",\n \"inboundTracking\": [\n \"1Z999AA10123456784\"\n ],\n \"lines\": [\n {\n \"ref\": \"L1\",\n \"garment\": {\n \"styleId\": \"0b4a2a9e-1c1d-4e6f-9a10-2b3c4d5e6f70\",\n \"colorId\": \"7c1e5a3b-2d4f-4a6b-8c9d-0e1f2a3b4c5d\"\n },\n \"suppliedBy\": \"customer\",\n \"sizes\": [\n {\n \"size\": \"M\",\n \"quantity\": 24\n },\n {\n \"size\": \"L\",\n \"quantity\": 12\n }\n ],\n \"clientSku\": \"TEE-BLK\"\n },\n {\n \"ref\": \"L2\",\n \"garment\": {\n \"brand\": \"Patagonia\",\n \"styleNumber\": \"25528\",\n \"colorName\": \"Stone Grey\",\n \"productName\": \"Better Sweater Jacket\"\n },\n \"suppliedBy\": \"customer\",\n \"sizes\": [\n {\n \"size\": \"L\",\n \"quantity\": 6\n }\n ]\n }\n ],\n \"decorations\": [\n {\n \"method\": \"SP\",\n \"locationCode\": \"FF\",\n \"size\": {\n \"width\": 10,\n \"height\": 12\n },\n \"inks\": [\n {\n \"name\": \"White\",\n \"pms\": \"WHITE\"\n }\n ],\n \"artUploadId\": \"upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F\",\n \"lineRefs\": [\n \"L1\",\n \"L2\"\n ]\n }\n ],\n \"expectedTotal\": \"412.50\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://partners.dekhq.com/api/partners/v1/order-submissions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orderName\": \"Spring team order\",\n \"purchaseOrderNumber\": \"PO-10042\",\n \"shippingMethod\": \"ship\",\n \"shipTo\": {\n \"company\": \"Example Co\",\n \"firstName\": \"Sam\",\n \"lastName\": \"Sample\",\n \"address1\": \"200 Sample St\",\n \"city\": \"Riverton\",\n \"region\": \"WY\",\n \"postalCode\": \"82501\",\n \"country\": \"US\"\n },\n \"requestedInHandsDate\": \"2026-03-02\",\n \"inboundTracking\": [\n \"1Z999AA10123456784\"\n ],\n \"lines\": [\n {\n \"ref\": \"L1\",\n \"garment\": {\n \"styleId\": \"0b4a2a9e-1c1d-4e6f-9a10-2b3c4d5e6f70\",\n \"colorId\": \"7c1e5a3b-2d4f-4a6b-8c9d-0e1f2a3b4c5d\"\n },\n \"suppliedBy\": \"customer\",\n \"sizes\": [\n {\n \"size\": \"M\",\n \"quantity\": 24\n },\n {\n \"size\": \"L\",\n \"quantity\": 12\n }\n ],\n \"clientSku\": \"TEE-BLK\"\n },\n {\n \"ref\": \"L2\",\n \"garment\": {\n \"brand\": \"Patagonia\",\n \"styleNumber\": \"25528\",\n \"colorName\": \"Stone Grey\",\n \"productName\": \"Better Sweater Jacket\"\n },\n \"suppliedBy\": \"customer\",\n \"sizes\": [\n {\n \"size\": \"L\",\n \"quantity\": 6\n }\n ]\n }\n ],\n \"decorations\": [\n {\n \"method\": \"SP\",\n \"locationCode\": \"FF\",\n \"size\": {\n \"width\": 10,\n \"height\": 12\n },\n \"inks\": [\n {\n \"name\": \"White\",\n \"pms\": \"WHITE\"\n }\n ],\n \"artUploadId\": \"upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F\",\n \"lineRefs\": [\n \"L1\",\n \"L2\"\n ]\n }\n ],\n \"expectedTotal\": \"412.50\"\n}"
response = http.request(request)
puts response.read_body{
"submissionId": "sub_4f8c2a7e9b1d3f5a7c9e1b3d5f7a9c1e",
"status": "accepted",
"order": {
"orderId": "ord_0123456789abcdef0123456789",
"orderNumber": "00058817",
"status": "pending_approval"
}
}{
"type": "https://docs.dekhq.com/api/partners/errors#invalid_request",
"title": "Invalid request",
"status": 400,
"detail": "A query parameter or body field is missing or invalid. `errors[]` lists each field.",
"code": "invalid_request",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#unauthenticated",
"title": "Unauthenticated",
"status": 401,
"detail": "Missing or invalid credentials.",
"code": "unauthenticated",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#forbidden",
"title": "Forbidden",
"status": 403,
"detail": "Your credential is not enabled for the scope this endpoint needs.",
"code": "forbidden",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#idempotency_conflict",
"title": "Idempotency conflict",
"status": 409,
"detail": "This `Idempotency-Key` was already used with a different body. Send the original body to get the original answer, or a new key for a new order.",
"code": "idempotency_conflict",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#payload_too_large",
"title": "Payload too large",
"status": 413,
"detail": "The request body is larger than this endpoint accepts.",
"code": "payload_too_large",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#order_refused",
"title": "Order refused",
"status": 422,
"detail": "The request is well formed but the order cannot be placed as sent. `errors[]` names each field and why: `not_supported_yet` for something this API does not take yet, `total_changed` when `expectedTotal` is not the current total (`currentTotal` carries it). `detail` says what to change.",
"code": "order_refused",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#rate_limited",
"title": "Rate limited",
"status": 429,
"detail": "More than the allowed requests per minute.",
"code": "rate_limited",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#internal",
"title": "Internal error",
"status": 500,
"detail": "An unexpected error on our side. It is logged; retry later.",
"code": "internal",
"requestId": "req_0123456789abcdef"
}Place an order
Place an order: priced by the same rules as our portal, for the client your credential acts for. Send expectedTotal from a preview; if the total has changed, the submission is refused with total_changed and currentTotal. The answer is always 202 with the submission: usually already accepted (with its order) or refused (with a problem naming each field); if it is received, poll it. Retry safely with the same Idempotency-Key and body: you get the first answer and never a second order. The same key with a different body is 409 idempotency_conflict.
curl --request POST \
--url https://partners.dekhq.com/api/partners/v1/order-submissions \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"orderName": "Spring team order",
"purchaseOrderNumber": "PO-10042",
"shippingMethod": "ship",
"shipTo": {
"company": "Example Co",
"firstName": "Sam",
"lastName": "Sample",
"address1": "200 Sample St",
"city": "Riverton",
"region": "WY",
"postalCode": "82501",
"country": "US"
},
"requestedInHandsDate": "2026-03-02",
"inboundTracking": [
"1Z999AA10123456784"
],
"lines": [
{
"ref": "L1",
"garment": {
"styleId": "0b4a2a9e-1c1d-4e6f-9a10-2b3c4d5e6f70",
"colorId": "7c1e5a3b-2d4f-4a6b-8c9d-0e1f2a3b4c5d"
},
"suppliedBy": "customer",
"sizes": [
{
"size": "M",
"quantity": 24
},
{
"size": "L",
"quantity": 12
}
],
"clientSku": "TEE-BLK"
},
{
"ref": "L2",
"garment": {
"brand": "Patagonia",
"styleNumber": "25528",
"colorName": "Stone Grey",
"productName": "Better Sweater Jacket"
},
"suppliedBy": "customer",
"sizes": [
{
"size": "L",
"quantity": 6
}
]
}
],
"decorations": [
{
"method": "SP",
"locationCode": "FF",
"size": {
"width": 10,
"height": 12
},
"inks": [
{
"name": "White",
"pms": "WHITE"
}
],
"artUploadId": "upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F",
"lineRefs": [
"L1",
"L2"
]
}
],
"expectedTotal": "412.50"
}
'import requests
url = "https://partners.dekhq.com/api/partners/v1/order-submissions"
payload = {
"orderName": "Spring team order",
"purchaseOrderNumber": "PO-10042",
"shippingMethod": "ship",
"shipTo": {
"company": "Example Co",
"firstName": "Sam",
"lastName": "Sample",
"address1": "200 Sample St",
"city": "Riverton",
"region": "WY",
"postalCode": "82501",
"country": "US"
},
"requestedInHandsDate": "2026-03-02",
"inboundTracking": ["1Z999AA10123456784"],
"lines": [
{
"ref": "L1",
"garment": {
"styleId": "0b4a2a9e-1c1d-4e6f-9a10-2b3c4d5e6f70",
"colorId": "7c1e5a3b-2d4f-4a6b-8c9d-0e1f2a3b4c5d"
},
"suppliedBy": "customer",
"sizes": [
{
"size": "M",
"quantity": 24
},
{
"size": "L",
"quantity": 12
}
],
"clientSku": "TEE-BLK"
},
{
"ref": "L2",
"garment": {
"brand": "Patagonia",
"styleNumber": "25528",
"colorName": "Stone Grey",
"productName": "Better Sweater Jacket"
},
"suppliedBy": "customer",
"sizes": [
{
"size": "L",
"quantity": 6
}
]
}
],
"decorations": [
{
"method": "SP",
"locationCode": "FF",
"size": {
"width": 10,
"height": 12
},
"inks": [
{
"name": "White",
"pms": "WHITE"
}
],
"artUploadId": "upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F",
"lineRefs": ["L1", "L2"]
}
],
"expectedTotal": "412.50"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
orderName: 'Spring team order',
purchaseOrderNumber: 'PO-10042',
shippingMethod: 'ship',
shipTo: {
company: 'Example Co',
firstName: 'Sam',
lastName: 'Sample',
address1: '200 Sample St',
city: 'Riverton',
region: 'WY',
postalCode: '82501',
country: 'US'
},
requestedInHandsDate: '2026-03-02',
inboundTracking: ['1Z999AA10123456784'],
lines: [
{
ref: 'L1',
garment: {
styleId: '0b4a2a9e-1c1d-4e6f-9a10-2b3c4d5e6f70',
colorId: '7c1e5a3b-2d4f-4a6b-8c9d-0e1f2a3b4c5d'
},
suppliedBy: 'customer',
sizes: [{size: 'M', quantity: 24}, {size: 'L', quantity: 12}],
clientSku: 'TEE-BLK'
},
{
ref: 'L2',
garment: {
brand: 'Patagonia',
styleNumber: '25528',
colorName: 'Stone Grey',
productName: 'Better Sweater Jacket'
},
suppliedBy: 'customer',
sizes: [{size: 'L', quantity: 6}]
}
],
decorations: [
{
method: 'SP',
locationCode: 'FF',
size: {width: 10, height: 12},
inks: [{name: 'White', pms: 'WHITE'}],
artUploadId: 'upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F',
lineRefs: ['L1', 'L2']
}
],
expectedTotal: '412.50'
})
};
fetch('https://partners.dekhq.com/api/partners/v1/order-submissions', 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://partners.dekhq.com/api/partners/v1/order-submissions",
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([
'orderName' => 'Spring team order',
'purchaseOrderNumber' => 'PO-10042',
'shippingMethod' => 'ship',
'shipTo' => [
'company' => 'Example Co',
'firstName' => 'Sam',
'lastName' => 'Sample',
'address1' => '200 Sample St',
'city' => 'Riverton',
'region' => 'WY',
'postalCode' => '82501',
'country' => 'US'
],
'requestedInHandsDate' => '2026-03-02',
'inboundTracking' => [
'1Z999AA10123456784'
],
'lines' => [
[
'ref' => 'L1',
'garment' => [
'styleId' => '0b4a2a9e-1c1d-4e6f-9a10-2b3c4d5e6f70',
'colorId' => '7c1e5a3b-2d4f-4a6b-8c9d-0e1f2a3b4c5d'
],
'suppliedBy' => 'customer',
'sizes' => [
[
'size' => 'M',
'quantity' => 24
],
[
'size' => 'L',
'quantity' => 12
]
],
'clientSku' => 'TEE-BLK'
],
[
'ref' => 'L2',
'garment' => [
'brand' => 'Patagonia',
'styleNumber' => '25528',
'colorName' => 'Stone Grey',
'productName' => 'Better Sweater Jacket'
],
'suppliedBy' => 'customer',
'sizes' => [
[
'size' => 'L',
'quantity' => 6
]
]
]
],
'decorations' => [
[
'method' => 'SP',
'locationCode' => 'FF',
'size' => [
'width' => 10,
'height' => 12
],
'inks' => [
[
'name' => 'White',
'pms' => 'WHITE'
]
],
'artUploadId' => 'upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F',
'lineRefs' => [
'L1',
'L2'
]
]
],
'expectedTotal' => '412.50'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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://partners.dekhq.com/api/partners/v1/order-submissions"
payload := strings.NewReader("{\n \"orderName\": \"Spring team order\",\n \"purchaseOrderNumber\": \"PO-10042\",\n \"shippingMethod\": \"ship\",\n \"shipTo\": {\n \"company\": \"Example Co\",\n \"firstName\": \"Sam\",\n \"lastName\": \"Sample\",\n \"address1\": \"200 Sample St\",\n \"city\": \"Riverton\",\n \"region\": \"WY\",\n \"postalCode\": \"82501\",\n \"country\": \"US\"\n },\n \"requestedInHandsDate\": \"2026-03-02\",\n \"inboundTracking\": [\n \"1Z999AA10123456784\"\n ],\n \"lines\": [\n {\n \"ref\": \"L1\",\n \"garment\": {\n \"styleId\": \"0b4a2a9e-1c1d-4e6f-9a10-2b3c4d5e6f70\",\n \"colorId\": \"7c1e5a3b-2d4f-4a6b-8c9d-0e1f2a3b4c5d\"\n },\n \"suppliedBy\": \"customer\",\n \"sizes\": [\n {\n \"size\": \"M\",\n \"quantity\": 24\n },\n {\n \"size\": \"L\",\n \"quantity\": 12\n }\n ],\n \"clientSku\": \"TEE-BLK\"\n },\n {\n \"ref\": \"L2\",\n \"garment\": {\n \"brand\": \"Patagonia\",\n \"styleNumber\": \"25528\",\n \"colorName\": \"Stone Grey\",\n \"productName\": \"Better Sweater Jacket\"\n },\n \"suppliedBy\": \"customer\",\n \"sizes\": [\n {\n \"size\": \"L\",\n \"quantity\": 6\n }\n ]\n }\n ],\n \"decorations\": [\n {\n \"method\": \"SP\",\n \"locationCode\": \"FF\",\n \"size\": {\n \"width\": 10,\n \"height\": 12\n },\n \"inks\": [\n {\n \"name\": \"White\",\n \"pms\": \"WHITE\"\n }\n ],\n \"artUploadId\": \"upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F\",\n \"lineRefs\": [\n \"L1\",\n \"L2\"\n ]\n }\n ],\n \"expectedTotal\": \"412.50\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Basic <encoded-value>")
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://partners.dekhq.com/api/partners/v1/order-submissions")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"orderName\": \"Spring team order\",\n \"purchaseOrderNumber\": \"PO-10042\",\n \"shippingMethod\": \"ship\",\n \"shipTo\": {\n \"company\": \"Example Co\",\n \"firstName\": \"Sam\",\n \"lastName\": \"Sample\",\n \"address1\": \"200 Sample St\",\n \"city\": \"Riverton\",\n \"region\": \"WY\",\n \"postalCode\": \"82501\",\n \"country\": \"US\"\n },\n \"requestedInHandsDate\": \"2026-03-02\",\n \"inboundTracking\": [\n \"1Z999AA10123456784\"\n ],\n \"lines\": [\n {\n \"ref\": \"L1\",\n \"garment\": {\n \"styleId\": \"0b4a2a9e-1c1d-4e6f-9a10-2b3c4d5e6f70\",\n \"colorId\": \"7c1e5a3b-2d4f-4a6b-8c9d-0e1f2a3b4c5d\"\n },\n \"suppliedBy\": \"customer\",\n \"sizes\": [\n {\n \"size\": \"M\",\n \"quantity\": 24\n },\n {\n \"size\": \"L\",\n \"quantity\": 12\n }\n ],\n \"clientSku\": \"TEE-BLK\"\n },\n {\n \"ref\": \"L2\",\n \"garment\": {\n \"brand\": \"Patagonia\",\n \"styleNumber\": \"25528\",\n \"colorName\": \"Stone Grey\",\n \"productName\": \"Better Sweater Jacket\"\n },\n \"suppliedBy\": \"customer\",\n \"sizes\": [\n {\n \"size\": \"L\",\n \"quantity\": 6\n }\n ]\n }\n ],\n \"decorations\": [\n {\n \"method\": \"SP\",\n \"locationCode\": \"FF\",\n \"size\": {\n \"width\": 10,\n \"height\": 12\n },\n \"inks\": [\n {\n \"name\": \"White\",\n \"pms\": \"WHITE\"\n }\n ],\n \"artUploadId\": \"upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F\",\n \"lineRefs\": [\n \"L1\",\n \"L2\"\n ]\n }\n ],\n \"expectedTotal\": \"412.50\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://partners.dekhq.com/api/partners/v1/order-submissions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orderName\": \"Spring team order\",\n \"purchaseOrderNumber\": \"PO-10042\",\n \"shippingMethod\": \"ship\",\n \"shipTo\": {\n \"company\": \"Example Co\",\n \"firstName\": \"Sam\",\n \"lastName\": \"Sample\",\n \"address1\": \"200 Sample St\",\n \"city\": \"Riverton\",\n \"region\": \"WY\",\n \"postalCode\": \"82501\",\n \"country\": \"US\"\n },\n \"requestedInHandsDate\": \"2026-03-02\",\n \"inboundTracking\": [\n \"1Z999AA10123456784\"\n ],\n \"lines\": [\n {\n \"ref\": \"L1\",\n \"garment\": {\n \"styleId\": \"0b4a2a9e-1c1d-4e6f-9a10-2b3c4d5e6f70\",\n \"colorId\": \"7c1e5a3b-2d4f-4a6b-8c9d-0e1f2a3b4c5d\"\n },\n \"suppliedBy\": \"customer\",\n \"sizes\": [\n {\n \"size\": \"M\",\n \"quantity\": 24\n },\n {\n \"size\": \"L\",\n \"quantity\": 12\n }\n ],\n \"clientSku\": \"TEE-BLK\"\n },\n {\n \"ref\": \"L2\",\n \"garment\": {\n \"brand\": \"Patagonia\",\n \"styleNumber\": \"25528\",\n \"colorName\": \"Stone Grey\",\n \"productName\": \"Better Sweater Jacket\"\n },\n \"suppliedBy\": \"customer\",\n \"sizes\": [\n {\n \"size\": \"L\",\n \"quantity\": 6\n }\n ]\n }\n ],\n \"decorations\": [\n {\n \"method\": \"SP\",\n \"locationCode\": \"FF\",\n \"size\": {\n \"width\": 10,\n \"height\": 12\n },\n \"inks\": [\n {\n \"name\": \"White\",\n \"pms\": \"WHITE\"\n }\n ],\n \"artUploadId\": \"upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F\",\n \"lineRefs\": [\n \"L1\",\n \"L2\"\n ]\n }\n ],\n \"expectedTotal\": \"412.50\"\n}"
response = http.request(request)
puts response.read_body{
"submissionId": "sub_4f8c2a7e9b1d3f5a7c9e1b3d5f7a9c1e",
"status": "accepted",
"order": {
"orderId": "ord_0123456789abcdef0123456789",
"orderNumber": "00058817",
"status": "pending_approval"
}
}{
"type": "https://docs.dekhq.com/api/partners/errors#invalid_request",
"title": "Invalid request",
"status": 400,
"detail": "A query parameter or body field is missing or invalid. `errors[]` lists each field.",
"code": "invalid_request",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#unauthenticated",
"title": "Unauthenticated",
"status": 401,
"detail": "Missing or invalid credentials.",
"code": "unauthenticated",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#forbidden",
"title": "Forbidden",
"status": 403,
"detail": "Your credential is not enabled for the scope this endpoint needs.",
"code": "forbidden",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#idempotency_conflict",
"title": "Idempotency conflict",
"status": 409,
"detail": "This `Idempotency-Key` was already used with a different body. Send the original body to get the original answer, or a new key for a new order.",
"code": "idempotency_conflict",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#payload_too_large",
"title": "Payload too large",
"status": 413,
"detail": "The request body is larger than this endpoint accepts.",
"code": "payload_too_large",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#order_refused",
"title": "Order refused",
"status": 422,
"detail": "The request is well formed but the order cannot be placed as sent. `errors[]` names each field and why: `not_supported_yet` for something this API does not take yet, `total_changed` when `expectedTotal` is not the current total (`currentTotal` carries it). `detail` says what to change.",
"code": "order_refused",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#rate_limited",
"title": "Rate limited",
"status": 429,
"detail": "More than the allowed requests per minute.",
"code": "rate_limited",
"requestId": "req_0123456789abcdef"
}{
"type": "https://docs.dekhq.com/api/partners/errors#internal",
"title": "Internal error",
"status": 500,
"detail": "An unexpected error on our side. It is logged; retry later.",
"code": "internal",
"requestId": "req_0123456789abcdef"
}Headers
Body
An order to place. expectedTotal is the total from the preview; if it is no longer the total, the order is refused with total_changed and the current total.
Your PO number, stored exactly as you send it. Printable characters, no leading or trailing spaces, and no HTML tags or entities (422 order_refused). A PO you used before is accepted: retries are matched by Idempotency-Key, never by PO.
1 - 64^[\x21-\x7E](?:[\x20-\x7E]*[\x21-\x7E])?$