POST
/
orders
Yeni sipariş oluştur
curl --request POST \
  --url https://api.hemenmagaza.com/v1/orders \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "customer": {
    "name": "Ayşe Yılmaz",
    "email": "ayse@example.com",
    "phone": "+905551112233"
  },
  "shipping_address": {
    "country": "Türkiye",
    "city": "İstanbul",
    "district": "Kadıköy",
    "address": "Caferağa Mah. Moda Cad. No:12",
    "postal_code": "34710"
  },
  "items": [
    {
      "product_id": 101,
      "quantity": 2
    }
  ]
}
'
{
  "id": 123,
  "total": 123,
  "currency": "<string>",
  "customer": {
    "name": "<string>",
    "email": "jsmith@example.com",
    "id": 123,
    "phone": "<string>"
  },
  "shipping_address": {
    "country": "<string>",
    "city": "<string>",
    "district": "<string>",
    "address": "<string>",
    "postal_code": "<string>"
  },
  "items": [
    {
      "product_id": 123,
      "quantity": 2,
      "sku": "<string>",
      "name": "<string>",
      "unit_price": 123,
      "total": 123
    }
  ],
  "created_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Authorization: Bearer YOUR_API_TOKEN

Headers

Idempotency-Key
string

Aynı yazma isteğinin iki kez işlenmesini önleyen benzersiz anahtar.

Example:

"order-frontend-8f1f7c"

Body

application/json
customer
object
required
shipping_address
object
required
items
object[]
required
Minimum array length: 1

Response

Sipariş oluşturuldu.

id
integer
required
Example:

9001

status
enum<string>
required
Available options:
pending,
paid,
preparing,
shipped,
cancelled,
refunded
total
number<float>
required
Example:

1199.8

currency
string
required
Example:

"TRY"

customer
object
required
shipping_address
object
required
items
object[]
required
created_at
string<date-time>