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

> Registers a URL to receive events. The response includes the signing secret, which is shown only once. An account can have up to 10 webhooks.

Requires an API key with write access.



## OpenAPI

````yaml /openapi.json post /webhooks
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:
  /webhooks:
    post:
      tags:
        - Webhooks
      summary: Create a webhook
      description: >-
        Registers a URL to receive events. The response includes the signing
        secret, which is shown only once. An account can have up to 10 webhooks.


        Requires an API key with write access.
      operationId: createWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - url
              properties:
                url:
                  type: string
                  format: uri
                  maxLength: 2000
                  description: >-
                    The URL to send events to. It must start with `https://` and
                    use a domain name, not an IP address.
                events:
                  type: array
                  items:
                    $ref: '#/components/schemas/EventKind'
                  description: >-
                    The events to send. Leave it out or send an empty list to
                    receive every event.
            example:
              url: https://example.com/webhooks/coinstack
              events:
                - checkout.completed
                - checkout.expired
      responses:
        '200':
          description: The webhook and its signing secret.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - response
                properties:
                  success:
                    type: boolean
                    description: Always `true` for a successful request.
                  response:
                    type: object
                    required:
                      - webhook
                      - secret
                    properties:
                      webhook:
                        $ref: '#/components/schemas/Webhook'
                      secret:
                        type: string
                        description: >-
                          The signing secret for this webhook. Store it now. It
                          is not returned again.
              example:
                success: true
                response:
                  webhook:
                    webhook_id: c2a9f1d4-7b3e-4c6a-9d2f-5e8b1a4c7d30
                    url: https://example.com/webhooks/coinstack
                    events:
                      - checkout.completed
                      - checkout.expired
                    active: true
                    created_at: '2026-12-02T15:58:20.331904Z'
                    updated_at: '2026-12-02T15:58:20.331904Z'
                  secret: >-
                    whsec_4b7e1a9c3d5f20866e8a0c2b4d6f1e3a5c7b9d0f2a4e6c8b1d3f5a7c9e0b2d4f
        '400':
          description: A field is not valid, or the account already has 10 webhooks.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalid_url:
                  summary: Invalid url
                  value:
                    success: false
                    response: Invalid url
                invalid_events:
                  summary: Invalid events
                  value:
                    success: false
                    response: Invalid events
                too_many_webhooks:
                  summary: Too many webhooks
                  value:
                    success: false
                    response: Too many webhooks
        '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:
    EventKind:
      type: string
      enum:
        - checkout.confirming
        - checkout.partial
        - checkout.completed
        - checkout.expired
        - checkout.resolved
        - payment.pending
        - payment.completed
        - payment.refunded
    Webhook:
      type: object
      description: A URL that CoinStack sends events to.
      required:
        - webhook_id
        - url
        - events
        - active
        - created_at
        - updated_at
      properties:
        webhook_id:
          type: string
          format: uuid
          description: The webhook ID.
        url:
          type: string
          format: uri
          description: The URL events are sent to.
        events:
          type: array
          items:
            $ref: '#/components/schemas/EventKind'
          description: The events this webhook receives. An empty list means every event.
        active:
          type: boolean
          description: '`true` while the webhook exists.'
        created_at:
          type: string
          format: date-time
          description: When the webhook was created. Time in RFC 3339 format, in UTC.
        updated_at:
          type: string
          format: date-time
          description: When the webhook last changed. Time in RFC 3339 format, in UTC.
      example:
        webhook_id: c2a9f1d4-7b3e-4c6a-9d2f-5e8b1a4c7d30
        url: https://example.com/webhooks/coinstack
        events:
          - checkout.completed
          - checkout.expired
        active: true
        created_at: '2026-12-02T15:58:20.331904Z'
        updated_at: '2026-12-02T15:58:20.331904Z'
    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.