> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maple.inc/llms.txt
> Use this file to discover all available pages before exploring further.

# Submit order validation result

> Partner reports whether an order can be accepted (item availability, pricing feasibility, POS injectability).

POST`https://api.maple.inc/v1/orders/{orderId}/validation_result`API key

Partner reports whether an order can be accepted (item availability, pricing feasibility, POS injectability). Echo the `validation_id` from the `order.validation_requested` event so the result is bound to that attempt — a result naming an expired/older attempt is rejected (404). A valid result lets Maple send the order notification; invalid blocks it. Results expire; Maple revalidates (a new `validation_id`) before final submission.

## Authorization

Send your API key as `Authorization: Bearer <key>`: `mpk_test_…` against the sandbox (`https://api.staging.maple.inc/v1`), `mpk_live_…` against production. See [Authentication](https://docs.maple.inc/developer-api/concepts/authentication.md). The samples read the key from `MAPLE_KEY` and the base URL from `MAPLE_BASE`, as set up in the [Quickstart](https://docs.maple.inc/developer-api/quickstart.md).

## Parameters

- `orderId` string path required

## Request body

`application/json`, required.

**Option 1**

- `validation_id` string required

- `status` string required

  Always `valid`.

- `partner_reference` string or null

- `warnings` string\[] or null

**Option 2**

- `validation_id` string required

- `status` string required

  Always `invalid`.

- `reason` object required

- `reason.code` string required

- `reason.explanation` string or null

- `reason.item_external_ids` string\[] or null

## Responses

### 200 OK

- `object` string required

  Always `order_validation`.

- `id` string required

- `livemode` boolean required

- `created` number required

- `order` string required

- `status` string required

  One of `pending`, `valid`, `invalid`, `expired`.

- `expires_at` number or null required

- `partner_reference` string or null required

- `reason` object or null required

- `reason.code` string required

- `reason.explanation` string or null

- `reason.item_external_ids` string\[] or null

- `warnings` string\[] required

### Errors

- `400` Bad request DeveloperApiBadRequest

- `401` Unauthorized DeveloperApiUnauthorized

- `403` Forbidden DeveloperApiForbidden

- `404` Not found DeveloperApiNotFound

- `429` Too many requests DeveloperApiRateLimited

Every error body names the error in `_tag`, explains it in `message`, and says where to report it in `feedback`. See [Errors](https://docs.maple.inc/developer-api/concepts/errors.md).

A `429` also sends `Retry-After`: Seconds to wait before retrying; also returned as retry\_after in the body.

Submit order validation result

```sh
curl "$MAPLE_BASE/orders/ord_123/validation_result" \
  -H "Authorization: Bearer $MAPLE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"validation_id":"string","status":"valid"}'
```

```python
import os
import requests


r = requests.post(
    f"{os.environ['MAPLE_BASE']}/orders/ord_123/validation_result",
    headers={"Authorization": f"Bearer {os.environ['MAPLE_KEY']}"},
    json={
        "validation_id": "string",
        "status": "valid",
    },
    timeout=30,
)
r.raise_for_status()
print(r.json())
```

```js
const res = await fetch(`${process.env.MAPLE_BASE}/orders/ord_123/validation_result`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MAPLE_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "validation_id": "string",
    "status": "valid"
  }),
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());
```

```json
{
  "object": "order_validation",
  "id": "string",
  "livemode": true,
  "created": 1.5,
  "order": "string",
  "status": "pending",
  "expires_at": 1.5,
  "partner_reference": "string",
  "reason": {
    "code": "string",
    "explanation": "string",
    "item_external_ids": [
      "string"
    ]
  },
  "warnings": [
    "string"
  ]
}
```

```json
{
  "_tag": "DeveloperApiBadRequest",
  "code": "string",
  "message": "string",
  "feedback": "string"
}
```
