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

# Mark Digital Download Complete by Friendly ID

> Mark an order's digital downloads as downloaded, addressing the order by its customer-facing friendly ID

> [!NOTE]
>
> **OAuth scope:** `order_write`
>
> API keys have full access to this endpoint.

Works exactly like [Mark Digital Download Complete](https://docs.fourthwall.com/api-reference/platform/orders/mark-download-complete.md), but you pass the order's **friendly ID** instead of its UUID. The friendly ID is the short order code customers see in emails and on the order page (for example `D3XZFWPP`). Use this endpoint when your system stores that code instead of the order UUID, so you don't have to call [Get Order by Friendly ID](https://docs.fourthwall.com/api-reference/platform/orders/get-order-by-friendly-id.md) first to look up the UUID.

## Behavior

The endpoint looks up the order in **your shop** by friendly ID, then:

| Order state | `defaultFileUrl` in body | Result |
| - | - | - |
| Has digital downloads | ignored | Every download that hasn't been downloaded yet is marked as downloaded. Returns `200`. |
| No downloads, contains a digital product | provided | A download pointing to `defaultFileUrl` is created (up to 1000 downloads allowed) and marked as downloaded. Returns `200`. |
| No downloads, contains a digital product | omitted | `400` `ORDER_HAS_NO_DOWNLOADS_ERROR` |
| No downloads, physical products only | provided or omitted | `400` `ORDER_HAS_NO_DOWNLOADS_ERROR`. A download is never created for a physical order. |
| No order with this friendly ID in your shop | — | `404` `ORDER_FRIENDLY_ID_NOT_FOUND` |

> [!TIP]
>
> The call is **idempotent**. Only downloads that haven't been downloaded yet are updated, so retrying after a timeout or network error is safe. Download counts are not increased again.

The request body is optional. Send it only if you want the `defaultFileUrl` fallback. Without it, either send `{}` or send no body.

> [!NOTE]
>
> Friendly IDs are scoped to your shop. An order from another shop returns `404`, the same as an order that doesn't exist.

## Examples

### Mark existing downloads as downloaded

```bash theme={null}
curl -u "your_username:your_password" \
  -X PUT https://api.fourthwall.com/open-api/v1.0/order/by-friendly-id/D3XZFWPP/downloaded \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Create a download from a fallback URL when none exists

Use this when the files for a digital order are delivered outside Fourthwall (for example, from your own storage). If the order already has downloads, `defaultFileUrl` is ignored.

```bash theme={null}
curl -u "your_username:your_password" \
  -X PUT https://api.fourthwall.com/open-api/v1.0/order/by-friendly-id/D3XZFWPP/downloaded \
  -H "Content-Type: application/json" \
  -d '{
    "defaultFileUrl": "https://example.com/files/album.zip"
  }'
```

A successful call returns `200 OK` with an empty body.

```bash cURL theme={null}
curl -u "your_username:your_password" \
  -X PUT https://api.fourthwall.com/open-api/v1.0/order/by-friendly-id/D3XZFWPP/downloaded \
  -H "Content-Type: application/json" \
  -d '{
    "defaultFileUrl": "https://example.com/files/album.zip"
  }'
```

```javascript JavaScript theme={null}
const credentials = btoa("your_username:your_password");

