# Deliver digital content by hand

Gives the customer a text, such as a subscription login, on the order page and by email when the order has one, and marks the order as delivered.

```http
POST https://larm.sa/stores/{storeId}/v1/orders/{id}/digital-delivery
```

Scope: `orders.digital:write`

Use it for what the store cannot deliver by itself. `content` is up to 5,000 characters. An order held for review is delivered by changing its status to `completed` instead. See [Digital products and delivery](/guides/digital-delivery).

## Path parameters

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes |  |


## Headers

| Field | Type | Required | Description |
|---|---|---|---|
| `Idempotency-Key` | string | yes |  |


## Request body

| Field | Type | Required | Description |
|---|---|---|---|
| `content` | string | yes | What the customer sees on the order page and receives by email. |


## Response

| Field | Type | Required | Description |
|---|---|---|---|
| `data` | object | yes |  |
| `data.order_id` | string | no |  |
| `data.delivered` | boolean | no | One of: `true`. |
| `execution` | object | no | Who executed the request: the app, version, installation and store. Field names here are camelCase. |
| `execution.appId` | string (uuid) | no |  |
| `execution.versionId` | string (uuid) | no |  |
| `execution.installationId` | string (uuid) | no |  |
| `execution.storeId` | string (uuid) | no |  |
| `execution.requestId` | string (uuid) | no |  |
| `execution.generation` | integer | no |  |
| `execution.routeEpoch` | integer | no |  |
| `execution.appAuthEpoch` | integer | no |  |
| `execution.grantRevision` | integer | no |  |
| `meta` | object | yes |  |
| `meta.request_id` | string (uuid) | no | The request ID; include it in any support request. |


## Example request

```bash
curl -X POST "https://larm.sa/stores/$STORE_ID/v1/orders/200123/digital-delivery" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Idempotency-Key: $UUID" \
  -H "Content-Type: application/json" \
  -d '{ "content": "Your account: sara@example.com. Sign in at https://service.example.com" }'
```


## Example response (200)

```json
{
  "data": {
    "order_id": "200123",
    "delivered": true
  },
  "execution": {
    "appId": "1f2e3d4c-5b6a-4978-8695-a4b3c2d1e0f9",
    "versionId": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
    "installationId": "c7e4a1f2-6b3d-4e8a-9c05-1d2f3a4b5c6d",
    "storeId": "5b1d7a62-0c4e-4f38-9a51-2e7b3c9d8f10",
    "requestId": "3f0c2b8e-7a51-4c1e-9d0a-5b6f1e2d4c3a",
    "generation": 1,
    "routeEpoch": 4,
    "appAuthEpoch": 1,
    "grantRevision": 2
  },
  "meta": {
    "request_id": "3f0c2b8e-7a51-4c1e-9d0a-5b6f1e2d4c3a"
  }
}
```


## Errors

| HTTP | Code | Meaning |
|---|---|---|
| 400 | `IDEMPOTENCY_KEY_REQUIRED` | No Idempotency-Key header. |
| 404 | `RESOURCE_NOT_FOUND` | The ID does not exist in this store. |
| 409 | `ORDER_NOT_PAID` | The order is not paid. |
| 409 | `ORDER_REVIEW_HOLD` | The order is held for review. Change its status to completed to deliver its codes. |
| 409 | `ORDER_TERMINAL` | The order is cancelled or refunded. |
| 409 | `STORE_RULE_REFUSED` | A store rule refused the command. Read the resource before you try again. |
| 422 | `INVALID_INPUT` | content is empty or too long. |
| 403 | `SCOPE_REQUIRED` | The token does not carry the required scope. |
| 503 | `APPS_SCOPE_RUNTIME_NOT_READY` | The resource is not enabled on this merchant's store yet. |
