> ## 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.

# Create a checkout

> Creates a checkout and returns the URL of its checkout page.

Requires an API key with write access.



## OpenAPI

````yaml /openapi.json post /checkouts
openapi: 3.1.0
info:
  title: CoinStack API
  version: 1.0.0
  description: >-
    Create checkouts, read payments and manage webhooks. Authenticate with an
    API key sent as a Bearer token. Every response is a JSON object with
    `success` and `response`.
servers:
  - url: https://coinstack.net/api/v1
security:
  - bearerAuth: []
tags:
  - name: Checkouts
    description: Requests for one payment.
  - name: Quotes
    description: >-
      Deposit addresses and amounts for showing payment details in your own
      interface.
  - name: Payments
    description: Transfers customers have sent.
  - name: Tokens
    description: The tokens and networks customers can pay with.
  - name: Webhooks
    description: URLs that receive events.
  - name: Events
    description: Changes to checkouts and payments, and their deliveries.
  - name: Webhook events
    description: Requests CoinStack sends to your webhooks.
paths:
  /checkouts:
    post:
      tags:
        - Checkouts
      summary: Create a checkout
      description: |-
        Creates a checkout and returns the URL of its checkout page.

        Requires an API key with write access.
      operationId: createCheckout
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - amount
                - currency
              properties:
                amount:
                  type: string
                  description: >-
                    The amount to charge, in `currency`. Send it as a string
                    such as `"25.00"`. It must be above zero, use no more
                    decimal places than the currency has, and be worth between 1
                    and 1,000,000 US dollars.
                  example: '25.00'
                currency:
                  type: string
                  description: >-
                    A supported three-letter currency code, such as `USD` or
                    `EUR`.
                  example: USD
                email:
                  type: string
                  description: The customer's email address.
                reference:
                  type: string
                  maxLength: 200
                  description: >-
                    Your own identifier for this checkout, such as an order
                    number. You can list checkouts by reference later.
                description:
                  type: string
                  maxLength: 1000
                  description: A description shown to the customer on the checkout page.
                success_url:
                  type: string
                  maxLength: 2000
                  description: >-
                    An `http` or `https` URL on your site. Once the checkout is
                    completed, the checkout page shows a Return to merchant
                    button that links here. `{CHECKOUT_ID}` in the URL is
                    replaced with the checkout ID.
                cancel_url:
                  type: string
                  maxLength: 2000
                  description: >-
                    An `http` or `https` URL on your site. The checkout page
                    links here so the customer can leave without paying, and
                    again if the checkout expires. `{CHECKOUT_ID}` in the URL is
                    replaced with the checkout ID.
                metadata:
                  type: object
                  additionalProperties:
                    type: string
                    maxLength: 500
                  maxProperties: 50
                  description: >-
                    Up to 50 key-value pairs to store with the checkout. Keys
                    can be up to 40 characters. Values must be strings of up to
                    500 characters.
                expires_at:
                  type: string
                  format: date-time
                  description: >-
                    When the checkout closes, in RFC 3339 format. It must be
                    between 10 minutes and 365 days from now. Defaults to 24
                    hours from now.
            example:
              amount: '25.00'
              currency: USD
              email: customer@example.com
              reference: order-1042
              description: 'Order #1042'
              success_url: https://example.com/orders/1042/thanks
              cancel_url: https://example.com/cart
              metadata:
                order_id: '1042'
      responses:
        '200':
          description: The checkout that was created.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - response
                properties:
                  success:
                    type: boolean
                    description: Always `true` for a successful request.
                  response:
                    type: object
                    required:
                      - checkout
                    properties:
                      checkout:
                        $ref: '#/components/schemas/Checkout'
              example:
                success: true
                response:
                  checkout:
                    checkout_id: 8f3b2c1e-5d47-4a9b-b6e0-2c7f1a9d4e53
                    quote_id: ''
                    email: customer@example.com
                    reference: order-1042
                    description: 'Order #1042'
                    success_url: https://example.com/orders/1042/thanks
                    cancel_url: https://example.com/cart
                    currency: USD
                    status: pending
                    amount: '25.00000000'
                    value: '25.00000000'
                    received: '0'
                    fee: '0.20000000'
                    underpaid: false
                    overpaid: false
                    late: false
                    metadata:
                      order_id: '1042'
                    created_at: '2026-12-02T16:20:11.482913Z'
                    updated_at: '2026-12-02T16:20:11.482913Z'
                    expires_at: '2026-12-03T16:20:11.482501Z'
                    completed_at: null
                    url: >-
                      https://coinstack.net/checkout/8f3b2c1e-5d47-4a9b-b6e0-2c7f1a9d4e53
        '400':
          description: A field is missing or not valid. The message names the field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalid_currency:
                  summary: Invalid currency
                  value:
                    success: false
                    response: Invalid currency
                invalid_amount:
                  summary: Invalid amount
                  value:
                    success: false
                    response: Invalid amount
                invalid_email:
                  summary: Invalid email
                  value:
                    success: false
                    response: Invalid email
                invalid_reference:
                  summary: Invalid reference
                  value:
                    success: false
                    response: Invalid reference
                invalid_description:
                  summary: Invalid description
                  value:
                    success: false
                    response: Invalid description
                invalid_success_url:
                  summary: Invalid success_url
                  value:
                    success: false
                    response: Invalid success_url
                invalid_cancel_url:
                  summary: Invalid cancel_url
                  value:
                    success: false
                    response: Invalid cancel_url
                invalid_metadata:
                  summary: Invalid metadata
                  value:
                    success: false
                    response: Invalid metadata
                invalid_expires_at:
                  summary: Invalid expires_at
                  value:
                    success: false
                    response: Invalid expires_at
        '401':
          description: The API key is missing, wrong or deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalid_authentication:
                  summary: Invalid authentication
                  value:
                    success: false
                    response: Invalid authentication
        '403':
          description: >-
            The API key is read only. This endpoint needs a key with write
            access.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalid_permissions:
                  summary: Invalid permissions
                  value:
                    success: false
                    response: Invalid permissions