const response = await fetch(
  "https://api.fourthwall.com/open-api/v1.0/order/by-friendly-id/D3XZFWPP/downloaded",
  {
    method: "PUT",
    headers: {
      Authorization: `Basic ${credentials}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      defaultFileUrl: "https://example.com/files/album.zip",
    }),
  }
);

if (!response.ok) {
  const error = await response.json();
  throw new Error(`${response.status} ${error.code}`);
}
```

```python Python theme={null}
import requests

response = requests.put(
    "https://api.fourthwall.com/open-api/v1.0/order/by-friendly-id/D3XZFWPP/downloaded",
    auth=("your_username", "your_password"),
    json={"defaultFileUrl": "https://example.com/files/album.zip"},
)
response.raise_for_status()
```

```bash OAuth theme={null}
curl -X PUT https://api.fourthwall.com/open-api/v1.0/order/by-friendly-id/D3XZFWPP/downloaded \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{}'
```

```text 200 theme={null}
(empty body)
```

```json 400 theme={null}
{
  "code": "ORDER_HAS_NO_DOWNLOADS_ERROR",
  "orderId": "9b7028f3-6594-4015-9d11-1116e8aad2e4"
}
```

```json 404 theme={null}
{
  "code": "ORDER_FRIENDLY_ID_NOT_FOUND",
  "id": "D3XZFWPP"
}
```

```json 429 theme={null}
{
  "code": "OPEN_API_TOO_MANY_REQUESTS",
  "title": "Too many requests",
  "status": 429
}
```


## OpenAPI

````yaml PUT /open-api/v1.0/order/by-friendly-id/{friendlyId}/downloaded
openapi: 3.1.0
info:
  title: Fourthwall APIs
  description: Service used for management of orders, carts, and payments.
  termsOfService: https://fourthwall.com/terms-of-service
  contact:
    name: Backend team
    url: https://fourthwall.com
    email: backend@fourthwall.com
  version: unspecified
servers:
  - url: https://api.fourthwall.com
    description: Production server
security: []
externalDocs:
  description: OpenAPI documentation
  url: https://docs.fourthwall.com
paths:
  /open-api/v1.0/order/by-friendly-id/{friendlyId}/downloaded:
    put:
      tags:
        - Orders
      summary: Mark digital download as downloaded by order friendly id
      description: >-
        *Rate limit: 100 requests / 10 seconds per shop. See [Rate
        limiting](/guides/rate-limiting).*


        Same as mark-download-complete, with the order addressed by its friendly
        id.
      operationId: mark-download-complete-by-friendly-id
      parameters:
        - name: friendlyId
          in: path
          required: true
          schema:
            type: string
          example: D3XZFWPP
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/com.fourthwall.app.openapi.endpoint.OpenApiOrderEndpoint.MarkDownloadAsDownloadedRequest
      responses:
        '200':
          description: OK
        '400':
          description: 'Possible errors: `ORDER_HAS_NO_DOWNLOADS_ERROR`'
          content:
            application/json:
              examples:
                order-has-no-downloads-error:
                  value:
                    code: ORDER_HAS_NO_DOWNLOADS_ERROR
                    orderId: <orderid>
        '404':
          description: >-
            Possible errors: `DOWNLOAD_NOT_FOUND_ERROR`,
            `OFFER_VARIANT_NOT_FOUND_ERROR`, `ORDER_FRIENDLY_ID_NOT_FOUND`
          content:
            application/json:
              examples:
                download-not-found-error:
                  value:
                    code: DOWNLOAD_NOT_FOUND_ERROR
                    downloadId: <downloadid>
                offer-variant-not-found-error:
                  value:
                    code: OFFER_VARIANT_NOT_FOUND_ERROR
                    offerVariantId: <offervariantid>
                order-friendly-id-not-found:
                  value:
                    code: ORDER_FRIENDLY_ID_NOT_FOUND
                    id: <orderfriendlyid>
        '429':
          description: 'Rate limited: 100 requests / 10 seconds per shop.'
          content:
            application/json:
              examples:
                too-many-requests:
                  value:
                    code: OPEN_API_TOO_MANY_REQUESTS
                    title: Too many requests
                    status: 429
      security:
        - oauth:
            - order_write
        - basicAuth: []
components:
  schemas:
    com.fourthwall.app.openapi.endpoint.OpenApiOrderEndpoint.MarkDownloadAsDownloadedRequest:
      type: object
      properties:
        defaultFileUrl:
          type: string
      title: Mark Download As Downloaded Request
  securitySchemes:
    oauth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: >-
            https://auth.staging.fourthwall.com/auth/realms/Fourthwall/protocol/openid-connect/auth
          scopes:
            donation_read: donation_read
            order_read: order_read
            order_write: order_write
            fulfillment_write: fulfillment_write
            giveaway_read: giveaway_read
            giveaway_write: giveaway_write
            memberships_read: memberships_read
            memberships_write: memberships_write
            promotions_write: promotions_write
            promotions_read: promotions_read
            offer_read: offer_read
            offer_write: offer_write
            shop_read: shop_read
            thankyou_read: thankyou_read
            thankyou_write: thankyou_write
            webhook_read: webhook_read
            webhook_write: webhook_write
            media_read: media_read
            media_write: media_write
            analytics_read: analytics_read
            samples_read: samples_read
            samples_write: samples_write
            dns_read: dns_read
            dns_write: dns_write
            settings_read: settings_read
            payout_read: payout_read
            integrations_read: integrations_read
    basicAuth:
      type: http
      scheme: basic

````

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