{
  "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",
        "operationId": "createCheckout",
        "description": "Creates a checkout and returns the URL of its checkout page.\n\nRequires an API key with write access.",
        "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"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Checkouts"
        ],
        "summary": "List checkouts",
        "operationId": "listCheckouts",
        "description": "Returns your checkouts, newest first.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "How many results to return, from 1 to 100. Values above 100 are treated as 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "The `cursor` value from the previous page. Leave it out for the first page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "reference",
            "in": "query",
            "description": "Only return checkouts with exactly this reference.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "response"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always `true` for a successful request."
                    },
                    "response": {
                      "type": "object",
                      "required": [
                        "checkouts",
                        "cursor"
                      ],
                      "properties": {
                        "checkouts": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Checkout"
                          }
                        },
                        "cursor": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Pass this as `cursor` to get the next page. `null` when there are no more results."
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "response": {
                    "checkouts": [
                      {
                        "checkout_id": "8f3b2c1e-5d47-4a9b-b6e0-2c7f1a9d4e53",
                        "quote_id": "0x5c1d9a7e3b6f48021e9d7c4a5b3f6e8d1a2c4b6e8f0a1c3e5d7f9b2a4c6e8d0f",
                        "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": "completed",
                        "amount": "25.00000000",
                        "value": "25.00000000",
                        "received": "24.77643200",
                        "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:24:37.905218Z",
                        "expires_at": "2026-12-03T16:20:11.482501Z",
                        "completed_at": "2026-12-02T16:24:37.905218Z",
                        "url": "https://coinstack.net/checkout/8f3b2c1e-5d47-4a9b-b6e0-2c7f1a9d4e53"
                      }
                    ],
                    "cursor": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "A query parameter is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_limit": {
                    "summary": "Invalid limit",
                    "value": {
                      "success": false,
                      "response": "Invalid limit"
                    }
                  },
                  "invalid_cursor": {
                    "summary": "Invalid cursor",
                    "value": {
                      "success": false,
                      "response": "Invalid cursor"
                    }
                  }
                }
              }
            }
          },
          "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"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/checkouts/{checkout_id}": {
      "get": {
        "tags": [
          "Checkouts"
        ],
        "summary": "Get a checkout",
        "operationId": "getCheckout",
        "description": "Returns a checkout with its quotes and payments.",
        "parameters": [
          {
            "name": "checkout_id",
            "in": "path",
            "required": true,
            "description": "The checkout ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "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",
                        "quotes",
                        "payments"
                      ],
                      "properties": {
                        "checkout": {
                          "$ref": "#/components/schemas/Checkout"
                        },
                        "quotes": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Quote"
                          },
                          "description": "Every quote created for this checkout, oldest first."
                        },
                        "payments": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Payment"
                          },
                          "description": "Every payment sent to this checkout, oldest first."
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "response": {
                    "checkout": {
                      "checkout_id": "8f3b2c1e-5d47-4a9b-b6e0-2c7f1a9d4e53",
                      "quote_id": "0x5c1d9a7e3b6f48021e9d7c4a5b3f6e8d1a2c4b6e8f0a1c3e5d7f9b2a4c6e8d0f",
                      "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": "completed",
                      "amount": "25.00000000",
                      "value": "25.00000000",
                      "received": "24.77643200",
                      "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:24:37.905218Z",
                      "expires_at": "2026-12-03T16:20:11.482501Z",
                      "completed_at": "2026-12-02T16:24:37.905218Z",
                      "url": "https://coinstack.net/checkout/8f3b2c1e-5d47-4a9b-b6e0-2c7f1a9d4e53"
                    },
                    "quotes": [
                      {
                        "checkout_id": "8f3b2c1e-5d47-4a9b-b6e0-2c7f1a9d4e53",
                        "quote_id": "0x5c1d9a7e3b6f48021e9d7c4a5b3f6e8d1a2c4b6e8f0a1c3e5d7f9b2a4c6e8d0f",
                        "network": "base",
                        "token": "USDC",
                        "address": "0x7a3e9c5d1b4f8026e9a1c3d5b7f9e2a4c6d8b0f1",
                        "settlement": "base",
                        "recipient": "0x91C4e7B2a6D83f05E2b7A9c4D6f8E1a3B5c7D9F0",
                        "amount": "25000000",
                        "received": "25000000",
                        "expected": "24.77643200",
                        "rate": "1.00000000",
                        "cost": "0.02356800",
                        "created_at": "2026-12-02T16:21:03.220145Z",
                        "updated_at": "2026-12-02T16:24:37.901102Z",
                        "expires_at": "2026-12-02T17:21:02.981377Z",
                        "remaining": "0",
                        "uri": "ethereum:0x833589fcd6edb6e08f4c7c32d4f71b54bda02913@8453/transfer?address=0x7a3e9c5d1b4f8026e9a1c3d5b7f9e2a4c6d8b0f1&uint256=0"
                      }
                    ],
                    "payments": [
                      {
                        "checkout_id": "8f3b2c1e-5d47-4a9b-b6e0-2c7f1a9d4e53",
                        "quote_id": "0x5c1d9a7e3b6f48021e9d7c4a5b3f6e8d1a2c4b6e8f0a1c3e5d7f9b2a4c6e8d0f",
                        "payment_id": "0x5c1d9a7e3b6f48021e9d7c4a5b3f6e8d1a2c4b6e8f0a1c3e5d7f9b2a4c6e8d0f",
                        "network": "base",
                        "token": "USDC",
                        "address": "0x7a3e9c5d1b4f8026e9a1c3d5b7f9e2a4c6d8b0f1",
                        "sender": "0x2b9d4f6a8c1e3057b9d2f4a6c8e0b1d3f5a7c9e2",
                        "settlement": "base",
                        "recipient": "0x91C4e7B2a6D83f05E2b7A9c4D6f8E1a3B5c7D9F0",
                        "status": "completed",
                        "amount": "25000000",
                        "value": "24.99375000",
                        "settled": "24.77643200",
                        "fee": "0.19995000",
                        "cost": "0.01736800",
                        "share": "1.000000000000000000",
                        "deposit_tx_hash": "0x3e7a1c9d5b2f4e6a8c0d1b3f5a7e9c2d4b6f8a0c1e3d5b7f9a2c4e6d8b0f1a3c",
                        "fill_tx_hash": "0x9b2d4f6a8c0e1b3d5f7a9c2e4b6d8f0a1c3e5b7d9f2a4c6e8b0d1f3a5c7e9b2d",
                        "fail_reason": "",
                        "created_at": "2026-12-02T16:23:58.774310Z",
                        "updated_at": "2026-12-02T16:24:37.889456Z",
                        "settled_at": "2026-12-02T16:24:37.889456Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "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"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No checkout with this ID belongs to your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_checkout": {
                    "summary": "Invalid checkout",
                    "value": {
                      "success": false,
                      "response": "Invalid checkout"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/checkouts/{checkout_id}/expire": {
      "post": {
        "tags": [
          "Checkouts"
        ],
        "summary": "Expire a checkout",
        "operationId": "expireCheckout",
        "description": "Closes a checkout now instead of waiting for `expires_at`. Only checkouts with the status `pending` or `partial` can be expired. Sends a `checkout.expired` event.\n\nRequires an API key with write access.",
        "parameters": [
          {
            "name": "checkout_id",
            "in": "path",
            "required": true,
            "description": "The checkout ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The expired checkout.",
            "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": "expired",
                      "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:31:02.117340Z",
                      "expires_at": "2026-12-02T16:31:02.117340Z",
                      "completed_at": null,
                      "url": "https://coinstack.net/checkout/8f3b2c1e-5d47-4a9b-b6e0-2c7f1a9d4e53"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The checkout does not exist or its status is not `pending` or `partial`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_checkout": {
                    "summary": "Invalid checkout",
                    "value": {
                      "success": false,
                      "response": "Invalid checkout"
                    }
                  }
                }
              }
            }
          },
          "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"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/checkouts/{checkout_id}/resolve": {
      "post": {
        "tags": [
          "Checkouts"
        ],
        "summary": "Resolve a checkout",
        "operationId": "resolveCheckout",
        "description": "Marks an underpaid checkout as settled, for when you decide to accept what was paid. The checkout must have the status `partial` or `expired` and must have received a payment. Sends a `checkout.resolved` event.\n\nRequires an API key with write access.",
        "parameters": [
          {
            "name": "checkout_id",
            "in": "path",
            "required": true,
            "description": "The checkout ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The resolved checkout.",
            "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": "0x5c1d9a7e3b6f48021e9d7c4a5b3f6e8d1a2c4b6e8f0a1c3e5d7f9b2a4c6e8d0f",
                      "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": "resolved",
                      "amount": "25.00000000",
                      "value": "25.00000000",
                      "received": "19.81204500",
                      "fee": "0.20000000",
                      "underpaid": true,
                      "overpaid": false,
                      "late": false,
                      "metadata": {
                        "order_id": "1042"
                      },
                      "created_at": "2026-12-02T16:20:11.482913Z",
                      "updated_at": "2026-12-03T17:02:44.610022Z",
                      "expires_at": "2026-12-03T16:20:11.482501Z",
                      "completed_at": null,
                      "url": "https://coinstack.net/checkout/8f3b2c1e-5d47-4a9b-b6e0-2c7f1a9d4e53"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The checkout does not exist, its status is not `partial` or `expired`, or nothing has been received.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_checkout": {
                    "summary": "Invalid checkout",
                    "value": {
                      "success": false,
                      "response": "Invalid checkout"
                    }
                  }
                }
              }
            }
          },
          "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"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/checkouts/{checkout_id}/quotes": {
      "post": {
        "tags": [
          "Quotes"
        ],
        "summary": "Create a quote",
        "operationId": "createQuote",
        "description": "Returns a deposit address and an amount for paying a checkout with one token on one network. Use this when you show the payment details in your own interface instead of sending the customer to the checkout page.\n\nAsking again for the same network and token returns the existing quote. A checkout can have up to 10 quotes. The checkout must have the status `pending` or `partial` and must not be past `expires_at`.\n\nRequires an API key with write access.",
        "parameters": [
          {
            "name": "checkout_id",
            "in": "path",
            "required": true,
            "description": "The checkout ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "network",
                  "token"
                ],
                "properties": {
                  "network": {
                    "type": "string",
                    "description": "The network the customer will pay on, such as `base`. See List tokens.",
                    "example": "base"
                  },
                  "token": {
                    "type": "string",
                    "description": "The token the customer will pay with, such as `USDC`. See List tokens.",
                    "example": "USDC"
                  }
                }
              },
              "example": {
                "network": "base",
                "token": "USDC"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The quote.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "response"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always `true` for a successful request."
                    },
                    "response": {
                      "type": "object",
                      "required": [
                        "quote"
                      ],
                      "properties": {
                        "quote": {
                          "$ref": "#/components/schemas/Quote"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "response": {
                    "quote": {
                      "checkout_id": "8f3b2c1e-5d47-4a9b-b6e0-2c7f1a9d4e53",
                      "quote_id": "0x5c1d9a7e3b6f48021e9d7c4a5b3f6e8d1a2c4b6e8f0a1c3e5d7f9b2a4c6e8d0f",
                      "network": "base",
                      "token": "USDC",
                      "address": "0x7a3e9c5d1b4f8026e9a1c3d5b7f9e2a4c6d8b0f1",
                      "settlement": "base",
                      "recipient": "0x91C4e7B2a6D83f05E2b7A9c4D6f8E1a3B5c7D9F0",
                      "amount": "25000000",
                      "received": "0",
                      "expected": "24.77643200",
                      "rate": "1.00000000",
                      "cost": "0.02356800",
                      "created_at": "2026-12-02T16:21:03.220145Z",
                      "updated_at": "2026-12-02T16:21:03.220145Z",
                      "expires_at": "2026-12-02T17:21:02.981377Z",
                      "remaining": "25000000",
                      "uri": "ethereum:0x833589fcd6edb6e08f4c7c32d4f71b54bda02913@8453/transfer?address=0x7a3e9c5d1b4f8026e9a1c3d5b7f9e2a4c6d8b0f1&uint256=25000000"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request cannot be quoted. The message says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_network": {
                    "summary": "Invalid network",
                    "value": {
                      "success": false,
                      "response": "Invalid network"
                    }
                  },
                  "invalid_token": {
                    "summary": "Invalid token",
                    "value": {
                      "success": false,
                      "response": "Invalid token"
                    }
                  },
                  "invalid_checkout": {
                    "summary": "Invalid checkout",
                    "value": {
                      "success": false,
                      "response": "Invalid checkout"
                    }
                  },
                  "amount_below_minimum": {
                    "summary": "Amount below minimum",
                    "value": {
                      "success": false,
                      "response": "Amount below minimum"
                    }
                  },
                  "too_many_quotes": {
                    "summary": "Too many quotes",
                    "value": {
                      "success": false,
                      "response": "Too many quotes"
                    }
                  }
                }
              }
            }
          },
          "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"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No checkout with this ID belongs to your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_checkout": {
                    "summary": "Invalid checkout",
                    "value": {
                      "success": false,
                      "response": "Invalid checkout"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/checkouts/{checkout_id}/quotes/{quote_id}/refresh": {
      "post": {
        "tags": [
          "Quotes"
        ],
        "summary": "Refresh a quote",
        "operationId": "refreshQuote",
        "description": "Returns a quote with an amount that is guaranteed again. If the quote has not reached `expires_at` it is returned unchanged. If it has, the amount is recalculated at the current price and `expires_at` moves forward. The deposit address stays the same.\n\nRequires an API key with write access.",
        "parameters": [
          {
            "name": "checkout_id",
            "in": "path",
            "required": true,
            "description": "The checkout ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "quote_id",
            "in": "path",
            "required": true,
            "description": "The quote ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The quote.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "response"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always `true` for a successful request."
                    },
                    "response": {
                      "type": "object",
                      "required": [
                        "quote"
                      ],
                      "properties": {
                        "quote": {
                          "$ref": "#/components/schemas/Quote"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "response": {
                    "quote": {
                      "checkout_id": "8f3b2c1e-5d47-4a9b-b6e0-2c7f1a9d4e53",
                      "quote_id": "0x5c1d9a7e3b6f48021e9d7c4a5b3f6e8d1a2c4b6e8f0a1c3e5d7f9b2a4c6e8d0f",
                      "network": "base",
                      "token": "USDC",
                      "address": "0x7a3e9c5d1b4f8026e9a1c3d5b7f9e2a4c6d8b0f1",
                      "settlement": "base",
                      "recipient": "0x91C4e7B2a6D83f05E2b7A9c4D6f8E1a3B5c7D9F0",
                      "amount": "25000000",
                      "received": "0",
                      "expected": "24.77643200",
                      "rate": "1.00000000",
                      "cost": "0.02356800",
                      "created_at": "2026-12-02T16:21:03.220145Z",
                      "updated_at": "2026-12-02T16:21:03.220145Z",
                      "expires_at": "2026-12-02T17:21:02.981377Z",
                      "remaining": "25000000",
                      "uri": "ethereum:0x833589fcd6edb6e08f4c7c32d4f71b54bda02913@8453/transfer?address=0x7a3e9c5d1b4f8026e9a1c3d5b7f9e2a4c6d8b0f1&uint256=25000000"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The quote cannot be refreshed. The message says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_token": {
                    "summary": "Invalid token",
                    "value": {
                      "success": false,
                      "response": "Invalid token"
                    }
                  },
                  "invalid_checkout": {
                    "summary": "Invalid checkout",
                    "value": {
                      "success": false,
                      "response": "Invalid checkout"
                    }
                  }
                }
              }
            }
          },
          "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"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "The checkout or the quote was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_checkout": {
                    "summary": "Invalid checkout",
                    "value": {
                      "success": false,
                      "response": "Invalid checkout"
                    }
                  },
                  "invalid_quote": {
                    "summary": "Invalid quote",
                    "value": {
                      "success": false,
                      "response": "Invalid quote"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/payments": {
      "get": {
        "tags": [
          "Payments"
        ],
        "summary": "List payments",
        "operationId": "listPayments",
        "description": "Returns your payments, newest first.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "How many results to return, from 1 to 100. Values above 100 are treated as 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "The `cursor` value from the previous page. Leave it out for the first page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "checkout_id",
            "in": "query",
            "description": "Only return payments for this checkout.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "response"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always `true` for a successful request."
                    },
                    "response": {
                      "type": "object",
                      "required": [
                        "payments",
                        "cursor"
                      ],
                      "properties": {
                        "payments": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Payment"
                          }
                        },
                        "cursor": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Pass this as `cursor` to get the next page. `null` when there are no more results."
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "response": {
                    "payments": [
                      {
                        "checkout_id": "8f3b2c1e-5d47-4a9b-b6e0-2c7f1a9d4e53",
                        "quote_id": "0x5c1d9a7e3b6f48021e9d7c4a5b3f6e8d1a2c4b6e8f0a1c3e5d7f9b2a4c6e8d0f",
                        "payment_id": "0x5c1d9a7e3b6f48021e9d7c4a5b3f6e8d1a2c4b6e8f0a1c3e5d7f9b2a4c6e8d0f",
                        "network": "base",
                        "token": "USDC",
                        "address": "0x7a3e9c5d1b4f8026e9a1c3d5b7f9e2a4c6d8b0f1",
                        "sender": "0x2b9d4f6a8c1e3057b9d2f4a6c8e0b1d3f5a7c9e2",
                        "settlement": "base",
                        "recipient": "0x91C4e7B2a6D83f05E2b7A9c4D6f8E1a3B5c7D9F0",
                        "status": "completed",
                        "amount": "25000000",
                        "value": "24.99375000",
                        "settled": "24.77643200",
                        "fee": "0.19995000",
                        "cost": "0.01736800",
                        "share": "1.000000000000000000",
                        "deposit_tx_hash": "0x3e7a1c9d5b2f4e6a8c0d1b3f5a7e9c2d4b6f8a0c1e3d5b7f9a2c4e6d8b0f1a3c",
                        "fill_tx_hash": "0x9b2d4f6a8c0e1b3d5f7a9c2e4b6d8f0a1c3e5b7d9f2a4c6e8b0d1f3a5c7e9b2d",
                        "fail_reason": "",
                        "created_at": "2026-12-02T16:23:58.774310Z",
                        "updated_at": "2026-12-02T16:24:37.889456Z",
                        "settled_at": "2026-12-02T16:24:37.889456Z"
                      }
                    ],
                    "cursor": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "A query parameter is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_limit": {
                    "summary": "Invalid limit",
                    "value": {
                      "success": false,
                      "response": "Invalid limit"
                    }
                  },
                  "invalid_cursor": {
                    "summary": "Invalid cursor",
                    "value": {
                      "success": false,
                      "response": "Invalid cursor"
                    }
                  }
                }
              }
            }
          },
          "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"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/payments/{payment_id}": {
      "get": {
        "tags": [
          "Payments"
        ],
        "summary": "Get a payment",
        "operationId": "getPayment",
        "description": "Returns one payment.",
        "parameters": [
          {
            "name": "payment_id",
            "in": "path",
            "required": true,
            "description": "The payment ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "response"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always `true` for a successful request."
                    },
                    "response": {
                      "type": "object",
                      "required": [
                        "payment"
                      ],
                      "properties": {
                        "payment": {
                          "$ref": "#/components/schemas/Payment"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "response": {
                    "payment": {
                      "checkout_id": "8f3b2c1e-5d47-4a9b-b6e0-2c7f1a9d4e53",
                      "quote_id": "0x5c1d9a7e3b6f48021e9d7c4a5b3f6e8d1a2c4b6e8f0a1c3e5d7f9b2a4c6e8d0f",
                      "payment_id": "0x5c1d9a7e3b6f48021e9d7c4a5b3f6e8d1a2c4b6e8f0a1c3e5d7f9b2a4c6e8d0f",
                      "network": "base",
                      "token": "USDC",
                      "address": "0x7a3e9c5d1b4f8026e9a1c3d5b7f9e2a4c6d8b0f1",
                      "sender": "0x2b9d4f6a8c1e3057b9d2f4a6c8e0b1d3f5a7c9e2",
                      "settlement": "base",
                      "recipient": "0x91C4e7B2a6D83f05E2b7A9c4D6f8E1a3B5c7D9F0",
                      "status": "completed",
                      "amount": "25000000",
                      "value": "24.99375000",
                      "settled": "24.77643200",
                      "fee": "0.19995000",
                      "cost": "0.01736800",
                      "share": "1.000000000000000000",
                      "deposit_tx_hash": "0x3e7a1c9d5b2f4e6a8c0d1b3f5a7e9c2d4b6f8a0c1e3d5b7f9a2c4e6d8b0f1a3c",
                      "fill_tx_hash": "0x9b2d4f6a8c0e1b3d5f7a9c2e4b6d8f0a1c3e5b7d9f2a4c6e8b0d1f3a5c7e9b2d",
                      "fail_reason": "",
                      "created_at": "2026-12-02T16:23:58.774310Z",
                      "updated_at": "2026-12-02T16:24:37.889456Z",
                      "settled_at": "2026-12-02T16:24:37.889456Z"
                    }
                  }
                }
              }
            }
          },
          "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"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No payment with this ID belongs to your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_payment": {
                    "summary": "Invalid payment",
                    "value": {
                      "success": false,
                      "response": "Invalid payment"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/tokens": {
      "get": {
        "tags": [
          "Tokens"
        ],
        "summary": "List tokens",
        "operationId": "listTokens",
        "description": "Returns every token and network that can be used to pay right now, with its current price, estimated network cost and minimum checkout value.",
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "response"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always `true` for a successful request."
                    },
                    "response": {
                      "type": "object",
                      "required": [
                        "tokens"
                      ],
                      "properties": {
                        "tokens": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Token"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "response": {
                    "tokens": [
                      {
                        "network": "base",
                        "token": "USDC",
                        "chain_id": 8453,
                        "contract": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
                        "decimals": 6,
                        "price": "0.99975000",
                        "cost": "0.02356800",
                        "minimum": "1.00000000",
                        "stable": true,
                        "active": true,
                        "created_at": "2026-11-17T03:12:44.190233Z",
                        "updated_at": "2026-12-02T16:19:48.557120Z"
                      },
                      {
                        "network": "bitcoin",
                        "token": "BTC",
                        "chain_id": 8253038,
                        "contract": "bc1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqmql8k8",
                        "decimals": 8,
                        "price": "59504.15000000",
                        "cost": "2.05789300",
                        "minimum": "10.29000000",
                        "stable": false,
                        "active": true,
                        "created_at": "2026-11-17T03:12:51.402871Z",
                        "updated_at": "2026-12-02T16:19:48.557120Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "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"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/webhooks": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Create a webhook",
        "operationId": "createWebhook",
        "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.\n\nRequires an API key with write access.",
        "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"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "List webhooks",
        "operationId": "listWebhooks",
        "description": "Returns your webhooks, newest first. Signing secrets are not included.\n\nRequires an API key with write access.",
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "response"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always `true` for a successful request."
                    },
                    "response": {
                      "type": "object",
                      "required": [
                        "webhooks"
                      ],
                      "properties": {
                        "webhooks": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Webhook"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "response": {
                    "webhooks": [
                      {
                        "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"
                      }
                    ]
                  }
                }
              }
            }
          },
          "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"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/{webhook_id}": {
      "patch": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Update a webhook",
        "operationId": "updateWebhook",
        "description": "Changes a webhook's URL, its events, or both. Fields you leave out stay as they are.\n\nRequires an API key with write access.",
        "parameters": [
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "maxLength": 2000,
                    "description": "The new URL. It must start with `https://` and use a domain name, not an IP address."
                  },
                  "events": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/EventKind"
                    },
                    "description": "The new list of events. An empty list means every event."
                  }
                }
              },
              "example": {
                "events": [
                  "checkout.completed",
                  "checkout.expired",
                  "checkout.resolved"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated webhook.",
            "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"
                      ],
                      "properties": {
                        "webhook": {
                          "$ref": "#/components/schemas/Webhook"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "response": {
                    "webhook": {
                      "webhook_id": "c2a9f1d4-7b3e-4c6a-9d2f-5e8b1a4c7d30",
                      "url": "https://example.com/webhooks/coinstack",
                      "events": [
                        "checkout.completed",
                        "checkout.expired",
                        "checkout.resolved"
                      ],
                      "active": true,
                      "created_at": "2026-12-02T15:58:20.331904Z",
                      "updated_at": "2026-12-02T16:40:09.118452Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A field is not valid.",
            "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"
                    }
                  }
                }
              }
            }
          },
          "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"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No webhook with this ID belongs to your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_webhook": {
                    "summary": "Invalid webhook",
                    "value": {
                      "success": false,
                      "response": "Invalid webhook"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Delete a webhook",
        "operationId": "deleteWebhook",
        "description": "Deletes a webhook. Events that were still waiting to be delivered to it are dropped.\n\nRequires an API key with write access.",
        "parameters": [
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "response"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always `true` for a successful request."
                    },
                    "response": {
                      "type": "object",
                      "description": "An empty object."
                    }
                  }
                },
                "example": {
                  "success": true,
                  "response": {}
                }
              }
            }
          },
          "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"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No webhook with this ID belongs to your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_webhook": {
                    "summary": "Invalid webhook",
                    "value": {
                      "success": false,
                      "response": "Invalid webhook"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/{webhook_id}/rotate": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Rotate a webhook secret",
        "operationId": "rotateWebhook",
        "description": "Replaces a webhook's signing secret. The old secret stops working straight away, so update your server as soon as you have the new one.\n\nRequires an API key with write access.",
        "parameters": [
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The webhook and its new 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 new signing secret. 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-02T16:44:51.730196Z"
                    },
                    "secret": "whsec_9e2c4a6b8d0f1a3c5e7b9d2f4a6c8e0b1d3f5a7c9e2b4d6f8a0c1e3b5d7f9a2c"
                  }
                }
              }
            }
          },
          "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"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No webhook with this ID belongs to your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_webhook": {
                    "summary": "Invalid webhook",
                    "value": {
                      "success": false,
                      "response": "Invalid webhook"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/{webhook_id}/test": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Send a test event",
        "operationId": "testWebhook",
        "description": "Sends a sample `checkout.completed` event to a webhook once and reports how your server answered. The sample checkout is for 10 US dollars and has the reference `test`. It is not saved and does not appear in your events.\n\nRequires an API key with write access.",
        "parameters": [
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "description": "The webhook ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "How your server answered.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "response"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always `true` for a successful request."
                    },
                    "response": {
                      "type": "object",
                      "required": [
                        "code",
                        "delivered"
                      ],
                      "properties": {
                        "code": {
                          "type": "integer",
                          "description": "The HTTP status your server returned. `0` if it could not be reached or did not answer within 10 seconds."
                        },
                        "delivered": {
                          "type": "boolean",
                          "description": "`true` if your server returned a 2xx status."
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "response": {
                    "code": 200,
                    "delivered": true
                  }
                }
              }
            }
          },
          "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"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No webhook with this ID belongs to your account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_webhook": {
                    "summary": "Invalid webhook",
                    "value": {
                      "success": false,
                      "response": "Invalid webhook"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/events": {
      "get": {
        "tags": [
          "Events"
        ],
        "summary": "List events",
        "operationId": "listEvents",
        "description": "Returns your events, newest first, each with the record of its deliveries to your webhooks.\n\nRequires an API key with write access.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "How many results to return, from 1 to 100. Values above 100 are treated as 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "The `cursor` value from the previous page. Leave it out for the first page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "response"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always `true` for a successful request."
                    },
                    "response": {
                      "type": "object",
                      "required": [
                        "events",
                        "cursor"
                      ],
                      "properties": {
                        "events": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "event",
                              "deliveries"
                            ],
                            "properties": {
                              "event": {
                                "$ref": "#/components/schemas/Event"
                              },
                              "deliveries": {
                                "type": "array",
                                "items": {
                                  "$ref": "#/components/schemas/Delivery"
                                },
                                "description": "One entry for each time the event was queued for a webhook. Empty if no webhook was subscribed."
                              }
                            }
                          }
                        },
                        "cursor": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Pass this as `cursor` to get the next page. `null` when there are no more results."
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "response": {
                    "events": [
                      {
                        "event": {
                          "event_id": "e41b7c92-3a5d-4f8e-b1c6-9d2a7f4e0b85",
                          "kind": "checkout.completed",
                          "data": {
                            "checkout": {
                              "checkout_id": "8f3b2c1e-5d47-4a9b-b6e0-2c7f1a9d4e53",
                              "quote_id": "0x5c1d9a7e3b6f48021e9d7c4a5b3f6e8d1a2c4b6e8f0a1c3e5d7f9b2a4c6e8d0f",
                              "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": "completed",
                              "amount": "25.00000000",
                              "value": "25.00000000",
                              "received": "24.77643200",
                              "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:24:37.905218Z",
                              "expires_at": "2026-12-03T16:20:11.482501Z",
                              "completed_at": "2026-12-02T16:24:37.905218Z",
                              "url": "https://coinstack.net/checkout/8f3b2c1e-5d47-4a9b-b6e0-2c7f1a9d4e53"
                            }
                          },
                          "created_at": "2026-12-02T16:24:37.905218Z"
                        },
                        "deliveries": [
                          {
                            "webhook_id": "c2a9f1d4-7b3e-4c6a-9d2f-5e8b1a4c7d30",
                            "event_id": "e41b7c92-3a5d-4f8e-b1c6-9d2a7f4e0b85",
                            "delivery_id": 4127,
                            "code": 200,
                            "attempts": 1,
                            "delivered": true,
                            "created_at": "2026-12-02T16:24:37.905218Z",
                            "updated_at": "2026-12-02T16:24:38.214077Z",
                            "next_at": null,
                            "delivered_at": "2026-12-02T16:24:38.214077Z"
                          }
                        ]
                      }
                    ],
                    "cursor": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "A query parameter is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_limit": {
                    "summary": "Invalid limit",
                    "value": {
                      "success": false,
                      "response": "Invalid limit"
                    }
                  },
                  "invalid_cursor": {
                    "summary": "Invalid cursor",
                    "value": {
                      "success": false,
                      "response": "Invalid cursor"
                    }
                  }
                }
              }
            }
          },
          "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"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/events/{event_id}/resend": {
      "post": {
        "tags": [
          "Events"
        ],
        "summary": "Resend an event",
        "operationId": "resendEvent",
        "description": "Queues an event for delivery again to every webhook that is subscribed to it. The `event_id` in the request your server receives stays the same.\n\nRequires an API key with write access.",
        "parameters": [
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "description": "The event ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "response"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Always `true` for a successful request."
                    },
                    "response": {
                      "type": "object",
                      "description": "An empty object."
                    }
                  }
                },
                "example": {
                  "success": true,
                  "response": {}
                }
              }
            }
          },
          "400": {
            "description": "The event does not exist, or no webhook is subscribed to it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_event": {
                    "summary": "Invalid event",
                    "value": {
                      "success": false,
                      "response": "Invalid event"
                    }
                  }
                }
              }
            }
          },
          "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"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "webhooks": {
    "checkoutEvent": {
      "post": {
        "tags": [
          "Webhook events"
        ],
        "summary": "Checkout event",
        "operationId": "checkoutEvent",
        "description": "Sent when a checkout changes status. `data.checkout` is the checkout as it was when the event happened.",
        "security": [],
        "parameters": [
          {
            "name": "CoinStack-Signature",
            "in": "header",
            "required": true,
            "description": "The time the request was signed and its signature, as `t=<unix seconds>,v1=<hex signature>`. The signature is an HMAC-SHA256 of `<t>.<raw request body>` keyed with the webhook's signing secret.",
            "schema": {
              "type": "string"
            },
            "example": "t=1796228678,v1=0e6494f309fc69039d6469d87098d20bf41703c430fb059d36e057beeb6ce6a4"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "event_id",
                  "kind",
                  "data",
                  "created_at"
                ],
                "properties": {
                  "event_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The event ID. It stays the same across retries and resends."
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "checkout.confirming",
                      "checkout.partial",
                      "checkout.completed",
                      "checkout.expired",
                      "checkout.resolved"
                    ],
                    "description": "What happened."
                  },
                  "data": {
                    "type": "object",
                    "required": [
                      "checkout"
                    ],
                    "properties": {
                      "checkout": {
                        "$ref": "#/components/schemas/Checkout"
                      }
                    }
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "When the event happened. Time in RFC 3339 format, in UTC."
                  }
                }
              },
              "example": {
                "event_id": "e41b7c92-3a5d-4f8e-b1c6-9d2a7f4e0b85",
                "kind": "checkout.completed",
                "data": {
                  "checkout": {
                    "checkout_id": "8f3b2c1e-5d47-4a9b-b6e0-2c7f1a9d4e53",
                    "quote_id": "0x5c1d9a7e3b6f48021e9d7c4a5b3f6e8d1a2c4b6e8f0a1c3e5d7f9b2a4c6e8d0f",
                    "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": "completed",
                    "amount": "25.00000000",
                    "value": "25.00000000",
                    "received": "24.77643200",
                    "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:24:37.905218Z",
                    "expires_at": "2026-12-03T16:20:11.482501Z",
                    "completed_at": "2026-12-02T16:24:37.905218Z",
                    "url": "https://coinstack.net/checkout/8f3b2c1e-5d47-4a9b-b6e0-2c7f1a9d4e53"
                  }
                },
                "created_at": "2026-12-02T16:24:37.905218Z"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx status within 10 seconds to confirm you received the event."
          }
        }
      }
    },
    "paymentEvent": {
      "post": {
        "tags": [
          "Webhook events"
        ],
        "summary": "Payment event",
        "operationId": "paymentEvent",
        "description": "Sent when a payment is detected, completed or returned to the sender. `data.payment` is the payment as it was when the event happened.",
        "security": [],
        "parameters": [
          {
            "name": "CoinStack-Signature",
            "in": "header",
            "required": true,
            "description": "The time the request was signed and its signature, as `t=<unix seconds>,v1=<hex signature>`. The signature is an HMAC-SHA256 of `<t>.<raw request body>` keyed with the webhook's signing secret.",
            "schema": {
              "type": "string"
            },
            "example": "t=1796228678,v1=0e6494f309fc69039d6469d87098d20bf41703c430fb059d36e057beeb6ce6a4"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "event_id",
                  "kind",
                  "data",
                  "created_at"
                ],
                "properties": {
                  "event_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The event ID. It stays the same across retries and resends."
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "payment.pending",
                      "payment.completed",
                      "payment.refunded"
                    ],
                    "description": "What happened."
                  },
                  "data": {
                    "type": "object",
                    "required": [
                      "payment"
                    ],
                    "properties": {
                      "payment": {
                        "$ref": "#/components/schemas/Payment"
                      }
                    }
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "When the event happened. Time in RFC 3339 format, in UTC."
                  }
                }
              },
              "example": {
                "event_id": "a7d3e9b1-6c2f-4e58-8a1d-3f5b7c9e2d46",
                "kind": "payment.completed",
                "data": {
                  "payment": {
                    "checkout_id": "8f3b2c1e-5d47-4a9b-b6e0-2c7f1a9d4e53",
                    "quote_id": "0x5c1d9a7e3b6f48021e9d7c4a5b3f6e8d1a2c4b6e8f0a1c3e5d7f9b2a4c6e8d0f",
                    "payment_id": "0x5c1d9a7e3b6f48021e9d7c4a5b3f6e8d1a2c4b6e8f0a1c3e5d7f9b2a4c6e8d0f",
                    "network": "base",
                    "token": "USDC",
                    "address": "0x7a3e9c5d1b4f8026e9a1c3d5b7f9e2a4c6d8b0f1",
                    "sender": "0x2b9d4f6a8c1e3057b9d2f4a6c8e0b1d3f5a7c9e2",
                    "settlement": "base",
                    "recipient": "0x91C4e7B2a6D83f05E2b7A9c4D6f8E1a3B5c7D9F0",
                    "status": "completed",
                    "amount": "25000000",
                    "value": "24.99375000",
                    "settled": "24.77643200",
                    "fee": "0.19995000",
                    "cost": "0.01736800",
                    "share": "1.000000000000000000",
                    "deposit_tx_hash": "0x3e7a1c9d5b2f4e6a8c0d1b3f5a7e9c2d4b6f8a0c1e3d5b7f9a2c4e6d8b0f1a3c",
                    "fill_tx_hash": "0x9b2d4f6a8c0e1b3d5f7a9c2e4b6d8f0a1c3e5b7d9f2a4c6e8b0d1f3a5c7e9b2d",
                    "fail_reason": "",
                    "created_at": "2026-12-02T16:23:58.774310Z",
                    "updated_at": "2026-12-02T16:24:37.889456Z",
                    "settled_at": "2026-12-02T16:24:37.889456Z"
                  }
                },
                "created_at": "2026-12-02T16:24:37.889456Z"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx status within 10 seconds to confirm you received the event."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Your API key, which starts with `sk_`. Create one in the dashboard under Developers."
      }
    },
    "schemas": {
      "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"
        }
      },
      "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"
        }
      },
      "Quote": {
        "type": "object",
        "description": "A deposit address and an amount for paying a checkout with one token on one network.",
        "required": [
          "checkout_id",
          "quote_id",
          "network",
          "token",
          "address",
          "settlement",
          "recipient",
          "amount",
          "received",
          "expected",
          "rate",
          "cost",
          "created_at",
          "updated_at",
          "expires_at",
          "remaining",
          "uri"
        ],
        "properties": {
          "checkout_id": {
            "type": "string",
            "format": "uuid",
            "description": "The checkout this quote belongs to."
          },
          "quote_id": {
            "type": "string",
            "description": "The quote ID."
          },
          "network": {
            "type": "string",
            "description": "The network the customer pays on.",
            "example": "base"
          },
          "token": {
            "type": "string",
            "description": "The token the customer pays with.",
            "example": "USDC"
          },
          "address": {
            "type": "string",
            "description": "The deposit address the customer sends the payment to. It belongs to this quote only."
          },
          "settlement": {
            "type": "string",
            "description": "The network your USDC is settled on.",
            "example": "base"
          },
          "recipient": {
            "type": "string",
            "description": "The address that receives your USDC."
          },
          "amount": {
            "type": "string",
            "description": "The full amount to pay with this token, in the token's smallest unit. Divide by 10 to the power of the token's `decimals` for the display amount.",
            "example": "25000000"
          },
          "received": {
            "type": "string",
            "description": "What completed payments on this quote have added up to so far, in the token's smallest unit."
          },
          "expected": {
            "type": "string",
            "description": "The USDC expected to reach your wallet if `amount` is paid in full. A decimal number sent as a string."
          },
          "rate": {
            "type": "string",
            "description": "The US dollar price of one token used for this quote. `1` for stablecoins. A decimal number sent as a string."
          },
          "cost": {
            "type": "string",
            "description": "The estimated network cost of moving this payment to your wallet, in US dollars. A decimal number sent as a string."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the quote was created. Time in RFC 3339 format, in UTC."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the quote last changed. Time in RFC 3339 format, in UTC."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the quoted amount stops being guaranteed. Time in RFC 3339 format, in UTC."
          },
          "remaining": {
            "type": "string",
            "description": "What is still left to pay, in the token's smallest unit. Show this amount to the customer.",
            "example": "25000000"
          },
          "uri": {
            "type": "string",
            "description": "A payment link for wallets and QR codes, with the address and remaining amount filled in. On TRON this is the plain address."
          }
        },
        "example": {
          "checkout_id": "8f3b2c1e-5d47-4a9b-b6e0-2c7f1a9d4e53",
          "quote_id": "0x5c1d9a7e3b6f48021e9d7c4a5b3f6e8d1a2c4b6e8f0a1c3e5d7f9b2a4c6e8d0f",
          "network": "base",
          "token": "USDC",
          "address": "0x7a3e9c5d1b4f8026e9a1c3d5b7f9e2a4c6d8b0f1",
          "settlement": "base",
          "recipient": "0x91C4e7B2a6D83f05E2b7A9c4D6f8E1a3B5c7D9F0",
          "amount": "25000000",
          "received": "0",
          "expected": "24.77643200",
          "rate": "1.00000000",
          "cost": "0.02356800",
          "created_at": "2026-12-02T16:21:03.220145Z",
          "updated_at": "2026-12-02T16:21:03.220145Z",
          "expires_at": "2026-12-02T17:21:02.981377Z",
          "remaining": "25000000",
          "uri": "ethereum:0x833589fcd6edb6e08f4c7c32d4f71b54bda02913@8453/transfer?address=0x7a3e9c5d1b4f8026e9a1c3d5b7f9e2a4c6d8b0f1&uint256=25000000"
        }
      },
      "Payment": {
        "type": "object",
        "description": "One transfer a customer sent to a deposit address.",
        "required": [
          "checkout_id",
          "quote_id",
          "payment_id",
          "network",
          "token",
          "address",
          "sender",
          "settlement",
          "recipient",
          "status",
          "amount",
          "value",
          "settled",
          "fee",
          "cost",
          "share",
          "deposit_tx_hash",
          "fill_tx_hash",
          "fail_reason",
          "created_at",
          "updated_at",
          "settled_at"
        ],
        "properties": {
          "checkout_id": {
            "type": "string",
            "format": "uuid",
            "description": "The checkout this payment belongs to."
          },
          "quote_id": {
            "type": "string",
            "description": "The quote whose deposit address received the payment."
          },
          "payment_id": {
            "type": "string",
            "description": "The payment ID."
          },
          "network": {
            "type": "string",
            "description": "The network the customer paid on.",
            "example": "base"
          },
          "token": {
            "type": "string",
            "description": "The token the customer paid with.",
            "example": "USDC"
          },
          "address": {
            "type": "string",
            "description": "The deposit address the payment was sent to."
          },
          "sender": {
            "type": "string",
            "description": "The address the payment came from. Empty if not known."
          },
          "settlement": {
            "type": "string",
            "description": "The network your USDC was settled on.",
            "example": "base"
          },
          "recipient": {
            "type": "string",
            "description": "The address that received your USDC."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "completed",
              "refunded",
              "failed"
            ],
            "description": "`pending`: the payment was detected and is being processed. `completed`: the USDC reached your wallet. `refunded`: the payment could not be processed and was returned to the sender. `failed`: the payment could not be processed."
          },
          "amount": {
            "type": "string",
            "description": "What the customer sent, in the token's smallest unit.",
            "example": "25000000"
          },
          "value": {
            "type": "string",
            "description": "What the customer sent, in US dollars. A decimal number sent as a string."
          },
          "settled": {
            "type": "string",
            "description": "The USDC that reached your wallet. `0` until the payment is completed. A decimal number sent as a string."
          },
          "fee": {
            "type": "string",
            "description": "The CoinStack fee taken from this payment, in US dollars. A decimal number sent as a string."
          },
          "cost": {
            "type": "string",
            "description": "The network cost of this payment, in US dollars. A decimal number sent as a string."
          },
          "share": {
            "type": "string",
            "description": "How much of the checkout this payment covered. `1` is the full amount and `0.5` is half. A decimal number sent as a string."
          },
          "deposit_tx_hash": {
            "type": "string",
            "description": "The transaction the customer sent. Empty if not known yet."
          },
          "fill_tx_hash": {
            "type": "string",
            "description": "The transaction that delivered the USDC to your wallet. Empty until the payment is completed."
          },
          "fail_reason": {
            "type": "string",
            "description": "Why a `failed` or `refunded` payment did not go through. Empty otherwise."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the payment was first detected. Time in RFC 3339 format, in UTC."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the payment last changed. Time in RFC 3339 format, in UTC."
          },
          "settled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the USDC reached your wallet. `null` until then. Time in RFC 3339 format, in UTC."
          }
        },
        "example": {
          "checkout_id": "8f3b2c1e-5d47-4a9b-b6e0-2c7f1a9d4e53",
          "quote_id": "0x5c1d9a7e3b6f48021e9d7c4a5b3f6e8d1a2c4b6e8f0a1c3e5d7f9b2a4c6e8d0f",
          "payment_id": "0x5c1d9a7e3b6f48021e9d7c4a5b3f6e8d1a2c4b6e8f0a1c3e5d7f9b2a4c6e8d0f",
          "network": "base",
          "token": "USDC",
          "address": "0x7a3e9c5d1b4f8026e9a1c3d5b7f9e2a4c6d8b0f1",
          "sender": "0x2b9d4f6a8c1e3057b9d2f4a6c8e0b1d3f5a7c9e2",
          "settlement": "base",
          "recipient": "0x91C4e7B2a6D83f05E2b7A9c4D6f8E1a3B5c7D9F0",
          "status": "completed",
          "amount": "25000000",
          "value": "24.99375000",
          "settled": "24.77643200",
          "fee": "0.19995000",
          "cost": "0.01736800",
          "share": "1.000000000000000000",
          "deposit_tx_hash": "0x3e7a1c9d5b2f4e6a8c0d1b3f5a7e9c2d4b6f8a0c1e3d5b7f9a2c4e6d8b0f1a3c",
          "fill_tx_hash": "0x9b2d4f6a8c0e1b3d5f7a9c2e4b6d8f0a1c3e5b7d9f2a4c6e8b0d1f3a5c7e9b2d",
          "fail_reason": "",
          "created_at": "2026-12-02T16:23:58.774310Z",
          "updated_at": "2026-12-02T16:24:37.889456Z",
          "settled_at": "2026-12-02T16:24:37.889456Z"
        }
      },
      "Token": {
        "type": "object",
        "description": "A token on a network that customers can pay with.",
        "required": [
          "network",
          "token",
          "chain_id",
          "contract",
          "decimals",
          "price",
          "cost",
          "minimum",
          "stable",
          "active",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "network": {
            "type": "string",
            "description": "The network identifier.",
            "example": "base"
          },
          "token": {
            "type": "string",
            "description": "The token symbol.",
            "example": "USDC"
          },
          "chain_id": {
            "type": "integer",
            "description": "The network's chain ID. For networks that are not EVM networks, this is CoinStack's own identifier."
          },
          "contract": {
            "type": "string",
            "description": "The token's contract address. For a network's native token this is a placeholder address."
          },
          "decimals": {
            "type": "integer",
            "description": "How many decimal places the token has."
          },
          "price": {
            "type": "string",
            "description": "The current price of one token in US dollars. A decimal number sent as a string."
          },
          "cost": {
            "type": "string",
            "description": "The estimated network cost of moving a payment in this token to your wallet, in US dollars. A decimal number sent as a string."
          },
          "minimum": {
            "type": "string",
            "description": "The smallest checkout value, in US dollars, that can be paid with this token. A decimal number sent as a string."
          },
          "stable": {
            "type": "boolean",
            "description": "`true` for stablecoins."
          },
          "active": {
            "type": "boolean",
            "description": "`true` while the token can be used."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the token was added. Time in RFC 3339 format, in UTC."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the price was last updated. Time in RFC 3339 format, in UTC."
          }
        },
        "example": {
          "network": "base",
          "token": "USDC",
          "chain_id": 8453,
          "contract": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
          "decimals": 6,
          "price": "0.99975000",
          "cost": "0.02356800",
          "minimum": "1.00000000",
          "stable": true,
          "active": true,
          "created_at": "2026-11-17T03:12:44.190233Z",
          "updated_at": "2026-12-02T16:19:48.557120Z"
        }
      },
      "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"
        }
      },
      "EventKind": {
        "type": "string",
        "enum": [
          "checkout.confirming",
          "checkout.partial",
          "checkout.completed",
          "checkout.expired",
          "checkout.resolved",
          "payment.pending",
          "payment.completed",
          "payment.refunded"
        ]
      },
      "Event": {
        "type": "object",
        "description": "A change to a checkout or payment. This is also the body of every webhook request.",
        "required": [
          "event_id",
          "kind",
          "data",
          "created_at"
        ],
        "properties": {
          "event_id": {
            "type": "string",
            "format": "uuid",
            "description": "The event ID. It stays the same across retries and resends."
          },
          "kind": {
            "$ref": "#/components/schemas/EventKind"
          },
          "data": {
            "type": "object",
            "description": "Holds `checkout` for `checkout.*` events and `payment` for `payment.*` events, as it was when the event happened.",
            "properties": {
              "checkout": {
                "$ref": "#/components/schemas/Checkout"
              },
              "payment": {
                "$ref": "#/components/schemas/Payment"
              }
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the event happened. Time in RFC 3339 format, in UTC."
          }
        },
        "example": {
          "event_id": "e41b7c92-3a5d-4f8e-b1c6-9d2a7f4e0b85",
          "kind": "checkout.completed",
          "data": {
            "checkout": {
              "checkout_id": "8f3b2c1e-5d47-4a9b-b6e0-2c7f1a9d4e53",
              "quote_id": "0x5c1d9a7e3b6f48021e9d7c4a5b3f6e8d1a2c4b6e8f0a1c3e5d7f9b2a4c6e8d0f",
              "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": "completed",
              "amount": "25.00000000",
              "value": "25.00000000",
              "received": "24.77643200",
              "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:24:37.905218Z",
              "expires_at": "2026-12-03T16:20:11.482501Z",
              "completed_at": "2026-12-02T16:24:37.905218Z",
              "url": "https://coinstack.net/checkout/8f3b2c1e-5d47-4a9b-b6e0-2c7f1a9d4e53"
            }
          },
          "created_at": "2026-12-02T16:24:37.905218Z"
        }
      },
      "Delivery": {
        "type": "object",
        "description": "The record of sending one event to one webhook.",
        "required": [
          "webhook_id",
          "event_id",
          "delivery_id",
          "code",
          "attempts",
          "delivered",
          "created_at",
          "updated_at",
          "next_at",
          "delivered_at"
        ],
        "properties": {
          "webhook_id": {
            "type": "string",
            "format": "uuid",
            "description": "The webhook the event was sent to."
          },
          "event_id": {
            "type": "string",
            "format": "uuid",
            "description": "The event that was sent."
          },
          "delivery_id": {
            "type": "integer",
            "description": "The delivery ID."
          },
          "code": {
            "type": "integer",
            "description": "The HTTP status your server returned on the latest attempt. `0` if there was no response or no attempt yet."
          },
          "attempts": {
            "type": "integer",
            "description": "How many times CoinStack has tried to deliver the event."
          },
          "delivered": {
            "type": "boolean",
            "description": "`true` once your server answered with a 2xx status."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the delivery was created. Time in RFC 3339 format, in UTC."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the delivery last changed. Time in RFC 3339 format, in UTC."
          },
          "next_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the next attempt is due. `null` once the event is delivered or CoinStack has stopped trying. Time in RFC 3339 format, in UTC."
          },
          "delivered_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the event was delivered. `null` until then. Time in RFC 3339 format, in UTC."
          }
        },
        "example": {
          "webhook_id": "c2a9f1d4-7b3e-4c6a-9d2f-5e8b1a4c7d30",
          "event_id": "e41b7c92-3a5d-4f8e-b1c6-9d2a7f4e0b85",
          "delivery_id": 4127,
          "code": 200,
          "attempts": 1,
          "delivered": true,
          "created_at": "2026-12-02T16:24:37.905218Z",
          "updated_at": "2026-12-02T16:24:38.214077Z",
          "next_at": null,
          "delivered_at": "2026-12-02T16:24:38.214077Z"
        }
      }
    }
  }
}
