# Troubleshoot Delivery Preview Errors

> 📘 Buy with Prime API is now available for early access
>
> Sign up for early access to the Buy with Prime API using the 'Sign Up' button below. The API may change as Amazon receives feedback and iterates on it.

[block:html]{"html":"<a href=\"https://www2.amazonbuywithprime.com/api-interest-list?utm_medium=website&utm_source=direct\"\n   style=\"background-color: #5a9bd5; color: white; border: none; padding: 10px 20px; cursor: pointer; margin-top: 10px; display: inline-block; font-size: 16px; border-radius: 5px; text-decoration: none;\">\n    Sign Up\n</a>"}[/block]

This topic explains possible errors that you can encounter when you [Create Delivery Previews](https://documents.buywithprime.amazon.com/bwp-api/docs/create-delivery-previews).

# Errors generating a delivery preview

The following errors can occur when you call the [`deliveryPreview`](https://documents.buywithprime.amazon.com/bwp-api/docs/delivery_preview-queries-deliverypreview) query. You can find additional details, such as the relevant `itemId`, in the `details` object of the exception.

| Error Type              | Error Code                  | Description                                                                                                                                                                                                                                                                                                                                                                                                                           | Suggested Action                                                                                                                                                                                    |
| :---------------------- | :-------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `AccessDeniedError`     | N/A                         | You don't have sufficient access to perform this action.                                                                                                                                                                                                                                                                                                                                                                              | Ensure that your access token has permission to access this information, and retry the call. For details, see [Authenticate to the Buy with Prime API](https://documents.buywithprime.amazon.com/bwp-api/docs/authenticate-to-the-buy-with-prime-api). |
| `InternalServerError`   | N/A                         | Unexpected error during request processing.                                                                                                                                                                                                                                                                                                                                                                                           | None. This is a server-side error.                                                                                                                                                                  |
| `ResourceNotFoundError` | `ResourceNotFoundException` | At least one item or product ID in the request is invalid.                                                                                                                                                                                                                                                                                                                                                                            | N/A                                                                                                                                                                                                 |
| `ThrottlingError`       | N/A                         | User made too many requests to the Buy with Prime API.                                                                                                                                                                                                                                                                                                                                                                                | Send the request again using exponential backoff.                                                                                                                                                   |
| `ValidationError`       | `ExpiredIdpToken`           | The `idPToken` in the [`IdentityTokenInput`](https://documents.buywithprime.amazon.com/bwp-api/docs/delivery_preview-objects-identitytokeninput) in the request is expired.                                                                                                                                                                                                                                                                                                              | Provide a current `idPToken`.                                                                                                                                                                       |
| `ValidationError`       | `InvalidIdpToken`           | The `idPToken` in the [`IdentityTokenInput`](https://documents.buywithprime.amazon.com/bwp-api/docs/delivery_preview-objects-identitytokeninput) in the request is invalid.                                                                                                                                                                                                                                                                                                              | Provide a valid `idPToken`.                                                                                                                                                                         |
| `ValidationError`       | `InvalidAddress`            | The address provided in the request is incomplete or inaccurately formatted.                                                                                                                                                                                                                                                                                                                                                          | Provide a valid shopper address.                                                                                                                                                                    |
| `ValidationError`       | `InvalidDestination`        | The shopper's shipping destination is invalid. Buy with Prime doesn't support non-US locations, non-continental US territories, or US military bases destinations, including: American Samoa (AS),  Micronesia (FM), Guam (GU), Marshall Islands (MH), Northern Marianas (MP), Puerto Rico (PR), Palau (PW), US Virgin Islands (VI), Armed Forces - America (AA), Armed Forces - North-Pacific (AE), and Armed Forces - Pacific (AP). | Provide a valid shopper shipping destination.                                                                                                                                                       |
| `ValidationError`       | `ItemAmountUnavailable`     | The available quantity for the specified item is insufficient to fulfill the requested quantity.                                                                                                                                                                                                                                                                                                                                      | Decrease the quantity requested for the item.                                                                                                                                                       |
| `ValidationError`       | `ItemNotPrimeEnabled`       | The item isn't enabled for Buy with Prime.                                                                                                                                                                                                                                                                                                                                                                                            | Remove the item from the request. Make sure that you uploaded the product to your Buy with Prime catalog.                                                                                           |
| `ValidationError`       | `ItemOutOfStock`            | There is no available inventory for the specified item. This error only occurs during checkout flow.                                                                                                                                                                                                                                                                                                                                  | Remove the item from the request. Replenish inventory for the product.                                                                                                                              |
| `ValidationError`       | `MerchantNotPrimeEnabled`   | Your storefront isn't correctly configured to offer Buy with Prime.                                                                                                                                                                                                                                                                                                                                                                   | N/A                                                                                                                                                                                                 |
| `ValidationError`       | `ProductAmountUnavailable`  | At least one item in the request isn't available for Buy with Prime.                                                                                                                                                                                                                                                                                                                                                                  | N/A                                                                                                                                                                                                 |
| `ValidationError`       | `ShopperNotPrimeEnabled`    | The shopper isn't a Prime member.                                                                                                                                                                                                                                                                                                                                                                                                     | Call the [`shopperBwPEligibility`](https://documents.buywithprime.amazon.com/bwp-api/docs/delivery_preview-queries-shopperbwpeligibility)  query in advance to verify that the shopper is a Prime member.                                              |
| `ValidationError`       | `UnspecifiedError`          | Invalid input. For example, this error can occur when `itemId` isn't eligible for Buy with Prime, the quantity for the item isn't a positive integer <= 250, the item is out of stock during pre-checkout flow, or the merchant SKU is incorrectly mapped.                                                                                                                                                                            | Check for invalid arguments.                                                                                                                                                                        |

# Errors getting shopper eligibility

The following errors can occur when you call the [`shopperbwpeligibility`](https://documents.buywithprime.amazon.com/bwp-api/docs/delivery_preview-queries-shopperbwpeligibility) query.

| Error Type            | Error Code         | Description                                                                                                              | Suggested Action                                                                                            |
| :-------------------- | :----------------- | :----------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------- |
| `InternalServerError` | N/A                | Unexpected error during request processing.                                                                              | None. This is a server-side error.                                                                          |
| `ThrottlingError`     | N/A                | User made too many requests to the Buy with Prime API.                                                                   | Send the request again using exponential backoff.                                                           |
| `ValidationError`     | `ExpiredIdpToken`  | The `idPToken` in the [`IdentityTokenInput`](https://documents.buywithprime.amazon.com/bwp-api/docs/delivery_preview-objects-identitytokeninput) in the request is expired. | Provide a current `idPToken`.                                                                               |
| `ValidationError`     | `InvalidIdpToken`  | The `idPToken` in the [`IdentityTokenInput`](https://documents.buywithprime.amazon.com/bwp-api/docs/delivery_preview-objects-identitytokeninput) in the request is invalid. | Provide a valid `idPToken`.                                                                                 |
| `ValidationError`     | `UnspecifiedError` | Invalid input. This error occurs when a query or argument value isn't valid.                                             | Check for invalid arguments in the [`IdentityTokenInput`](https://documents.buywithprime.amazon.com/bwp-api/docs/delivery_preview-objects-identitytokeninput). |

# Related topics

* [Create Delivery Previews](https://documents.buywithprime.amazon.com/bwp-api/docs/create-delivery-previews)
* [Create a Delivery Preview for a Product Detail Page](https://documents.buywithprime.amazon.com/bwp-api/docs/create-a-delivery-preview-for-a-product-detail-page)
* [Create a Delivery Preview for Checkout](https://documents.buywithprime.amazon.com/bwp-api/docs/create-a-delivery-preview-for-checkout)
* [Manage Buy with Prime Offers](https://documents.buywithprime.amazon.com/bwp-api/docs/manage-buy-with-prime-offers)