Skip to main content

Order Management

1 API call in this section.

APIs for confirming orders after invoice extraction and review

Confirm Order​

Express Shipping / Order / Order Management
POST/express-shipping/order/confirm

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.

  • 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

Query parameters

ParameterTypeDescription
languagestring

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

Example: en

Headers

ParameterTypeDescription
X-EXPRESS-KEYRequiredstring

Short-lived JWT from OTP verification (required)

Example: {{express_access_token}}

Content-Typestring

JSON request body

Example: application/json

Body parameters

ParameterTypeDescription
order_numberstring—
store_namestring—
total_amountnumber—
currencystring—
order_datestring—
itemsarray<object>—
items.namestring—
items.quantitynumber—
items.unit_pricenumber—
items.total_pricenumber—
tax_amountnumber—
customer_namestring—
Show 4 more body fields

Additional body parameters

ParameterTypeDescription
customer_emailstring—
customer_addressstring—
invoice_numberstring—
invoice_file_urlstring—
Staging
Request
curl
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/express-shipping/order/confirm?language=en" \2  --header "X-EXPRESS-KEY: ${EXPRESS_ACCESS_TOKEN}" \3  --header "Content-Type: application/json" \4  --data-raw '{5  "order_number": "TREND-ORD-98765",6  "store_name": "Trendyol",7  "total_amount": 125.5,8  "currency": "USD",9  "order_date": "2024-01-15",10  "items": [11    {12      "name": "Wireless Bluetooth Headphones",13      "quantity": 1,14      "unit_price": 75,15      "total_price": 7516    },17    {18      "name": "Phone Case",19      "quantity": 2,20      "unit_price": 25.25,21      "total_price": 50.522    }23  ],24  "tax_amount": 22.59,25  "customer_name": "John Doe",26  "customer_email": "[email protected]",27  "customer_address": "123 Main St, City",28  "invoice_number": "INV-2024-001",29  "invoice_file_url": "express/invoice/GAL1704067200000/1704067300000-invoice.pdf"30}'

Response examples

201Created
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}