Merchants
API
Version 2
Orders

Table of Contents

  1. Variables
  2. Orders
  3. Error Codes

Variables

  • merchantAPIEndpoint: https://merchant.api.shopflix.gr/v2
  • orderId: GR--3001--MER78

Orders

1. Get Orders

GET {{merchantAPIEndpoint}}/orders

Parameters

NameTypeDescriptionRequiredDefault
pagenumberPage number for pagination.NoNone
itemsPerPagenumberItems per page.No10
statusnumberFilter by order status.Nonull
dateFromdateFilter orders from this date (ISO 8601).Nonull
dateTodateFilter orders to this date (ISO 8601).Nonull
Example
GET {{merchantAPIEndpoint}}/orders?page=1&itemsPerPage=10

Response

Status: 200 OK

Content-Type: application/json

response
{
  "params": {
    "page": 1,                     // Current page number
    "itemsPerPage": 10,            // Number of items returned per page
    "totalItems": 265,             // Total number of available orders
    "status": null,                // Order status filter (null = no filter applied)
    "dateFrom": "2020-01-01 00:00:00", // Start date for filtering orders
    "dateTo": "2025-10-14 10:24:00"    // End date for filtering orders
  },
  "orders": [
    {
      "id": "GR--3292--MER78",      // Merchant order reference
      "state": "return-canceled",  // Current order state
      "countryCode": "GR",         // Order country code
      "hasInvoice": false,         // Indicates whether an invoice exists
      "totalItemsAmount": 1000,    // Total amount of the order
      "createdAt": "2025-09-30 17:31:31", // Order creation timestamp
      "updatedAt": null,           // Last update timestamp (null if never updated)
      "customer": {
        "userId": 17,              // Internal customer identifier
        "email": "sarah@example.com", // Customer email address
        "phone": "425-222-45-76",  // Customer phone number
        "firstName": "Sarah",      // Customer first name
        "lastName": "Muller"       // Customer last name
      }
    },
    {
      "id": "GR--3291--MER78",      // Merchant order reference
      "state": "delivered-to-customer", // Current order state
      "countryCode": "GR",         // Order country code
      "hasInvoice": false,         // Indicates whether an invoice exists
      "totalItemsAmount": 1000,    // Total amount of the order
      "createdAt": "2025-09-30 17:23:14", // Order creation timestamp
      "updatedAt": null,           // Last update timestamp
      "customer": {
        "userId": 17,              // Internal customer identifier
        "email": "sarah@example.com", // Customer email address
        "phone": "425-222-45-76",  // Customer phone number
        "firstName": "Sarah",      // Customer first name
        "lastName": "Muller"       // Customer last name
      }
    }
    // More orders can be listed here...
  ]
}

2. Retrieve a single order

GET {{merchantAPIEndpoint}}/orders/{orderId}

Structure the response into key sections:

  • Order Details
  • Customer Information
  • Address Details
  • Carrier Information
  • Payment Details
  • Line Items

Response

Status: 200 OK

Content-Type: application/json