components:
  schemas:
    Checkout:
      type: object
      description: A request for one payment.
      required:
        - checkout_id
        - quote_id
        - email
        - reference
        - description
        - success_url
        - cancel_url
        - currency
        - status
        - amount
        - value
        - received
        - fee
        - underpaid
        - overpaid
        - late
        - metadata
        - created_at
        - updated_at
        - expires_at
        - completed_at
        - url
      properties:
        checkout_id:
          type: string
          format: uuid
          description: The checkout ID.
        quote_id:
          type: string
          description: >-
            The quote the customer selected most recently. Empty until a payment
            method is chosen.
        email:
          type: string
          description: The customer's email address. Empty if none was given.
        reference:
          type: string
          description: >-
            Your own identifier for this checkout, such as an order number.
            Empty if none was given.
        description:
          type: string
          description: >-
            The description shown to the customer on the checkout page. Empty if
            none was given.
        success_url:
          type: string
          description: >-
            The link behind the Return to merchant button that the checkout page
            shows once the checkout is completed. Empty if none was given.
        cancel_url:
          type: string
          description: >-
            The link the checkout page offers for leaving without paying, and
            for returning to you if the checkout expires. Empty if none was
            given.
        currency:
          type: string
          description: The three-letter currency code the checkout was priced in.
          example: USD
        status:
          type: string
          enum:
            - pending
            - confirming
            - partial
            - completed
            - expired
            - resolved
          description: >-
            `pending`: nothing has been paid yet. `confirming`: a payment was
            detected and is being processed. `partial`: less than the full
            amount has been paid and the checkout is still open. `completed`:
            paid in full. `expired`: the checkout closed before it was paid in
            full. `resolved`: you marked an underpaid checkout as settled.
        amount:
          type: string
          description: The amount in `currency`. A decimal number sent as a string.
        value:
          type: string
          description: >-
            The amount in US dollars, converted when the checkout was created. A
            decimal number sent as a string.
        received:
          type: string
          description: >-
            The USDC that has reached your wallet from completed payments on
            this checkout. A decimal number sent as a string.
        fee:
          type: string
          description: >-
            The CoinStack fee for the full amount, in US dollars. A decimal
            number sent as a string.
        underpaid:
          type: boolean
          description: >-
            `true` if payments have arrived but add up to less than the full
            amount.
        overpaid:
          type: boolean
          description: '`true` if the customer paid more than 2% over the full amount.'
        late:
          type: boolean
          description: >-
            `true` if the payment that completed the checkout arrived after
            `expires_at`.
        metadata:
          type: object
          additionalProperties:
            type: string
          description: The key-value pairs you attached when creating the checkout.
        created_at:
          type: string
          format: date-time
          description: When the checkout was created. Time in RFC 3339 format, in UTC.
        updated_at:
          type: string
          format: date-time
          description: When the checkout last changed. Time in RFC 3339 format, in UTC.
        expires_at:
          type: string
          format: date-time
          description: >-
            When the checkout closes if it has not been paid. Time in RFC 3339
            format, in UTC.
        completed_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            When the checkout was completed. `null` until then. Time in RFC 3339
            format, in UTC.
        url:
          type: string
          format: uri
          description: The checkout page. Send your customer here to pay.
      example:
        checkout_id: 8f3b2c1e-5d47-4a9b-b6e0-2c7f1a9d4e53
        quote_id: ''
        email: customer@example.com
        reference: order-1042
        description: 'Order #1042'
        success_url: https://example.com/orders/1042/thanks
        cancel_url: https://example.com/cart
        currency: USD
        status: pending
        amount: '25.00000000'
        value: '25.00000000'
        received: '0'
        fee: '0.20000000'
        underpaid: false
        overpaid: false
        late: false
        metadata:
          order_id: '1042'
        created_at: '2026-12-02T16:20:11.482913Z'
        updated_at: '2026-12-02T16:20:11.482913Z'
        expires_at: '2026-12-03T16:20:11.482501Z'
        completed_at: null
        url: https://coinstack.net/checkout/8f3b2c1e-5d47-4a9b-b6e0-2c7f1a9d4e53
    Error:
      type: object
      required:
        - success
        - response
      properties:
        success:
          type: boolean
          description: Always `false` for an error.
        response:
          type: string
          description: What went wrong, for example `Invalid amount`.
      example:
        success: false
        response: Invalid amount
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your API key, which starts with `sk_`. Create one in the dashboard under
        Developers.

````

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