Skip to main content

Orders

Base URL

/api/v3/admin/orders/order

Authentication

Required permissions for using this API:

  • For read operations: No specific permission required
  • For update operations: order:update
  • For delete operations: Requires delete policy permission

List Orders

Retrieves a list of orders.

  • URL: /
  • Method: GET
  • Query Parameters:
    • only-trashed: If true, returns only deleted orders
    • filter: Available filters:
      • id: Filter by order ID
      • orderNumber: Filter by order number
      • customerEmail: Filter by customer email
      • orderStatus: Filter by order status
      • createDate: Filter by creation date
      • cargoCompanyName: Filter by cargo company
      • deliveryCity: Filter by delivery city
    • include: Used to include related data
      • address: Order address information
      • customer: Customer details
      • products: Order products
      • store: Store information
      • orderReferrers: Order referrer information
    • append: Additional calculated fields
      • campaign: Campaign information
    • sort: Sort by field (prefix with - for descending)
      • Allowed fields: id, orderNumber, createDate, orderTotal, orderStatus, cargoCompanyName, deliveryCity
  • Response: Paginated list of orders

Get Single Order

Retrieves a specific order by ID.

  • URL: /{id}
  • Method: GET
  • URL Parameters:
    • id: Order ID
  • Query Parameters:
    • include: Used to include related data
      • address: Order address information
      • customer: Customer details
      • store: Store information
      • relation_metadata: Additional metadata
      • orderReferrers: Order referrer information
    • append: Additional calculated fields
      • campaign: Campaign information
    • filter[trashed]: Include archived orders
  • Response: Order details

Update Order

Updates an existing order.

  • URL: /{id}
  • Method: PUT
  • Permissions: order:update
  • URL Parameters:
    • id: Order ID
  • Request Body:
{
"orderStatus": "preparing", // Order status
"cargoCompanyId": 1, // Cargo company ID
"waybillNumber": "1234567890", // Waybill number
"invoiceNumber": "INV2024001", // Invoice number
"generalOrderNote": "Special note" // General order note
}
  • Response: Updated order object

Delete Order

Archives an order.

  • URL: /{id}
  • Method: DELETE
  • Permissions: Delete permission required
  • URL Parameters:
    • id: Order ID
  • Response: Archived order object

Batch Operations

Perform operations on multiple orders.

  • URL: /batch
  • Method: POST
  • Request Body:
{
"operation": "recover", // Operation type
"filter": { // Filters for selecting orders
"id": [1, 2, 3] // Order IDs to recover
}
}

All Available Fields

Order Information

FieldTypeDescriptionRequired
orderNumberstringOrder numberYes
orderStatusstringCurrent status of the orderYes
createDatedatetimeOrder creation dateYes
updateDatedatetimeLast update dateNo
orderCurrencystringOrder currencyYes
orderTotaldecimalTotal order amountYes
orderSubtotaldecimalSubtotal amountYes
orderTaxdecimalTotal tax amountYes

Customer Information

FieldTypeDescriptionRequired
customerIdintegerCustomer IDYes
customerFirstNamestringCustomer first nameYes
customerLastNamestringCustomer last nameYes
customerEmailstringCustomer emailYes
customerPhonestringCustomer phoneYes
customerCompanystringCustomer company nameNo
customerGroupIdintegerCustomer group IDNo
customerIpstringCustomer IP addressNo

Payment Information

FieldTypeDescriptionRequired
paymentMethodstringPayment methodYes
paymentSubMethodstringPayment sub-methodNo
paymentBankNamestringBank nameNo
paymentDiscountdecimalPayment discount amountNo
installmentintegerNumber of installmentsNo
ccBrandstringCredit card brandNo
ccBankstringCredit card bankNo

Shipping Information

FieldTypeDescriptionRequired
cargoCompanyIdintegerCargo company IDNo
cargoCompanyNamestringCargo company nameNo
cargoNumberstringCargo tracking numberNo
cargoTotaldecimalTotal cargo amountNo
cargoTaxdecimalCargo tax amountNo
waybillNumberstringWaybill numberNo
deliveryDatedatetimeDelivery dateNo
shipmentDatedatetimeShipment dateNo

Invoice Information

FieldTypeDescriptionRequired
isInvoicedbooleanInvoice statusNo
invoiceNumberstringInvoice numberNo
invoiceDatedatetimeInvoice dateNo
invoiceTypestringInvoice typeNo
isEarchivebooleanE-archive statusNo
earchiveUuidstringE-archive UUIDNo
einvoiceLinkstringE-invoice linkNo

System Fields

FieldTypeDescriptionRequired
isDeletedbooleanDeletion statusNo
isTransferredbooleanTransfer statusNo
lastTransferredDatedatetimeLast transfer dateNo
languagestringOrder languageNo
applicationstringOrder source applicationNo
generalOrderNotestringGeneral order noteNo

Error Codes

  • 401: Authentication error
  • 403: Permission error
  • 404: Order not found
  • 422: Validation error
    • orderStatus.in: Invalid order status
    • cargoCompanyId.exists: Invalid cargo company
    • waybillNumber.unique: Waybill number already exists

Changelog

2024-12

  • Added filter for viewing orders from Google Ads

2024-09

  • Fixed package product content display in order products
  • Added metafields model relationships

2024-07

  • Enhanced campaign information export in order printing

2024-05

  • Improved order products performance
  • Added ID number field with eager loading

2024-03

  • Implemented order authorization definitions

2024-02

  • Added store delivery indication in order details

2024-01

  • Implemented order archive functionality
  • Fixed campaign information display in order details

2023-12

  • Added ability to update order email address
  • Enhanced campaign order details

2023-10

  • Implemented order archive and recovery services
  • Added archive model support for filtering services

2023-09

  • Added date/time localization support
  • Implemented representative module integration

2023-07

  • Implemented API V3 resources
  • Added base collection functionality
  • Fixed various API V3 issues

2023-06

  • Initial release of Order API V3
  • Added eager loading filter service support
  • Implemented core query builder with sortable fields

This document was generated by AI. For support: api-support@tsoft.com.tr