response
{
  "id": "GR--3001--MER78",               // Merchant order reference
  "state": "picked-by-courier",         // Current order state
  "countryCode": "GR",                  // Country code where the order was placed
  "hasInvoice": false,                  // Indicates whether an invoice exists
  "subTotalItemsAmount": 2346,          // Sum of line item prices (before additional charges)
  "totalItemsAmount": 2746,             // Final order amount
  "createdAt": "2024-11-05 15:27:04",   // Order creation timestamp
  "updatedAt": null,                    // Last update timestamp (null if never updated)
  "expiresAt": null,                    // Order expiration timestamp (if applicable)
  "dispatchUntil": null,                // Latest allowed dispatch time
 
  "customer": {
    "userId": 0,                        // Internal customer identifier (0 = guest)
    "email": "maria.williams@example.com", // Customer email address
    "phone": null,                     // Customer phone number (if provided)
    "firstName": "Maria",              // Customer first name
    "lastName": "Williams"             // Customer last name
  },
 
  "addressDetails": {
    "street": "Aiolou",                // Street name
    "streetNumber": "24",              // Street number
    "postCode": "10552",                // Postal code
    "city": "Athens",                  // City
    "region": "ATTICA",                // Region name
    "regionCode": "ATT",               // Region code
    "country": "Greece",               // Country name
    "countryCode": "GR"                // Country ISO code
  },
 
  "invoiceDetails": null,               // Invoice details (null if no invoice issued)
 
  "carrier": {
    "shipmentId": 88,                  // Shipment identifier
    "name": "Courier Center",           // Courier company name
    "deliveryName": "Box Now",          // Delivery service name
    "deliveryKey": "courier_center_box_now", // Internal delivery method key
    "trackingCodes": "013742332791",    // Shipment tracking code(s)
    "comments": null,                  // Optional delivery comments
    "deliveryToCourierEstimationDate": null, // Estimated pickup date by courier
    "deliveryToCustomerEstimationDate": null // Estimated delivery date to customer
  },
 
  "payment": {
    "name": "cod"                      // Payment method (e.g. cod, credit_card)
  },
 
  "lineItems": [
    {
      "id": 310,                       // Line item identifier
      "sku": "SF-5",                   // Product SKU
      "merchantEan": "sf-foo-bar-9",   // Merchant EAN
      "merchantSku": "MERSKU9",        // Merchant SKU
      "productName": "Fashion Product Second", // Product name
      "unitPrice": 2346,               // Unit price
      "originalUnitPrice": 2346,       // Original unit price before discounts
      "totalPrice": 2346,              // Total price for this line item
      "quantity": 1,                   // Quantity ordered
      "sfArticle39Valid": false,       // Business rule flag
      "giftWrap": false,               // Gift wrap indicator
      "extendedAttributes": []         // Additional attributes (can be empty)
    }
 
    // Additional line items may follow...
  ]
}

Status: 400 BAD REQUEST

Error Response if Order Not Found

response
{
	"error": {
		"code": "10301",
		"message": "The order with id {oderId} was not found"
	}
}

3. Accept Order

PATCH {{merchantAPIEndpoint}}/orders/{orderId}/accept

Response

Status: 200 OK

Content-Type: application/json

response
{
	"success": true
}

Status: 400 BAD REQUEST

response
{
	"error": {
		"code": "10304",
		"message": "Cannot Accept Order"
	}
}

Possible Reasons

  • The order has already been rejected or canceled.
  • The order is in a final state (e.g., already shipped or completed).
  • The order has already been accepted or is currently being processed.

4. Reject Order

PATCH {{merchantAPIEndpoint}}/orders/{orderId}/reject
Request Body

Content-Type: application/json

{
    "status":"D",
    "reason": "damaged" // optional
}
Available Reasons
out-of-stock
damaged
wrong-price
disabled-product
wrong-product

Response

Status: 200 OK

Content-Type: application/json

response
{
	"success": true
}

Status: 400 BAD REQUEST

response
{
	"error": {
		"code": "10304",
		"message": "Cannot Reject Order"
	}
}

Possible Reasons

  • The order has already been accepted, processed, or shipped.
  • The order is in a terminal state (e.g., completed, canceled).

Invalid Reason

response
{
    "error": {
        "code": "10301",
        "message": "The reason is not valid"
    }
}

Error Codes

CodeMessageExplanation
10301The order with id %s was not foundInvalid or missing order ID
10303Cannot Accept OrderOrder cannot be accepted in current state
10304Cannot Reject OrderOrder cannot be rejected in current state
10305Invalid ActionAction is not allowed
10306The reason is not validInvalid or unsupported reason

Quick Reference

EndpointDescriptionMethodResponse
/ordersList all orders (with filters & pagination)GETPaginated orders list
/orders/{orderId}Retrieve a specific orderGETOrder details
/orders/{orderId}/acceptAccept an orderPATCHsuccess: true
/orders/{orderId}/rejectReject an orderPATCHsuccess: true