> ## Documentation Index
> Fetch the complete documentation index at: https://doc-neteven.mylectra.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Acknowledge orders or order lines

## Definition

Acknowledgement serves a double purpose:

* flagging the order\_line as **acknowledged** so its hidden from the `GET /merchant/orders/new` response
* integrating a custom id at the `order-line` level to help you better identify orders in the Neteven system.

There are two ways of acknowledging orders:

* at the entire order level via `PATCH /merchant/orders/{order-id}/ack`  (which means every single order line at once)
* order-line per order-line via `PATCH /merchant/orders/{order-id}/lines/{order-line-id}/ack`

The differences lies in how you want to flag orders lines in your system and how much control you want over this process, based on order line status, for example (or other internal checks you might want to do before acknowledgement).

> [!TIP]
>
> ### Note
>
> If you decide to acknowledge at order-line level, every line of a given order should be included in the body of the message to ensure it is properly considered "*acknowledged*" and retrieved.

## Endpoints detail

| `PATCH` | `/merchant/orders/``{order-id}``/lines/``{order-line-id}``/ack` |
| - | - |
| **Description** | integrate your own internal `merchant_order_line_id` and *acknowledge* the order in the process. You can also release the stock that Neteven holds on pending order\_lines using the `release_reserved_stock` flag. |
| **Required scope** | `order_manager` |
| **Path parameters** | **-** `order-id`: Neteven identifier for the order object **-** `order-line-id`: Neteven identifier for the order line object |
| **Returns** | a status message from the API for that specific request. |

| `PATCH` | `/merchant/orders/``{order-id}``/ack` |
| - | - |
| **Description** | integrate your own internal `merchant_order_id` and *acknowledge* the order in the process and every one of its order lines. You can also release the stock that Neteven holds on pending order\_lines using the `release_reserved_stock` flag. Note that the `merchant_order_id` will be inserted as `merchant_order_line_id` on every single order line of the given order. |
| **Required scope** | `order_manager` |
| **Path parameters** | **-** `order-id`: Neteven identifier for the order object |
| **Returns** | a status message from the API for that specific request. |

***

## Endpoint specific errors

### Path parameters errors

#### Invalid format of order-id / order-line-id

**Response HTTP Header code :** `400`

**Cause:** The order id submitted is invalid.

**Actionable :** Ensure that the `order_id` / `order_line_id` sent as a path parameter is correct. These identifiers can be retrieved using the `get /merchant/orders` or `get /merchant/orders/new` endpoints. Do NOT retry the same call without verifying the validity of the `order-id` / `order-line-id` used as a path parameter.

> [!TIP]
>
> It is very unlikely that you will encounter this error during the production phase, since you are retrieving these identifiers from a `GET /merchant/orders` endpoint.

**Examples:**

> \{\
> "message": "Invalid value for 'order-id' query parameter: '\{order\_id}'. It must be an integer.",\
> "code": 400,\
> "title": "Bad Request"\
> }

> \{\
> "message": "Invalid value for 'order-line-id' query parameter: '\{order\_line\_id}'. It must be an integer.",\
> "code": 400,\
> "title": "Bad Request"\
> }

***

#### Mismatch of order-id and order-line-id

**Response HTTP Header code :** `404`

**Cause:** The order-id and/or order-line-id submitted are not found on your account (please note that both of these identifiers are unique identifiers).

**Actionable :** Ensure that the `order-id` and/or `order-line-id` sent as a path parameter exist on your account. Both of these identifiers can be retrieved using the `get /merchant/orders` or `get /merchant/orders/new` endpoints. Do NOT retry the same call without verifying that both exist on your account.

> [!TIP]
>
> It is very unlikely that you will encounter this error during the production phase, since you are retrieving the `order-line-id` to use as a path parameter from a `GET /merchant/orders` endpoint.

**Example:**

> \{\
> "message": "Mismatch of order-id '\{order\_id}' and order-line-id '\{order\_line\_id}'. Please ensure that both order-id and order-line-id are consistent and exist on your account.",\
> "code": 404,\
> "title": "Not Found"\
> }

***

#### Marketplace does not exist/is inactive

**Response HTTP Header code :** `400`

**Cause:** The order / order line you are trying to update is associated to a Marketplace that is not active on your account. This can happen if you deactivated a Marketplace AFTER orders where placed.

**Actionable :** Stop pulling these orders or reactivate the Marketplace in the Neteven user interface. Do NOT resubmit the same request until the corresponding Marketplace is active.

**Example:**

> \{\
> "message": "marketplace \{sql\_order\_line.marketplace\_id} non existant or inactive.",\
> "code": 400,\
> "title": "Bad Request"\
> }

***

#### Action already submitted

**Response HTTP Header code :** `409`

**Cause:** You wanted to release stock on an order line, but it was already done. You cannot re-release stock or un-release it.

**Actionable:** You should no longer try to update this order line as it is no longer required. If you only want to update the `merchant_order_line_id`, you can do so by resubmitting this call AFTER removing the `release_reserved_stock` from the request body.

**Example:**

> \{\
> "message": "release\_reserved\_stock was already set to True: impossible to change.",\
> "code": 409,\
> "title": "Conflict"\
> }

***

## API reference

*more information on parameters, responses and content in the* [API Reference](https://doc-neteven.mylectra.com/merchant-api/api-reference.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.