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

> ## Agent Instructions
> The CoinStack API base URL is https://coinstack.net/api/v1. Authenticate with an API key sent as 'Authorization: Bearer sk_...' from a server, never from a browser. Every response is a JSON object with 'success' and 'response'. Amounts are strings; token amounts on quotes and payments are in the token's smallest unit. Fulfil an order when its checkout status is 'completed', not when the customer returns to success_url. Verify the CoinStack-Signature header on every webhook using the raw request body. The OpenAPI file is at https://docs.coinstack.net/openapi.json.

# Errors

> How the API reports a failed request.

A failed request returns a `4xx` or `5xx` status and a JSON body with `success` set to `false`. The `response` field holds a short message.

```json theme={null}
{
  "success": false,
  "response": "Invalid amount"
}
```

## Status codes

| Status | Meaning |
| - | - |
| `200` | The request worked. |
| `400` | The request is not valid. The message says which field or why. |
| `401` | The API key is missing, wrong or deleted. |
| `403` | The API key does not have the access this endpoint needs. |
| `404` | The checkout, payment, quote or webhook was not found on your account. |
| `500` | Something failed on our side. |

## Messages

Validation messages name the field that was rejected, such as `Invalid currency`, `Invalid amount` or `Invalid expires_at`. Each endpoint in this reference lists the messages it can return.

Other messages describe a rule that was broken:

| Message | Meaning |
| - | - |
| `Invalid checkout` | The checkout does not exist, or its status does not allow this action. |
| `Amount below minimum` | The checkout is worth less than the token's `minimum`. |
| `Too many quotes` | The checkout already has 10 quotes. |
| `Too many webhooks` | The account already has 10 webhooks. |

Messages are written for people. Base your code on the HTTP status and on `success`, not on the exact text.

## Request bodies that are not JSON

A request body that is not valid JSON, or that is sent without `Content-Type: application/json`, is rejected before it reaches the endpoint. That response has a `4xx` status and a plain text body instead of the JSON shown above.

## Handling failures

* **`400`, `401`, `403`, `404`:** fix the request. Sending the same request again returns the same error.
* **`500` and timeouts:** wait a moment and try again.

Creating a checkout twice makes two checkouts. If a create request times out, [list checkouts](https://docs.coinstack.net/api-reference/checkouts/list-checkouts.md) by the `reference` you sent before trying again, in case the first request went through.


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