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

# Debugging

> Use request headers to trace and debug API calls.

When something goes wrong, the fastest path to a fix is being able to pinpoint the exact request that failed. The Smart Send API supports a small set of optional headers that make debugging dramatically easier — both for you and for our support team.

## User-Agent

We recommend including a descriptive `User-Agent` header with every API request. This helps us identify your integration and is invaluable when debugging issues on your behalf.

Follow the `Product/Version (Comments)` pattern established by [RFC 7231](https://datatracker.ietf.org/doc/html/rfc7231#section-5.5.3). Include your application name and version, along with any relevant platform details in the comments.

```bash Example theme={null}
User-Agent: my-shipping-app/1.0.0 (MyPlatform/2.3.1; PHP/8.2)
```

For reference, our own WooCommerce plugin sends the following header:

```bash WooCommerce plugin example theme={null}
User-Agent: smart-send-logistics/8.1.0 (WooCommerce/8.5.0; WordPress/6.4.2; PHP/8.1)
```

<Note>
  Without a descriptive `User-Agent`, your requests appear as anonymous traffic, making it much harder for our support team to trace and resolve issues.
</Note>

## Request-ID

The `Request-ID` header is the single most useful tool you have for debugging Smart Send API calls. It is an identifier that you set on each request, and the API echoes the same value back in the response `Request-ID` header.

```bash Example theme={null}
Request-ID: order-4521-book-a1b2c3
```

We recommend the following pattern:

<Steps>
  <Step title="Generate a unique ID for each request">
    Generate a unique identifier on your end before making the request. A UUID works well, but a descriptive key tied to your business logic (for example, an order number combined with the action) is often more useful when you later need to find it in your own logs.
  </Step>

  <Step title="Send it in the Request-ID header">
    Attach the identifier to the request using the `Request-ID` header. The Smart Send API returns the same value in the response `Request-ID` header, so you can verify it was received correctly.
  </Step>

  <Step title="Log it on your end">
    Include the `Request-ID` in your own application logs alongside any other context about the request. That way, if anything goes wrong, you can look up the call in your logs and forward the `Request-ID` to Smart Send support.
  </Step>
</Steps>

The `Request-ID` is included in our internal logs, so when you contact support about a specific request, providing the `Request-ID` lets us trace it through our systems quickly and pinpoint exactly what happened.

<Note>
  Use any string up to 128 characters containing letters, numbers, dots, hyphens, or underscores.
</Note>
