Skip to main content

Order Management

1 API call in this section.

Confirm Order

Express Shipping / Order / Order Management
POST/express-shipping/order/confirm?language=en

API: Confirm Order Endpoint: POST /express-shipping/order/confirm Purpose: Create a package after customer reviews and confirms extracted invoice data. This is Step 2 of the order creation workflow. Authentication: - Bearer token: Authorization: Bearer {{access_token}} (required) - API Key: X-API-Key: {{api_key}} (alternative authentication method) Content-Type: application/json Form Fields: - customer_id (string, required): Galina customer ID - confirmed_data (string, required): JSON string with corrected/confirmed extracted data - order_number (string, required): Order number from store - store_name (string, required): Store/marketplace name - total_amount (number, required): Total order amount - currency (string, required): Currency code (USD, EUR, etc.) - order_date (string, optional): Order date (YYYY-MM-DD) - items (array, required): Array of order items - name (string, required): Item name - quantity (number, required): Quantity ordered - unit_price (number, optional): Price per unit - total_price (number, optional): Total price for quantity - tax_amount (number, optional): Tax amount - customer_name (string, optional): Customer name from invoice - customer_email (string, optional): Customer email from invoice - customer_address (string, optional): Customer address from invoice - invoice_number (string, optional): Invoice number - invoice_file (file, required): Original invoice file (PDF, JPEG, PNG) Business Logic: 1. Validate tenant has active express shipping service 2. Verify customer exists and is verified 3. Calculate shipping price based on weight and configuration 4. Create package record with confirmed data 5. Generate tracking number 6. Create delivery, inventory, and receiving order records 7. Store invoice file for reference Error Responses: 400 - Missing Required Fields: 400 - Invalid Order Data: 404 - Customer Not Found: 409 - Order Already Exists: 500 - Order Creation Failed:

Most OnDi APIs require an authenticated session or service token. Public endpoints are marked by their path and module context.
Request
curl
1curl --request POST "$ONDI_BASE_URL/express-shipping/order/confirm?language=en" \2  --header "X-EXPRESS-KEY: {{express_access_token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "order_number": "TREND-ORD-98765",7  "store_name": "Trendyol",8  "total_amount": 125.5,9  "currency": "USD",10  "order_date": "2024-01-15",11  "items": [12    {13      "name": "Wireless Bluetooth Headphones",14      "quantity": 1,15      "unit_price": 75,16      "total_price": 7517    },18    {19      "name": "Phone Case",20      "quantity": 2,21      "unit_price": 25.25,22      "total_price": 50.523    }24  ],25  "tax_amount": 22.59,26  "customer_name": "John Doe",27  "customer_email": "john@example.com",28  "customer_address": "123 Main St, City",29  "invoice_number": "INV-2024-001",30  "invoice_file_url": "express/invoice/GAL1704067200000/1704067300000-invoice.pdf"31}'
Request body
json
1{2  "order_number": "TREND-ORD-98765",3  "store_name": "Trendyol",4  "total_amount": 125.5,5  "currency": "USD",6  "order_date": "2024-01-15",7  "items": [8    {9      "name": "Wireless Bluetooth Headphones",10      "quantity": 1,11      "unit_price": 75,12      "total_price": 7513    },14    {15      "name": "Phone Case",16      "quantity": 2,17      "unit_price": 25.25,18      "total_price": 50.519    }20  ],21  "tax_amount": 22.59,22  "customer_name": "John Doe",23  "customer_email": "john@example.com",24  "customer_address": "123 Main St, City",25  "invoice_number": "INV-2024-001",26  "invoice_file_url": "express/invoice/GAL1704067200000/1704067300000-invoice.pdf"27}

Query parameters

languageOptional
query string

en

Preferred language for response messages (en, ar, ku)

Request body fields

order_numberExample
string

Example field from the request body.

store_nameExample
string

Example field from the request body.

total_amountExample
number

Example field from the request body.

currencyExample
string

Example field from the request body.

order_dateExample
string

Example field from the request body.

itemsExample
array<object>

Example field from the request body.

items.nameExample
string

Example field from the request body.

items.quantityExample
number

Example field from the request body.

items.unit_priceExample
number

Example field from the request body.

items.total_priceExample
number

Example field from the request body.

tax_amountExample
number

Example field from the request body.

customer_nameExample
string

Example field from the request body.

customer_emailExample
string

Example field from the request body.

customer_addressExample
string

Example field from the request body.

invoice_numberExample
string

Example field from the request body.

invoice_file_urlExample
string

Example field from the request body.

Headers

X-EXPRESS-KEYOptional
header string

{{express_access_token}}

Short-lived JWT from OTP verification (required)

Content-TypeOptional
header string

application/json

JSON request body

Responses

Success Response - Order Confirmed201Created
Response body
json
1{2  "success": true,3  "data": {4    "package": {5      "tracking_number": "GL1706371234567",6      "order_id": "TREND-ORD-98765",7      "status": "claimed",8      "payment_status": "pending",9      "declared_value": 125.5,10      "currency": "USD",11      "store_name": "Trendyol",12      "quantity": 3,13      "weight": 350,14      "delivery_fee": 15,15      "claimed_at": "2024-01-27T10:00:00Z",16      "created_at": "2024-01-27T10:00:00Z"17    },18    "delivery": {19      "delivery_id": "DEL1706371234567",20      "status": "draft",21      "delivery_type": "express",22      "estimated_delivery": "2024-02-03"23    },24    "customer": {25      "customer_id": "GAL1704067200000",26      "full_name": "John Doe",27      "phone": "+919876543210",28      "delivery_address": {29        "full_address": "123 Main Street, Mumbai, India"30      }31    }32  },33  "message": "Order confirmed successfully. Package created and ready for shipping."34}
Error - Order Already Exists409Conflict
Response body
json
1{2  "success": false,3  "message": "Order with number TREND-ORD-98765 already exists"4}
Error - Customer Not Verified404Not Found
Response body
json
1{2  "success": false,3  "message": "Customer not found or not verified"4}
400 - Missing Required Fields400
Response body
json
1{2  "success": false,3  "message": "Missing required fields: customer_id, confirmed_data"4}
400 - Invalid Order Data400
Response body
json
1{2  "success": false,3  "message": "Invalid order data: total_amount must be greater than 0"4}
500 - Order Creation Failed500
Response body
json
1{2  "success": false,3  "message": "Failed to create order. Please try again."4}