cURL
curl -X POST "https://api.easy-orders.net/api/partners-apps/v1/orders" \
-H "Authorization: Bearer $EASYORDERS_ACCESS_TOKEN" \
-H "Idempotency-Key: INV-778" \
-H "Content-Type: application/json" \
-d '{
"full_name": "Mona Hassan",
"phone": "+201001234567",
"country": "Egypt",
"city": "Cairo",
"address": "12 Tahrir St, Downtown",
"payment_method": "cod",
"items": [
{
"product_id": "0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10",
"quantity": 2
}
],
"metadata": {
"erp_ref": "INV-778"
}
}'const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/orders', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,
'Idempotency-Key': 'INV-778',
'Content-Type': 'application/json',
},
body: JSON.stringify({
full_name: 'Mona Hassan',
phone: '+201001234567',
country: 'Egypt',
city: 'Cairo',
address: '12 Tahrir St, Downtown',
payment_method: 'cod',
items: [
{
product_id: '0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10',
quantity: 2,
},
],
metadata: {
erp_ref: 'INV-778',
},
}),
})
const json = await response.json()
if (!response.ok) {
throw new Error(`${json.error.code}: ${json.error.message}`)
}
const { order } = jsonpackage main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"os"
)
func main() {
body := []byte(`{
"full_name": "Mona Hassan",
"phone": "+201001234567",
"country": "Egypt",
"city": "Cairo",
"address": "12 Tahrir St, Downtown",
"payment_method": "cod",
"items": [
{
"product_id": "0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10",
"quantity": 2
}
],
"metadata": {
"erp_ref": "INV-778"
}
}`)
req, err := http.NewRequest("POST", "https://api.easy-orders.net/api/partners-apps/v1/orders", bytes.NewReader(body))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("EASYORDERS_ACCESS_TOKEN"))
req.Header.Set("Idempotency-Key", "INV-778")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
var answer map[string]any
if err := json.NewDecoder(res.Body).Decode(&answer); err != nil {
panic(err)
}
if res.StatusCode >= 300 {
panic(fmt.Sprint(res.Status, answer["error"]))
}
fmt.Println(answer["order"])
}<?php
$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/orders');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),
'Idempotency-Key: INV-778',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'full_name' => 'Mona Hassan',
'phone' => '+201001234567',
'country' => 'Egypt',
'city' => 'Cairo',
'address' => '12 Tahrir St, Downtown',
'payment_method' => 'cod',
'items' => [
[
'product_id' => '0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10',
'quantity' => 2,
],
],
'metadata' => [
'erp_ref' => 'INV-778',
],
]),
]);
$answer = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
if ($status >= 300) {
throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);
}
$order = $answer['order'];import os
import requests
response = requests.post(
"https://api.easy-orders.net/api/partners-apps/v1/orders",
headers={
"Authorization": f"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}",
"Idempotency-Key": "INV-778",
},
json={
"full_name": "Mona Hassan",
"phone": "+201001234567",
"country": "Egypt",
"city": "Cairo",
"address": "12 Tahrir St, Downtown",
"payment_method": "cod",
"items": [
{
"product_id": "0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10",
"quantity": 2,
},
],
"metadata": {
"erp_ref": "INV-778",
},
},
timeout=30,
)
answer = response.json()
if not response.ok:
raise RuntimeError(f"{answer['error']['code']}: {answer['error']['message']}")
order = answer["order"]{
"order": {
"id": "6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c",
"number": 1042,
"status": "confirmed",
"payment_status": "pending_payment",
"payment_method": "cod",
"full_name": "Mona Hassan",
"email": "",
"phone": "+201001234567",
"phone_alt": "",
"country": "Egypt",
"city": "Cairo",
"address": "12 Tahrir St, Downtown",
"sa_national_address": "",
"note": "",
"ref": "",
"utm_source": "",
"utm_campaign": "",
"metadata": {
"is_app_order": true,
"app_name": "ERP Sync",
"erp_ref": "INV-778"
},
"product_cost": 900,
"shipping_cost": 60,
"coupon_code": "",
"coupon_discount": 0,
"total_cost": 960,
"custom_currency": "",
"is_digital": false,
"shipping_status": "",
"masked": false,
"masked_reason": null,
"items": [
{
"id": "2d3e4f5a-6b7c-4d8e-9f0a-1b2c3d4e5f60",
"product_id": "0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10",
"variant_id": null,
"quantity": 2,
"price": 450,
"metadata": {}
}
],
"created_at": "2026-12-04T10:15:00Z",
"updated_at": "2026-12-04T10:20:00Z"
}
}{
"error": {
"code": "invalid_request",
"message": "Invalid JSON body: unknown field"
}
}{
"error": {
"code": "unauthenticated",
"message": "Missing or invalid access token"
}
}{
"error": {
"code": "payment_required",
"message": "The app's subscription on this store is suspended"
}
}{
"error": {
"code": "insufficient_scope",
"message": "This request requires the scope: read_orders",
"details": {
"required_scope": "read_orders"
}
}
}{
"error": {
"code": "insufficient_stock",
"message": "A product or variant of the order has less in stock than its items ask"
}
}{
"error": {
"code": "validation_failed",
"message": "Validation failed",
"details": {
"fields": [
{
"field": "items[0].quantity",
"rule": "between",
"param": "1,10000"
}
]
}
}
}{
"error": {
"code": "too_many_requests",
"message": "Rate limit exceeded"
}
}Orders
Create an order
Scope: write_orders
Creates an order. It starts pending, with the payment status
pending_payment.
- Set each item’s
price,shipping_costandtotal_costyourself, or leave them out to use the store’s prices and shipping. coupon_codesapply to the prices; they cannot be sent withtotal_cost.- Stock moves with the order: an item over the available stock of a
product that tracks it answers
409 insufficient_stock. - A blocked phone number is refused.
Send an Idempotency-Key to retry safely.
POST
/
orders
cURL
curl -X POST "https://api.easy-orders.net/api/partners-apps/v1/orders" \
-H "Authorization: Bearer $EASYORDERS_ACCESS_TOKEN" \
-H "Idempotency-Key: INV-778" \
-H "Content-Type: application/json" \
-d '{
"full_name": "Mona Hassan",
"phone": "+201001234567",
"country": "Egypt",
"city": "Cairo",
"address": "12 Tahrir St, Downtown",
"payment_method": "cod",
"items": [
{
"product_id": "0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10",
"quantity": 2
}
],
"metadata": {
"erp_ref": "INV-778"
}
}'const response = await fetch('https://api.easy-orders.net/api/partners-apps/v1/orders', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.EASYORDERS_ACCESS_TOKEN}`,
'Idempotency-Key': 'INV-778',
'Content-Type': 'application/json',
},
body: JSON.stringify({
full_name: 'Mona Hassan',
phone: '+201001234567',
country: 'Egypt',
city: 'Cairo',
address: '12 Tahrir St, Downtown',
payment_method: 'cod',
items: [
{
product_id: '0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10',
quantity: 2,
},
],
metadata: {
erp_ref: 'INV-778',
},
}),
})
const json = await response.json()
if (!response.ok) {
throw new Error(`${json.error.code}: ${json.error.message}`)
}
const { order } = jsonpackage main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"os"
)
func main() {
body := []byte(`{
"full_name": "Mona Hassan",
"phone": "+201001234567",
"country": "Egypt",
"city": "Cairo",
"address": "12 Tahrir St, Downtown",
"payment_method": "cod",
"items": [
{
"product_id": "0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10",
"quantity": 2
}
],
"metadata": {
"erp_ref": "INV-778"
}
}`)
req, err := http.NewRequest("POST", "https://api.easy-orders.net/api/partners-apps/v1/orders", bytes.NewReader(body))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("EASYORDERS_ACCESS_TOKEN"))
req.Header.Set("Idempotency-Key", "INV-778")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
var answer map[string]any
if err := json.NewDecoder(res.Body).Decode(&answer); err != nil {
panic(err)
}
if res.StatusCode >= 300 {
panic(fmt.Sprint(res.Status, answer["error"]))
}
fmt.Println(answer["order"])
}<?php
$ch = curl_init('https://api.easy-orders.net/api/partners-apps/v1/orders');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('EASYORDERS_ACCESS_TOKEN'),
'Idempotency-Key: INV-778',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'full_name' => 'Mona Hassan',
'phone' => '+201001234567',
'country' => 'Egypt',
'city' => 'Cairo',
'address' => '12 Tahrir St, Downtown',
'payment_method' => 'cod',
'items' => [
[
'product_id' => '0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10',
'quantity' => 2,
],
],
'metadata' => [
'erp_ref' => 'INV-778',
],
]),
]);
$answer = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
if ($status >= 300) {
throw new RuntimeException($answer['error']['code'] . ': ' . $answer['error']['message']);
}
$order = $answer['order'];import os
import requests
response = requests.post(
"https://api.easy-orders.net/api/partners-apps/v1/orders",
headers={
"Authorization": f"Bearer {os.environ['EASYORDERS_ACCESS_TOKEN']}",
"Idempotency-Key": "INV-778",
},
json={
"full_name": "Mona Hassan",
"phone": "+201001234567",
"country": "Egypt",
"city": "Cairo",
"address": "12 Tahrir St, Downtown",
"payment_method": "cod",
"items": [
{
"product_id": "0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10",
"quantity": 2,
},
],
"metadata": {
"erp_ref": "INV-778",
},
},
timeout=30,
)
answer = response.json()
if not response.ok:
raise RuntimeError(f"{answer['error']['code']}: {answer['error']['message']}")
order = answer["order"]{
"order": {
"id": "6f1c2a9e-8b4d-4e3a-9f7c-1d2e3f4a5b6c",
"number": 1042,
"status": "confirmed",
"payment_status": "pending_payment",
"payment_method": "cod",
"full_name": "Mona Hassan",
"email": "",
"phone": "+201001234567",
"phone_alt": "",
"country": "Egypt",
"city": "Cairo",
"address": "12 Tahrir St, Downtown",
"sa_national_address": "",
"note": "",
"ref": "",
"utm_source": "",
"utm_campaign": "",
"metadata": {
"is_app_order": true,
"app_name": "ERP Sync",
"erp_ref": "INV-778"
},
"product_cost": 900,
"shipping_cost": 60,
"coupon_code": "",
"coupon_discount": 0,
"total_cost": 960,
"custom_currency": "",
"is_digital": false,
"shipping_status": "",
"masked": false,
"masked_reason": null,
"items": [
{
"id": "2d3e4f5a-6b7c-4d8e-9f0a-1b2c3d4e5f60",
"product_id": "0b6f3c7e-3a1d-4a8e-9d5e-2f1b7c9a4e10",
"variant_id": null,
"quantity": 2,
"price": 450,
"metadata": {}
}
],
"created_at": "2026-12-04T10:15:00Z",
"updated_at": "2026-12-04T10:20:00Z"
}
}{
"error": {
"code": "invalid_request",
"message": "Invalid JSON body: unknown field"
}
}{
"error": {
"code": "unauthenticated",
"message": "Missing or invalid access token"
}
}{
"error": {
"code": "payment_required",
"message": "The app's subscription on this store is suspended"
}
}{
"error": {
"code": "insufficient_scope",
"message": "This request requires the scope: read_orders",
"details": {
"required_scope": "read_orders"
}
}
}{
"error": {
"code": "insufficient_stock",
"message": "A product or variant of the order has less in stock than its items ask"
}
}{
"error": {
"code": "validation_failed",
"message": "Validation failed",
"details": {
"fields": [
{
"field": "items[0].quantity",
"rule": "between",
"param": "1,10000"
}
]
}
}
}{
"error": {
"code": "too_many_requests",
"message": "Rate limit exceeded"
}
}Authorizations
An access token from the OAuth flow (eo_at_...). It lasts one hour;
refresh it with the refresh token. See Authentication.
Headers
Body
application/json