Create an order
curl --request POST \
--url https://api.mymorabaa.com/external/v1/orders \
--header 'Content-Type: <content-type>' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"customerName": "<string>",
"customerPhone": "<string>",
"note": "<string>",
"items": [
{
"productId": "<string>",
"combinationId": "<string>",
"quantity": 123
}
],
"address": {
"lineOne": "<string>",
"lineTwo": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"zipCode": "<string>",
"phone": "<string>",
"latitude": 123,
"longitude": 123
}
}
'import requests
url = "https://api.mymorabaa.com/external/v1/orders"
payload = {
"customerName": "<string>",
"customerPhone": "<string>",
"note": "<string>",
"items": [
{
"productId": "<string>",
"combinationId": "<string>",
"quantity": 123
}
],
"address": {
"lineOne": "<string>",
"lineTwo": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"zipCode": "<string>",
"phone": "<string>",
"latitude": 123,
"longitude": 123
}
}
headers = {
"X-Api-Key": "<x-api-key>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<x-api-key>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
customerName: '<string>',
customerPhone: '<string>',
note: '<string>',
items: [{productId: '<string>', combinationId: '<string>', quantity: 123}],
address: {
lineOne: '<string>',
lineTwo: '<string>',
city: '<string>',
state: '<string>',
country: '<string>',
zipCode: '<string>',
phone: '<string>',
latitude: 123,
longitude: 123
}
})
};
fetch('https://api.mymorabaa.com/external/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://api.mymorabaa.com/external/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([
'customerName' => '<string>',
'customerPhone' => '<string>',
'note' => '<string>',
'items' => [
[
'productId' => '<string>',
'combinationId' => '<string>',
'quantity' => 123
]
],
'address' => [
'lineOne' => '<string>',
'lineTwo' => '<string>',
'city' => '<string>',
'state' => '<string>',
'country' => '<string>',
'zipCode' => '<string>',
'phone' => '<string>',
'latitude' => 123,
'longitude' => 123
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: <content-type>",
"X-Api-Key: <x-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://api.mymorabaa.com/external/v1/orders"
payload := strings.NewReader("{\n \"customerName\": \"<string>\",\n \"customerPhone\": \"<string>\",\n \"note\": \"<string>\",\n \"items\": [\n {\n \"productId\": \"<string>\",\n \"combinationId\": \"<string>\",\n \"quantity\": 123\n }\n ],\n \"address\": {\n \"lineOne\": \"<string>\",\n \"lineTwo\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"zipCode\": \"<string>\",\n \"phone\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<x-api-key>")
req.Header.Add("Content-Type", "<content-type>")
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.mymorabaa.com/external/v1/orders")
.header("X-Api-Key", "<x-api-key>")
.header("Content-Type", "<content-type>")
.body("{\n \"customerName\": \"<string>\",\n \"customerPhone\": \"<string>\",\n \"note\": \"<string>\",\n \"items\": [\n {\n \"productId\": \"<string>\",\n \"combinationId\": \"<string>\",\n \"quantity\": 123\n }\n ],\n \"address\": {\n \"lineOne\": \"<string>\",\n \"lineTwo\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"zipCode\": \"<string>\",\n \"phone\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mymorabaa.com/external/v1/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<x-api-key>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"customerName\": \"<string>\",\n \"customerPhone\": \"<string>\",\n \"note\": \"<string>\",\n \"items\": [\n {\n \"productId\": \"<string>\",\n \"combinationId\": \"<string>\",\n \"quantity\": 123\n }\n ],\n \"address\": {\n \"lineOne\": \"<string>\",\n \"lineTwo\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"zipCode\": \"<string>\",\n \"phone\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"orderNumber": "<string>",
"status": "<string>",
"total": 123,
"finalTotal": 123,
"productsCount": 123,
"date": "<string>",
"customerName": "<string>",
"customerPhone": {},
"note": {}
}API reference
Create an order
Create an order with customer, item, and delivery details.
POST
https://api.mymorabaa.com
/
external
/
v1
/
orders
Create an order
curl --request POST \
--url https://api.mymorabaa.com/external/v1/orders \
--header 'Content-Type: <content-type>' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"customerName": "<string>",
"customerPhone": "<string>",
"note": "<string>",
"items": [
{
"productId": "<string>",
"combinationId": "<string>",
"quantity": 123
}
],
"address": {
"lineOne": "<string>",
"lineTwo": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"zipCode": "<string>",
"phone": "<string>",
"latitude": 123,
"longitude": 123
}
}
'import requests
url = "https://api.mymorabaa.com/external/v1/orders"
payload = {
"customerName": "<string>",
"customerPhone": "<string>",
"note": "<string>",
"items": [
{
"productId": "<string>",
"combinationId": "<string>",
"quantity": 123
}
],
"address": {
"lineOne": "<string>",
"lineTwo": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"zipCode": "<string>",
"phone": "<string>",
"latitude": 123,
"longitude": 123
}
}
headers = {
"X-Api-Key": "<x-api-key>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<x-api-key>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
customerName: '<string>',
customerPhone: '<string>',
note: '<string>',
items: [{productId: '<string>', combinationId: '<string>', quantity: 123}],
address: {
lineOne: '<string>',
lineTwo: '<string>',
city: '<string>',
state: '<string>',
country: '<string>',
zipCode: '<string>',
phone: '<string>',
latitude: 123,
longitude: 123
}
})
};
fetch('https://api.mymorabaa.com/external/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://api.mymorabaa.com/external/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([
'customerName' => '<string>',
'customerPhone' => '<string>',
'note' => '<string>',
'items' => [
[
'productId' => '<string>',
'combinationId' => '<string>',
'quantity' => 123
]
],
'address' => [
'lineOne' => '<string>',
'lineTwo' => '<string>',
'city' => '<string>',
'state' => '<string>',
'country' => '<string>',
'zipCode' => '<string>',
'phone' => '<string>',
'latitude' => 123,
'longitude' => 123
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: <content-type>",
"X-Api-Key: <x-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://api.mymorabaa.com/external/v1/orders"
payload := strings.NewReader("{\n \"customerName\": \"<string>\",\n \"customerPhone\": \"<string>\",\n \"note\": \"<string>\",\n \"items\": [\n {\n \"productId\": \"<string>\",\n \"combinationId\": \"<string>\",\n \"quantity\": 123\n }\n ],\n \"address\": {\n \"lineOne\": \"<string>\",\n \"lineTwo\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"zipCode\": \"<string>\",\n \"phone\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<x-api-key>")
req.Header.Add("Content-Type", "<content-type>")
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.mymorabaa.com/external/v1/orders")
.header("X-Api-Key", "<x-api-key>")
.header("Content-Type", "<content-type>")
.body("{\n \"customerName\": \"<string>\",\n \"customerPhone\": \"<string>\",\n \"note\": \"<string>\",\n \"items\": [\n {\n \"productId\": \"<string>\",\n \"combinationId\": \"<string>\",\n \"quantity\": 123\n }\n ],\n \"address\": {\n \"lineOne\": \"<string>\",\n \"lineTwo\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"zipCode\": \"<string>\",\n \"phone\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mymorabaa.com/external/v1/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<x-api-key>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"customerName\": \"<string>\",\n \"customerPhone\": \"<string>\",\n \"note\": \"<string>\",\n \"items\": [\n {\n \"productId\": \"<string>\",\n \"combinationId\": \"<string>\",\n \"quantity\": 123\n }\n ],\n \"address\": {\n \"lineOne\": \"<string>\",\n \"lineTwo\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"zipCode\": \"<string>\",\n \"phone\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"orderNumber": "<string>",
"status": "<string>",
"total": 123,
"finalTotal": 123,
"productsCount": 123,
"date": "<string>",
"customerName": "<string>",
"customerPhone": {},
"note": {}
}Creates an order. Your API key needs the
The delivery phone, or
orders:create scope.
Headers
string
required
Your API key. You can use
Authorization: Api-Key your_key instead.string
required
Use
application/json.Request body
string
required
Customer name. Cannot be blank.
string
required
Customer phone number.
string
Order note.
object[]
required
object
customerPhone when no delivery phone is supplied, must be valid.
Request example
curl --request POST "$MORABAA_API_URL/external/v1/orders" \
--header "X-Api-Key: $MORABAA_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"customerName": "Ahmed Ali",
"customerPhone": "+9647700000000",
"note": "Leave at reception",
"items": [{
"productId": "11111111-1111-1111-1111-111111111111",
"combinationId": null,
"quantity": 2
}],
"address": {
"lineOne": "Street 1",
"city": "Baghdad",
"country": "Iraq"
}
}'
Response
A successful request returns201 Created. The Location header contains the new order URL.
UUID
required
Order ID.
string
required
Order number.
string
required
Current order status.
number
required
Order subtotal.
number
required
Final order total.
integer
required
Total item quantity.
string
required
Order date and time in ISO 8601 format.
string
required
Customer name.
string | null
Customer phone.
string | null
Order note.
{
"id": "55555555-5555-5555-5555-555555555555",
"orderNumber": "ORD-1042",
"status": "Pending",
"total": 20000,
"finalTotal": 20000,
"productsCount": 2,
"date": "2026-08-16T10:30:00+03:00",
"customerName": "Ahmed Ali",
"customerPhone": "+9647700000000",
"note": "Leave at reception"
}
Errors
| Status | Error code | Cause |
|---|---|---|
400 | customer_name_required | customerName is blank. |
400 | items_required | items is empty or missing. |
400 | invalid_item | An item has an invalid productId. |
400 | invalid_quantity | An item quantity is not greater than zero. |
400 | invalid_phone_number | The delivery phone is invalid. |
400 | order_creation_failed | The order could not be created. The message contains the reason. |
401 | — | The API key is missing or invalid. |
403 | — | The key lacks the orders:create scope. |
429 | — | The rate limit was exceeded. |
500 | — | An unexpected error occurred. |
503 | store_under_maintenance | The store is under maintenance. |
⌘I