Returns a sale's details, the customer and the sale lines.

```
v1/orders/get_entry.php
```

## Parameters

| Field | Type | Required | Description |
|---|---|---|---|
| order_id | int | Yes | Sale ID |

## Response

An object order with the sale's fields:

| Field | Type | Description |
|---|---|---|
| id | int | Sale ID |
| num | string | Sale number with the prefix |
| status | int | Status, a code from [Changing the Sale Status](https://developers.controlata.com/hc/api-docs/articles/api-orders-update-status) |
| payment | int | Payment status, a code from [Changing the Payment Status](https://developers.controlata.com/hc/api-docs/articles/api-orders-update-payment) |
| date_placed | string | Sale date |
| date_shipped | string | Shipping date. Empty string if not set |
| subtotal | float | Sum of the lines |
| delivery_price | float | Delivery cost |
| discount | float | Discount |
| total | float | Total: subtotal plus delivery_price minus discount |
| cost | float | Sale cost |
| amount | float | Total quantity if all lines share one unit, otherwise null |
| lines | int | Number of lines |
| production | int | 1 if the sale is fulfilled by made-to-order production |
| production_num | string | Linked production number, null without production |
| source | string | Where the sale came from: "manual", "api", "shopify" |
| notes | string | Notes |
| products_storage_id | int | Products storage location |
| products_storage_name | string | Products storage location name |
| materials_storage_id | int | Materials storage location |
| materials_storage_name | string | Materials storage location name |
| customer_id | int | Customer ID |
| customer_name | string | Name |
| customer_email | string | Email |
| customer_phone | string | Phone |
| customer_address_real | string | Delivery address |
| customer_address_legal | string | Legal address |
| customer_agreement | string | Agreement |
| customer_manager_name | string | Manager |
| customer_manager_post | string | Manager's position |
| customer_notes | string | Customer notes |

And two arrays of sale lines: products and materials.

Line fields:

| Field | Type | Description |
|---|---|---|
| id | int | Product or material ID |
| sku | string | SKU |
| name | string | Name |
| amount | float | Quantity |
| unit | string | Unit of measure |
| total | float | Line total |
| price | float | Price per unit: total divided by amount |
| cost | float | Line cost |
| position | int | Line number in the sale, from 0 |

The position numbering is shared across both arrays: it restores the line order as in the sale card.

The lines from the response can be sent to [v1/orders/edit](https://developers.controlata.com/hc/api-docs/articles/api-orders-edit) unchanged: extra fields are ignored.

## Example request

```
{
    "order_id": 43727
}
```

## Example response

```
{
    "success": true,
    "order": {
        "id": 43727,
        "num": "A-1001",
        "status": 3,
        "payment": 2,
        "date_placed": "2026-10-06",
        "date_shipped": "2026-10-08",
        "subtotal": 30500,
        "delivery_price": 500,
        "discount": 1000,
        "total": 30000,
        "cost": 17800,
        "amount": 3,
        "lines": 2,
        "production": 0,
        "production_num": null,
        "source": "api",
        "notes": "Order from the website",
        "products_storage_id": 3998,
        "products_storage_name": "Main location",
        "materials_storage_id": 3998,
        "materials_storage_name": "Main location",
        "customer_id": 512,
        "customer_name": "John Smith",
        "customer_email": "john@example.com",
        "customer_phone": "+1 917 555-0145",
        "customer_address_real": "5 Forest St, Apt 12, New York",
        "customer_address_legal": "",
        "customer_agreement": "",
        "customer_manager_name": "",
        "customer_manager_post": "",
        "customer_notes": "",
        "products": [
            {
                "id": 815,
                "sku": "P001",
                "name": "Oak table",
                "amount": 2,
                "unit": "pcs",
                "total": 26000,
                "price": 13000,
                "cost": 15400,
                "position": 0
            },
            {
                "id": 816,
                "sku": "P002",
                "name": "Oak stool",
                "amount": 1,
                "unit": "pcs",
                "total": 4500,
                "price": 4500,
                "cost": 2400,
                "position": 1
            }
        ],
        "materials": []
    }
}
```

## Errors

| Error | Reason |
|---|---|
| No order_id in input | order_id is missing |
| Order not found or access denied | Sale not found or deleted |
