Create Order
POST
/ordersThis endpoint allows you to create an order related to your store directly from this endpoint.
:::caution[Alert]
When creating an order, you must send either the customer_id
variable or the receiver
object, or both.
:::
Request
Customer ID. Required if both variables customer.mobile
and customer.name
are not in the request. List of customer ID can be found here.
Customer Mobile. Required if the variable customer.id
is not in the request.
Customer Name. Required if the variable customer.id
is not in the request.
Customer Email. Required if the variable customer.id
is not in the request.
Receiver Name
Receiver Country. Fetch a list of country codes using this endpoint.
Receiver Phone
Receiver Email
Whether or not to notify Receiver
Receiver Country Code
Payment Status
Payment Methods. Required if the variable status
value is set to paid
Bank ID. Required if the variable method
value is set to bank
Receipt Image Path. Required if the variable method
value is set to bank
Payment Accepted Methods by the store. Required if the variable status
value is set to pending_payment
Cash on Delivery details. Required if the variable method
value is set to cod
Delivery Method. This variable is required if one or more products require shipping
Branch ID. Required if the variable delivery_method
value is set to pickup
. List of branches can be found here.
Courier ID. Required if the variable delivery_method
value is set to shipping
. List of shipping companies can be found here
Ship to destination details. Required if the variable delivery_method
value is shipping
Ship to destination country. Fetch a list of country codes using this endpoint.
Ship to destination city. Fetch a list of city codes using this endpoint.
Ship to destination block
Ship to destination street number
Ship to destination address line
Ship to destination postal code
Product identifier type value
identifier value
- if the variable
identifier_type
value is set tosku
, then the datatype of this variable will bestring
- if the variable
identifier_type
value is set toid
, then the datatype of this variable will benumber
Product quantity value
Product options details. Required if the product has advanced options
Product donating amount. Require if the store is of type جمعيات خيرية | charity
Coupon code value
{
"customer": {
"id": 1209983424,
"name": "new name",
"mobile": "+966566666666",
"email": "[email protected]"
},
"receiver": {
"name": "i am the one",
"country_code": "SA",
"phone": "966566666666",
"email": "[email protected]",
"notify": false
},
"delivery_method": "shipping",
"branch_id": 203948803,
"courier_id": 1433878184,
"ship_to": {
"country": 1473353380,
"city": 1939592358,
"block": "Apt. 836",
"street_number": "8230",
"address": "24453 Rosalinda Well",
"address_line": "West",
"postal_code": "51434",
"geo_coordinates": {
"lat": 79.0225,
"lng": 53.5041
}
},
"payment": {
"status": "paid",
"method": "bank",
"store_bank_id": 234234,
"receipt_image_path": "url",
"accepted_methods": [
"bank",
"credit_card"
],
"cash_on_delivery": {
"amount": 10,
"currency": "SAR"
}
},
"products": [
{
"identifier_type": "id",
"identifier": 892907448,
"quantity": 1,
"options": [
{
"id": 1626535321,
"value": [
"96445177"
]
}
]
},
{
"identifier_type": "id",
"identifier": 728473534,
"quantity": 1
},
{
"identifier_type": "sku",
"identifier": "sku123",
"quantity": 1
}
]
}
Request samples
Responses
{
"status": 200,
"success": true,
"data": {
"id": 1275404514,
"reference_id": 40497223,
"urls": {
"customer": "https://salla.sa/dev-wofftr4xsra5xtlv/order/Rowq4JLlxVenM8ELG5X1vzOPYXyjGpQ0",
"admin": "https://s.salla.sa/orders/order/Rowq4JLlxVenM8ELG5X1vzOPYXyjGpQ0"
},
"date": {
"date": "2022-06-16 14:41:05.000000",
"timezone_type": 3,
"timezone": "Asia/Riyadh"
},
"source": "dashboard-api",
"source_device": "desktop",
"source_details": {
"type": "dashboard-api",
"value": null,
"device": "desktop",
"user-agent": "PostmanRuntime/7.29.0",
"ip": null
},
"first_complete_at": null,
"status": {
"id": 566146469,
"name": "بإنتظار المراجعة",
"slug": "under_review"
},
"payment_method": "credit_card",
"currency": "SAR",
"amounts": {
"sub_total": {
"amount": 0,
"currency": "SAR"
},
"shipping_cost": {
"amount": 0,
"currency": "SAR"
},
"cash_on_delivery": {
"amount": 0,
"currency": "SAR"
},
"tax": {
"percent": "0.00",
"amount": {
"amount": 0,
"currency": "SAR"
}
},
"discounts": [],
"total": {
"amount": 0,
"currency": "SAR"
}
},
"shipping": [],
"can_cancel": true,
"can_reorder": true,
"is_pending_payment": false,
"pending_payment_ends_at": 75598,
"rating_link": "https://store-test.com/rating-link",
"shipment_branch": [],
"customer": {
"id": 1438395499,
"first_name": "صالح",
"last_name": "4",
"mobile": 540090076,
"mobile_code": "+966",
"email": "",
"urls": {
"customer": "https://salla.sa/dev-wofftr4xsra5xtlv/profile",
"admin": "https://s.salla.sa/customers/Y7GXy5K8j9Qw1lrAKz3WLPkOq4omVNR2"
},
"avatar": "https://store-test.com/cp/assets/images/avatar_male.png",
"gender": "",
"birthday": null,
"city": "",
"country": "السعودية",
"country_code": null,
"currency": "SAR",
"location": "",
"updated_at": {
"date": "2022-05-23 09:37:10.000000",
"timezone_type": 3,
"timezone": "Asia/Riyadh"
}
},
"items": [
{
"id": 510046883,
"name": "تي شيرت بلاك",
"sku": "996754231",
"quantity": 1,
"currency": "SAR",
"weight": 12,
"amounts": {
"price_without_tax": {
"amount": 55,
"currency": "SAR"
},
"total_discount": {
"amount": 0,
"currency": "SAR"
},
"tax": {
"percent": "0",
"amount": {
"amount": 0,
"currency": "SAR"
}
},
"total": {
"amount": 55,
"currency": "SAR"
}
},
"notes": "",
"product": {
"id": 784769282,
"type": "product",
"promotion": {
"title": "New",
"sub_title": "Collection 2020"
},
"status": "sale",
"is_available": true,
"sku": "996754231",
"name": "تي شيرت بلاك",
"price": {
"amount": 55,
"currency": "SAR"
},
"sale_price": {
"amount": 0,
"currency": "SAR"
},
"currency": "SAR",
"url": "https://salla.sa/dev-wofftr4xsra5xtlv/t-shirt-blue-collection-2020/p784769282",
"thumbnail": "https://cdn.salla.sa/bYQEn/uUTgTrRihqRAGXy0jEV8DcJ3D8j4v6PPtwRpkCdz.png",
"has_special_price": false,
"regular_price": {
"amount": 55,
"currency": "SAR"
},
"calories": null,
"mpn": "45343",
"gtin": "14643439",
"favorite": null
},
"options": [],
"images": [],
"codes": [],
"files": []
}
],
"bank": null,
"tags": []
}
}