{
  "openapi": "3.1.0",
  "info": {
    "title": "Zaprite API",
    "description": "Build checkout and order flows on Zaprite with a single API for Orders, Contacts, and Webhooks.\n\n> The Zaprite API is designed for hosted checkout flows: create an order, send your customer to `checkoutUrl`, and use webhook events to keep your own product in sync.\n\nUsing TypeScript? Start with our [official JS SDK](https://www.npmjs.com/package/@zaprite/api) for typed request helpers and a faster integration.\n\n## Start Here\n\n1. Generate an API key in your [Zaprite API settings](https://app.zaprite.com/org/default/settings/api)\n2. Send it as a Bearer token in the `Authorization` header\n3. Create an order with pricing, customer, and redirect details\n4. Redirect your customer to the returned `checkoutUrl`. Use it exactly as returned: never build a checkout URL from the order id. It carries the access token that opens the order, and its format may change. A URL built from the order id will soon stop opening 3 months after the order was created.\n5. Subscribe to webhook events so your system stays updated after payment\n\n## Base URL\n\nAll public API endpoints are served from:\n\n```text\nhttps://api.zaprite.com\n```\n\nResource paths are versioned under `/v1`, such as `/v1/orders` and `/v1/webhooks`.\n\n## Authentication\n\nAuthenticated endpoints expect a Bearer token in the `Authorization` header. Each API key is scoped to a single Zaprite organization, so requests automatically operate on that organization's data.\n\nAn API key has one of three access levels:\n\n- **Full access** can call every endpoint, including endpoints added later.\n- **Read only** can call every `GET` endpoint.\n- **Custom** can call only the endpoints of the scopes chosen for the key, such as `orders.read` or `contacts.create`. Each endpoint shows the scopes it accepts.\n\nOrders, contacts, payment links and tickets have two read scopes. The `.read` scope (for example `orders.read`) allows the list and the get by ID. The `.get` scope (for example `orders.get`) allows the get by ID only: a key with it cannot call the list endpoint. In your API settings, the List checkbox grants `.read` and the Get by ID checkbox grants `.get`. `GET /orders/{id}` also matches your own `externalUniqId`, so an `orders.get` key can read each order whose external ID it can guess.\n\nA request with a key that does not have the required scope gets a `403` response that names the missing scope. A key can also have an expiration date. After that date, requests get a `401` response with the message `API key expired`. You can change a key's access in your API settings, and add an expiration date to a key that has none. An expiration date cannot change once set: create a new key instead.\n\n```http\nAuthorization: Bearer YOUR_ZAPRITE_API_KEY\n```\n\nYou can create, rotate, and revoke keys in your [Zaprite API settings](https://app.zaprite.com/org/default/settings/api).\n\n## Errors\n\nZaprite uses standard HTTP status codes and returns a consistent error envelope:\n\n```json\n{\n  \"code\": \"BAD_REQUEST\",\n  \"message\": \"Invalid input data\",\n  \"issues\": [\n    {\n      \"message\": \"Expected string, received number\"\n    }\n  ]\n}\n```\n\nThe `code` field is the machine-readable error code, the `message` field is the human-readable summary, and the optional `issues` array is most useful for validation failures where a request field is malformed or missing.\n\nAny endpoint can return these errors:\n\n- **400 `BAD_REQUEST`.** The request is invalid, most often a missing or malformed field listed in `issues`. Fix the request, because sending it again unchanged returns the same error.\n- **401 `UNAUTHORIZED`.** The API key is missing, invalid, expired or suspended, or the organization is suspended or has no access to this endpoint. `message` says which. Check the key in your API settings or create a new one. For a suspension, contact support.\n- **403 `FORBIDDEN`.** The API key does not have the scope this endpoint requires. `message` names it. Create a key with that scope.\n- **404 `NOT_FOUND`.** The resource does not exist in your organization. Check the id and the organization of the API key.\n- **429.** Too many requests from your IP address. The body is plain text, not JSON. Slow down and retry after a minute.\n- **500 `INTERNAL_SERVER_ERROR`.** Zaprite ran into an unexpected failure. Retry later. If it keeps failing, contact support.\n- **504.** The request took too long and was stopped. The body is not JSON. Retry later. On Pay Order the charge may still have gone through: handle it like the `try_again` advice.\n\nSome endpoints return other errors that depend on the state of a resource. Each of them lists these errors under Responses, with what the error means and what to do. Pay Order, for example, returns `PAYMENT_REQUIRED` (402) when the payment provider declines a charge and `PRECONDITION_FAILED` (412) when the outcome of a charge is unknown. Its errors also carry an `adviceCode` that says what to do next.\n\nWhen handling errors, log the HTTP status code, `code`, and `message`.\n\n## Pagination\n\nList endpoints return a consistent paginated envelope with up to 100 results per page. Use the `page` parameter to move through the collection and inspect the `meta` object to understand how many results remain.\n\n```json\n{\n  \"items\": [],\n  \"meta\": {\n    \"itemsCount\": 42,\n    \"pagesCount\": 1,\n    \"page\": 1,\n    \"perPage\": 100\n  }\n}\n```\n\n## Metadata\n\nOrders support custom metadata so you can attach your own internal identifiers or workflow context to a payment flow. Metadata is returned on create, retrieve, and list responses for orders, which makes it a good place to store reconciliation fields from your own system.\n\n## Testing and Sandbox\n\nUse a sandbox organization to test your integration without moving real money. Sandbox organizations let you validate order creation, checkout redirects, and webhook flows before you point production traffic at Zaprite.\n\nIf you need a safe starting point, follow our [sandbox testing guide](https://help.zaprite.com/en/articles/9875022-how-to-test-payments-for-an-api-integration).\n\n## Webhooks\n\nWebhooks let Zaprite notify your system when order activity changes. A common production flow is: create an order, redirect the customer to checkout, then rely on webhook deliveries to confirm downstream fulfillment or status updates in your own system.\n\nIf your endpoint returns a non-`200` response, Zaprite retries the delivery multiple times before abandoning it. Make sure your webhook handler is fast, logs failures clearly, and can safely process the same business event more than once.\n\n## Developer Resources\n\n- **OpenAPI JSON** - [View the raw OpenAPI document](https://api.zaprite.com/openapi.json) for code generation and tooling\n- **LLM Docs** - [Read the Markdown version of these docs](https://api.zaprite.com/llms.txt) for AI workflows and plain-text reference\n- **Official JS SDK** - [@zaprite/api](https://www.npmjs.com/package/@zaprite/api) for Node.js and browser integrations\n- **System Status** - [Check live service status and uptime](https://status.zaprite.com) for the Zaprite API and dashboard\n- **Support** - Questions about the API? [Contact us](https://help.zaprite.com/)",
    "version": "1.0",
    "x-logo": {
      "url": "https://app.zaprite.com/zaprite.png",
      "altText": "Zaprite",
      "href": "https://zaprite.com"
    }
  },
  "servers": [
    {
      "url": "https://api.zaprite.com"
    }
  ],
  "tags": [
    {
      "name": "Contacts",
      "description": "Create and manage customer contact records for use across your Zaprite workflows."
    },
    {
      "name": "Orders",
      "description": "Create payment-ready orders, redirect customers to Zaprite Checkout, and retrieve or update order state."
    },
    {
      "name": "Payment Links",
      "description": "Retrieve the payment links configured on your organization, including their items (products, ticket types...)."
    },
    {
      "name": "Tickets"
    },
    {
      "name": "Webhooks",
      "description": "Zaprite can send requests to your own server to notify you about events on your Zaprite organization. To receive those requests, add a webhook on your [Organization settings](https://app.zaprite.com/org/default/settings/api)."
    }
  ],
  "paths": {
    "/v1/orders": {
      "post": {
        "operationId": "order-create",
        "summary": "Create Order",
        "description": "Create a Zaprite Order. You can then send your customer to `checkoutUrl` to pay that Order. Note that Orders are not visible on your Zaprite dashboard until they have received a payment.<br/>💡 To test your integration, you can create <a href=\"https://help.zaprite.com/en/articles/9875022-how-to-test-payments-for-an-api-integration\">Zaprite sandbox Organizations</a> that let you complete Orders with no real payment.<br/><br/>You can also create an invoice along with the order by providing the `invoice` field with line items. In this case, the order amount will be calculated from the invoice line items.<br/><br/>To offer discount codes, provide `coupons`: the customer can then enter one of the codes on the checkout page. To apply a coupon at once, also provide `appliedCouponCode`. The applied coupon is returned in `promo`. You cannot change coupons after the Order is created.<br/><br/>Required API key scope: `orders.create`",
        "tags": [
          "Orders"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "amount": 100,
                "currency": "USD",
                "externalUniqId": "abc123",
                "redirectUrl": "https://example.com",
                "expiresAt": "2024-03-25T11:04:09.656Z",
                "countdownToExpiry": true,
                "label": "Label for the order",
                "metadata": {
                  "custom_id": "12345",
                  "customer_reference": "ABC123"
                },
                "coupons": [
                  {
                    "code": "SAVE10",
                    "rateBipsOff": 1000,
                    "label": "10% Off"
                  },
                  {
                    "code": "VIP25",
                    "rateBipsOff": 2500,
                    "validUntil": "2099-12-31T23:59:59.000Z"
                  }
                ],
                "appliedCouponCode": "SAVE10"
              },
              "schema": {
                "type": "object",
                "properties": {
                  "amount": {
                    "description": "Amount denominated in currency smallest unit (e.g., cents for USD, satoshis for BTC). Example: `100` for $1.00 USD. Optional only if invoice is provided, in which case the amount will be calculated from invoice line items and amount will be ignored if provided.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "currency": {
                    "type": "string",
                    "enum": [
                      "USD",
                      "USDC",
                      "USDT",
                      "BTC",
                      "LBTC",
                      "ALL",
                      "DZD",
                      "ARS",
                      "AMD",
                      "AUD",
                      "AZN",
                      "BHD",
                      "BDT",
                      "BYN",
                      "BMD",
                      "BOB",
                      "BAM",
                      "BRL",
                      "BGN",
                      "KHR",
                      "CAD",
                      "CLP",
                      "CNY",
                      "COP",
                      "CRC",
                      "HRK",
                      "CUP",
                      "CZK",
                      "DKK",
                      "DOP",
                      "EGP",
                      "EUR",
                      "GEL",
                      "GHS",
                      "GTQ",
                      "HNL",
                      "HKD",
                      "HUF",
                      "ISK",
                      "INR",
                      "IDR",
                      "IRR",
                      "IQD",
                      "ILS",
                      "JMD",
                      "JPY",
                      "JOD",
                      "KZT",
                      "KES",
                      "KWD",
                      "KGS",
                      "LBP",
                      "MKD",
                      "MYR",
                      "MUR",
                      "MXN",
                      "MDL",
                      "MNT",
                      "MAD",
                      "MMK",
                      "NAD",
                      "NPR",
                      "TWD",
                      "NZD",
                      "NIO",
                      "NGN",
                      "NOK",
                      "OMR",
                      "PKR",
                      "PAB",
                      "PEN",
                      "PHP",
                      "PLN",
                      "GBP",
                      "QAR",
                      "RON",
                      "RUB",
                      "SAR",
                      "RSD",
                      "SGD",
                      "ZAR",
                      "KRW",
                      "SSP",
                      "VES",
                      "LKR",
                      "SEK",
                      "CHF",
                      "THB",
                      "TTD",
                      "TND",
                      "TRY",
                      "UGX",
                      "UAH",
                      "AED",
                      "UYU",
                      "UZS",
                      "VND"
                    ]
                  },
                  "externalUniqId": {
                    "description": "Optionally, you can store your own unique ID for this order. This can be useful for reconciling payments with your own systems.",
                    "type": "string"
                  },
                  "redirectUrl": {
                    "description": "Redirect your customer to this URL after they have paid for the order.",
                    "type": "string"
                  },
                  "redirectIfPending": {
                    "description": "If true, the customer will be redirected to `redirectUrl` even if the order is still pending (ie. Bitcoin transaction is unconfirmed).",
                    "type": "boolean"
                  },
                  "expiresAt": {
                    "description": "ISO 8601 datetime when this order expires. After this time, an order with no payment yet cannot be paid. An order that already received a payment (for example partly paid) stays payable for the rest, and payments already in progress are still processed.",
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                  },
                  "countdownToExpiry": {
                    "description": "If true and `expiresAt` is set, every checkout page shows a countdown to `expiresAt` during its last 60 minutes, like a checkout session, and the countdown of each payment quote is hidden. When the countdown ends, the checkout shows that the order expired, with a link back to `redirectUrl` if it is set. Use it to hold stock for a limited time on your platform. Defaults to false.",
                    "type": "boolean"
                  },
                  "label": {
                    "description": "Will be shown on the checkout page and in Bitcoin on-chain transaction labels.",
                    "type": "string"
                  },
                  "customCheckoutId": {
                    "description": "If you want a custom checkout for specific orders, you can configure a new checkout at https://app.zaprite.com/org/default/settings/api",
                    "type": "string"
                  },
                  "contactId": {
                    "description": "Optionally, you can associate the Order with one of your Zaprite contacts.",
                    "type": "string"
                  },
                  "sendReceiptToCustomer": {
                    "default": true,
                    "description": "Whether to send a receipt email to the customer after successful payment. Defaults to true.",
                    "type": "boolean"
                  },
                  "disablePaymentNotifs": {
                    "description": "Whether to disable payment notifications to organization admins after successful payment. Defaults to false.",
                    "type": "boolean"
                  },
                  "customerData": {
                    "type": "object",
                    "properties": {
                      "email": {
                        "description": "If set, a payment receipt will be sent to this email upon payment.",
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    }
                  },
                  "metadata": {
                    "description": "Custom metadata for this order. Limited to 50 key-value pairs. Keys must be strings with a maximum length of 255 characters. Values must be strings with a maximum length of 1000 characters.",
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "additionalProperties": {
                      "type": "string",
                      "maxLength": 1000
                    }
                  },
                  "tags": {
                    "description": "Add arbitrary tags to easily group and filter Orders in your reports. You can add up to 10 tags, each with a maximum length of 32 characters.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 32
                    }
                  },
                  "invoice": {
                    "description": "Optional invoice data. If provided, an invoice will be created for this order, and the order amount will be calculated from invoice line items. You must provide a `contactId` when creating an invoice.",
                    "type": "object",
                    "properties": {
                      "title": {
                        "description": "Optional title for the invoice",
                        "type": "string",
                        "maxLength": 255
                      },
                      "number": {
                        "description": "Optional invoice number. If not provided, one will be generated",
                        "type": "string",
                        "maxLength": 255
                      },
                      "date": {
                        "description": "Invoice date in YYYY-MM-DD format. Defaults to current date",
                        "type": "string",
                        "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                      },
                      "daysToPay": {
                        "description": "Number of days until payment is due. If not provided, the invoice will show \"DUE ON RECEIPT\"",
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 3650
                      },
                      "purchaseOrderNumber": {
                        "description": "Optional purchase order number",
                        "type": "string",
                        "maxLength": 255
                      },
                      "footerNote": {
                        "description": "Optional note to display at the bottom of the invoice",
                        "type": "string",
                        "maxLength": 1000
                      },
                      "lineItems": {
                        "minItems": 1,
                        "maxItems": 256,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 255,
                              "description": "Name of the line item"
                            },
                            "description": {
                              "description": "Optional description of the line item",
                              "type": "string",
                              "maxLength": 1000
                            },
                            "quantity": {
                              "description": "Quantity as a decimal number (e.g., 1.5 for one and a half units). Maximum of 2 decimal places allowed. Defaults to 1 if not provided.",
                              "type": "number",
                              "exclusiveMinimum": 0
                            },
                            "unitPrice": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991,
                              "description": "Price per unit in currency smallest unit (e.g., cents for USD, satoshis for BTC). Can be negative for credits or adjustments."
                            },
                            "taxRateBips": {
                              "description": "Tax rate in bips (e.g., 1000 = 10%)",
                              "default": 0,
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 10000
                            },
                            "discountRateBips": {
                              "description": "Discount rate in bips (e.g., 1000 = 10%)",
                              "default": 0,
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 10000
                            },
                            "discountAmount": {
                              "description": "Fixed discount amount in currency smallest unit (e.g., cents for USD, satoshis for BTC)",
                              "default": 0,
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "name",
                            "unitPrice"
                          ]
                        },
                        "description": "Line items for the invoice"
                      },
                      "discount": {
                        "description": "Optional discount on the whole invoice: a rate or a fixed amount, not both. It applies after the line item discounts and before tax, and cannot exceed the subtotal after line item discounts. Requires the invoice discount feature for your organization.",
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "rateBips": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 10000,
                                "description": "Discount rate in bips (e.g., 1000 = 10%)"
                              }
                            },
                            "required": [
                              "rateBips"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "amount": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991,
                                "description": "Fixed discount amount in currency smallest unit (e.g., cents for USD, satoshis for BTC)"
                              }
                            },
                            "required": [
                              "amount"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      },
                      "discountLabel": {
                        "description": "Optional label shown in the invoice totals instead of \"Invoice discount\"",
                        "type": "string",
                        "maxLength": 255
                      }
                    },
                    "required": [
                      "lineItems"
                    ]
                  },
                  "allowSavePaymentProfile": {
                    "description": "If true and the selected payment method supports autopay, then the customer will be able to save their payment profile for future payments.",
                    "type": "boolean"
                  },
                  "customerFields": {
                    "description": "Configure fields displayed on checkout page to collect customer information. Collected information will be stored in the `Order.customerData` field.",
                    "type": "object",
                    "properties": {
                      "email": {
                        "type": "string",
                        "enum": [
                          "REQUIRED",
                          "OPTIONAL"
                        ],
                        "description": "Collect the customer email"
                      },
                      "name": {
                        "type": "string",
                        "enum": [
                          "REQUIRED",
                          "OPTIONAL"
                        ],
                        "description": "Collect the customer name"
                      },
                      "address": {
                        "type": "string",
                        "enum": [
                          "REQUIRED",
                          "OPTIONAL"
                        ],
                        "description": "Collect the customer full postal address"
                      },
                      "phone": {
                        "type": "string",
                        "enum": [
                          "REQUIRED",
                          "OPTIONAL"
                        ],
                        "description": "Collect the customer phone number"
                      },
                      "company": {
                        "type": "string",
                        "enum": [
                          "REQUIRED",
                          "OPTIONAL"
                        ],
                        "description": "Collect the customer company"
                      },
                      "note": {
                        "type": "string",
                        "enum": [
                          "REQUIRED",
                          "OPTIONAL"
                        ],
                        "description": "Let the customer add a free-text note"
                      }
                    }
                  },
                  "coupons": {
                    "maxItems": 16,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9]{3,24}$",
                          "description": "Code that the customer enters at checkout. 3 to 24 characters, letters A-Z and digits 0-9 only. Matching is not case-sensitive: the code is stored in capital letters."
                        },
                        "rateBipsOff": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 10000,
                          "description": "Percentage discount in bips (e.g. 1000 for 10%). From 1 to 10000 (100%). Applied to the order amount before taxes."
                        },
                        "label": {
                          "description": "Display label for the coupon at checkout.",
                          "type": "string",
                          "maxLength": 255
                        },
                        "validUntil": {
                          "description": "ISO 8601 datetime after which the customer can no longer apply this coupon. A coupon that is already applied stays applied. Omit for no end date.",
                          "format": "datetime string",
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "rateBipsOff"
                      ]
                    },
                    "description": "Coupons that the customer can apply on the checkout page of this Order. Up to 16 coupons. The customer can apply one coupon at a time. You can set coupons only when you create the Order. Not allowed with `invoice`: invoice line items have their own discounts."
                  },
                  "appliedCouponCode": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9]{3,24}$",
                    "description": "Code of one of the `coupons` to apply to the Order now. The checkout then shows the discount, and the customer can remove it or apply another coupon. The coupon must not be past its `validUntil`."
                  }
                },
                "required": [
                  "currency"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "example": {
                  "id": "od_abc123",
                  "orgId": "abc123",
                  "orderType": "other",
                  "totalAmount": 100,
                  "currency": "USD",
                  "externalUniqId": "abc123",
                  "status": "PROCESSING",
                  "paidAt": "2024-02-25T11:04:09.656Z",
                  "expiresAt": "2024-03-25T11:04:09.656Z",
                  "countdownToExpiry": true,
                  "redirectUrl": "https://your-url.com",
                  "label": "Order label",
                  "checkoutUrl": "https://pay.zaprite.com/order/od_abc123#access=Xk2fQ9pLmT4wZa",
                  "receiptPdfUrl": null,
                  "customCheckoutId": null,
                  "eventTickets": [
                    {
                      "id": "et_123",
                      "paymentLinkItem": {
                        "id": "pi_123",
                        "title": "VIP Ticket"
                      }
                    }
                  ],
                  "orderItems": [
                    {
                      "id": "oi_123",
                      "label": "VIP Ticket",
                      "quantity": 1,
                      "paymentLinkItem": {
                        "id": "pi_123",
                        "title": "VIP Ticket"
                      }
                    }
                  ],
                  "invoice": null,
                  "contact": null,
                  "transactions": [
                    {
                      "amount": 1400,
                      "currency": "BTC",
                      "amountInOrderCurrency": 100,
                      "discountsInOrderCurrency": [],
                      "orderCurrency": "USD",
                      "amountInAccountingCurrency": 100,
                      "accountingCurrency": "USD",
                      "method": "BITCOIN",
                      "status": "PENDING",
                      "date": "2024-02-25T11:04:09.656Z",
                      "externalRef": "b340b455d25ae2379e3a22328c96421a8f5a4483848e01f14eee0abae89daabc"
                    }
                  ],
                  "paymentLink": null,
                  "customerData": {
                    "email": "example@email.com",
                    "name": "John Doe",
                    "phone": "1234567890",
                    "address": null,
                    "note": "Example customer note",
                    "company": "Example company"
                  },
                  "metadata": {
                    "custom_id": "12345",
                    "customer_reference": "ABC123"
                  },
                  "tags": [
                    "tag1",
                    "tag2"
                  ],
                  "allowSavePaymentProfile": false,
                  "customerFields": {
                    "address": "OPTIONAL",
                    "email": "REQUIRED",
                    "name": "OPTIONAL"
                  },
                  "promo": {
                    "code": "SAVE10",
                    "amountOff": 0,
                    "rateBipsOff": 1000,
                    "label": "10% Off"
                  },
                  "coupons": [
                    {
                      "code": "SAVE10",
                      "rateBipsOff": 1000,
                      "label": "10% Off",
                      "validUntil": null
                    },
                    {
                      "code": "VIP25",
                      "rateBipsOff": 2500,
                      "label": null,
                      "validUntil": "2099-12-31T23:59:59.000Z"
                    }
                  ],
                  "customerPiiClearedAt": null
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "orgId": {
                      "type": "string",
                      "description": "Id of the Zaprite organization that created this order"
                    },
                    "orderType": {
                      "type": "string",
                      "enum": [
                        "invoice",
                        "apiInvoice",
                        "paymentLink",
                        "pos",
                        "event",
                        "wooCommerce",
                        "paymentRequest",
                        "apiOrder",
                        "other"
                      ]
                    },
                    "totalAmount": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991,
                      "description": "Total amount to be paid by the customer in currency smallest unit (e.g. cents or sats)"
                    },
                    "currency": {
                      "type": "string",
                      "enum": [
                        "USD",
                        "USDC",
                        "USDT",
                        "BTC",
                        "LBTC",
                        "ALL",
                        "DZD",
                        "ARS",
                        "AMD",
                        "AUD",
                        "AZN",
                        "BHD",
                        "BDT",
                        "BYN",
                        "BMD",
                        "BOB",
                        "BAM",
                        "BRL",
                        "BGN",
                        "KHR",
                        "CAD",
                        "CLP",
                        "CNY",
                        "COP",
                        "CRC",
                        "HRK",
                        "CUP",
                        "CZK",
                        "DKK",
                        "DOP",
                        "EGP",
                        "EUR",
                        "GEL",
                        "GHS",
                        "GTQ",
                        "HNL",
                        "HKD",
                        "HUF",
                        "ISK",
                        "INR",
                        "IDR",
                        "IRR",
                        "IQD",
                        "ILS",
                        "JMD",
                        "JPY",
                        "JOD",
                        "KZT",
                        "KES",
                        "KWD",
                        "KGS",
                        "LBP",
                        "MKD",
                        "MYR",
                        "MUR",
                        "MXN",
                        "MDL",
                        "MNT",
                        "MAD",
                        "MMK",
                        "NAD",
                        "NPR",
                        "TWD",
                        "NZD",
                        "NIO",
                        "NGN",
                        "NOK",
                        "OMR",
                        "PKR",
                        "PAB",
                        "PEN",
                        "PHP",
                        "PLN",
                        "GBP",
                        "QAR",
                        "RON",
                        "RUB",
                        "SAR",
                        "RSD",
                        "SGD",
                        "ZAR",
                        "KRW",
                        "SSP",
                        "VES",
                        "LKR",
                        "SEK",
                        "CHF",
                        "THB",
                        "TTD",
                        "TND",
                        "TRY",
                        "UGX",
                        "UAH",
                        "AED",
                        "UYU",
                        "UZS",
                        "VND"
                      ]
                    },
                    "externalUniqId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "PENDING",
                        "PROCESSING",
                        "PAID",
                        "OVERPAID",
                        "UNDERPAID",
                        "COMPLETE"
                      ],
                      "description": "`PENDING`: The order is pending payment</br>`PROCESSING`: The order received a payment but the transaction is still pending (ie. an on-chain transaction with 0 conf or manual bank transfer awaiting manual confirmation)</br>`PAID`: The order was paid but it requires manual fulfillment to be flagged as `COMPLETE`</br>`COMPLETE`: The order was paid and is complete</br>`OVERPAID`: The order received a payment that was more than the total amount</br>`UNDERPAID`: The order received a payment that was less than the total amount"
                    },
                    "paidAt": {
                      "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\"). `null` until the order is paid.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "expiresAt": {
                      "description": "Date in ISO 8601 format when this order expires. After this time, an order with no payment yet cannot be paid; a partly paid order can still be paid in full.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "countdownToExpiry": {
                      "type": "boolean",
                      "description": "If true and `expiresAt` is set, the checkout shows a countdown to `expiresAt` during its last 60 minutes."
                    },
                    "redirectUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "label": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "checkoutUrl": {
                      "type": "string",
                      "format": "uri",
                      "description": "Send your customer to this URL to complete the payment. It carries the order’s access token: use it as returned, do not build it from the order id."
                    },
                    "receiptPdfUrl": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uri"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "URL to download the Order receipt PDF, with the order’s access token. `null` until the order is paid."
                    },
                    "customCheckoutId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "contact": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "legalName": {
                              "type": "string"
                            },
                            "contactName": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "displayName": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "email": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "email",
                                  "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "taxId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "defaultCurrency": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "enum": [
                                    "USD",
                                    "USDC",
                                    "USDT",
                                    "BTC",
                                    "LBTC",
                                    "ALL",
                                    "DZD",
                                    "ARS",
                                    "AMD",
                                    "AUD",
                                    "AZN",
                                    "BHD",
                                    "BDT",
                                    "BYN",
                                    "BMD",
                                    "BOB",
                                    "BAM",
                                    "BRL",
                                    "BGN",
                                    "KHR",
                                    "CAD",
                                    "CLP",
                                    "CNY",
                                    "COP",
                                    "CRC",
                                    "HRK",
                                    "CUP",
                                    "CZK",
                                    "DKK",
                                    "DOP",
                                    "EGP",
                                    "EUR",
                                    "GEL",
                                    "GHS",
                                    "GTQ",
                                    "HNL",
                                    "HKD",
                                    "HUF",
                                    "ISK",
                                    "INR",
                                    "IDR",
                                    "IRR",
                                    "IQD",
                                    "ILS",
                                    "JMD",
                                    "JPY",
                                    "JOD",
                                    "KZT",
                                    "KES",
                                    "KWD",
                                    "KGS",
                                    "LBP",
                                    "MKD",
                                    "MYR",
                                    "MUR",
                                    "MXN",
                                    "MDL",
                                    "MNT",
                                    "MAD",
                                    "MMK",
                                    "NAD",
                                    "NPR",
                                    "TWD",
                                    "NZD",
                                    "NIO",
                                    "NGN",
                                    "NOK",
                                    "OMR",
                                    "PKR",
                                    "PAB",
                                    "PEN",
                                    "PHP",
                                    "PLN",
                                    "GBP",
                                    "QAR",
                                    "RON",
                                    "RUB",
                                    "SAR",
                                    "RSD",
                                    "SGD",
                                    "ZAR",
                                    "KRW",
                                    "SSP",
                                    "VES",
                                    "LKR",
                                    "SEK",
                                    "CHF",
                                    "THB",
                                    "TTD",
                                    "TND",
                                    "TRY",
                                    "UGX",
                                    "UAH",
                                    "AED",
                                    "UYU",
                                    "UZS",
                                    "VND"
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "billingAddress": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "line1": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "line2": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "zipCode": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "city": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "state": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "countryCode": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "line1",
                                    "line2",
                                    "zipCode",
                                    "city",
                                    "state",
                                    "countryCode"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "paymentProfiles": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "externalId": {
                                    "type": "string"
                                  },
                                  "method": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  },
                                  "expiresAt": {
                                    "anyOf": [
                                      {
                                        "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "connection": {
                                    "type": "object",
                                    "properties": {
                                      "label": {
                                        "type": "string"
                                      },
                                      "pluginSlug": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "label",
                                      "pluginSlug",
                                      "id"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "sourceOrder": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "externalUniqId": {
                                            "type": [
                                              "string",
                                              "null"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "externalUniqId"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ],
                                    "description": "The Order that your customer was paying when saving this payment profile."
                                  }
                                },
                                "required": [
                                  "id",
                                  "externalId",
                                  "method",
                                  "label",
                                  "expiresAt",
                                  "connection",
                                  "sourceOrder"
                                ],
                                "additionalProperties": false
                              },
                              "description": "Active saved Payment Profiles for this contact. Can be used to pay Orders with the `charge` endpoint."
                            }
                          },
                          "required": [
                            "id",
                            "legalName",
                            "contactName",
                            "displayName",
                            "email",
                            "taxId",
                            "defaultCurrency",
                            "billingAddress",
                            "paymentProfiles"
                          ],
                          "additionalProperties": false,
                          "description": "Optional Zaprite contact associated with this order"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "invoice": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "number": {
                              "type": "string",
                              "description": "Invoice number, displayed on the invoice page and PDF"
                            },
                            "title": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "orgId": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "DRAFT",
                                "SENT",
                                "OVERDUE",
                                "PAID",
                                "OVERPAID",
                                "UNDERPAID",
                                "VOID"
                              ]
                            },
                            "footerNote": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "daysToPay": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "description": "Natural days from invoice date before the invoice is overdue. If null, invoice will be shown as \"DUE ON RECEIPT\""
                            },
                            "date": {
                              "type": "string",
                              "description": "Date of the invoice, displayed on the invoice page and PDF. Format: YYYY-MM-DD"
                            },
                            "purchaseOrderNumber": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "hideOrgAddress": {
                              "type": "boolean",
                              "description": "Organization address is hidden on the public invoice"
                            },
                            "hideOrgEmail": {
                              "type": "boolean",
                              "description": "Organization email is hidden on the public invoice"
                            },
                            "hideOrgName": {
                              "type": "boolean",
                              "description": "Organization name is hidden on the public invoice"
                            },
                            "sentAt": {
                              "description": "Date when the invoice was sent to the customer",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "voidedAt": {
                              "description": "Date when the invoice was voided",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "publicUrl": {
                              "type": "string",
                              "format": "uri",
                              "description": "URL to view the public invoice page. It carries the invoice’s access token: use it as returned, do not build it from the invoice id."
                            },
                            "customer": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    },
                                    "legalName": {
                                      "type": "string"
                                    },
                                    "contactName": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "displayName": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "email": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "format": "email",
                                          "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "taxId": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "defaultCurrency": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "enum": [
                                            "USD",
                                            "USDC",
                                            "USDT",
                                            "BTC",
                                            "LBTC",
                                            "ALL",
                                            "DZD",
                                            "ARS",
                                            "AMD",
                                            "AUD",
                                            "AZN",
                                            "BHD",
                                            "BDT",
                                            "BYN",
                                            "BMD",
                                            "BOB",
                                            "BAM",
                                            "BRL",
                                            "BGN",
                                            "KHR",
                                            "CAD",
                                            "CLP",
                                            "CNY",
                                            "COP",
                                            "CRC",
                                            "HRK",
                                            "CUP",
                                            "CZK",
                                            "DKK",
                                            "DOP",
                                            "EGP",
                                            "EUR",
                                            "GEL",
                                            "GHS",
                                            "GTQ",
                                            "HNL",
                                            "HKD",
                                            "HUF",
                                            "ISK",
                                            "INR",
                                            "IDR",
                                            "IRR",
                                            "IQD",
                                            "ILS",
                                            "JMD",
                                            "JPY",
                                            "JOD",
                                            "KZT",
                                            "KES",
                                            "KWD",
                                            "KGS",
                                            "LBP",
                                            "MKD",
                                            "MYR",
                                            "MUR",
                                            "MXN",
                                            "MDL",
                                            "MNT",
                                            "MAD",
                                            "MMK",
                                            "NAD",
                                            "NPR",
                                            "TWD",
                                            "NZD",
                                            "NIO",
                                            "NGN",
                                            "NOK",
                                            "OMR",
                                            "PKR",
                                            "PAB",
                                            "PEN",
                                            "PHP",
                                            "PLN",
                                            "GBP",
                                            "QAR",
                                            "RON",
                                            "RUB",
                                            "SAR",
                                            "RSD",
                                            "SGD",
                                            "ZAR",
                                            "KRW",
                                            "SSP",
                                            "VES",
                                            "LKR",
                                            "SEK",
                                            "CHF",
                                            "THB",
                                            "TTD",
                                            "TND",
                                            "TRY",
                                            "UGX",
                                            "UAH",
                                            "AED",
                                            "UYU",
                                            "UZS",
                                            "VND"
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "billingAddress": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "line1": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "line2": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "zipCode": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "city": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "state": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "countryCode": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "line1",
                                            "line2",
                                            "zipCode",
                                            "city",
                                            "state",
                                            "countryCode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "paymentProfiles": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "externalId": {
                                            "type": "string"
                                          },
                                          "method": {
                                            "type": "string"
                                          },
                                          "label": {
                                            "type": "string"
                                          },
                                          "expiresAt": {
                                            "anyOf": [
                                              {
                                                "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                                                "type": "string"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "connection": {
                                            "type": "object",
                                            "properties": {
                                              "label": {
                                                "type": "string"
                                              },
                                              "pluginSlug": {
                                                "type": "string"
                                              },
                                              "id": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "label",
                                              "pluginSlug",
                                              "id"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "sourceOrder": {
                                            "anyOf": [
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string"
                                                  },
                                                  "externalUniqId": {
                                                    "type": [
                                                      "string",
                                                      "null"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "externalUniqId"
                                                ],
                                                "additionalProperties": false
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ],
                                            "description": "The Order that your customer was paying when saving this payment profile."
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "externalId",
                                          "method",
                                          "label",
                                          "expiresAt",
                                          "connection",
                                          "sourceOrder"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "description": "Active saved Payment Profiles for this contact. Can be used to pay Orders with the `charge` endpoint."
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "legalName",
                                    "contactName",
                                    "displayName",
                                    "email",
                                    "taxId",
                                    "defaultCurrency",
                                    "billingAddress",
                                    "paymentProfiles"
                                  ],
                                  "additionalProperties": false,
                                  "description": "**DEPRECATED:** Use `order.contact` instead"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "lineItems": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "unitPrice": {
                                    "description": "Price of the item in currency smallest unit (e.g. cents or sats)",
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  "quantity": {
                                    "type": "number",
                                    "description": "Quantity of units (Max 2 decimal places)"
                                  },
                                  "taxRateBips": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991,
                                    "description": "Tax rate in bips (e.g. 1234 for 12.34%)"
                                  },
                                  "taxAmount": {
                                    "description": "In currency smallest unit (e.g. cents or sats)",
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  "discountRateBips": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991,
                                    "description": "Discount rate in bips (e.g. 1234 for 12.34%)"
                                  },
                                  "discountAmount": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "id",
                                  "name",
                                  "description",
                                  "unitPrice",
                                  "quantity",
                                  "taxRateBips",
                                  "taxAmount",
                                  "discountRateBips",
                                  "discountAmount"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "discountRateBips": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991,
                              "description": "Discount on the whole invoice, in bips (e.g. 1000 for 10%). 0 if none"
                            },
                            "discountAmount": {
                              "description": "Fixed discount on the whole invoice, in currency smallest unit. 0 if none",
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "discountLabel": {
                              "description": "Label of the invoice discount in the totals",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "amounts": {
                              "type": "object",
                              "properties": {
                                "subtotal": {
                                  "type": "number"
                                },
                                "lineDiscounts": {
                                  "type": "number"
                                },
                                "invoiceDiscount": {
                                  "type": "number"
                                },
                                "tax": {
                                  "type": "number"
                                },
                                "total": {
                                  "type": "number"
                                }
                              },
                              "required": [
                                "subtotal",
                                "lineDiscounts",
                                "invoiceDiscount",
                                "tax",
                                "total"
                              ],
                              "additionalProperties": false,
                              "description": "Invoice totals in currency smallest unit: subtotal - lineDiscounts - invoiceDiscount + tax = total"
                            }
                          },
                          "required": [
                            "id",
                            "number",
                            "title",
                            "orgId",
                            "status",
                            "footerNote",
                            "daysToPay",
                            "date",
                            "purchaseOrderNumber",
                            "hideOrgAddress",
                            "hideOrgEmail",
                            "hideOrgName",
                            "sentAt",
                            "voidedAt",
                            "publicUrl",
                            "customer",
                            "lineItems",
                            "discountRateBips",
                            "discountAmount",
                            "discountLabel",
                            "amounts"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Set only if the order is for a Zaprite invoice (`orderType=\"invoice\"` or `\"apiInvoice\"`), `null` otherwise"
                    },
                    "paymentLink": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "title": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "title"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Set only if the order was created from a Payment Link (`orderType=\"paymentLink\"`), `null` otherwise"
                    },
                    "transactions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "date": {
                            "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                            "type": "string"
                          },
                          "amount": {
                            "description": "Transaction amount in currency smallest unit (e.g. cents or sats)",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "currency": {
                            "type": "string",
                            "enum": [
                              "USD",
                              "USDC",
                              "USDT",
                              "BTC",
                              "LBTC",
                              "ALL",
                              "DZD",
                              "ARS",
                              "AMD",
                              "AUD",
                              "AZN",
                              "BHD",
                              "BDT",
                              "BYN",
                              "BMD",
                              "BOB",
                              "BAM",
                              "BRL",
                              "BGN",
                              "KHR",
                              "CAD",
                              "CLP",
                              "CNY",
                              "COP",
                              "CRC",
                              "HRK",
                              "CUP",
                              "CZK",
                              "DKK",
                              "DOP",
                              "EGP",
                              "EUR",
                              "GEL",
                              "GHS",
                              "GTQ",
                              "HNL",
                              "HKD",
                              "HUF",
                              "ISK",
                              "INR",
                              "IDR",
                              "IRR",
                              "IQD",
                              "ILS",
                              "JMD",
                              "JPY",
                              "JOD",
                              "KZT",
                              "KES",
                              "KWD",
                              "KGS",
                              "LBP",
                              "MKD",
                              "MYR",
                              "MUR",
                              "MXN",
                              "MDL",
                              "MNT",
                              "MAD",
                              "MMK",
                              "NAD",
                              "NPR",
                              "TWD",
                              "NZD",
                              "NIO",
                              "NGN",
                              "NOK",
                              "OMR",
                              "PKR",
                              "PAB",
                              "PEN",
                              "PHP",
                              "PLN",
                              "GBP",
                              "QAR",
                              "RON",
                              "RUB",
                              "SAR",
                              "RSD",
                              "SGD",
                              "ZAR",
                              "KRW",
                              "SSP",
                              "VES",
                              "LKR",
                              "SEK",
                              "CHF",
                              "THB",
                              "TTD",
                              "TND",
                              "TRY",
                              "UGX",
                              "UAH",
                              "AED",
                              "UYU",
                              "UZS",
                              "VND"
                            ]
                          },
                          "amountInOrderCurrency": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Transaction amount denominated in the currency of the Order and in smallest unit (e.g. cents or sats)"
                          },
                          "discountsInOrderCurrency": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "amountOff": {
                                  "description": "Amount of the discount denominated in `orderCurrency` and in smallest unit (e.g cents or sats). Negative value means a premium was applied.",
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "rateBipsOff": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991,
                                  "description": "Rate of the discount in bips (e.g. 1234 for 12.34%). Negative value means a premium was applied."
                                },
                                "paymentType": {
                                  "type": "string",
                                  "enum": [
                                    "FIAT",
                                    "BITCOIN",
                                    "LIGHTNING",
                                    "STABLECOIN"
                                  ],
                                  "description": "Type of payments this discount applies to"
                                }
                              },
                              "required": [
                                "amountOff",
                                "rateBipsOff",
                                "paymentType"
                              ],
                              "additionalProperties": false
                            },
                            "description": "List premiums and discounts applied to this transaction. Note: The amount retained as payment for the Order is `amountInOrderCurrency + sum(discountsInChargeCurrency.amount)`"
                          },
                          "orderCurrency": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "USD",
                                  "USDC",
                                  "USDT",
                                  "BTC",
                                  "LBTC",
                                  "ALL",
                                  "DZD",
                                  "ARS",
                                  "AMD",
                                  "AUD",
                                  "AZN",
                                  "BHD",
                                  "BDT",
                                  "BYN",
                                  "BMD",
                                  "BOB",
                                  "BAM",
                                  "BRL",
                                  "BGN",
                                  "KHR",
                                  "CAD",
                                  "CLP",
                                  "CNY",
                                  "COP",
                                  "CRC",
                                  "HRK",
                                  "CUP",
                                  "CZK",
                                  "DKK",
                                  "DOP",
                                  "EGP",
                                  "EUR",
                                  "GEL",
                                  "GHS",
                                  "GTQ",
                                  "HNL",
                                  "HKD",
                                  "HUF",
                                  "ISK",
                                  "INR",
                                  "IDR",
                                  "IRR",
                                  "IQD",
                                  "ILS",
                                  "JMD",
                                  "JPY",
                                  "JOD",
                                  "KZT",
                                  "KES",
                                  "KWD",
                                  "KGS",
                                  "LBP",
                                  "MKD",
                                  "MYR",
                                  "MUR",
                                  "MXN",
                                  "MDL",
                                  "MNT",
                                  "MAD",
                                  "MMK",
                                  "NAD",
                                  "NPR",
                                  "TWD",
                                  "NZD",
                                  "NIO",
                                  "NGN",
                                  "NOK",
                                  "OMR",
                                  "PKR",
                                  "PAB",
                                  "PEN",
                                  "PHP",
                                  "PLN",
                                  "GBP",
                                  "QAR",
                                  "RON",
                                  "RUB",
                                  "SAR",
                                  "RSD",
                                  "SGD",
                                  "ZAR",
                                  "KRW",
                                  "SSP",
                                  "VES",
                                  "LKR",
                                  "SEK",
                                  "CHF",
                                  "THB",
                                  "TTD",
                                  "TND",
                                  "TRY",
                                  "UGX",
                                  "UAH",
                                  "AED",
                                  "UYU",
                                  "UZS",
                                  "VND"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Currency of the Order this transaction is paying for. For example, when paying an USD invoice in BTC, transaction `currency` would be USD and `orderCurrency` USD."
                          },
                          "accountingCurrency": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "USD",
                                  "USDC",
                                  "USDT",
                                  "BTC",
                                  "LBTC",
                                  "ALL",
                                  "DZD",
                                  "ARS",
                                  "AMD",
                                  "AUD",
                                  "AZN",
                                  "BHD",
                                  "BDT",
                                  "BYN",
                                  "BMD",
                                  "BOB",
                                  "BAM",
                                  "BRL",
                                  "BGN",
                                  "KHR",
                                  "CAD",
                                  "CLP",
                                  "CNY",
                                  "COP",
                                  "CRC",
                                  "HRK",
                                  "CUP",
                                  "CZK",
                                  "DKK",
                                  "DOP",
                                  "EGP",
                                  "EUR",
                                  "GEL",
                                  "GHS",
                                  "GTQ",
                                  "HNL",
                                  "HKD",
                                  "HUF",
                                  "ISK",
                                  "INR",
                                  "IDR",
                                  "IRR",
                                  "IQD",
                                  "ILS",
                                  "JMD",
                                  "JPY",
                                  "JOD",
                                  "KZT",
                                  "KES",
                                  "KWD",
                                  "KGS",
                                  "LBP",
                                  "MKD",
                                  "MYR",
                                  "MUR",
                                  "MXN",
                                  "MDL",
                                  "MNT",
                                  "MAD",
                                  "MMK",
                                  "NAD",
                                  "NPR",
                                  "TWD",
                                  "NZD",
                                  "NIO",
                                  "NGN",
                                  "NOK",
                                  "OMR",
                                  "PKR",
                                  "PAB",
                                  "PEN",
                                  "PHP",
                                  "PLN",
                                  "GBP",
                                  "QAR",
                                  "RON",
                                  "RUB",
                                  "SAR",
                                  "RSD",
                                  "SGD",
                                  "ZAR",
                                  "KRW",
                                  "SSP",
                                  "VES",
                                  "LKR",
                                  "SEK",
                                  "CHF",
                                  "THB",
                                  "TTD",
                                  "TND",
                                  "TRY",
                                  "UGX",
                                  "UAH",
                                  "AED",
                                  "UYU",
                                  "UZS",
                                  "VND"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "The is the currency configured for your Organization"
                          },
                          "amountInAccountingCurrency": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Transaction amount denominated in accounting currency and in smallest unit (e.g. cents or sats)"
                          },
                          "method": {
                            "type": "string",
                            "enum": [
                              "BITCOIN",
                              "LIQUID",
                              "LIGHTNING",
                              "BANK",
                              "CARD",
                              "CASH",
                              "CHECK",
                              "GIFTCARD",
                              "COUPON",
                              "APPLEPAY",
                              "GOOGLEPAY",
                              "CASHAPP_PAY",
                              "INTERAC",
                              "ACH",
                              "SEPA",
                              "UNKNOWN",
                              "WIRE_TRANSFER",
                              "VENMO",
                              "PAYPAL",
                              "REVOLUT_PAY",
                              "NO_CHARGE",
                              "TETHER",
                              "USDCIRCLE"
                            ]
                          },
                          "externalRef": {
                            "description": "External reference for the transaction. (e.g. Bitcoin txId, Stripe transaction ID...)",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "PENDING",
                              "CONFIRMED",
                              "CANCELED"
                            ]
                          }
                        },
                        "required": [
                          "date",
                          "amount",
                          "currency",
                          "amountInOrderCurrency",
                          "discountsInOrderCurrency",
                          "orderCurrency",
                          "accountingCurrency",
                          "amountInAccountingCurrency",
                          "method",
                          "externalRef",
                          "status"
                        ],
                        "additionalProperties": false
                      },
                      "description": "All transactions this Order received"
                    },
                    "customerData": {
                      "type": "object",
                      "properties": {
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "address": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "line1": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "line2": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "zipCode": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "city": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "state": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "countryCode": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "line1",
                                "line2",
                                "zipCode",
                                "city",
                                "state",
                                "countryCode"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "note": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "company": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "email",
                        "name",
                        "phone",
                        "address",
                        "note",
                        "company"
                      ],
                      "additionalProperties": {},
                      "description": "Customer data collected on payment links if you enabled customer fields. Custom field values are included as additional keys."
                    },
                    "customerFields": {
                      "type": "object",
                      "properties": {
                        "address": {
                          "type": "string",
                          "enum": [
                            "REQUIRED",
                            "OPTIONAL"
                          ]
                        },
                        "email": {
                          "type": "string",
                          "enum": [
                            "REQUIRED",
                            "OPTIONAL"
                          ]
                        },
                        "name": {
                          "type": "string",
                          "enum": [
                            "REQUIRED",
                            "OPTIONAL"
                          ]
                        },
                        "phone": {
                          "type": "string",
                          "enum": [
                            "REQUIRED",
                            "OPTIONAL"
                          ]
                        },
                        "note": {
                          "type": "string",
                          "enum": [
                            "REQUIRED",
                            "OPTIONAL"
                          ]
                        }
                      },
                      "additionalProperties": false,
                      "description": "Configuration for fields displayed on checkout page to collect customer data"
                    },
                    "metadata": {
                      "default": {},
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": "string"
                      },
                      "description": "Custom metadata for this order"
                    },
                    "tags": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Custom tags for this order"
                    },
                    "allowSavePaymentProfile": {
                      "default": false,
                      "type": "boolean",
                      "description": "If true and the selected payment method supports autopay, then the customer will be able to save their payment profile for future payments."
                    },
                    "eventTickets": {
                      "default": [],
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "paymentLinkItem": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "title": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "title"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "id",
                          "paymentLinkItem"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Event tickets issued for this order (empty if none)."
                    },
                    "orderItems": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "label": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "quantity": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "paymentLinkItem": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "title": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "title"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "label",
                          "quantity",
                          "paymentLinkItem"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Order items for this order. Empty if none."
                    },
                    "promo": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "code": {
                              "description": "Coupon code applied to this order",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "amountOff": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991,
                              "description": "Fixed amount discounted from the order total in currency smallest unit (e.g. cents or sats)"
                            },
                            "rateBipsOff": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991,
                              "description": "Percentage discount rate in bips (e.g. 1000 for 10%). Applied before taxes."
                            },
                            "label": {
                              "description": "Display label for the coupon",
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "code",
                            "amountOff",
                            "rateBipsOff",
                            "label"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Coupon applied to this order. `null` if none."
                    },
                    "coupons": {
                      "default": [],
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string",
                            "description": "Code that the customer enters at checkout"
                          },
                          "rateBipsOff": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991,
                            "description": "Percentage discount in bips (e.g. 1000 for 10%)"
                          },
                          "label": {
                            "description": "Display label for the coupon",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "validUntil": {
                            "description": "Date in ISO 8601 format after which the customer can no longer apply this coupon. `null` if it has no end date.",
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "code",
                          "rateBipsOff",
                          "label",
                          "validUntil"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Coupons that the customer can apply at checkout, set with `coupons` when the Order was created with the API. Empty if none."
                    },
                    "customerPiiClearedAt": {
                      "description": "Date in ISO 8601 format when the customer PII of this order was cleared with `POST /orders/{id}/clear-customer-pii`. `null` if it was never cleared.",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "orgId",
                    "orderType",
                    "totalAmount",
                    "currency",
                    "externalUniqId",
                    "status",
                    "paidAt",
                    "expiresAt",
                    "countdownToExpiry",
                    "redirectUrl",
                    "label",
                    "checkoutUrl",
                    "receiptPdfUrl",
                    "customCheckoutId",
                    "contact",
                    "invoice",
                    "paymentLink",
                    "transactions",
                    "customerData",
                    "customerFields",
                    "metadata",
                    "tags",
                    "allowSavePaymentProfile",
                    "eventTickets",
                    "orderItems",
                    "promo",
                    "coupons",
                    "customerPiiClearedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, invalid, expired or suspended, or your organization cannot use this endpoint. `message` says which.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the `orders.create` scope. Add it to the key in your API settings, or use a key that has it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "409": {
            "description": "An Order with this `externalUniqId` already exists. Retrieve that Order instead of creating a new one.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string",
                      "const": "CONFLICT"
                    }
                  },
                  "required": [
                    "message",
                    "code"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "message": "Order with this externalUniqId already exists",
                  "code": "CONFLICT"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "order-search",
        "summary": "List Orders",
        "description": "Retrieve a paginated list of orders with support for full-text search and filtering by date, status, currency, or contact. Returns up to 100 results per page. **Note:** To reduce noise, `PENDING` orders are excluded by default. To view them, explicitly set `includePending=true` or filter by a specific `status` (which overrides this default).<br/><br/>Required API key scope: `orders.read`",
        "tags": [
          "Orders"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "schema": {
              "default": 1,
              "type": "number",
              "minimum": 1,
              "description": "Page number. 1 for first page"
            }
          },
          {
            "in": "query",
            "name": "search",
            "schema": {
              "description": "Free text search. Searches in order id, externalUniqId, invoice number, customer info, contact info, order items labels, payment link title, and tags",
              "type": "string"
            },
            "description": "Free text search. Searches in order id, externalUniqId, invoice number, customer info, contact info, order items labels, payment link title, and tags"
          },
          {
            "in": "query",
            "name": "contactId",
            "schema": {
              "description": "Filter orders associated with a specific contact. Repeat the parameter to pass multiple values. Comma-separated is not supported.",
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Filter orders associated with a specific contact. Repeat the parameter to pass multiple values. Comma-separated is not supported."
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "description": "Filter by order status. Accepts any Zaprite order status. Repeat the parameter to pass multiple values. Comma-separated is not supported.",
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "PENDING",
                  "PROCESSING",
                  "PAID",
                  "OVERPAID",
                  "UNDERPAID",
                  "COMPLETE",
                  "ABANDONED"
                ]
              }
            },
            "description": "Filter by order status. Accepts any Zaprite order status. Repeat the parameter to pass multiple values. Comma-separated is not supported."
          },
          {
            "in": "query",
            "name": "type",
            "schema": {
              "description": "Filter by order type: `invoice`, `paymentLink` (generic payment links), `pos`, `event`, `wooCommerce`, `paymentRequest`, or `other` (API-created orders).",
              "type": "string",
              "enum": [
                "invoice",
                "apiInvoice",
                "paymentLink",
                "pos",
                "event",
                "wooCommerce",
                "paymentRequest",
                "apiOrder",
                "other"
              ]
            },
            "description": "Filter by order type: `invoice`, `paymentLink` (generic payment links), `pos`, `event`, `wooCommerce`, `paymentRequest`, or `other` (API-created orders)."
          },
          {
            "in": "query",
            "name": "currency",
            "schema": {
              "description": "Filter by order currency (ISO 4217 or BTC/LBTC). Repeat the parameter to pass multiple values. Comma-separated is not supported.",
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "USD",
                  "USDC",
                  "USDT",
                  "BTC",
                  "LBTC",
                  "ALL",
                  "DZD",
                  "ARS",
                  "AMD",
                  "AUD",
                  "AZN",
                  "BHD",
                  "BDT",
                  "BYN",
                  "BMD",
                  "BOB",
                  "BAM",
                  "BRL",
                  "BGN",
                  "KHR",
                  "CAD",
                  "CLP",
                  "CNY",
                  "COP",
                  "CRC",
                  "HRK",
                  "CUP",
                  "CZK",
                  "DKK",
                  "DOP",
                  "EGP",
                  "EUR",
                  "GEL",
                  "GHS",
                  "GTQ",
                  "HNL",
                  "HKD",
                  "HUF",
                  "ISK",
                  "INR",
                  "IDR",
                  "IRR",
                  "IQD",
                  "ILS",
                  "JMD",
                  "JPY",
                  "JOD",
                  "KZT",
                  "KES",
                  "KWD",
                  "KGS",
                  "LBP",
                  "MKD",
                  "MYR",
                  "MUR",
                  "MXN",
                  "MDL",
                  "MNT",
                  "MAD",
                  "MMK",
                  "NAD",
                  "NPR",
                  "TWD",
                  "NZD",
                  "NIO",
                  "NGN",
                  "NOK",
                  "OMR",
                  "PKR",
                  "PAB",
                  "PEN",
                  "PHP",
                  "PLN",
                  "GBP",
                  "QAR",
                  "RON",
                  "RUB",
                  "SAR",
                  "RSD",
                  "SGD",
                  "ZAR",
                  "KRW",
                  "SSP",
                  "VES",
                  "LKR",
                  "SEK",
                  "CHF",
                  "THB",
                  "TTD",
                  "TND",
                  "TRY",
                  "UGX",
                  "UAH",
                  "AED",
                  "UYU",
                  "UZS",
                  "VND"
                ]
              }
            },
            "description": "Filter by order currency (ISO 4217 or BTC/LBTC). Repeat the parameter to pass multiple values. Comma-separated is not supported."
          },
          {
            "in": "query",
            "name": "createdAtMin",
            "schema": {
              "description": "Filter orders created after this date (ISO 8601 - e.g. \"2021-01-01T00:00:00.000Z\").",
              "format": "datetime string",
              "type": "string"
            },
            "description": "Filter orders created after this date (ISO 8601 - e.g. \"2021-01-01T00:00:00.000Z\")."
          },
          {
            "in": "query",
            "name": "createdAtMax",
            "schema": {
              "description": "Filter orders created before this date (ISO 8601 - e.g. \"2021-01-01T00:00:00.000Z\").",
              "format": "datetime string",
              "type": "string"
            },
            "description": "Filter orders created before this date (ISO 8601 - e.g. \"2021-01-01T00:00:00.000Z\")."
          },
          {
            "in": "query",
            "name": "paidAtMin",
            "schema": {
              "description": "Filter orders paid after this date (ISO 8601 - e.g. \"2021-01-01T00:00:00.000Z\"). Only matches paid Orders.",
              "format": "datetime string",
              "type": "string"
            },
            "description": "Filter orders paid after this date (ISO 8601 - e.g. \"2021-01-01T00:00:00.000Z\"). Only matches paid Orders."
          },
          {
            "in": "query",
            "name": "paidAtMax",
            "schema": {
              "description": "Filter orders paid before this date (ISO 8601 - e.g. \"2021-01-01T00:00:00.000Z\"). Only matches paid Orders.",
              "format": "datetime string",
              "type": "string"
            },
            "description": "Filter orders paid before this date (ISO 8601 - e.g. \"2021-01-01T00:00:00.000Z\"). Only matches paid Orders."
          },
          {
            "in": "query",
            "name": "tags",
            "schema": {
              "description": "Filter orders by tags. Returns orders that have any of the provided tags. Repeat the parameter to pass multiple values. Comma-separated is not supported.",
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Filter orders by tags. Returns orders that have any of the provided tags. Repeat the parameter to pass multiple values. Comma-separated is not supported."
          },
          {
            "in": "query",
            "name": "includePending",
            "schema": {
              "description": "If true, includes PENDING orders when no status filter is provided. Ignored if status filter is provided.",
              "default": "false",
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            },
            "description": "If true, includes PENDING orders when no status filter is provided. Ignored if status filter is provided."
          },
          {
            "in": "query",
            "name": "sortBy",
            "schema": {
              "default": "createdAt",
              "type": "string",
              "enum": [
                "createdAt",
                "paidAt"
              ]
            }
          },
          {
            "in": "query",
            "name": "sortOrder",
            "schema": {
              "default": "desc",
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "orgId": {
                            "type": "string",
                            "description": "Id of the Zaprite organization that created this order"
                          },
                          "orderType": {
                            "type": "string",
                            "enum": [
                              "invoice",
                              "apiInvoice",
                              "paymentLink",
                              "pos",
                              "event",
                              "wooCommerce",
                              "paymentRequest",
                              "apiOrder",
                              "other"
                            ]
                          },
                          "totalAmount": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991,
                            "description": "Total amount to be paid by the customer in currency smallest unit (e.g. cents or sats)"
                          },
                          "currency": {
                            "type": "string",
                            "enum": [
                              "USD",
                              "USDC",
                              "USDT",
                              "BTC",
                              "LBTC",
                              "ALL",
                              "DZD",
                              "ARS",
                              "AMD",
                              "AUD",
                              "AZN",
                              "BHD",
                              "BDT",
                              "BYN",
                              "BMD",
                              "BOB",
                              "BAM",
                              "BRL",
                              "BGN",
                              "KHR",
                              "CAD",
                              "CLP",
                              "CNY",
                              "COP",
                              "CRC",
                              "HRK",
                              "CUP",
                              "CZK",
                              "DKK",
                              "DOP",
                              "EGP",
                              "EUR",
                              "GEL",
                              "GHS",
                              "GTQ",
                              "HNL",
                              "HKD",
                              "HUF",
                              "ISK",
                              "INR",
                              "IDR",
                              "IRR",
                              "IQD",
                              "ILS",
                              "JMD",
                              "JPY",
                              "JOD",
                              "KZT",
                              "KES",
                              "KWD",
                              "KGS",
                              "LBP",
                              "MKD",
                              "MYR",
                              "MUR",
                              "MXN",
                              "MDL",
                              "MNT",
                              "MAD",
                              "MMK",
                              "NAD",
                              "NPR",
                              "TWD",
                              "NZD",
                              "NIO",
                              "NGN",
                              "NOK",
                              "OMR",
                              "PKR",
                              "PAB",
                              "PEN",
                              "PHP",
                              "PLN",
                              "GBP",
                              "QAR",
                              "RON",
                              "RUB",
                              "SAR",
                              "RSD",
                              "SGD",
                              "ZAR",
                              "KRW",
                              "SSP",
                              "VES",
                              "LKR",
                              "SEK",
                              "CHF",
                              "THB",
                              "TTD",
                              "TND",
                              "TRY",
                              "UGX",
                              "UAH",
                              "AED",
                              "UYU",
                              "UZS",
                              "VND"
                            ]
                          },
                          "externalUniqId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "PENDING",
                              "PROCESSING",
                              "PAID",
                              "OVERPAID",
                              "UNDERPAID",
                              "COMPLETE"
                            ],
                            "description": "`PENDING`: The order is pending payment</br>`PROCESSING`: The order received a payment but the transaction is still pending (ie. an on-chain transaction with 0 conf or manual bank transfer awaiting manual confirmation)</br>`PAID`: The order was paid but it requires manual fulfillment to be flagged as `COMPLETE`</br>`COMPLETE`: The order was paid and is complete</br>`OVERPAID`: The order received a payment that was more than the total amount</br>`UNDERPAID`: The order received a payment that was less than the total amount"
                          },
                          "paidAt": {
                            "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\"). `null` until the order is paid.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "expiresAt": {
                            "description": "Date in ISO 8601 format when this order expires. After this time, an order with no payment yet cannot be paid; a partly paid order can still be paid in full.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "countdownToExpiry": {
                            "type": "boolean",
                            "description": "If true and `expiresAt` is set, the checkout shows a countdown to `expiresAt` during its last 60 minutes."
                          },
                          "redirectUrl": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "label": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "checkoutUrl": {
                            "type": "string",
                            "format": "uri",
                            "description": "Send your customer to this URL to complete the payment. It carries the order’s access token: use it as returned, do not build it from the order id."
                          },
                          "receiptPdfUrl": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uri"
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "URL to download the Order receipt PDF, with the order’s access token. `null` until the order is paid."
                          },
                          "customCheckoutId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "contact": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "legalName": {
                                    "type": "string"
                                  },
                                  "contactName": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "displayName": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "email": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "format": "email",
                                        "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "taxId": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "defaultCurrency": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "enum": [
                                          "USD",
                                          "USDC",
                                          "USDT",
                                          "BTC",
                                          "LBTC",
                                          "ALL",
                                          "DZD",
                                          "ARS",
                                          "AMD",
                                          "AUD",
                                          "AZN",
                                          "BHD",
                                          "BDT",
                                          "BYN",
                                          "BMD",
                                          "BOB",
                                          "BAM",
                                          "BRL",
                                          "BGN",
                                          "KHR",
                                          "CAD",
                                          "CLP",
                                          "CNY",
                                          "COP",
                                          "CRC",
                                          "HRK",
                                          "CUP",
                                          "CZK",
                                          "DKK",
                                          "DOP",
                                          "EGP",
                                          "EUR",
                                          "GEL",
                                          "GHS",
                                          "GTQ",
                                          "HNL",
                                          "HKD",
                                          "HUF",
                                          "ISK",
                                          "INR",
                                          "IDR",
                                          "IRR",
                                          "IQD",
                                          "ILS",
                                          "JMD",
                                          "JPY",
                                          "JOD",
                                          "KZT",
                                          "KES",
                                          "KWD",
                                          "KGS",
                                          "LBP",
                                          "MKD",
                                          "MYR",
                                          "MUR",
                                          "MXN",
                                          "MDL",
                                          "MNT",
                                          "MAD",
                                          "MMK",
                                          "NAD",
                                          "NPR",
                                          "TWD",
                                          "NZD",
                                          "NIO",
                                          "NGN",
                                          "NOK",
                                          "OMR",
                                          "PKR",
                                          "PAB",
                                          "PEN",
                                          "PHP",
                                          "PLN",
                                          "GBP",
                                          "QAR",
                                          "RON",
                                          "RUB",
                                          "SAR",
                                          "RSD",
                                          "SGD",
                                          "ZAR",
                                          "KRW",
                                          "SSP",
                                          "VES",
                                          "LKR",
                                          "SEK",
                                          "CHF",
                                          "THB",
                                          "TTD",
                                          "TND",
                                          "TRY",
                                          "UGX",
                                          "UAH",
                                          "AED",
                                          "UYU",
                                          "UZS",
                                          "VND"
                                        ]
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "billingAddress": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "line1": {
                                            "type": [
                                              "string",
                                              "null"
                                            ]
                                          },
                                          "line2": {
                                            "type": [
                                              "string",
                                              "null"
                                            ]
                                          },
                                          "zipCode": {
                                            "type": [
                                              "string",
                                              "null"
                                            ]
                                          },
                                          "city": {
                                            "type": [
                                              "string",
                                              "null"
                                            ]
                                          },
                                          "state": {
                                            "type": [
                                              "string",
                                              "null"
                                            ]
                                          },
                                          "countryCode": {
                                            "type": [
                                              "string",
                                              "null"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "line1",
                                          "line2",
                                          "zipCode",
                                          "city",
                                          "state",
                                          "countryCode"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "paymentProfiles": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string"
                                        },
                                        "externalId": {
                                          "type": "string"
                                        },
                                        "method": {
                                          "type": "string"
                                        },
                                        "label": {
                                          "type": "string"
                                        },
                                        "expiresAt": {
                                          "anyOf": [
                                            {
                                              "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                                              "type": "string"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "connection": {
                                          "type": "object",
                                          "properties": {
                                            "label": {
                                              "type": "string"
                                            },
                                            "pluginSlug": {
                                              "type": "string"
                                            },
                                            "id": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "label",
                                            "pluginSlug",
                                            "id"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "sourceOrder": {
                                          "anyOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string"
                                                },
                                                "externalUniqId": {
                                                  "type": [
                                                    "string",
                                                    "null"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "externalUniqId"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ],
                                          "description": "The Order that your customer was paying when saving this payment profile."
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "externalId",
                                        "method",
                                        "label",
                                        "expiresAt",
                                        "connection",
                                        "sourceOrder"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "description": "Active saved Payment Profiles for this contact. Can be used to pay Orders with the `charge` endpoint."
                                  }
                                },
                                "required": [
                                  "id",
                                  "legalName",
                                  "contactName",
                                  "displayName",
                                  "email",
                                  "taxId",
                                  "defaultCurrency",
                                  "billingAddress",
                                  "paymentProfiles"
                                ],
                                "additionalProperties": false,
                                "description": "Optional Zaprite contact associated with this order"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "invoice": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "number": {
                                    "type": "string",
                                    "description": "Invoice number, displayed on the invoice page and PDF"
                                  },
                                  "title": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "orgId": {
                                    "type": "string"
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "DRAFT",
                                      "SENT",
                                      "OVERDUE",
                                      "PAID",
                                      "OVERPAID",
                                      "UNDERPAID",
                                      "VOID"
                                    ]
                                  },
                                  "footerNote": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "daysToPay": {
                                    "anyOf": [
                                      {
                                        "type": "integer",
                                        "minimum": -9007199254740991,
                                        "maximum": 9007199254740991
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ],
                                    "description": "Natural days from invoice date before the invoice is overdue. If null, invoice will be shown as \"DUE ON RECEIPT\""
                                  },
                                  "date": {
                                    "type": "string",
                                    "description": "Date of the invoice, displayed on the invoice page and PDF. Format: YYYY-MM-DD"
                                  },
                                  "purchaseOrderNumber": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "hideOrgAddress": {
                                    "type": "boolean",
                                    "description": "Organization address is hidden on the public invoice"
                                  },
                                  "hideOrgEmail": {
                                    "type": "boolean",
                                    "description": "Organization email is hidden on the public invoice"
                                  },
                                  "hideOrgName": {
                                    "type": "boolean",
                                    "description": "Organization name is hidden on the public invoice"
                                  },
                                  "sentAt": {
                                    "description": "Date when the invoice was sent to the customer",
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "voidedAt": {
                                    "description": "Date when the invoice was voided",
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "publicUrl": {
                                    "type": "string",
                                    "format": "uri",
                                    "description": "URL to view the public invoice page. It carries the invoice’s access token: use it as returned, do not build it from the invoice id."
                                  },
                                  "customer": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "legalName": {
                                            "type": "string"
                                          },
                                          "contactName": {
                                            "type": [
                                              "string",
                                              "null"
                                            ]
                                          },
                                          "displayName": {
                                            "type": [
                                              "string",
                                              "null"
                                            ]
                                          },
                                          "email": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "format": "email",
                                                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "taxId": {
                                            "type": [
                                              "string",
                                              "null"
                                            ]
                                          },
                                          "defaultCurrency": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "enum": [
                                                  "USD",
                                                  "USDC",
                                                  "USDT",
                                                  "BTC",
                                                  "LBTC",
                                                  "ALL",
                                                  "DZD",
                                                  "ARS",
                                                  "AMD",
                                                  "AUD",
                                                  "AZN",
                                                  "BHD",
                                                  "BDT",
                                                  "BYN",
                                                  "BMD",
                                                  "BOB",
                                                  "BAM",
                                                  "BRL",
                                                  "BGN",
                                                  "KHR",
                                                  "CAD",
                                                  "CLP",
                                                  "CNY",
                                                  "COP",
                                                  "CRC",
                                                  "HRK",
                                                  "CUP",
                                                  "CZK",
                                                  "DKK",
                                                  "DOP",
                                                  "EGP",
                                                  "EUR",
                                                  "GEL",
                                                  "GHS",
                                                  "GTQ",
                                                  "HNL",
                                                  "HKD",
                                                  "HUF",
                                                  "ISK",
                                                  "INR",
                                                  "IDR",
                                                  "IRR",
                                                  "IQD",
                                                  "ILS",
                                                  "JMD",
                                                  "JPY",
                                                  "JOD",
                                                  "KZT",
                                                  "KES",
                                                  "KWD",
                                                  "KGS",
                                                  "LBP",
                                                  "MKD",
                                                  "MYR",
                                                  "MUR",
                                                  "MXN",
                                                  "MDL",
                                                  "MNT",
                                                  "MAD",
                                                  "MMK",
                                                  "NAD",
                                                  "NPR",
                                                  "TWD",
                                                  "NZD",
                                                  "NIO",
                                                  "NGN",
                                                  "NOK",
                                                  "OMR",
                                                  "PKR",
                                                  "PAB",
                                                  "PEN",
                                                  "PHP",
                                                  "PLN",
                                                  "GBP",
                                                  "QAR",
                                                  "RON",
                                                  "RUB",
                                                  "SAR",
                                                  "RSD",
                                                  "SGD",
                                                  "ZAR",
                                                  "KRW",
                                                  "SSP",
                                                  "VES",
                                                  "LKR",
                                                  "SEK",
                                                  "CHF",
                                                  "THB",
                                                  "TTD",
                                                  "TND",
                                                  "TRY",
                                                  "UGX",
                                                  "UAH",
                                                  "AED",
                                                  "UYU",
                                                  "UZS",
                                                  "VND"
                                                ]
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "billingAddress": {
                                            "anyOf": [
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "line1": {
                                                    "type": [
                                                      "string",
                                                      "null"
                                                    ]
                                                  },
                                                  "line2": {
                                                    "type": [
                                                      "string",
                                                      "null"
                                                    ]
                                                  },
                                                  "zipCode": {
                                                    "type": [
                                                      "string",
                                                      "null"
                                                    ]
                                                  },
                                                  "city": {
                                                    "type": [
                                                      "string",
                                                      "null"
                                                    ]
                                                  },
                                                  "state": {
                                                    "type": [
                                                      "string",
                                                      "null"
                                                    ]
                                                  },
                                                  "countryCode": {
                                                    "type": [
                                                      "string",
                                                      "null"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "line1",
                                                  "line2",
                                                  "zipCode",
                                                  "city",
                                                  "state",
                                                  "countryCode"
                                                ],
                                                "additionalProperties": false
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "paymentProfiles": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string"
                                                },
                                                "externalId": {
                                                  "type": "string"
                                                },
                                                "method": {
                                                  "type": "string"
                                                },
                                                "label": {
                                                  "type": "string"
                                                },
                                                "expiresAt": {
                                                  "anyOf": [
                                                    {
                                                      "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                                                      "type": "string"
                                                    },
                                                    {
                                                      "type": "null"
                                                    }
                                                  ]
                                                },
                                                "connection": {
                                                  "type": "object",
                                                  "properties": {
                                                    "label": {
                                                      "type": "string"
                                                    },
                                                    "pluginSlug": {
                                                      "type": "string"
                                                    },
                                                    "id": {
                                                      "type": "string"
                                                    }
                                                  },
                                                  "required": [
                                                    "label",
                                                    "pluginSlug",
                                                    "id"
                                                  ],
                                                  "additionalProperties": false
                                                },
                                                "sourceOrder": {
                                                  "anyOf": [
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "id": {
                                                          "type": "string"
                                                        },
                                                        "externalUniqId": {
                                                          "type": [
                                                            "string",
                                                            "null"
                                                          ]
                                                        }
                                                      },
                                                      "required": [
                                                        "id",
                                                        "externalUniqId"
                                                      ],
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "null"
                                                    }
                                                  ],
                                                  "description": "The Order that your customer was paying when saving this payment profile."
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "externalId",
                                                "method",
                                                "label",
                                                "expiresAt",
                                                "connection",
                                                "sourceOrder"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "description": "Active saved Payment Profiles for this contact. Can be used to pay Orders with the `charge` endpoint."
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "legalName",
                                          "contactName",
                                          "displayName",
                                          "email",
                                          "taxId",
                                          "defaultCurrency",
                                          "billingAddress",
                                          "paymentProfiles"
                                        ],
                                        "additionalProperties": false,
                                        "description": "**DEPRECATED:** Use `order.contact` instead"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "lineItems": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string"
                                        },
                                        "name": {
                                          "type": "string"
                                        },
                                        "description": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        },
                                        "unitPrice": {
                                          "description": "Price of the item in currency smallest unit (e.g. cents or sats)",
                                          "type": "integer",
                                          "minimum": -9007199254740991,
                                          "maximum": 9007199254740991
                                        },
                                        "quantity": {
                                          "type": "number",
                                          "description": "Quantity of units (Max 2 decimal places)"
                                        },
                                        "taxRateBips": {
                                          "type": "integer",
                                          "minimum": -9007199254740991,
                                          "maximum": 9007199254740991,
                                          "description": "Tax rate in bips (e.g. 1234 for 12.34%)"
                                        },
                                        "taxAmount": {
                                          "description": "In currency smallest unit (e.g. cents or sats)",
                                          "type": "integer",
                                          "minimum": -9007199254740991,
                                          "maximum": 9007199254740991
                                        },
                                        "discountRateBips": {
                                          "type": "integer",
                                          "minimum": -9007199254740991,
                                          "maximum": 9007199254740991,
                                          "description": "Discount rate in bips (e.g. 1234 for 12.34%)"
                                        },
                                        "discountAmount": {
                                          "type": "integer",
                                          "minimum": -9007199254740991,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "name",
                                        "description",
                                        "unitPrice",
                                        "quantity",
                                        "taxRateBips",
                                        "taxAmount",
                                        "discountRateBips",
                                        "discountAmount"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "discountRateBips": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991,
                                    "description": "Discount on the whole invoice, in bips (e.g. 1000 for 10%). 0 if none"
                                  },
                                  "discountAmount": {
                                    "description": "Fixed discount on the whole invoice, in currency smallest unit. 0 if none",
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  "discountLabel": {
                                    "description": "Label of the invoice discount in the totals",
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "amounts": {
                                    "type": "object",
                                    "properties": {
                                      "subtotal": {
                                        "type": "number"
                                      },
                                      "lineDiscounts": {
                                        "type": "number"
                                      },
                                      "invoiceDiscount": {
                                        "type": "number"
                                      },
                                      "tax": {
                                        "type": "number"
                                      },
                                      "total": {
                                        "type": "number"
                                      }
                                    },
                                    "required": [
                                      "subtotal",
                                      "lineDiscounts",
                                      "invoiceDiscount",
                                      "tax",
                                      "total"
                                    ],
                                    "additionalProperties": false,
                                    "description": "Invoice totals in currency smallest unit: subtotal - lineDiscounts - invoiceDiscount + tax = total"
                                  }
                                },
                                "required": [
                                  "id",
                                  "number",
                                  "title",
                                  "orgId",
                                  "status",
                                  "footerNote",
                                  "daysToPay",
                                  "date",
                                  "purchaseOrderNumber",
                                  "hideOrgAddress",
                                  "hideOrgEmail",
                                  "hideOrgName",
                                  "sentAt",
                                  "voidedAt",
                                  "publicUrl",
                                  "customer",
                                  "lineItems",
                                  "discountRateBips",
                                  "discountAmount",
                                  "discountLabel",
                                  "amounts"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Set only if the order is for a Zaprite invoice (`orderType=\"invoice\"` or `\"apiInvoice\"`), `null` otherwise"
                          },
                          "paymentLink": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "title": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "title"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Set only if the order was created from a Payment Link (`orderType=\"paymentLink\"`), `null` otherwise"
                          },
                          "transactions": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "date": {
                                  "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                                  "type": "string"
                                },
                                "amount": {
                                  "description": "Transaction amount in currency smallest unit (e.g. cents or sats)",
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "currency": {
                                  "type": "string",
                                  "enum": [
                                    "USD",
                                    "USDC",
                                    "USDT",
                                    "BTC",
                                    "LBTC",
                                    "ALL",
                                    "DZD",
                                    "ARS",
                                    "AMD",
                                    "AUD",
                                    "AZN",
                                    "BHD",
                                    "BDT",
                                    "BYN",
                                    "BMD",
                                    "BOB",
                                    "BAM",
                                    "BRL",
                                    "BGN",
                                    "KHR",
                                    "CAD",
                                    "CLP",
                                    "CNY",
                                    "COP",
                                    "CRC",
                                    "HRK",
                                    "CUP",
                                    "CZK",
                                    "DKK",
                                    "DOP",
                                    "EGP",
                                    "EUR",
                                    "GEL",
                                    "GHS",
                                    "GTQ",
                                    "HNL",
                                    "HKD",
                                    "HUF",
                                    "ISK",
                                    "INR",
                                    "IDR",
                                    "IRR",
                                    "IQD",
                                    "ILS",
                                    "JMD",
                                    "JPY",
                                    "JOD",
                                    "KZT",
                                    "KES",
                                    "KWD",
                                    "KGS",
                                    "LBP",
                                    "MKD",
                                    "MYR",
                                    "MUR",
                                    "MXN",
                                    "MDL",
                                    "MNT",
                                    "MAD",
                                    "MMK",
                                    "NAD",
                                    "NPR",
                                    "TWD",
                                    "NZD",
                                    "NIO",
                                    "NGN",
                                    "NOK",
                                    "OMR",
                                    "PKR",
                                    "PAB",
                                    "PEN",
                                    "PHP",
                                    "PLN",
                                    "GBP",
                                    "QAR",
                                    "RON",
                                    "RUB",
                                    "SAR",
                                    "RSD",
                                    "SGD",
                                    "ZAR",
                                    "KRW",
                                    "SSP",
                                    "VES",
                                    "LKR",
                                    "SEK",
                                    "CHF",
                                    "THB",
                                    "TTD",
                                    "TND",
                                    "TRY",
                                    "UGX",
                                    "UAH",
                                    "AED",
                                    "UYU",
                                    "UZS",
                                    "VND"
                                  ]
                                },
                                "amountInOrderCurrency": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "Transaction amount denominated in the currency of the Order and in smallest unit (e.g. cents or sats)"
                                },
                                "discountsInOrderCurrency": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "amountOff": {
                                        "description": "Amount of the discount denominated in `orderCurrency` and in smallest unit (e.g cents or sats). Negative value means a premium was applied.",
                                        "type": "integer",
                                        "minimum": -9007199254740991,
                                        "maximum": 9007199254740991
                                      },
                                      "rateBipsOff": {
                                        "type": "integer",
                                        "minimum": -9007199254740991,
                                        "maximum": 9007199254740991,
                                        "description": "Rate of the discount in bips (e.g. 1234 for 12.34%). Negative value means a premium was applied."
                                      },
                                      "paymentType": {
                                        "type": "string",
                                        "enum": [
                                          "FIAT",
                                          "BITCOIN",
                                          "LIGHTNING",
                                          "STABLECOIN"
                                        ],
                                        "description": "Type of payments this discount applies to"
                                      }
                                    },
                                    "required": [
                                      "amountOff",
                                      "rateBipsOff",
                                      "paymentType"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "description": "List premiums and discounts applied to this transaction. Note: The amount retained as payment for the Order is `amountInOrderCurrency + sum(discountsInChargeCurrency.amount)`"
                                },
                                "orderCurrency": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "enum": [
                                        "USD",
                                        "USDC",
                                        "USDT",
                                        "BTC",
                                        "LBTC",
                                        "ALL",
                                        "DZD",
                                        "ARS",
                                        "AMD",
                                        "AUD",
                                        "AZN",
                                        "BHD",
                                        "BDT",
                                        "BYN",
                                        "BMD",
                                        "BOB",
                                        "BAM",
                                        "BRL",
                                        "BGN",
                                        "KHR",
                                        "CAD",
                                        "CLP",
                                        "CNY",
                                        "COP",
                                        "CRC",
                                        "HRK",
                                        "CUP",
                                        "CZK",
                                        "DKK",
                                        "DOP",
                                        "EGP",
                                        "EUR",
                                        "GEL",
                                        "GHS",
                                        "GTQ",
                                        "HNL",
                                        "HKD",
                                        "HUF",
                                        "ISK",
                                        "INR",
                                        "IDR",
                                        "IRR",
                                        "IQD",
                                        "ILS",
                                        "JMD",
                                        "JPY",
                                        "JOD",
                                        "KZT",
                                        "KES",
                                        "KWD",
                                        "KGS",
                                        "LBP",
                                        "MKD",
                                        "MYR",
                                        "MUR",
                                        "MXN",
                                        "MDL",
                                        "MNT",
                                        "MAD",
                                        "MMK",
                                        "NAD",
                                        "NPR",
                                        "TWD",
                                        "NZD",
                                        "NIO",
                                        "NGN",
                                        "NOK",
                                        "OMR",
                                        "PKR",
                                        "PAB",
                                        "PEN",
                                        "PHP",
                                        "PLN",
                                        "GBP",
                                        "QAR",
                                        "RON",
                                        "RUB",
                                        "SAR",
                                        "RSD",
                                        "SGD",
                                        "ZAR",
                                        "KRW",
                                        "SSP",
                                        "VES",
                                        "LKR",
                                        "SEK",
                                        "CHF",
                                        "THB",
                                        "TTD",
                                        "TND",
                                        "TRY",
                                        "UGX",
                                        "UAH",
                                        "AED",
                                        "UYU",
                                        "UZS",
                                        "VND"
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "Currency of the Order this transaction is paying for. For example, when paying an USD invoice in BTC, transaction `currency` would be USD and `orderCurrency` USD."
                                },
                                "accountingCurrency": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "enum": [
                                        "USD",
                                        "USDC",
                                        "USDT",
                                        "BTC",
                                        "LBTC",
                                        "ALL",
                                        "DZD",
                                        "ARS",
                                        "AMD",
                                        "AUD",
                                        "AZN",
                                        "BHD",
                                        "BDT",
                                        "BYN",
                                        "BMD",
                                        "BOB",
                                        "BAM",
                                        "BRL",
                                        "BGN",
                                        "KHR",
                                        "CAD",
                                        "CLP",
                                        "CNY",
                                        "COP",
                                        "CRC",
                                        "HRK",
                                        "CUP",
                                        "CZK",
                                        "DKK",
                                        "DOP",
                                        "EGP",
                                        "EUR",
                                        "GEL",
                                        "GHS",
                                        "GTQ",
                                        "HNL",
                                        "HKD",
                                        "HUF",
                                        "ISK",
                                        "INR",
                                        "IDR",
                                        "IRR",
                                        "IQD",
                                        "ILS",
                                        "JMD",
                                        "JPY",
                                        "JOD",
                                        "KZT",
                                        "KES",
                                        "KWD",
                                        "KGS",
                                        "LBP",
                                        "MKD",
                                        "MYR",
                                        "MUR",
                                        "MXN",
                                        "MDL",
                                        "MNT",
                                        "MAD",
                                        "MMK",
                                        "NAD",
                                        "NPR",
                                        "TWD",
                                        "NZD",
                                        "NIO",
                                        "NGN",
                                        "NOK",
                                        "OMR",
                                        "PKR",
                                        "PAB",
                                        "PEN",
                                        "PHP",
                                        "PLN",
                                        "GBP",
                                        "QAR",
                                        "RON",
                                        "RUB",
                                        "SAR",
                                        "RSD",
                                        "SGD",
                                        "ZAR",
                                        "KRW",
                                        "SSP",
                                        "VES",
                                        "LKR",
                                        "SEK",
                                        "CHF",
                                        "THB",
                                        "TTD",
                                        "TND",
                                        "TRY",
                                        "UGX",
                                        "UAH",
                                        "AED",
                                        "UYU",
                                        "UZS",
                                        "VND"
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "The is the currency configured for your Organization"
                                },
                                "amountInAccountingCurrency": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "Transaction amount denominated in accounting currency and in smallest unit (e.g. cents or sats)"
                                },
                                "method": {
                                  "type": "string",
                                  "enum": [
                                    "BITCOIN",
                                    "LIQUID",
                                    "LIGHTNING",
                                    "BANK",
                                    "CARD",
                                    "CASH",
                                    "CHECK",
                                    "GIFTCARD",
                                    "COUPON",
                                    "APPLEPAY",
                                    "GOOGLEPAY",
                                    "CASHAPP_PAY",
                                    "INTERAC",
                                    "ACH",
                                    "SEPA",
                                    "UNKNOWN",
                                    "WIRE_TRANSFER",
                                    "VENMO",
                                    "PAYPAL",
                                    "REVOLUT_PAY",
                                    "NO_CHARGE",
                                    "TETHER",
                                    "USDCIRCLE"
                                  ]
                                },
                                "externalRef": {
                                  "description": "External reference for the transaction. (e.g. Bitcoin txId, Stripe transaction ID...)",
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "PENDING",
                                    "CONFIRMED",
                                    "CANCELED"
                                  ]
                                }
                              },
                              "required": [
                                "date",
                                "amount",
                                "currency",
                                "amountInOrderCurrency",
                                "discountsInOrderCurrency",
                                "orderCurrency",
                                "accountingCurrency",
                                "amountInAccountingCurrency",
                                "method",
                                "externalRef",
                                "status"
                              ],
                              "additionalProperties": false
                            },
                            "description": "All transactions this Order received"
                          },
                          "customerData": {
                            "type": "object",
                            "properties": {
                              "email": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "name": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "phone": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "address": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "line1": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      },
                                      "line2": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      },
                                      "zipCode": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      },
                                      "city": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      },
                                      "state": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      },
                                      "countryCode": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "line1",
                                      "line2",
                                      "zipCode",
                                      "city",
                                      "state",
                                      "countryCode"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "note": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "company": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "email",
                              "name",
                              "phone",
                              "address",
                              "note",
                              "company"
                            ],
                            "additionalProperties": {},
                            "description": "Customer data collected on payment links if you enabled customer fields. Custom field values are included as additional keys."
                          },
                          "customerFields": {
                            "type": "object",
                            "properties": {
                              "address": {
                                "type": "string",
                                "enum": [
                                  "REQUIRED",
                                  "OPTIONAL"
                                ]
                              },
                              "email": {
                                "type": "string",
                                "enum": [
                                  "REQUIRED",
                                  "OPTIONAL"
                                ]
                              },
                              "name": {
                                "type": "string",
                                "enum": [
                                  "REQUIRED",
                                  "OPTIONAL"
                                ]
                              },
                              "phone": {
                                "type": "string",
                                "enum": [
                                  "REQUIRED",
                                  "OPTIONAL"
                                ]
                              },
                              "note": {
                                "type": "string",
                                "enum": [
                                  "REQUIRED",
                                  "OPTIONAL"
                                ]
                              }
                            },
                            "additionalProperties": false,
                            "description": "Configuration for fields displayed on checkout page to collect customer data"
                          },
                          "metadata": {
                            "default": {},
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {
                              "type": "string"
                            },
                            "description": "Custom metadata for this order"
                          },
                          "tags": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Custom tags for this order"
                          },
                          "allowSavePaymentProfile": {
                            "default": false,
                            "type": "boolean",
                            "description": "If true and the selected payment method supports autopay, then the customer will be able to save their payment profile for future payments."
                          },
                          "eventTickets": {
                            "default": [],
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "paymentLinkItem": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    },
                                    "title": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "title"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "paymentLinkItem"
                              ],
                              "additionalProperties": false
                            },
                            "description": "Event tickets issued for this order (empty if none)."
                          },
                          "orderItems": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "label": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "quantity": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "paymentLinkItem": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string"
                                        },
                                        "title": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "title"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "label",
                                "quantity",
                                "paymentLinkItem"
                              ],
                              "additionalProperties": false
                            },
                            "description": "Order items for this order. Empty if none."
                          },
                          "promo": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "code": {
                                    "description": "Coupon code applied to this order",
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "amountOff": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991,
                                    "description": "Fixed amount discounted from the order total in currency smallest unit (e.g. cents or sats)"
                                  },
                                  "rateBipsOff": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991,
                                    "description": "Percentage discount rate in bips (e.g. 1000 for 10%). Applied before taxes."
                                  },
                                  "label": {
                                    "description": "Display label for the coupon",
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "code",
                                  "amountOff",
                                  "rateBipsOff",
                                  "label"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Coupon applied to this order. `null` if none."
                          },
                          "coupons": {
                            "default": [],
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "code": {
                                  "type": "string",
                                  "description": "Code that the customer enters at checkout"
                                },
                                "rateBipsOff": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991,
                                  "description": "Percentage discount in bips (e.g. 1000 for 10%)"
                                },
                                "label": {
                                  "description": "Display label for the coupon",
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "validUntil": {
                                  "description": "Date in ISO 8601 format after which the customer can no longer apply this coupon. `null` if it has no end date.",
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "code",
                                "rateBipsOff",
                                "label",
                                "validUntil"
                              ],
                              "additionalProperties": false
                            },
                            "description": "Coupons that the customer can apply at checkout, set with `coupons` when the Order was created with the API. Empty if none."
                          },
                          "customerPiiClearedAt": {
                            "description": "Date in ISO 8601 format when the customer PII of this order was cleared with `POST /orders/{id}/clear-customer-pii`. `null` if it was never cleared.",
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "orgId",
                          "orderType",
                          "totalAmount",
                          "currency",
                          "externalUniqId",
                          "status",
                          "paidAt",
                          "expiresAt",
                          "countdownToExpiry",
                          "redirectUrl",
                          "label",
                          "checkoutUrl",
                          "receiptPdfUrl",
                          "customCheckoutId",
                          "contact",
                          "invoice",
                          "paymentLink",
                          "transactions",
                          "customerData",
                          "customerFields",
                          "metadata",
                          "tags",
                          "allowSavePaymentProfile",
                          "eventTickets",
                          "orderItems",
                          "promo",
                          "coupons",
                          "customerPiiClearedAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "itemsCount": {
                          "type": "number"
                        },
                        "pagesCount": {
                          "type": "number"
                        },
                        "page": {
                          "type": "number"
                        },
                        "perPage": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "itemsCount",
                        "pagesCount",
                        "page",
                        "perPage"
                      ],
                      "additionalProperties": false,
                      "description": "Pagination metadata"
                    }
                  },
                  "required": [
                    "items",
                    "meta"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, invalid, expired or suspended, or your organization cannot use this endpoint. `message` says which.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the `orders.read` scope. Add it to the key in your API settings, or use a key that has it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/orders/{id}": {
      "patch": {
        "operationId": "order-update",
        "summary": "Edit Order",
        "description": "Update order status and expiration. Status updates are equivalent to using \"Mark as Complete\" in the Zaprite dashboard. Setting expiration to the past stops new payments on an order that has no payment yet; a partly paid order can still be paid in full, and in-flight payments are still processed.<br/><br/>Required API key scope: `orders.update`",
        "tags": [
          "Orders"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "Zaprite `id` or `externalUniqId`"
            },
            "required": true,
            "description": "Zaprite `id` or `externalUniqId`"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "status": "COMPLETE",
                "expiresAt": "2024-03-25T11:04:09.656Z"
              },
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "COMPLETE",
                      "PAID"
                    ],
                    "description": "New status for the order"
                  },
                  "expiresAt": {
                    "description": "ISO 8601 datetime when this order expires. Set to anytime in past to immediately expire the order, which prevents new payments while it has no payment yet. A partly paid order can still be paid in full, and in-flight payments are still processed. Set to null to remove expiration.",
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "example": {
                  "id": "od_abc123",
                  "orgId": "abc123",
                  "orderType": "other",
                  "totalAmount": 100,
                  "currency": "USD",
                  "externalUniqId": "abc123",
                  "status": "PROCESSING",
                  "paidAt": "2024-02-25T11:04:09.656Z",
                  "expiresAt": "2024-03-25T11:04:09.656Z",
                  "countdownToExpiry": true,
                  "redirectUrl": "https://your-url.com",
                  "label": "Order label",
                  "checkoutUrl": "https://pay.zaprite.com/order/od_abc123#access=Xk2fQ9pLmT4wZa",
                  "receiptPdfUrl": null,
                  "customCheckoutId": null,
                  "eventTickets": [
                    {
                      "id": "et_123",
                      "paymentLinkItem": {
                        "id": "pi_123",
                        "title": "VIP Ticket"
                      }
                    }
                  ],
                  "orderItems": [
                    {
                      "id": "oi_123",
                      "label": "VIP Ticket",
                      "quantity": 1,
                      "paymentLinkItem": {
                        "id": "pi_123",
                        "title": "VIP Ticket"
                      }
                    }
                  ],
                  "invoice": null,
                  "contact": null,
                  "transactions": [
                    {
                      "amount": 1400,
                      "currency": "BTC",
                      "amountInOrderCurrency": 100,
                      "discountsInOrderCurrency": [],
                      "orderCurrency": "USD",
                      "amountInAccountingCurrency": 100,
                      "accountingCurrency": "USD",
                      "method": "BITCOIN",
                      "status": "PENDING",
                      "date": "2024-02-25T11:04:09.656Z",
                      "externalRef": "b340b455d25ae2379e3a22328c96421a8f5a4483848e01f14eee0abae89daabc"
                    }
                  ],
                  "paymentLink": null,
                  "customerData": {
                    "email": "example@email.com",
                    "name": "John Doe",
                    "phone": "1234567890",
                    "address": null,
                    "note": "Example customer note",
                    "company": "Example company"
                  },
                  "metadata": {
                    "custom_id": "12345",
                    "customer_reference": "ABC123"
                  },
                  "tags": [
                    "tag1",
                    "tag2"
                  ],
                  "allowSavePaymentProfile": false,
                  "customerFields": {
                    "address": "OPTIONAL",
                    "email": "REQUIRED",
                    "name": "OPTIONAL"
                  },
                  "promo": {
                    "code": "SAVE10",
                    "amountOff": 0,
                    "rateBipsOff": 1000,
                    "label": "10% Off"
                  },
                  "coupons": [
                    {
                      "code": "SAVE10",
                      "rateBipsOff": 1000,
                      "label": "10% Off",
                      "validUntil": null
                    },
                    {
                      "code": "VIP25",
                      "rateBipsOff": 2500,
                      "label": null,
                      "validUntil": "2099-12-31T23:59:59.000Z"
                    }
                  ],
                  "customerPiiClearedAt": null
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "orgId": {
                      "type": "string",
                      "description": "Id of the Zaprite organization that created this order"
                    },
                    "orderType": {
                      "type": "string",
                      "enum": [
                        "invoice",
                        "apiInvoice",
                        "paymentLink",
                        "pos",
                        "event",
                        "wooCommerce",
                        "paymentRequest",
                        "apiOrder",
                        "other"
                      ]
                    },
                    "totalAmount": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991,
                      "description": "Total amount to be paid by the customer in currency smallest unit (e.g. cents or sats)"
                    },
                    "currency": {
                      "type": "string",
                      "enum": [
                        "USD",
                        "USDC",
                        "USDT",
                        "BTC",
                        "LBTC",
                        "ALL",
                        "DZD",
                        "ARS",
                        "AMD",
                        "AUD",
                        "AZN",
                        "BHD",
                        "BDT",
                        "BYN",
                        "BMD",
                        "BOB",
                        "BAM",
                        "BRL",
                        "BGN",
                        "KHR",
                        "CAD",
                        "CLP",
                        "CNY",
                        "COP",
                        "CRC",
                        "HRK",
                        "CUP",
                        "CZK",
                        "DKK",
                        "DOP",
                        "EGP",
                        "EUR",
                        "GEL",
                        "GHS",
                        "GTQ",
                        "HNL",
                        "HKD",
                        "HUF",
                        "ISK",
                        "INR",
                        "IDR",
                        "IRR",
                        "IQD",
                        "ILS",
                        "JMD",
                        "JPY",
                        "JOD",
                        "KZT",
                        "KES",
                        "KWD",
                        "KGS",
                        "LBP",
                        "MKD",
                        "MYR",
                        "MUR",
                        "MXN",
                        "MDL",
                        "MNT",
                        "MAD",
                        "MMK",
                        "NAD",
                        "NPR",
                        "TWD",
                        "NZD",
                        "NIO",
                        "NGN",
                        "NOK",
                        "OMR",
                        "PKR",
                        "PAB",
                        "PEN",
                        "PHP",
                        "PLN",
                        "GBP",
                        "QAR",
                        "RON",
                        "RUB",
                        "SAR",
                        "RSD",
                        "SGD",
                        "ZAR",
                        "KRW",
                        "SSP",
                        "VES",
                        "LKR",
                        "SEK",
                        "CHF",
                        "THB",
                        "TTD",
                        "TND",
                        "TRY",
                        "UGX",
                        "UAH",
                        "AED",
                        "UYU",
                        "UZS",
                        "VND"
                      ]
                    },
                    "externalUniqId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "PENDING",
                        "PROCESSING",
                        "PAID",
                        "OVERPAID",
                        "UNDERPAID",
                        "COMPLETE"
                      ],
                      "description": "`PENDING`: The order is pending payment</br>`PROCESSING`: The order received a payment but the transaction is still pending (ie. an on-chain transaction with 0 conf or manual bank transfer awaiting manual confirmation)</br>`PAID`: The order was paid but it requires manual fulfillment to be flagged as `COMPLETE`</br>`COMPLETE`: The order was paid and is complete</br>`OVERPAID`: The order received a payment that was more than the total amount</br>`UNDERPAID`: The order received a payment that was less than the total amount"
                    },
                    "paidAt": {
                      "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\"). `null` until the order is paid.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "expiresAt": {
                      "description": "Date in ISO 8601 format when this order expires. After this time, an order with no payment yet cannot be paid; a partly paid order can still be paid in full.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "countdownToExpiry": {
                      "type": "boolean",
                      "description": "If true and `expiresAt` is set, the checkout shows a countdown to `expiresAt` during its last 60 minutes."
                    },
                    "redirectUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "label": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "checkoutUrl": {
                      "type": "string",
                      "format": "uri",
                      "description": "Send your customer to this URL to complete the payment. It carries the order’s access token: use it as returned, do not build it from the order id."
                    },
                    "receiptPdfUrl": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uri"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "URL to download the Order receipt PDF, with the order’s access token. `null` until the order is paid."
                    },
                    "customCheckoutId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "contact": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "legalName": {
                              "type": "string"
                            },
                            "contactName": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "displayName": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "email": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "email",
                                  "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "taxId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "defaultCurrency": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "enum": [
                                    "USD",
                                    "USDC",
                                    "USDT",
                                    "BTC",
                                    "LBTC",
                                    "ALL",
                                    "DZD",
                                    "ARS",
                                    "AMD",
                                    "AUD",
                                    "AZN",
                                    "BHD",
                                    "BDT",
                                    "BYN",
                                    "BMD",
                                    "BOB",
                                    "BAM",
                                    "BRL",
                                    "BGN",
                                    "KHR",
                                    "CAD",
                                    "CLP",
                                    "CNY",
                                    "COP",
                                    "CRC",
                                    "HRK",
                                    "CUP",
                                    "CZK",
                                    "DKK",
                                    "DOP",
                                    "EGP",
                                    "EUR",
                                    "GEL",
                                    "GHS",
                                    "GTQ",
                                    "HNL",
                                    "HKD",
                                    "HUF",
                                    "ISK",
                                    "INR",
                                    "IDR",
                                    "IRR",
                                    "IQD",
                                    "ILS",
                                    "JMD",
                                    "JPY",
                                    "JOD",
                                    "KZT",
                                    "KES",
                                    "KWD",
                                    "KGS",
                                    "LBP",
                                    "MKD",
                                    "MYR",
                                    "MUR",
                                    "MXN",
                                    "MDL",
                                    "MNT",
                                    "MAD",
                                    "MMK",
                                    "NAD",
                                    "NPR",
                                    "TWD",
                                    "NZD",
                                    "NIO",
                                    "NGN",
                                    "NOK",
                                    "OMR",
                                    "PKR",
                                    "PAB",
                                    "PEN",
                                    "PHP",
                                    "PLN",
                                    "GBP",
                                    "QAR",
                                    "RON",
                                    "RUB",
                                    "SAR",
                                    "RSD",
                                    "SGD",
                                    "ZAR",
                                    "KRW",
                                    "SSP",
                                    "VES",
                                    "LKR",
                                    "SEK",
                                    "CHF",
                                    "THB",
                                    "TTD",
                                    "TND",
                                    "TRY",
                                    "UGX",
                                    "UAH",
                                    "AED",
                                    "UYU",
                                    "UZS",
                                    "VND"
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "billingAddress": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "line1": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "line2": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "zipCode": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "city": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "state": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "countryCode": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "line1",
                                    "line2",
                                    "zipCode",
                                    "city",
                                    "state",
                                    "countryCode"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "paymentProfiles": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "externalId": {
                                    "type": "string"
                                  },
                                  "method": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  },
                                  "expiresAt": {
                                    "anyOf": [
                                      {
                                        "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "connection": {
                                    "type": "object",
                                    "properties": {
                                      "label": {
                                        "type": "string"
                                      },
                                      "pluginSlug": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "label",
                                      "pluginSlug",
                                      "id"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "sourceOrder": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "externalUniqId": {
                                            "type": [
                                              "string",
                                              "null"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "externalUniqId"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ],
                                    "description": "The Order that your customer was paying when saving this payment profile."
                                  }
                                },
                                "required": [
                                  "id",
                                  "externalId",
                                  "method",
                                  "label",
                                  "expiresAt",
                                  "connection",
                                  "sourceOrder"
                                ],
                                "additionalProperties": false
                              },
                              "description": "Active saved Payment Profiles for this contact. Can be used to pay Orders with the `charge` endpoint."
                            }
                          },
                          "required": [
                            "id",
                            "legalName",
                            "contactName",
                            "displayName",
                            "email",
                            "taxId",
                            "defaultCurrency",
                            "billingAddress",
                            "paymentProfiles"
                          ],
                          "additionalProperties": false,
                          "description": "Optional Zaprite contact associated with this order"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "invoice": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "number": {
                              "type": "string",
                              "description": "Invoice number, displayed on the invoice page and PDF"
                            },
                            "title": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "orgId": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "DRAFT",
                                "SENT",
                                "OVERDUE",
                                "PAID",
                                "OVERPAID",
                                "UNDERPAID",
                                "VOID"
                              ]
                            },
                            "footerNote": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "daysToPay": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "description": "Natural days from invoice date before the invoice is overdue. If null, invoice will be shown as \"DUE ON RECEIPT\""
                            },
                            "date": {
                              "type": "string",
                              "description": "Date of the invoice, displayed on the invoice page and PDF. Format: YYYY-MM-DD"
                            },
                            "purchaseOrderNumber": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "hideOrgAddress": {
                              "type": "boolean",
                              "description": "Organization address is hidden on the public invoice"
                            },
                            "hideOrgEmail": {
                              "type": "boolean",
                              "description": "Organization email is hidden on the public invoice"
                            },
                            "hideOrgName": {
                              "type": "boolean",
                              "description": "Organization name is hidden on the public invoice"
                            },
                            "sentAt": {
                              "description": "Date when the invoice was sent to the customer",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "voidedAt": {
                              "description": "Date when the invoice was voided",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "publicUrl": {
                              "type": "string",
                              "format": "uri",
                              "description": "URL to view the public invoice page. It carries the invoice’s access token: use it as returned, do not build it from the invoice id."
                            },
                            "customer": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    },
                                    "legalName": {
                                      "type": "string"
                                    },
                                    "contactName": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "displayName": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "email": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "format": "email",
                                          "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "taxId": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "defaultCurrency": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "enum": [
                                            "USD",
                                            "USDC",
                                            "USDT",
                                            "BTC",
                                            "LBTC",
                                            "ALL",
                                            "DZD",
                                            "ARS",
                                            "AMD",
                                            "AUD",
                                            "AZN",
                                            "BHD",
                                            "BDT",
                                            "BYN",
                                            "BMD",
                                            "BOB",
                                            "BAM",
                                            "BRL",
                                            "BGN",
                                            "KHR",
                                            "CAD",
                                            "CLP",
                                            "CNY",
                                            "COP",
                                            "CRC",
                                            "HRK",
                                            "CUP",
                                            "CZK",
                                            "DKK",
                                            "DOP",
                                            "EGP",
                                            "EUR",
                                            "GEL",
                                            "GHS",
                                            "GTQ",
                                            "HNL",
                                            "HKD",
                                            "HUF",
                                            "ISK",
                                            "INR",
                                            "IDR",
                                            "IRR",
                                            "IQD",
                                            "ILS",
                                            "JMD",
                                            "JPY",
                                            "JOD",
                                            "KZT",
                                            "KES",
                                            "KWD",
                                            "KGS",
                                            "LBP",
                                            "MKD",
                                            "MYR",
                                            "MUR",
                                            "MXN",
                                            "MDL",
                                            "MNT",
                                            "MAD",
                                            "MMK",
                                            "NAD",
                                            "NPR",
                                            "TWD",
                                            "NZD",
                                            "NIO",
                                            "NGN",
                                            "NOK",
                                            "OMR",
                                            "PKR",
                                            "PAB",
                                            "PEN",
                                            "PHP",
                                            "PLN",
                                            "GBP",
                                            "QAR",
                                            "RON",
                                            "RUB",
                                            "SAR",
                                            "RSD",
                                            "SGD",
                                            "ZAR",
                                            "KRW",
                                            "SSP",
                                            "VES",
                                            "LKR",
                                            "SEK",
                                            "CHF",
                                            "THB",
                                            "TTD",
                                            "TND",
                                            "TRY",
                                            "UGX",
                                            "UAH",
                                            "AED",
                                            "UYU",
                                            "UZS",
                                            "VND"
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "billingAddress": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "line1": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "line2": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "zipCode": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "city": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "state": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "countryCode": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "line1",
                                            "line2",
                                            "zipCode",
                                            "city",
                                            "state",
                                            "countryCode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "paymentProfiles": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "externalId": {
                                            "type": "string"
                                          },
                                          "method": {
                                            "type": "string"
                                          },
                                          "label": {
                                            "type": "string"
                                          },
                                          "expiresAt": {
                                            "anyOf": [
                                              {
                                                "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                                                "type": "string"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "connection": {
                                            "type": "object",
                                            "properties": {
                                              "label": {
                                                "type": "string"
                                              },
                                              "pluginSlug": {
                                                "type": "string"
                                              },
                                              "id": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "label",
                                              "pluginSlug",
                                              "id"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "sourceOrder": {
                                            "anyOf": [
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string"
                                                  },
                                                  "externalUniqId": {
                                                    "type": [
                                                      "string",
                                                      "null"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "externalUniqId"
                                                ],
                                                "additionalProperties": false
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ],
                                            "description": "The Order that your customer was paying when saving this payment profile."
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "externalId",
                                          "method",
                                          "label",
                                          "expiresAt",
                                          "connection",
                                          "sourceOrder"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "description": "Active saved Payment Profiles for this contact. Can be used to pay Orders with the `charge` endpoint."
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "legalName",
                                    "contactName",
                                    "displayName",
                                    "email",
                                    "taxId",
                                    "defaultCurrency",
                                    "billingAddress",
                                    "paymentProfiles"
                                  ],
                                  "additionalProperties": false,
                                  "description": "**DEPRECATED:** Use `order.contact` instead"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "lineItems": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "unitPrice": {
                                    "description": "Price of the item in currency smallest unit (e.g. cents or sats)",
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  "quantity": {
                                    "type": "number",
                                    "description": "Quantity of units (Max 2 decimal places)"
                                  },
                                  "taxRateBips": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991,
                                    "description": "Tax rate in bips (e.g. 1234 for 12.34%)"
                                  },
                                  "taxAmount": {
                                    "description": "In currency smallest unit (e.g. cents or sats)",
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  "discountRateBips": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991,
                                    "description": "Discount rate in bips (e.g. 1234 for 12.34%)"
                                  },
                                  "discountAmount": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "id",
                                  "name",
                                  "description",
                                  "unitPrice",
                                  "quantity",
                                  "taxRateBips",
                                  "taxAmount",
                                  "discountRateBips",
                                  "discountAmount"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "discountRateBips": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991,
                              "description": "Discount on the whole invoice, in bips (e.g. 1000 for 10%). 0 if none"
                            },
                            "discountAmount": {
                              "description": "Fixed discount on the whole invoice, in currency smallest unit. 0 if none",
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "discountLabel": {
                              "description": "Label of the invoice discount in the totals",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "amounts": {
                              "type": "object",
                              "properties": {
                                "subtotal": {
                                  "type": "number"
                                },
                                "lineDiscounts": {
                                  "type": "number"
                                },
                                "invoiceDiscount": {
                                  "type": "number"
                                },
                                "tax": {
                                  "type": "number"
                                },
                                "total": {
                                  "type": "number"
                                }
                              },
                              "required": [
                                "subtotal",
                                "lineDiscounts",
                                "invoiceDiscount",
                                "tax",
                                "total"
                              ],
                              "additionalProperties": false,
                              "description": "Invoice totals in currency smallest unit: subtotal - lineDiscounts - invoiceDiscount + tax = total"
                            }
                          },
                          "required": [
                            "id",
                            "number",
                            "title",
                            "orgId",
                            "status",
                            "footerNote",
                            "daysToPay",
                            "date",
                            "purchaseOrderNumber",
                            "hideOrgAddress",
                            "hideOrgEmail",
                            "hideOrgName",
                            "sentAt",
                            "voidedAt",
                            "publicUrl",
                            "customer",
                            "lineItems",
                            "discountRateBips",
                            "discountAmount",
                            "discountLabel",
                            "amounts"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Set only if the order is for a Zaprite invoice (`orderType=\"invoice\"` or `\"apiInvoice\"`), `null` otherwise"
                    },
                    "paymentLink": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "title": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "title"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Set only if the order was created from a Payment Link (`orderType=\"paymentLink\"`), `null` otherwise"
                    },
                    "transactions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "date": {
                            "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                            "type": "string"
                          },
                          "amount": {
                            "description": "Transaction amount in currency smallest unit (e.g. cents or sats)",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "currency": {
                            "type": "string",
                            "enum": [
                              "USD",
                              "USDC",
                              "USDT",
                              "BTC",
                              "LBTC",
                              "ALL",
                              "DZD",
                              "ARS",
                              "AMD",
                              "AUD",
                              "AZN",
                              "BHD",
                              "BDT",
                              "BYN",
                              "BMD",
                              "BOB",
                              "BAM",
                              "BRL",
                              "BGN",
                              "KHR",
                              "CAD",
                              "CLP",
                              "CNY",
                              "COP",
                              "CRC",
                              "HRK",
                              "CUP",
                              "CZK",
                              "DKK",
                              "DOP",
                              "EGP",
                              "EUR",
                              "GEL",
                              "GHS",
                              "GTQ",
                              "HNL",
                              "HKD",
                              "HUF",
                              "ISK",
                              "INR",
                              "IDR",
                              "IRR",
                              "IQD",
                              "ILS",
                              "JMD",
                              "JPY",
                              "JOD",
                              "KZT",
                              "KES",
                              "KWD",
                              "KGS",
                              "LBP",
                              "MKD",
                              "MYR",
                              "MUR",
                              "MXN",
                              "MDL",
                              "MNT",
                              "MAD",
                              "MMK",
                              "NAD",
                              "NPR",
                              "TWD",
                              "NZD",
                              "NIO",
                              "NGN",
                              "NOK",
                              "OMR",
                              "PKR",
                              "PAB",
                              "PEN",
                              "PHP",
                              "PLN",
                              "GBP",
                              "QAR",
                              "RON",
                              "RUB",
                              "SAR",
                              "RSD",
                              "SGD",
                              "ZAR",
                              "KRW",
                              "SSP",
                              "VES",
                              "LKR",
                              "SEK",
                              "CHF",
                              "THB",
                              "TTD",
                              "TND",
                              "TRY",
                              "UGX",
                              "UAH",
                              "AED",
                              "UYU",
                              "UZS",
                              "VND"
                            ]
                          },
                          "amountInOrderCurrency": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Transaction amount denominated in the currency of the Order and in smallest unit (e.g. cents or sats)"
                          },
                          "discountsInOrderCurrency": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "amountOff": {
                                  "description": "Amount of the discount denominated in `orderCurrency` and in smallest unit (e.g cents or sats). Negative value means a premium was applied.",
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "rateBipsOff": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991,
                                  "description": "Rate of the discount in bips (e.g. 1234 for 12.34%). Negative value means a premium was applied."
                                },
                                "paymentType": {
                                  "type": "string",
                                  "enum": [
                                    "FIAT",
                                    "BITCOIN",
                                    "LIGHTNING",
                                    "STABLECOIN"
                                  ],
                                  "description": "Type of payments this discount applies to"
                                }
                              },
                              "required": [
                                "amountOff",
                                "rateBipsOff",
                                "paymentType"
                              ],
                              "additionalProperties": false
                            },
                            "description": "List premiums and discounts applied to this transaction. Note: The amount retained as payment for the Order is `amountInOrderCurrency + sum(discountsInChargeCurrency.amount)`"
                          },
                          "orderCurrency": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "USD",
                                  "USDC",
                                  "USDT",
                                  "BTC",
                                  "LBTC",
                                  "ALL",
                                  "DZD",
                                  "ARS",
                                  "AMD",
                                  "AUD",
                                  "AZN",
                                  "BHD",
                                  "BDT",
                                  "BYN",
                                  "BMD",
                                  "BOB",
                                  "BAM",
                                  "BRL",
                                  "BGN",
                                  "KHR",
                                  "CAD",
                                  "CLP",
                                  "CNY",
                                  "COP",
                                  "CRC",
                                  "HRK",
                                  "CUP",
                                  "CZK",
                                  "DKK",
                                  "DOP",
                                  "EGP",
                                  "EUR",
                                  "GEL",
                                  "GHS",
                                  "GTQ",
                                  "HNL",
                                  "HKD",
                                  "HUF",
                                  "ISK",
                                  "INR",
                                  "IDR",
                                  "IRR",
                                  "IQD",
                                  "ILS",
                                  "JMD",
                                  "JPY",
                                  "JOD",
                                  "KZT",
                                  "KES",
                                  "KWD",
                                  "KGS",
                                  "LBP",
                                  "MKD",
                                  "MYR",
                                  "MUR",
                                  "MXN",
                                  "MDL",
                                  "MNT",
                                  "MAD",
                                  "MMK",
                                  "NAD",
                                  "NPR",
                                  "TWD",
                                  "NZD",
                                  "NIO",
                                  "NGN",
                                  "NOK",
                                  "OMR",
                                  "PKR",
                                  "PAB",
                                  "PEN",
                                  "PHP",
                                  "PLN",
                                  "GBP",
                                  "QAR",
                                  "RON",
                                  "RUB",
                                  "SAR",
                                  "RSD",
                                  "SGD",
                                  "ZAR",
                                  "KRW",
                                  "SSP",
                                  "VES",
                                  "LKR",
                                  "SEK",
                                  "CHF",
                                  "THB",
                                  "TTD",
                                  "TND",
                                  "TRY",
                                  "UGX",
                                  "UAH",
                                  "AED",
                                  "UYU",
                                  "UZS",
                                  "VND"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Currency of the Order this transaction is paying for. For example, when paying an USD invoice in BTC, transaction `currency` would be USD and `orderCurrency` USD."
                          },
                          "accountingCurrency": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "USD",
                                  "USDC",
                                  "USDT",
                                  "BTC",
                                  "LBTC",
                                  "ALL",
                                  "DZD",
                                  "ARS",
                                  "AMD",
                                  "AUD",
                                  "AZN",
                                  "BHD",
                                  "BDT",
                                  "BYN",
                                  "BMD",
                                  "BOB",
                                  "BAM",
                                  "BRL",
                                  "BGN",
                                  "KHR",
                                  "CAD",
                                  "CLP",
                                  "CNY",
                                  "COP",
                                  "CRC",
                                  "HRK",
                                  "CUP",
                                  "CZK",
                                  "DKK",
                                  "DOP",
                                  "EGP",
                                  "EUR",
                                  "GEL",
                                  "GHS",
                                  "GTQ",
                                  "HNL",
                                  "HKD",
                                  "HUF",
                                  "ISK",
                                  "INR",
                                  "IDR",
                                  "IRR",
                                  "IQD",
                                  "ILS",
                                  "JMD",
                                  "JPY",
                                  "JOD",
                                  "KZT",
                                  "KES",
                                  "KWD",
                                  "KGS",
                                  "LBP",
                                  "MKD",
                                  "MYR",
                                  "MUR",
                                  "MXN",
                                  "MDL",
                                  "MNT",
                                  "MAD",
                                  "MMK",
                                  "NAD",
                                  "NPR",
                                  "TWD",
                                  "NZD",
                                  "NIO",
                                  "NGN",
                                  "NOK",
                                  "OMR",
                                  "PKR",
                                  "PAB",
                                  "PEN",
                                  "PHP",
                                  "PLN",
                                  "GBP",
                                  "QAR",
                                  "RON",
                                  "RUB",
                                  "SAR",
                                  "RSD",
                                  "SGD",
                                  "ZAR",
                                  "KRW",
                                  "SSP",
                                  "VES",
                                  "LKR",
                                  "SEK",
                                  "CHF",
                                  "THB",
                                  "TTD",
                                  "TND",
                                  "TRY",
                                  "UGX",
                                  "UAH",
                                  "AED",
                                  "UYU",
                                  "UZS",
                                  "VND"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "The is the currency configured for your Organization"
                          },
                          "amountInAccountingCurrency": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Transaction amount denominated in accounting currency and in smallest unit (e.g. cents or sats)"
                          },
                          "method": {
                            "type": "string",
                            "enum": [
                              "BITCOIN",
                              "LIQUID",
                              "LIGHTNING",
                              "BANK",
                              "CARD",
                              "CASH",
                              "CHECK",
                              "GIFTCARD",
                              "COUPON",
                              "APPLEPAY",
                              "GOOGLEPAY",
                              "CASHAPP_PAY",
                              "INTERAC",
                              "ACH",
                              "SEPA",
                              "UNKNOWN",
                              "WIRE_TRANSFER",
                              "VENMO",
                              "PAYPAL",
                              "REVOLUT_PAY",
                              "NO_CHARGE",
                              "TETHER",
                              "USDCIRCLE"
                            ]
                          },
                          "externalRef": {
                            "description": "External reference for the transaction. (e.g. Bitcoin txId, Stripe transaction ID...)",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "PENDING",
                              "CONFIRMED",
                              "CANCELED"
                            ]
                          }
                        },
                        "required": [
                          "date",
                          "amount",
                          "currency",
                          "amountInOrderCurrency",
                          "discountsInOrderCurrency",
                          "orderCurrency",
                          "accountingCurrency",
                          "amountInAccountingCurrency",
                          "method",
                          "externalRef",
                          "status"
                        ],
                        "additionalProperties": false
                      },
                      "description": "All transactions this Order received"
                    },
                    "customerData": {
                      "type": "object",
                      "properties": {
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "address": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "line1": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "line2": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "zipCode": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "city": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "state": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "countryCode": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "line1",
                                "line2",
                                "zipCode",
                                "city",
                                "state",
                                "countryCode"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "note": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "company": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "email",
                        "name",
                        "phone",
                        "address",
                        "note",
                        "company"
                      ],
                      "additionalProperties": {},
                      "description": "Customer data collected on payment links if you enabled customer fields. Custom field values are included as additional keys."
                    },
                    "customerFields": {
                      "type": "object",
                      "properties": {
                        "address": {
                          "type": "string",
                          "enum": [
                            "REQUIRED",
                            "OPTIONAL"
                          ]
                        },
                        "email": {
                          "type": "string",
                          "enum": [
                            "REQUIRED",
                            "OPTIONAL"
                          ]
                        },
                        "name": {
                          "type": "string",
                          "enum": [
                            "REQUIRED",
                            "OPTIONAL"
                          ]
                        },
                        "phone": {
                          "type": "string",
                          "enum": [
                            "REQUIRED",
                            "OPTIONAL"
                          ]
                        },
                        "note": {
                          "type": "string",
                          "enum": [
                            "REQUIRED",
                            "OPTIONAL"
                          ]
                        }
                      },
                      "additionalProperties": false,
                      "description": "Configuration for fields displayed on checkout page to collect customer data"
                    },
                    "metadata": {
                      "default": {},
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": "string"
                      },
                      "description": "Custom metadata for this order"
                    },
                    "tags": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Custom tags for this order"
                    },
                    "allowSavePaymentProfile": {
                      "default": false,
                      "type": "boolean",
                      "description": "If true and the selected payment method supports autopay, then the customer will be able to save their payment profile for future payments."
                    },
                    "eventTickets": {
                      "default": [],
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "paymentLinkItem": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "title": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "title"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "id",
                          "paymentLinkItem"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Event tickets issued for this order (empty if none)."
                    },
                    "orderItems": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "label": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "quantity": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "paymentLinkItem": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "title": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "title"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "label",
                          "quantity",
                          "paymentLinkItem"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Order items for this order. Empty if none."
                    },
                    "promo": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "code": {
                              "description": "Coupon code applied to this order",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "amountOff": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991,
                              "description": "Fixed amount discounted from the order total in currency smallest unit (e.g. cents or sats)"
                            },
                            "rateBipsOff": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991,
                              "description": "Percentage discount rate in bips (e.g. 1000 for 10%). Applied before taxes."
                            },
                            "label": {
                              "description": "Display label for the coupon",
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "code",
                            "amountOff",
                            "rateBipsOff",
                            "label"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Coupon applied to this order. `null` if none."
                    },
                    "coupons": {
                      "default": [],
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string",
                            "description": "Code that the customer enters at checkout"
                          },
                          "rateBipsOff": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991,
                            "description": "Percentage discount in bips (e.g. 1000 for 10%)"
                          },
                          "label": {
                            "description": "Display label for the coupon",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "validUntil": {
                            "description": "Date in ISO 8601 format after which the customer can no longer apply this coupon. `null` if it has no end date.",
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "code",
                          "rateBipsOff",
                          "label",
                          "validUntil"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Coupons that the customer can apply at checkout, set with `coupons` when the Order was created with the API. Empty if none."
                    },
                    "customerPiiClearedAt": {
                      "description": "Date in ISO 8601 format when the customer PII of this order was cleared with `POST /orders/{id}/clear-customer-pii`. `null` if it was never cleared.",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "orgId",
                    "orderType",
                    "totalAmount",
                    "currency",
                    "externalUniqId",
                    "status",
                    "paidAt",
                    "expiresAt",
                    "countdownToExpiry",
                    "redirectUrl",
                    "label",
                    "checkoutUrl",
                    "receiptPdfUrl",
                    "customCheckoutId",
                    "contact",
                    "invoice",
                    "paymentLink",
                    "transactions",
                    "customerData",
                    "customerFields",
                    "metadata",
                    "tags",
                    "allowSavePaymentProfile",
                    "eventTickets",
                    "orderItems",
                    "promo",
                    "coupons",
                    "customerPiiClearedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, invalid, expired or suspended, or your organization cannot use this endpoint. `message` says which.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the `orders.update` scope. Add it to the key in your API settings, or use a key that has it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "order-getById",
        "summary": "Get Order",
        "description": "Get an order by either it's Zaprite ID or your own ID (`externalUniqId`)<br/><br/>Required API key scope: `orders.get` or `orders.read`",
        "tags": [
          "Orders"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "Zaprite `id` or `externalUniqId`"
            },
            "required": true,
            "description": "Zaprite `id` or `externalUniqId`"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "example": {
                  "id": "od_abc123",
                  "orgId": "abc123",
                  "orderType": "other",
                  "totalAmount": 100,
                  "currency": "USD",
                  "externalUniqId": "abc123",
                  "status": "PROCESSING",
                  "paidAt": "2024-02-25T11:04:09.656Z",
                  "expiresAt": "2024-03-25T11:04:09.656Z",
                  "countdownToExpiry": true,
                  "redirectUrl": "https://your-url.com",
                  "label": "Order label",
                  "checkoutUrl": "https://pay.zaprite.com/order/od_abc123#access=Xk2fQ9pLmT4wZa",
                  "receiptPdfUrl": null,
                  "customCheckoutId": null,
                  "eventTickets": [
                    {
                      "id": "et_123",
                      "paymentLinkItem": {
                        "id": "pi_123",
                        "title": "VIP Ticket"
                      }
                    }
                  ],
                  "orderItems": [
                    {
                      "id": "oi_123",
                      "label": "VIP Ticket",
                      "quantity": 1,
                      "paymentLinkItem": {
                        "id": "pi_123",
                        "title": "VIP Ticket"
                      }
                    }
                  ],
                  "invoice": null,
                  "contact": null,
                  "transactions": [
                    {
                      "amount": 1400,
                      "currency": "BTC",
                      "amountInOrderCurrency": 100,
                      "discountsInOrderCurrency": [],
                      "orderCurrency": "USD",
                      "amountInAccountingCurrency": 100,
                      "accountingCurrency": "USD",
                      "method": "BITCOIN",
                      "status": "PENDING",
                      "date": "2024-02-25T11:04:09.656Z",
                      "externalRef": "b340b455d25ae2379e3a22328c96421a8f5a4483848e01f14eee0abae89daabc"
                    }
                  ],
                  "paymentLink": null,
                  "customerData": {
                    "email": "example@email.com",
                    "name": "John Doe",
                    "phone": "1234567890",
                    "address": null,
                    "note": "Example customer note",
                    "company": "Example company"
                  },
                  "metadata": {
                    "custom_id": "12345",
                    "customer_reference": "ABC123"
                  },
                  "tags": [
                    "tag1",
                    "tag2"
                  ],
                  "allowSavePaymentProfile": false,
                  "customerFields": {
                    "address": "OPTIONAL",
                    "email": "REQUIRED",
                    "name": "OPTIONAL"
                  },
                  "promo": {
                    "code": "SAVE10",
                    "amountOff": 0,
                    "rateBipsOff": 1000,
                    "label": "10% Off"
                  },
                  "coupons": [
                    {
                      "code": "SAVE10",
                      "rateBipsOff": 1000,
                      "label": "10% Off",
                      "validUntil": null
                    },
                    {
                      "code": "VIP25",
                      "rateBipsOff": 2500,
                      "label": null,
                      "validUntil": "2099-12-31T23:59:59.000Z"
                    }
                  ],
                  "customerPiiClearedAt": null
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "orgId": {
                      "type": "string",
                      "description": "Id of the Zaprite organization that created this order"
                    },
                    "orderType": {
                      "type": "string",
                      "enum": [
                        "invoice",
                        "apiInvoice",
                        "paymentLink",
                        "pos",
                        "event",
                        "wooCommerce",
                        "paymentRequest",
                        "apiOrder",
                        "other"
                      ]
                    },
                    "totalAmount": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991,
                      "description": "Total amount to be paid by the customer in currency smallest unit (e.g. cents or sats)"
                    },
                    "currency": {
                      "type": "string",
                      "enum": [
                        "USD",
                        "USDC",
                        "USDT",
                        "BTC",
                        "LBTC",
                        "ALL",
                        "DZD",
                        "ARS",
                        "AMD",
                        "AUD",
                        "AZN",
                        "BHD",
                        "BDT",
                        "BYN",
                        "BMD",
                        "BOB",
                        "BAM",
                        "BRL",
                        "BGN",
                        "KHR",
                        "CAD",
                        "CLP",
                        "CNY",
                        "COP",
                        "CRC",
                        "HRK",
                        "CUP",
                        "CZK",
                        "DKK",
                        "DOP",
                        "EGP",
                        "EUR",
                        "GEL",
                        "GHS",
                        "GTQ",
                        "HNL",
                        "HKD",
                        "HUF",
                        "ISK",
                        "INR",
                        "IDR",
                        "IRR",
                        "IQD",
                        "ILS",
                        "JMD",
                        "JPY",
                        "JOD",
                        "KZT",
                        "KES",
                        "KWD",
                        "KGS",
                        "LBP",
                        "MKD",
                        "MYR",
                        "MUR",
                        "MXN",
                        "MDL",
                        "MNT",
                        "MAD",
                        "MMK",
                        "NAD",
                        "NPR",
                        "TWD",
                        "NZD",
                        "NIO",
                        "NGN",
                        "NOK",
                        "OMR",
                        "PKR",
                        "PAB",
                        "PEN",
                        "PHP",
                        "PLN",
                        "GBP",
                        "QAR",
                        "RON",
                        "RUB",
                        "SAR",
                        "RSD",
                        "SGD",
                        "ZAR",
                        "KRW",
                        "SSP",
                        "VES",
                        "LKR",
                        "SEK",
                        "CHF",
                        "THB",
                        "TTD",
                        "TND",
                        "TRY",
                        "UGX",
                        "UAH",
                        "AED",
                        "UYU",
                        "UZS",
                        "VND"
                      ]
                    },
                    "externalUniqId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "PENDING",
                        "PROCESSING",
                        "PAID",
                        "OVERPAID",
                        "UNDERPAID",
                        "COMPLETE"
                      ],
                      "description": "`PENDING`: The order is pending payment</br>`PROCESSING`: The order received a payment but the transaction is still pending (ie. an on-chain transaction with 0 conf or manual bank transfer awaiting manual confirmation)</br>`PAID`: The order was paid but it requires manual fulfillment to be flagged as `COMPLETE`</br>`COMPLETE`: The order was paid and is complete</br>`OVERPAID`: The order received a payment that was more than the total amount</br>`UNDERPAID`: The order received a payment that was less than the total amount"
                    },
                    "paidAt": {
                      "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\"). `null` until the order is paid.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "expiresAt": {
                      "description": "Date in ISO 8601 format when this order expires. After this time, an order with no payment yet cannot be paid; a partly paid order can still be paid in full.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "countdownToExpiry": {
                      "type": "boolean",
                      "description": "If true and `expiresAt` is set, the checkout shows a countdown to `expiresAt` during its last 60 minutes."
                    },
                    "redirectUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "label": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "checkoutUrl": {
                      "type": "string",
                      "format": "uri",
                      "description": "Send your customer to this URL to complete the payment. It carries the order’s access token: use it as returned, do not build it from the order id."
                    },
                    "receiptPdfUrl": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uri"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "URL to download the Order receipt PDF, with the order’s access token. `null` until the order is paid."
                    },
                    "customCheckoutId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "contact": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "legalName": {
                              "type": "string"
                            },
                            "contactName": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "displayName": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "email": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "email",
                                  "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "taxId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "defaultCurrency": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "enum": [
                                    "USD",
                                    "USDC",
                                    "USDT",
                                    "BTC",
                                    "LBTC",
                                    "ALL",
                                    "DZD",
                                    "ARS",
                                    "AMD",
                                    "AUD",
                                    "AZN",
                                    "BHD",
                                    "BDT",
                                    "BYN",
                                    "BMD",
                                    "BOB",
                                    "BAM",
                                    "BRL",
                                    "BGN",
                                    "KHR",
                                    "CAD",
                                    "CLP",
                                    "CNY",
                                    "COP",
                                    "CRC",
                                    "HRK",
                                    "CUP",
                                    "CZK",
                                    "DKK",
                                    "DOP",
                                    "EGP",
                                    "EUR",
                                    "GEL",
                                    "GHS",
                                    "GTQ",
                                    "HNL",
                                    "HKD",
                                    "HUF",
                                    "ISK",
                                    "INR",
                                    "IDR",
                                    "IRR",
                                    "IQD",
                                    "ILS",
                                    "JMD",
                                    "JPY",
                                    "JOD",
                                    "KZT",
                                    "KES",
                                    "KWD",
                                    "KGS",
                                    "LBP",
                                    "MKD",
                                    "MYR",
                                    "MUR",
                                    "MXN",
                                    "MDL",
                                    "MNT",
                                    "MAD",
                                    "MMK",
                                    "NAD",
                                    "NPR",
                                    "TWD",
                                    "NZD",
                                    "NIO",
                                    "NGN",
                                    "NOK",
                                    "OMR",
                                    "PKR",
                                    "PAB",
                                    "PEN",
                                    "PHP",
                                    "PLN",
                                    "GBP",
                                    "QAR",
                                    "RON",
                                    "RUB",
                                    "SAR",
                                    "RSD",
                                    "SGD",
                                    "ZAR",
                                    "KRW",
                                    "SSP",
                                    "VES",
                                    "LKR",
                                    "SEK",
                                    "CHF",
                                    "THB",
                                    "TTD",
                                    "TND",
                                    "TRY",
                                    "UGX",
                                    "UAH",
                                    "AED",
                                    "UYU",
                                    "UZS",
                                    "VND"
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "billingAddress": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "line1": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "line2": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "zipCode": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "city": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "state": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "countryCode": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "line1",
                                    "line2",
                                    "zipCode",
                                    "city",
                                    "state",
                                    "countryCode"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "paymentProfiles": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "externalId": {
                                    "type": "string"
                                  },
                                  "method": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  },
                                  "expiresAt": {
                                    "anyOf": [
                                      {
                                        "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "connection": {
                                    "type": "object",
                                    "properties": {
                                      "label": {
                                        "type": "string"
                                      },
                                      "pluginSlug": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "label",
                                      "pluginSlug",
                                      "id"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "sourceOrder": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "externalUniqId": {
                                            "type": [
                                              "string",
                                              "null"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "externalUniqId"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ],
                                    "description": "The Order that your customer was paying when saving this payment profile."
                                  }
                                },
                                "required": [
                                  "id",
                                  "externalId",
                                  "method",
                                  "label",
                                  "expiresAt",
                                  "connection",
                                  "sourceOrder"
                                ],
                                "additionalProperties": false
                              },
                              "description": "Active saved Payment Profiles for this contact. Can be used to pay Orders with the `charge` endpoint."
                            }
                          },
                          "required": [
                            "id",
                            "legalName",
                            "contactName",
                            "displayName",
                            "email",
                            "taxId",
                            "defaultCurrency",
                            "billingAddress",
                            "paymentProfiles"
                          ],
                          "additionalProperties": false,
                          "description": "Optional Zaprite contact associated with this order"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "invoice": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "number": {
                              "type": "string",
                              "description": "Invoice number, displayed on the invoice page and PDF"
                            },
                            "title": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "orgId": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "DRAFT",
                                "SENT",
                                "OVERDUE",
                                "PAID",
                                "OVERPAID",
                                "UNDERPAID",
                                "VOID"
                              ]
                            },
                            "footerNote": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "daysToPay": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "description": "Natural days from invoice date before the invoice is overdue. If null, invoice will be shown as \"DUE ON RECEIPT\""
                            },
                            "date": {
                              "type": "string",
                              "description": "Date of the invoice, displayed on the invoice page and PDF. Format: YYYY-MM-DD"
                            },
                            "purchaseOrderNumber": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "hideOrgAddress": {
                              "type": "boolean",
                              "description": "Organization address is hidden on the public invoice"
                            },
                            "hideOrgEmail": {
                              "type": "boolean",
                              "description": "Organization email is hidden on the public invoice"
                            },
                            "hideOrgName": {
                              "type": "boolean",
                              "description": "Organization name is hidden on the public invoice"
                            },
                            "sentAt": {
                              "description": "Date when the invoice was sent to the customer",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "voidedAt": {
                              "description": "Date when the invoice was voided",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "publicUrl": {
                              "type": "string",
                              "format": "uri",
                              "description": "URL to view the public invoice page. It carries the invoice’s access token: use it as returned, do not build it from the invoice id."
                            },
                            "customer": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    },
                                    "legalName": {
                                      "type": "string"
                                    },
                                    "contactName": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "displayName": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "email": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "format": "email",
                                          "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "taxId": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "defaultCurrency": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "enum": [
                                            "USD",
                                            "USDC",
                                            "USDT",
                                            "BTC",
                                            "LBTC",
                                            "ALL",
                                            "DZD",
                                            "ARS",
                                            "AMD",
                                            "AUD",
                                            "AZN",
                                            "BHD",
                                            "BDT",
                                            "BYN",
                                            "BMD",
                                            "BOB",
                                            "BAM",
                                            "BRL",
                                            "BGN",
                                            "KHR",
                                            "CAD",
                                            "CLP",
                                            "CNY",
                                            "COP",
                                            "CRC",
                                            "HRK",
                                            "CUP",
                                            "CZK",
                                            "DKK",
                                            "DOP",
                                            "EGP",
                                            "EUR",
                                            "GEL",
                                            "GHS",
                                            "GTQ",
                                            "HNL",
                                            "HKD",
                                            "HUF",
                                            "ISK",
                                            "INR",
                                            "IDR",
                                            "IRR",
                                            "IQD",
                                            "ILS",
                                            "JMD",
                                            "JPY",
                                            "JOD",
                                            "KZT",
                                            "KES",
                                            "KWD",
                                            "KGS",
                                            "LBP",
                                            "MKD",
                                            "MYR",
                                            "MUR",
                                            "MXN",
                                            "MDL",
                                            "MNT",
                                            "MAD",
                                            "MMK",
                                            "NAD",
                                            "NPR",
                                            "TWD",
                                            "NZD",
                                            "NIO",
                                            "NGN",
                                            "NOK",
                                            "OMR",
                                            "PKR",
                                            "PAB",
                                            "PEN",
                                            "PHP",
                                            "PLN",
                                            "GBP",
                                            "QAR",
                                            "RON",
                                            "RUB",
                                            "SAR",
                                            "RSD",
                                            "SGD",
                                            "ZAR",
                                            "KRW",
                                            "SSP",
                                            "VES",
                                            "LKR",
                                            "SEK",
                                            "CHF",
                                            "THB",
                                            "TTD",
                                            "TND",
                                            "TRY",
                                            "UGX",
                                            "UAH",
                                            "AED",
                                            "UYU",
                                            "UZS",
                                            "VND"
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "billingAddress": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "line1": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "line2": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "zipCode": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "city": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "state": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "countryCode": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "line1",
                                            "line2",
                                            "zipCode",
                                            "city",
                                            "state",
                                            "countryCode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "paymentProfiles": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "externalId": {
                                            "type": "string"
                                          },
                                          "method": {
                                            "type": "string"
                                          },
                                          "label": {
                                            "type": "string"
                                          },
                                          "expiresAt": {
                                            "anyOf": [
                                              {
                                                "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                                                "type": "string"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "connection": {
                                            "type": "object",
                                            "properties": {
                                              "label": {
                                                "type": "string"
                                              },
                                              "pluginSlug": {
                                                "type": "string"
                                              },
                                              "id": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "label",
                                              "pluginSlug",
                                              "id"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "sourceOrder": {
                                            "anyOf": [
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string"
                                                  },
                                                  "externalUniqId": {
                                                    "type": [
                                                      "string",
                                                      "null"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "externalUniqId"
                                                ],
                                                "additionalProperties": false
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ],
                                            "description": "The Order that your customer was paying when saving this payment profile."
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "externalId",
                                          "method",
                                          "label",
                                          "expiresAt",
                                          "connection",
                                          "sourceOrder"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "description": "Active saved Payment Profiles for this contact. Can be used to pay Orders with the `charge` endpoint."
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "legalName",
                                    "contactName",
                                    "displayName",
                                    "email",
                                    "taxId",
                                    "defaultCurrency",
                                    "billingAddress",
                                    "paymentProfiles"
                                  ],
                                  "additionalProperties": false,
                                  "description": "**DEPRECATED:** Use `order.contact` instead"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "lineItems": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "unitPrice": {
                                    "description": "Price of the item in currency smallest unit (e.g. cents or sats)",
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  "quantity": {
                                    "type": "number",
                                    "description": "Quantity of units (Max 2 decimal places)"
                                  },
                                  "taxRateBips": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991,
                                    "description": "Tax rate in bips (e.g. 1234 for 12.34%)"
                                  },
                                  "taxAmount": {
                                    "description": "In currency smallest unit (e.g. cents or sats)",
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  "discountRateBips": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991,
                                    "description": "Discount rate in bips (e.g. 1234 for 12.34%)"
                                  },
                                  "discountAmount": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "id",
                                  "name",
                                  "description",
                                  "unitPrice",
                                  "quantity",
                                  "taxRateBips",
                                  "taxAmount",
                                  "discountRateBips",
                                  "discountAmount"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "discountRateBips": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991,
                              "description": "Discount on the whole invoice, in bips (e.g. 1000 for 10%). 0 if none"
                            },
                            "discountAmount": {
                              "description": "Fixed discount on the whole invoice, in currency smallest unit. 0 if none",
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "discountLabel": {
                              "description": "Label of the invoice discount in the totals",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "amounts": {
                              "type": "object",
                              "properties": {
                                "subtotal": {
                                  "type": "number"
                                },
                                "lineDiscounts": {
                                  "type": "number"
                                },
                                "invoiceDiscount": {
                                  "type": "number"
                                },
                                "tax": {
                                  "type": "number"
                                },
                                "total": {
                                  "type": "number"
                                }
                              },
                              "required": [
                                "subtotal",
                                "lineDiscounts",
                                "invoiceDiscount",
                                "tax",
                                "total"
                              ],
                              "additionalProperties": false,
                              "description": "Invoice totals in currency smallest unit: subtotal - lineDiscounts - invoiceDiscount + tax = total"
                            }
                          },
                          "required": [
                            "id",
                            "number",
                            "title",
                            "orgId",
                            "status",
                            "footerNote",
                            "daysToPay",
                            "date",
                            "purchaseOrderNumber",
                            "hideOrgAddress",
                            "hideOrgEmail",
                            "hideOrgName",
                            "sentAt",
                            "voidedAt",
                            "publicUrl",
                            "customer",
                            "lineItems",
                            "discountRateBips",
                            "discountAmount",
                            "discountLabel",
                            "amounts"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Set only if the order is for a Zaprite invoice (`orderType=\"invoice\"` or `\"apiInvoice\"`), `null` otherwise"
                    },
                    "paymentLink": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "title": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "title"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Set only if the order was created from a Payment Link (`orderType=\"paymentLink\"`), `null` otherwise"
                    },
                    "transactions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "date": {
                            "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                            "type": "string"
                          },
                          "amount": {
                            "description": "Transaction amount in currency smallest unit (e.g. cents or sats)",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "currency": {
                            "type": "string",
                            "enum": [
                              "USD",
                              "USDC",
                              "USDT",
                              "BTC",
                              "LBTC",
                              "ALL",
                              "DZD",
                              "ARS",
                              "AMD",
                              "AUD",
                              "AZN",
                              "BHD",
                              "BDT",
                              "BYN",
                              "BMD",
                              "BOB",
                              "BAM",
                              "BRL",
                              "BGN",
                              "KHR",
                              "CAD",
                              "CLP",
                              "CNY",
                              "COP",
                              "CRC",
                              "HRK",
                              "CUP",
                              "CZK",
                              "DKK",
                              "DOP",
                              "EGP",
                              "EUR",
                              "GEL",
                              "GHS",
                              "GTQ",
                              "HNL",
                              "HKD",
                              "HUF",
                              "ISK",
                              "INR",
                              "IDR",
                              "IRR",
                              "IQD",
                              "ILS",
                              "JMD",
                              "JPY",
                              "JOD",
                              "KZT",
                              "KES",
                              "KWD",
                              "KGS",
                              "LBP",
                              "MKD",
                              "MYR",
                              "MUR",
                              "MXN",
                              "MDL",
                              "MNT",
                              "MAD",
                              "MMK",
                              "NAD",
                              "NPR",
                              "TWD",
                              "NZD",
                              "NIO",
                              "NGN",
                              "NOK",
                              "OMR",
                              "PKR",
                              "PAB",
                              "PEN",
                              "PHP",
                              "PLN",
                              "GBP",
                              "QAR",
                              "RON",
                              "RUB",
                              "SAR",
                              "RSD",
                              "SGD",
                              "ZAR",
                              "KRW",
                              "SSP",
                              "VES",
                              "LKR",
                              "SEK",
                              "CHF",
                              "THB",
                              "TTD",
                              "TND",
                              "TRY",
                              "UGX",
                              "UAH",
                              "AED",
                              "UYU",
                              "UZS",
                              "VND"
                            ]
                          },
                          "amountInOrderCurrency": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Transaction amount denominated in the currency of the Order and in smallest unit (e.g. cents or sats)"
                          },
                          "discountsInOrderCurrency": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "amountOff": {
                                  "description": "Amount of the discount denominated in `orderCurrency` and in smallest unit (e.g cents or sats). Negative value means a premium was applied.",
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "rateBipsOff": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991,
                                  "description": "Rate of the discount in bips (e.g. 1234 for 12.34%). Negative value means a premium was applied."
                                },
                                "paymentType": {
                                  "type": "string",
                                  "enum": [
                                    "FIAT",
                                    "BITCOIN",
                                    "LIGHTNING",
                                    "STABLECOIN"
                                  ],
                                  "description": "Type of payments this discount applies to"
                                }
                              },
                              "required": [
                                "amountOff",
                                "rateBipsOff",
                                "paymentType"
                              ],
                              "additionalProperties": false
                            },
                            "description": "List premiums and discounts applied to this transaction. Note: The amount retained as payment for the Order is `amountInOrderCurrency + sum(discountsInChargeCurrency.amount)`"
                          },
                          "orderCurrency": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "USD",
                                  "USDC",
                                  "USDT",
                                  "BTC",
                                  "LBTC",
                                  "ALL",
                                  "DZD",
                                  "ARS",
                                  "AMD",
                                  "AUD",
                                  "AZN",
                                  "BHD",
                                  "BDT",
                                  "BYN",
                                  "BMD",
                                  "BOB",
                                  "BAM",
                                  "BRL",
                                  "BGN",
                                  "KHR",
                                  "CAD",
                                  "CLP",
                                  "CNY",
                                  "COP",
                                  "CRC",
                                  "HRK",
                                  "CUP",
                                  "CZK",
                                  "DKK",
                                  "DOP",
                                  "EGP",
                                  "EUR",
                                  "GEL",
                                  "GHS",
                                  "GTQ",
                                  "HNL",
                                  "HKD",
                                  "HUF",
                                  "ISK",
                                  "INR",
                                  "IDR",
                                  "IRR",
                                  "IQD",
                                  "ILS",
                                  "JMD",
                                  "JPY",
                                  "JOD",
                                  "KZT",
                                  "KES",
                                  "KWD",
                                  "KGS",
                                  "LBP",
                                  "MKD",
                                  "MYR",
                                  "MUR",
                                  "MXN",
                                  "MDL",
                                  "MNT",
                                  "MAD",
                                  "MMK",
                                  "NAD",
                                  "NPR",
                                  "TWD",
                                  "NZD",
                                  "NIO",
                                  "NGN",
                                  "NOK",
                                  "OMR",
                                  "PKR",
                                  "PAB",
                                  "PEN",
                                  "PHP",
                                  "PLN",
                                  "GBP",
                                  "QAR",
                                  "RON",
                                  "RUB",
                                  "SAR",
                                  "RSD",
                                  "SGD",
                                  "ZAR",
                                  "KRW",
                                  "SSP",
                                  "VES",
                                  "LKR",
                                  "SEK",
                                  "CHF",
                                  "THB",
                                  "TTD",
                                  "TND",
                                  "TRY",
                                  "UGX",
                                  "UAH",
                                  "AED",
                                  "UYU",
                                  "UZS",
                                  "VND"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Currency of the Order this transaction is paying for. For example, when paying an USD invoice in BTC, transaction `currency` would be USD and `orderCurrency` USD."
                          },
                          "accountingCurrency": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "USD",
                                  "USDC",
                                  "USDT",
                                  "BTC",
                                  "LBTC",
                                  "ALL",
                                  "DZD",
                                  "ARS",
                                  "AMD",
                                  "AUD",
                                  "AZN",
                                  "BHD",
                                  "BDT",
                                  "BYN",
                                  "BMD",
                                  "BOB",
                                  "BAM",
                                  "BRL",
                                  "BGN",
                                  "KHR",
                                  "CAD",
                                  "CLP",
                                  "CNY",
                                  "COP",
                                  "CRC",
                                  "HRK",
                                  "CUP",
                                  "CZK",
                                  "DKK",
                                  "DOP",
                                  "EGP",
                                  "EUR",
                                  "GEL",
                                  "GHS",
                                  "GTQ",
                                  "HNL",
                                  "HKD",
                                  "HUF",
                                  "ISK",
                                  "INR",
                                  "IDR",
                                  "IRR",
                                  "IQD",
                                  "ILS",
                                  "JMD",
                                  "JPY",
                                  "JOD",
                                  "KZT",
                                  "KES",
                                  "KWD",
                                  "KGS",
                                  "LBP",
                                  "MKD",
                                  "MYR",
                                  "MUR",
                                  "MXN",
                                  "MDL",
                                  "MNT",
                                  "MAD",
                                  "MMK",
                                  "NAD",
                                  "NPR",
                                  "TWD",
                                  "NZD",
                                  "NIO",
                                  "NGN",
                                  "NOK",
                                  "OMR",
                                  "PKR",
                                  "PAB",
                                  "PEN",
                                  "PHP",
                                  "PLN",
                                  "GBP",
                                  "QAR",
                                  "RON",
                                  "RUB",
                                  "SAR",
                                  "RSD",
                                  "SGD",
                                  "ZAR",
                                  "KRW",
                                  "SSP",
                                  "VES",
                                  "LKR",
                                  "SEK",
                                  "CHF",
                                  "THB",
                                  "TTD",
                                  "TND",
                                  "TRY",
                                  "UGX",
                                  "UAH",
                                  "AED",
                                  "UYU",
                                  "UZS",
                                  "VND"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "The is the currency configured for your Organization"
                          },
                          "amountInAccountingCurrency": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Transaction amount denominated in accounting currency and in smallest unit (e.g. cents or sats)"
                          },
                          "method": {
                            "type": "string",
                            "enum": [
                              "BITCOIN",
                              "LIQUID",
                              "LIGHTNING",
                              "BANK",
                              "CARD",
                              "CASH",
                              "CHECK",
                              "GIFTCARD",
                              "COUPON",
                              "APPLEPAY",
                              "GOOGLEPAY",
                              "CASHAPP_PAY",
                              "INTERAC",
                              "ACH",
                              "SEPA",
                              "UNKNOWN",
                              "WIRE_TRANSFER",
                              "VENMO",
                              "PAYPAL",
                              "REVOLUT_PAY",
                              "NO_CHARGE",
                              "TETHER",
                              "USDCIRCLE"
                            ]
                          },
                          "externalRef": {
                            "description": "External reference for the transaction. (e.g. Bitcoin txId, Stripe transaction ID...)",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "PENDING",
                              "CONFIRMED",
                              "CANCELED"
                            ]
                          }
                        },
                        "required": [
                          "date",
                          "amount",
                          "currency",
                          "amountInOrderCurrency",
                          "discountsInOrderCurrency",
                          "orderCurrency",
                          "accountingCurrency",
                          "amountInAccountingCurrency",
                          "method",
                          "externalRef",
                          "status"
                        ],
                        "additionalProperties": false
                      },
                      "description": "All transactions this Order received"
                    },
                    "customerData": {
                      "type": "object",
                      "properties": {
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "address": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "line1": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "line2": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "zipCode": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "city": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "state": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "countryCode": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "line1",
                                "line2",
                                "zipCode",
                                "city",
                                "state",
                                "countryCode"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "note": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "company": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "email",
                        "name",
                        "phone",
                        "address",
                        "note",
                        "company"
                      ],
                      "additionalProperties": {},
                      "description": "Customer data collected on payment links if you enabled customer fields. Custom field values are included as additional keys."
                    },
                    "customerFields": {
                      "type": "object",
                      "properties": {
                        "address": {
                          "type": "string",
                          "enum": [
                            "REQUIRED",
                            "OPTIONAL"
                          ]
                        },
                        "email": {
                          "type": "string",
                          "enum": [
                            "REQUIRED",
                            "OPTIONAL"
                          ]
                        },
                        "name": {
                          "type": "string",
                          "enum": [
                            "REQUIRED",
                            "OPTIONAL"
                          ]
                        },
                        "phone": {
                          "type": "string",
                          "enum": [
                            "REQUIRED",
                            "OPTIONAL"
                          ]
                        },
                        "note": {
                          "type": "string",
                          "enum": [
                            "REQUIRED",
                            "OPTIONAL"
                          ]
                        }
                      },
                      "additionalProperties": false,
                      "description": "Configuration for fields displayed on checkout page to collect customer data"
                    },
                    "metadata": {
                      "default": {},
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": "string"
                      },
                      "description": "Custom metadata for this order"
                    },
                    "tags": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Custom tags for this order"
                    },
                    "allowSavePaymentProfile": {
                      "default": false,
                      "type": "boolean",
                      "description": "If true and the selected payment method supports autopay, then the customer will be able to save their payment profile for future payments."
                    },
                    "eventTickets": {
                      "default": [],
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "paymentLinkItem": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "title": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "title"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "id",
                          "paymentLinkItem"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Event tickets issued for this order (empty if none)."
                    },
                    "orderItems": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "label": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "quantity": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "paymentLinkItem": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "title": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "title"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "label",
                          "quantity",
                          "paymentLinkItem"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Order items for this order. Empty if none."
                    },
                    "promo": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "code": {
                              "description": "Coupon code applied to this order",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "amountOff": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991,
                              "description": "Fixed amount discounted from the order total in currency smallest unit (e.g. cents or sats)"
                            },
                            "rateBipsOff": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991,
                              "description": "Percentage discount rate in bips (e.g. 1000 for 10%). Applied before taxes."
                            },
                            "label": {
                              "description": "Display label for the coupon",
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "code",
                            "amountOff",
                            "rateBipsOff",
                            "label"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Coupon applied to this order. `null` if none."
                    },
                    "coupons": {
                      "default": [],
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string",
                            "description": "Code that the customer enters at checkout"
                          },
                          "rateBipsOff": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991,
                            "description": "Percentage discount in bips (e.g. 1000 for 10%)"
                          },
                          "label": {
                            "description": "Display label for the coupon",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "validUntil": {
                            "description": "Date in ISO 8601 format after which the customer can no longer apply this coupon. `null` if it has no end date.",
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "code",
                          "rateBipsOff",
                          "label",
                          "validUntil"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Coupons that the customer can apply at checkout, set with `coupons` when the Order was created with the API. Empty if none."
                    },
                    "customerPiiClearedAt": {
                      "description": "Date in ISO 8601 format when the customer PII of this order was cleared with `POST /orders/{id}/clear-customer-pii`. `null` if it was never cleared.",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "orgId",
                    "orderType",
                    "totalAmount",
                    "currency",
                    "externalUniqId",
                    "status",
                    "paidAt",
                    "expiresAt",
                    "countdownToExpiry",
                    "redirectUrl",
                    "label",
                    "checkoutUrl",
                    "receiptPdfUrl",
                    "customCheckoutId",
                    "contact",
                    "invoice",
                    "paymentLink",
                    "transactions",
                    "customerData",
                    "customerFields",
                    "metadata",
                    "tags",
                    "allowSavePaymentProfile",
                    "eventTickets",
                    "orderItems",
                    "promo",
                    "coupons",
                    "customerPiiClearedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, invalid, expired or suspended, or your organization cannot use this endpoint. `message` says which.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the `orders.get` or `orders.read` scope. Add it to the key in your API settings, or use a key that has it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/orders/charge": {
      "post": {
        "operationId": "order-charge",
        "summary": "Pay Order",
        "description": "Pay an Order with a payment profile previously saved by your customer.\n\nWhen the charge fails, the `adviceCode` of the error says what to do next:\n\n- `try_again`: charge again, now or a few minutes later. It does not take a second payment. If the error repeats, `message` says why.\n- `try_again_later`: the card was declined. Charge again after a day or more.\n- `do_not_try_again`: do not charge this Order again with this payment profile. The Order is already paid, or the card will not work.\n- `check_provider_first`: the charge may have gone through. Check the payment in your provider account before charging again.\n\nAn error without `adviceCode` is about the request itself, such as invalid input or an API key problem: fix it before sending it again. A `504` has no JSON body: handle it like `try_again`.<br/><br/>Required API key scope: `orders.pay`",
        "tags": [
          "Orders"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "orderId": {
                    "type": "string",
                    "description": "Zaprite `id` or `externalUniqId`"
                  },
                  "paymentProfileId": {
                    "type": "string",
                    "description": "You can find this id in `Contact.paymentProfiles`. Your Order checkout must enabled the connection for this payment profile."
                  },
                  "sendReceiptToCustomer": {
                    "type": "boolean",
                    "description": "Required field that must be explicitly set to true or false. If true, will send a receipt email to the customer after successful payment."
                  }
                },
                "required": [
                  "orderId",
                  "paymentProfileId",
                  "sendReceiptToCustomer"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "example": {
                  "id": "od_abc123",
                  "orgId": "abc123",
                  "orderType": "other",
                  "totalAmount": 100,
                  "currency": "USD",
                  "externalUniqId": "abc123",
                  "status": "PROCESSING",
                  "paidAt": "2024-02-25T11:04:09.656Z",
                  "expiresAt": "2024-03-25T11:04:09.656Z",
                  "countdownToExpiry": true,
                  "redirectUrl": "https://your-url.com",
                  "label": "Order label",
                  "checkoutUrl": "https://pay.zaprite.com/order/od_abc123#access=Xk2fQ9pLmT4wZa",
                  "receiptPdfUrl": null,
                  "customCheckoutId": null,
                  "eventTickets": [
                    {
                      "id": "et_123",
                      "paymentLinkItem": {
                        "id": "pi_123",
                        "title": "VIP Ticket"
                      }
                    }
                  ],
                  "orderItems": [
                    {
                      "id": "oi_123",
                      "label": "VIP Ticket",
                      "quantity": 1,
                      "paymentLinkItem": {
                        "id": "pi_123",
                        "title": "VIP Ticket"
                      }
                    }
                  ],
                  "invoice": null,
                  "contact": null,
                  "transactions": [
                    {
                      "amount": 1400,
                      "currency": "BTC",
                      "amountInOrderCurrency": 100,
                      "discountsInOrderCurrency": [],
                      "orderCurrency": "USD",
                      "amountInAccountingCurrency": 100,
                      "accountingCurrency": "USD",
                      "method": "BITCOIN",
                      "status": "PENDING",
                      "date": "2024-02-25T11:04:09.656Z",
                      "externalRef": "b340b455d25ae2379e3a22328c96421a8f5a4483848e01f14eee0abae89daabc"
                    }
                  ],
                  "paymentLink": null,
                  "customerData": {
                    "email": "example@email.com",
                    "name": "John Doe",
                    "phone": "1234567890",
                    "address": null,
                    "note": "Example customer note",
                    "company": "Example company"
                  },
                  "metadata": {
                    "custom_id": "12345",
                    "customer_reference": "ABC123"
                  },
                  "tags": [
                    "tag1",
                    "tag2"
                  ],
                  "allowSavePaymentProfile": false,
                  "customerFields": {
                    "address": "OPTIONAL",
                    "email": "REQUIRED",
                    "name": "OPTIONAL"
                  },
                  "promo": {
                    "code": "SAVE10",
                    "amountOff": 0,
                    "rateBipsOff": 1000,
                    "label": "10% Off"
                  },
                  "coupons": [
                    {
                      "code": "SAVE10",
                      "rateBipsOff": 1000,
                      "label": "10% Off",
                      "validUntil": null
                    },
                    {
                      "code": "VIP25",
                      "rateBipsOff": 2500,
                      "label": null,
                      "validUntil": "2099-12-31T23:59:59.000Z"
                    }
                  ],
                  "customerPiiClearedAt": null
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "orgId": {
                      "type": "string",
                      "description": "Id of the Zaprite organization that created this order"
                    },
                    "orderType": {
                      "type": "string",
                      "enum": [
                        "invoice",
                        "apiInvoice",
                        "paymentLink",
                        "pos",
                        "event",
                        "wooCommerce",
                        "paymentRequest",
                        "apiOrder",
                        "other"
                      ]
                    },
                    "totalAmount": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991,
                      "description": "Total amount to be paid by the customer in currency smallest unit (e.g. cents or sats)"
                    },
                    "currency": {
                      "type": "string",
                      "enum": [
                        "USD",
                        "USDC",
                        "USDT",
                        "BTC",
                        "LBTC",
                        "ALL",
                        "DZD",
                        "ARS",
                        "AMD",
                        "AUD",
                        "AZN",
                        "BHD",
                        "BDT",
                        "BYN",
                        "BMD",
                        "BOB",
                        "BAM",
                        "BRL",
                        "BGN",
                        "KHR",
                        "CAD",
                        "CLP",
                        "CNY",
                        "COP",
                        "CRC",
                        "HRK",
                        "CUP",
                        "CZK",
                        "DKK",
                        "DOP",
                        "EGP",
                        "EUR",
                        "GEL",
                        "GHS",
                        "GTQ",
                        "HNL",
                        "HKD",
                        "HUF",
                        "ISK",
                        "INR",
                        "IDR",
                        "IRR",
                        "IQD",
                        "ILS",
                        "JMD",
                        "JPY",
                        "JOD",
                        "KZT",
                        "KES",
                        "KWD",
                        "KGS",
                        "LBP",
                        "MKD",
                        "MYR",
                        "MUR",
                        "MXN",
                        "MDL",
                        "MNT",
                        "MAD",
                        "MMK",
                        "NAD",
                        "NPR",
                        "TWD",
                        "NZD",
                        "NIO",
                        "NGN",
                        "NOK",
                        "OMR",
                        "PKR",
                        "PAB",
                        "PEN",
                        "PHP",
                        "PLN",
                        "GBP",
                        "QAR",
                        "RON",
                        "RUB",
                        "SAR",
                        "RSD",
                        "SGD",
                        "ZAR",
                        "KRW",
                        "SSP",
                        "VES",
                        "LKR",
                        "SEK",
                        "CHF",
                        "THB",
                        "TTD",
                        "TND",
                        "TRY",
                        "UGX",
                        "UAH",
                        "AED",
                        "UYU",
                        "UZS",
                        "VND"
                      ]
                    },
                    "externalUniqId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "PENDING",
                        "PROCESSING",
                        "PAID",
                        "OVERPAID",
                        "UNDERPAID",
                        "COMPLETE"
                      ],
                      "description": "`PENDING`: The order is pending payment</br>`PROCESSING`: The order received a payment but the transaction is still pending (ie. an on-chain transaction with 0 conf or manual bank transfer awaiting manual confirmation)</br>`PAID`: The order was paid but it requires manual fulfillment to be flagged as `COMPLETE`</br>`COMPLETE`: The order was paid and is complete</br>`OVERPAID`: The order received a payment that was more than the total amount</br>`UNDERPAID`: The order received a payment that was less than the total amount"
                    },
                    "paidAt": {
                      "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\"). `null` until the order is paid.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "expiresAt": {
                      "description": "Date in ISO 8601 format when this order expires. After this time, an order with no payment yet cannot be paid; a partly paid order can still be paid in full.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "countdownToExpiry": {
                      "type": "boolean",
                      "description": "If true and `expiresAt` is set, the checkout shows a countdown to `expiresAt` during its last 60 minutes."
                    },
                    "redirectUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "label": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "checkoutUrl": {
                      "type": "string",
                      "format": "uri",
                      "description": "Send your customer to this URL to complete the payment. It carries the order’s access token: use it as returned, do not build it from the order id."
                    },
                    "receiptPdfUrl": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uri"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "URL to download the Order receipt PDF, with the order’s access token. `null` until the order is paid."
                    },
                    "customCheckoutId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "contact": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "legalName": {
                              "type": "string"
                            },
                            "contactName": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "displayName": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "email": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "email",
                                  "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "taxId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "defaultCurrency": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "enum": [
                                    "USD",
                                    "USDC",
                                    "USDT",
                                    "BTC",
                                    "LBTC",
                                    "ALL",
                                    "DZD",
                                    "ARS",
                                    "AMD",
                                    "AUD",
                                    "AZN",
                                    "BHD",
                                    "BDT",
                                    "BYN",
                                    "BMD",
                                    "BOB",
                                    "BAM",
                                    "BRL",
                                    "BGN",
                                    "KHR",
                                    "CAD",
                                    "CLP",
                                    "CNY",
                                    "COP",
                                    "CRC",
                                    "HRK",
                                    "CUP",
                                    "CZK",
                                    "DKK",
                                    "DOP",
                                    "EGP",
                                    "EUR",
                                    "GEL",
                                    "GHS",
                                    "GTQ",
                                    "HNL",
                                    "HKD",
                                    "HUF",
                                    "ISK",
                                    "INR",
                                    "IDR",
                                    "IRR",
                                    "IQD",
                                    "ILS",
                                    "JMD",
                                    "JPY",
                                    "JOD",
                                    "KZT",
                                    "KES",
                                    "KWD",
                                    "KGS",
                                    "LBP",
                                    "MKD",
                                    "MYR",
                                    "MUR",
                                    "MXN",
                                    "MDL",
                                    "MNT",
                                    "MAD",
                                    "MMK",
                                    "NAD",
                                    "NPR",
                                    "TWD",
                                    "NZD",
                                    "NIO",
                                    "NGN",
                                    "NOK",
                                    "OMR",
                                    "PKR",
                                    "PAB",
                                    "PEN",
                                    "PHP",
                                    "PLN",
                                    "GBP",
                                    "QAR",
                                    "RON",
                                    "RUB",
                                    "SAR",
                                    "RSD",
                                    "SGD",
                                    "ZAR",
                                    "KRW",
                                    "SSP",
                                    "VES",
                                    "LKR",
                                    "SEK",
                                    "CHF",
                                    "THB",
                                    "TTD",
                                    "TND",
                                    "TRY",
                                    "UGX",
                                    "UAH",
                                    "AED",
                                    "UYU",
                                    "UZS",
                                    "VND"
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "billingAddress": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "line1": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "line2": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "zipCode": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "city": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "state": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "countryCode": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "line1",
                                    "line2",
                                    "zipCode",
                                    "city",
                                    "state",
                                    "countryCode"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "paymentProfiles": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "externalId": {
                                    "type": "string"
                                  },
                                  "method": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  },
                                  "expiresAt": {
                                    "anyOf": [
                                      {
                                        "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "connection": {
                                    "type": "object",
                                    "properties": {
                                      "label": {
                                        "type": "string"
                                      },
                                      "pluginSlug": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "label",
                                      "pluginSlug",
                                      "id"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "sourceOrder": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "externalUniqId": {
                                            "type": [
                                              "string",
                                              "null"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "externalUniqId"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ],
                                    "description": "The Order that your customer was paying when saving this payment profile."
                                  }
                                },
                                "required": [
                                  "id",
                                  "externalId",
                                  "method",
                                  "label",
                                  "expiresAt",
                                  "connection",
                                  "sourceOrder"
                                ],
                                "additionalProperties": false
                              },
                              "description": "Active saved Payment Profiles for this contact. Can be used to pay Orders with the `charge` endpoint."
                            }
                          },
                          "required": [
                            "id",
                            "legalName",
                            "contactName",
                            "displayName",
                            "email",
                            "taxId",
                            "defaultCurrency",
                            "billingAddress",
                            "paymentProfiles"
                          ],
                          "additionalProperties": false,
                          "description": "Optional Zaprite contact associated with this order"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "invoice": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "number": {
                              "type": "string",
                              "description": "Invoice number, displayed on the invoice page and PDF"
                            },
                            "title": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "orgId": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "DRAFT",
                                "SENT",
                                "OVERDUE",
                                "PAID",
                                "OVERPAID",
                                "UNDERPAID",
                                "VOID"
                              ]
                            },
                            "footerNote": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "daysToPay": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "description": "Natural days from invoice date before the invoice is overdue. If null, invoice will be shown as \"DUE ON RECEIPT\""
                            },
                            "date": {
                              "type": "string",
                              "description": "Date of the invoice, displayed on the invoice page and PDF. Format: YYYY-MM-DD"
                            },
                            "purchaseOrderNumber": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "hideOrgAddress": {
                              "type": "boolean",
                              "description": "Organization address is hidden on the public invoice"
                            },
                            "hideOrgEmail": {
                              "type": "boolean",
                              "description": "Organization email is hidden on the public invoice"
                            },
                            "hideOrgName": {
                              "type": "boolean",
                              "description": "Organization name is hidden on the public invoice"
                            },
                            "sentAt": {
                              "description": "Date when the invoice was sent to the customer",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "voidedAt": {
                              "description": "Date when the invoice was voided",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "publicUrl": {
                              "type": "string",
                              "format": "uri",
                              "description": "URL to view the public invoice page. It carries the invoice’s access token: use it as returned, do not build it from the invoice id."
                            },
                            "customer": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    },
                                    "legalName": {
                                      "type": "string"
                                    },
                                    "contactName": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "displayName": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "email": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "format": "email",
                                          "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "taxId": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "defaultCurrency": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "enum": [
                                            "USD",
                                            "USDC",
                                            "USDT",
                                            "BTC",
                                            "LBTC",
                                            "ALL",
                                            "DZD",
                                            "ARS",
                                            "AMD",
                                            "AUD",
                                            "AZN",
                                            "BHD",
                                            "BDT",
                                            "BYN",
                                            "BMD",
                                            "BOB",
                                            "BAM",
                                            "BRL",
                                            "BGN",
                                            "KHR",
                                            "CAD",
                                            "CLP",
                                            "CNY",
                                            "COP",
                                            "CRC",
                                            "HRK",
                                            "CUP",
                                            "CZK",
                                            "DKK",
                                            "DOP",
                                            "EGP",
                                            "EUR",
                                            "GEL",
                                            "GHS",
                                            "GTQ",
                                            "HNL",
                                            "HKD",
                                            "HUF",
                                            "ISK",
                                            "INR",
                                            "IDR",
                                            "IRR",
                                            "IQD",
                                            "ILS",
                                            "JMD",
                                            "JPY",
                                            "JOD",
                                            "KZT",
                                            "KES",
                                            "KWD",
                                            "KGS",
                                            "LBP",
                                            "MKD",
                                            "MYR",
                                            "MUR",
                                            "MXN",
                                            "MDL",
                                            "MNT",
                                            "MAD",
                                            "MMK",
                                            "NAD",
                                            "NPR",
                                            "TWD",
                                            "NZD",
                                            "NIO",
                                            "NGN",
                                            "NOK",
                                            "OMR",
                                            "PKR",
                                            "PAB",
                                            "PEN",
                                            "PHP",
                                            "PLN",
                                            "GBP",
                                            "QAR",
                                            "RON",
                                            "RUB",
                                            "SAR",
                                            "RSD",
                                            "SGD",
                                            "ZAR",
                                            "KRW",
                                            "SSP",
                                            "VES",
                                            "LKR",
                                            "SEK",
                                            "CHF",
                                            "THB",
                                            "TTD",
                                            "TND",
                                            "TRY",
                                            "UGX",
                                            "UAH",
                                            "AED",
                                            "UYU",
                                            "UZS",
                                            "VND"
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "billingAddress": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "line1": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "line2": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "zipCode": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "city": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "state": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "countryCode": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "line1",
                                            "line2",
                                            "zipCode",
                                            "city",
                                            "state",
                                            "countryCode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "paymentProfiles": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "externalId": {
                                            "type": "string"
                                          },
                                          "method": {
                                            "type": "string"
                                          },
                                          "label": {
                                            "type": "string"
                                          },
                                          "expiresAt": {
                                            "anyOf": [
                                              {
                                                "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                                                "type": "string"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "connection": {
                                            "type": "object",
                                            "properties": {
                                              "label": {
                                                "type": "string"
                                              },
                                              "pluginSlug": {
                                                "type": "string"
                                              },
                                              "id": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "label",
                                              "pluginSlug",
                                              "id"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "sourceOrder": {
                                            "anyOf": [
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string"
                                                  },
                                                  "externalUniqId": {
                                                    "type": [
                                                      "string",
                                                      "null"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "externalUniqId"
                                                ],
                                                "additionalProperties": false
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ],
                                            "description": "The Order that your customer was paying when saving this payment profile."
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "externalId",
                                          "method",
                                          "label",
                                          "expiresAt",
                                          "connection",
                                          "sourceOrder"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "description": "Active saved Payment Profiles for this contact. Can be used to pay Orders with the `charge` endpoint."
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "legalName",
                                    "contactName",
                                    "displayName",
                                    "email",
                                    "taxId",
                                    "defaultCurrency",
                                    "billingAddress",
                                    "paymentProfiles"
                                  ],
                                  "additionalProperties": false,
                                  "description": "**DEPRECATED:** Use `order.contact` instead"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "lineItems": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "unitPrice": {
                                    "description": "Price of the item in currency smallest unit (e.g. cents or sats)",
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  "quantity": {
                                    "type": "number",
                                    "description": "Quantity of units (Max 2 decimal places)"
                                  },
                                  "taxRateBips": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991,
                                    "description": "Tax rate in bips (e.g. 1234 for 12.34%)"
                                  },
                                  "taxAmount": {
                                    "description": "In currency smallest unit (e.g. cents or sats)",
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  "discountRateBips": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991,
                                    "description": "Discount rate in bips (e.g. 1234 for 12.34%)"
                                  },
                                  "discountAmount": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "id",
                                  "name",
                                  "description",
                                  "unitPrice",
                                  "quantity",
                                  "taxRateBips",
                                  "taxAmount",
                                  "discountRateBips",
                                  "discountAmount"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "discountRateBips": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991,
                              "description": "Discount on the whole invoice, in bips (e.g. 1000 for 10%). 0 if none"
                            },
                            "discountAmount": {
                              "description": "Fixed discount on the whole invoice, in currency smallest unit. 0 if none",
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "discountLabel": {
                              "description": "Label of the invoice discount in the totals",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "amounts": {
                              "type": "object",
                              "properties": {
                                "subtotal": {
                                  "type": "number"
                                },
                                "lineDiscounts": {
                                  "type": "number"
                                },
                                "invoiceDiscount": {
                                  "type": "number"
                                },
                                "tax": {
                                  "type": "number"
                                },
                                "total": {
                                  "type": "number"
                                }
                              },
                              "required": [
                                "subtotal",
                                "lineDiscounts",
                                "invoiceDiscount",
                                "tax",
                                "total"
                              ],
                              "additionalProperties": false,
                              "description": "Invoice totals in currency smallest unit: subtotal - lineDiscounts - invoiceDiscount + tax = total"
                            }
                          },
                          "required": [
                            "id",
                            "number",
                            "title",
                            "orgId",
                            "status",
                            "footerNote",
                            "daysToPay",
                            "date",
                            "purchaseOrderNumber",
                            "hideOrgAddress",
                            "hideOrgEmail",
                            "hideOrgName",
                            "sentAt",
                            "voidedAt",
                            "publicUrl",
                            "customer",
                            "lineItems",
                            "discountRateBips",
                            "discountAmount",
                            "discountLabel",
                            "amounts"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Set only if the order is for a Zaprite invoice (`orderType=\"invoice\"` or `\"apiInvoice\"`), `null` otherwise"
                    },
                    "paymentLink": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "title": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "title"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Set only if the order was created from a Payment Link (`orderType=\"paymentLink\"`), `null` otherwise"
                    },
                    "transactions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "date": {
                            "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                            "type": "string"
                          },
                          "amount": {
                            "description": "Transaction amount in currency smallest unit (e.g. cents or sats)",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "currency": {
                            "type": "string",
                            "enum": [
                              "USD",
                              "USDC",
                              "USDT",
                              "BTC",
                              "LBTC",
                              "ALL",
                              "DZD",
                              "ARS",
                              "AMD",
                              "AUD",
                              "AZN",
                              "BHD",
                              "BDT",
                              "BYN",
                              "BMD",
                              "BOB",
                              "BAM",
                              "BRL",
                              "BGN",
                              "KHR",
                              "CAD",
                              "CLP",
                              "CNY",
                              "COP",
                              "CRC",
                              "HRK",
                              "CUP",
                              "CZK",
                              "DKK",
                              "DOP",
                              "EGP",
                              "EUR",
                              "GEL",
                              "GHS",
                              "GTQ",
                              "HNL",
                              "HKD",
                              "HUF",
                              "ISK",
                              "INR",
                              "IDR",
                              "IRR",
                              "IQD",
                              "ILS",
                              "JMD",
                              "JPY",
                              "JOD",
                              "KZT",
                              "KES",
                              "KWD",
                              "KGS",
                              "LBP",
                              "MKD",
                              "MYR",
                              "MUR",
                              "MXN",
                              "MDL",
                              "MNT",
                              "MAD",
                              "MMK",
                              "NAD",
                              "NPR",
                              "TWD",
                              "NZD",
                              "NIO",
                              "NGN",
                              "NOK",
                              "OMR",
                              "PKR",
                              "PAB",
                              "PEN",
                              "PHP",
                              "PLN",
                              "GBP",
                              "QAR",
                              "RON",
                              "RUB",
                              "SAR",
                              "RSD",
                              "SGD",
                              "ZAR",
                              "KRW",
                              "SSP",
                              "VES",
                              "LKR",
                              "SEK",
                              "CHF",
                              "THB",
                              "TTD",
                              "TND",
                              "TRY",
                              "UGX",
                              "UAH",
                              "AED",
                              "UYU",
                              "UZS",
                              "VND"
                            ]
                          },
                          "amountInOrderCurrency": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Transaction amount denominated in the currency of the Order and in smallest unit (e.g. cents or sats)"
                          },
                          "discountsInOrderCurrency": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "amountOff": {
                                  "description": "Amount of the discount denominated in `orderCurrency` and in smallest unit (e.g cents or sats). Negative value means a premium was applied.",
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "rateBipsOff": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991,
                                  "description": "Rate of the discount in bips (e.g. 1234 for 12.34%). Negative value means a premium was applied."
                                },
                                "paymentType": {
                                  "type": "string",
                                  "enum": [
                                    "FIAT",
                                    "BITCOIN",
                                    "LIGHTNING",
                                    "STABLECOIN"
                                  ],
                                  "description": "Type of payments this discount applies to"
                                }
                              },
                              "required": [
                                "amountOff",
                                "rateBipsOff",
                                "paymentType"
                              ],
                              "additionalProperties": false
                            },
                            "description": "List premiums and discounts applied to this transaction. Note: The amount retained as payment for the Order is `amountInOrderCurrency + sum(discountsInChargeCurrency.amount)`"
                          },
                          "orderCurrency": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "USD",
                                  "USDC",
                                  "USDT",
                                  "BTC",
                                  "LBTC",
                                  "ALL",
                                  "DZD",
                                  "ARS",
                                  "AMD",
                                  "AUD",
                                  "AZN",
                                  "BHD",
                                  "BDT",
                                  "BYN",
                                  "BMD",
                                  "BOB",
                                  "BAM",
                                  "BRL",
                                  "BGN",
                                  "KHR",
                                  "CAD",
                                  "CLP",
                                  "CNY",
                                  "COP",
                                  "CRC",
                                  "HRK",
                                  "CUP",
                                  "CZK",
                                  "DKK",
                                  "DOP",
                                  "EGP",
                                  "EUR",
                                  "GEL",
                                  "GHS",
                                  "GTQ",
                                  "HNL",
                                  "HKD",
                                  "HUF",
                                  "ISK",
                                  "INR",
                                  "IDR",
                                  "IRR",
                                  "IQD",
                                  "ILS",
                                  "JMD",
                                  "JPY",
                                  "JOD",
                                  "KZT",
                                  "KES",
                                  "KWD",
                                  "KGS",
                                  "LBP",
                                  "MKD",
                                  "MYR",
                                  "MUR",
                                  "MXN",
                                  "MDL",
                                  "MNT",
                                  "MAD",
                                  "MMK",
                                  "NAD",
                                  "NPR",
                                  "TWD",
                                  "NZD",
                                  "NIO",
                                  "NGN",
                                  "NOK",
                                  "OMR",
                                  "PKR",
                                  "PAB",
                                  "PEN",
                                  "PHP",
                                  "PLN",
                                  "GBP",
                                  "QAR",
                                  "RON",
                                  "RUB",
                                  "SAR",
                                  "RSD",
                                  "SGD",
                                  "ZAR",
                                  "KRW",
                                  "SSP",
                                  "VES",
                                  "LKR",
                                  "SEK",
                                  "CHF",
                                  "THB",
                                  "TTD",
                                  "TND",
                                  "TRY",
                                  "UGX",
                                  "UAH",
                                  "AED",
                                  "UYU",
                                  "UZS",
                                  "VND"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Currency of the Order this transaction is paying for. For example, when paying an USD invoice in BTC, transaction `currency` would be USD and `orderCurrency` USD."
                          },
                          "accountingCurrency": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "USD",
                                  "USDC",
                                  "USDT",
                                  "BTC",
                                  "LBTC",
                                  "ALL",
                                  "DZD",
                                  "ARS",
                                  "AMD",
                                  "AUD",
                                  "AZN",
                                  "BHD",
                                  "BDT",
                                  "BYN",
                                  "BMD",
                                  "BOB",
                                  "BAM",
                                  "BRL",
                                  "BGN",
                                  "KHR",
                                  "CAD",
                                  "CLP",
                                  "CNY",
                                  "COP",
                                  "CRC",
                                  "HRK",
                                  "CUP",
                                  "CZK",
                                  "DKK",
                                  "DOP",
                                  "EGP",
                                  "EUR",
                                  "GEL",
                                  "GHS",
                                  "GTQ",
                                  "HNL",
                                  "HKD",
                                  "HUF",
                                  "ISK",
                                  "INR",
                                  "IDR",
                                  "IRR",
                                  "IQD",
                                  "ILS",
                                  "JMD",
                                  "JPY",
                                  "JOD",
                                  "KZT",
                                  "KES",
                                  "KWD",
                                  "KGS",
                                  "LBP",
                                  "MKD",
                                  "MYR",
                                  "MUR",
                                  "MXN",
                                  "MDL",
                                  "MNT",
                                  "MAD",
                                  "MMK",
                                  "NAD",
                                  "NPR",
                                  "TWD",
                                  "NZD",
                                  "NIO",
                                  "NGN",
                                  "NOK",
                                  "OMR",
                                  "PKR",
                                  "PAB",
                                  "PEN",
                                  "PHP",
                                  "PLN",
                                  "GBP",
                                  "QAR",
                                  "RON",
                                  "RUB",
                                  "SAR",
                                  "RSD",
                                  "SGD",
                                  "ZAR",
                                  "KRW",
                                  "SSP",
                                  "VES",
                                  "LKR",
                                  "SEK",
                                  "CHF",
                                  "THB",
                                  "TTD",
                                  "TND",
                                  "TRY",
                                  "UGX",
                                  "UAH",
                                  "AED",
                                  "UYU",
                                  "UZS",
                                  "VND"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "The is the currency configured for your Organization"
                          },
                          "amountInAccountingCurrency": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Transaction amount denominated in accounting currency and in smallest unit (e.g. cents or sats)"
                          },
                          "method": {
                            "type": "string",
                            "enum": [
                              "BITCOIN",
                              "LIQUID",
                              "LIGHTNING",
                              "BANK",
                              "CARD",
                              "CASH",
                              "CHECK",
                              "GIFTCARD",
                              "COUPON",
                              "APPLEPAY",
                              "GOOGLEPAY",
                              "CASHAPP_PAY",
                              "INTERAC",
                              "ACH",
                              "SEPA",
                              "UNKNOWN",
                              "WIRE_TRANSFER",
                              "VENMO",
                              "PAYPAL",
                              "REVOLUT_PAY",
                              "NO_CHARGE",
                              "TETHER",
                              "USDCIRCLE"
                            ]
                          },
                          "externalRef": {
                            "description": "External reference for the transaction. (e.g. Bitcoin txId, Stripe transaction ID...)",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "PENDING",
                              "CONFIRMED",
                              "CANCELED"
                            ]
                          }
                        },
                        "required": [
                          "date",
                          "amount",
                          "currency",
                          "amountInOrderCurrency",
                          "discountsInOrderCurrency",
                          "orderCurrency",
                          "accountingCurrency",
                          "amountInAccountingCurrency",
                          "method",
                          "externalRef",
                          "status"
                        ],
                        "additionalProperties": false
                      },
                      "description": "All transactions this Order received"
                    },
                    "customerData": {
                      "type": "object",
                      "properties": {
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "address": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "line1": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "line2": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "zipCode": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "city": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "state": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "countryCode": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "line1",
                                "line2",
                                "zipCode",
                                "city",
                                "state",
                                "countryCode"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "note": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "company": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "email",
                        "name",
                        "phone",
                        "address",
                        "note",
                        "company"
                      ],
                      "additionalProperties": {},
                      "description": "Customer data collected on payment links if you enabled customer fields. Custom field values are included as additional keys."
                    },
                    "customerFields": {
                      "type": "object",
                      "properties": {
                        "address": {
                          "type": "string",
                          "enum": [
                            "REQUIRED",
                            "OPTIONAL"
                          ]
                        },
                        "email": {
                          "type": "string",
                          "enum": [
                            "REQUIRED",
                            "OPTIONAL"
                          ]
                        },
                        "name": {
                          "type": "string",
                          "enum": [
                            "REQUIRED",
                            "OPTIONAL"
                          ]
                        },
                        "phone": {
                          "type": "string",
                          "enum": [
                            "REQUIRED",
                            "OPTIONAL"
                          ]
                        },
                        "note": {
                          "type": "string",
                          "enum": [
                            "REQUIRED",
                            "OPTIONAL"
                          ]
                        }
                      },
                      "additionalProperties": false,
                      "description": "Configuration for fields displayed on checkout page to collect customer data"
                    },
                    "metadata": {
                      "default": {},
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": "string"
                      },
                      "description": "Custom metadata for this order"
                    },
                    "tags": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Custom tags for this order"
                    },
                    "allowSavePaymentProfile": {
                      "default": false,
                      "type": "boolean",
                      "description": "If true and the selected payment method supports autopay, then the customer will be able to save their payment profile for future payments."
                    },
                    "eventTickets": {
                      "default": [],
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "paymentLinkItem": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "title": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "title"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "id",
                          "paymentLinkItem"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Event tickets issued for this order (empty if none)."
                    },
                    "orderItems": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "label": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "quantity": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "paymentLinkItem": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "title": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "title"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "label",
                          "quantity",
                          "paymentLinkItem"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Order items for this order. Empty if none."
                    },
                    "promo": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "code": {
                              "description": "Coupon code applied to this order",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "amountOff": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991,
                              "description": "Fixed amount discounted from the order total in currency smallest unit (e.g. cents or sats)"
                            },
                            "rateBipsOff": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991,
                              "description": "Percentage discount rate in bips (e.g. 1000 for 10%). Applied before taxes."
                            },
                            "label": {
                              "description": "Display label for the coupon",
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "code",
                            "amountOff",
                            "rateBipsOff",
                            "label"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Coupon applied to this order. `null` if none."
                    },
                    "coupons": {
                      "default": [],
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string",
                            "description": "Code that the customer enters at checkout"
                          },
                          "rateBipsOff": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991,
                            "description": "Percentage discount in bips (e.g. 1000 for 10%)"
                          },
                          "label": {
                            "description": "Display label for the coupon",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "validUntil": {
                            "description": "Date in ISO 8601 format after which the customer can no longer apply this coupon. `null` if it has no end date.",
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "code",
                          "rateBipsOff",
                          "label",
                          "validUntil"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Coupons that the customer can apply at checkout, set with `coupons` when the Order was created with the API. Empty if none."
                    },
                    "customerPiiClearedAt": {
                      "description": "Date in ISO 8601 format when the customer PII of this order was cleared with `POST /orders/{id}/clear-customer-pii`. `null` if it was never cleared.",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "orgId",
                    "orderType",
                    "totalAmount",
                    "currency",
                    "externalUniqId",
                    "status",
                    "paidAt",
                    "expiresAt",
                    "countdownToExpiry",
                    "redirectUrl",
                    "label",
                    "checkoutUrl",
                    "receiptPdfUrl",
                    "customCheckoutId",
                    "contact",
                    "invoice",
                    "paymentLink",
                    "transactions",
                    "customerData",
                    "customerFields",
                    "metadata",
                    "tags",
                    "allowSavePaymentProfile",
                    "eventTickets",
                    "orderItems",
                    "promo",
                    "coupons",
                    "customerPiiClearedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "The input is invalid, or the payment profile cannot pay this Order: it was deleted, it has expired, or it belongs to another contact. `message` says which. Charging again returns the same error.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string",
                      "const": "BAD_REQUEST"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "message"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "message",
                    "code"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "message": "Invalid paymentProfileId",
                  "code": "BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, invalid, expired or suspended, or your organization cannot use this endpoint. `message` says which.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "402": {
            "description": "The payment provider refused the charge, most often for a declined or expired card or insufficient funds. Nothing was charged.\n\n`adviceCode` is `do_not_try_again` when this payment profile will not work for this Order, so ask your customer for another payment method. It is `try_again_later` when charging again can work, but not right away. A decline the provider does not explain also gets `try_again_later`.\n\nLater means a day or more. The usual causes, such as insufficient funds or a spending limit, take days to clear, so a charge sent again within seconds or minutes gets the same answer. Wait at least 24 hours between attempts, and stop after a few attempts spread over about two weeks. Card networks limit how many times a declined payment can be retried.\n\n`decline.providerCode` is the code returned by the provider (Square error code, Stripe decline or error code, Authorize.Net response reason or error code, Merchant X response code, Revolut decline reason). Use it for your logs, or read it against that provider's documentation for finer rules of your own. Some codes flag suspected fraud, so do not show it to your customer.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string",
                      "const": "PAYMENT_REQUIRED"
                    },
                    "adviceCode": {
                      "type": "string",
                      "enum": [
                        "try_again_later",
                        "do_not_try_again"
                      ],
                      "description": "What to do next. The description of this endpoint explains each value."
                    },
                    "decline": {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "type": "string",
                          "description": "The payment provider that refused the charge, such as `square` or `stripe`."
                        },
                        "providerCode": {
                          "description": "The provider's own code, passed through as is. Each provider has its own list, so read it against `provider`. Omitted when the provider gave none.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "provider"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "message",
                    "code",
                    "adviceCode",
                    "decline"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "message": "Square payment failed: Insufficient funds.",
                  "code": "PAYMENT_REQUIRED",
                  "adviceCode": "try_again_later",
                  "decline": {
                    "provider": "square",
                    "providerCode": "INSUFFICIENT_FUNDS"
                  }
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the `orders.pay` scope. Add it to the key in your API settings, or use a key that has it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "409": {
            "description": "The Order is already paid (`do_not_try_again`), or a charge for it is already running (`try_again`). A running charge blocks new ones until it ends, at most 5 minutes later.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string",
                      "const": "CONFLICT"
                    },
                    "adviceCode": {
                      "type": "string",
                      "enum": [
                        "do_not_try_again",
                        "try_again"
                      ],
                      "description": "What to do next. The description of this endpoint explains each value."
                    }
                  },
                  "required": [
                    "message",
                    "code",
                    "adviceCode"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "message": "This Order was already paid",
                  "code": "CONFLICT",
                  "adviceCode": "do_not_try_again"
                }
              }
            }
          },
          "412": {
            "description": "The charge did not complete, and this is not always final: after a provider timeout, for example, the payment may still go through, and the Order can take a few minutes to show it. You can charge again with the same payment profile: if the first charge went through after all, the new one does not take a second payment.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string",
                      "const": "PRECONDITION_FAILED"
                    },
                    "adviceCode": {
                      "type": "string",
                      "enum": [
                        "try_again"
                      ],
                      "description": "What to do next. The description of this endpoint explains each value."
                    }
                  },
                  "required": [
                    "message",
                    "code",
                    "adviceCode"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "message": "A payment for this order is still pending",
                  "code": "PRECONDITION_FAILED",
                  "adviceCode": "try_again"
                }
              }
            }
          },
          "500": {
            "description": "Zaprite ran into an unexpected failure, and the charge may still have gone through. Charge again as you would after a `412`.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string",
                      "const": "INTERNAL_SERVER_ERROR"
                    },
                    "adviceCode": {
                      "type": "string",
                      "enum": [
                        "try_again"
                      ],
                      "description": "What to do next. The description of this endpoint explains each value."
                    }
                  },
                  "required": [
                    "message",
                    "code",
                    "adviceCode"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "message": "Internal server error",
                  "code": "INTERNAL_SERVER_ERROR",
                  "adviceCode": "try_again"
                }
              }
            }
          },
          "502": {
            "description": "Zaprite cannot tell whether the charge went through, for example because the payment provider did not answer. Check the payment in your provider account before charging again.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string",
                      "const": "BAD_GATEWAY"
                    },
                    "adviceCode": {
                      "type": "string",
                      "enum": [
                        "check_provider_first"
                      ],
                      "description": "What to do next. The description of this endpoint explains each value."
                    }
                  },
                  "required": [
                    "message",
                    "code",
                    "adviceCode"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "message": "Internal server error",
                  "code": "BAD_GATEWAY",
                  "adviceCode": "check_provider_first"
                }
              }
            }
          }
        }
      }
    },
    "/v1/orders/create-quote": {
      "post": {
        "operationId": "order-createQuote",
        "summary": "Create Quote",
        "description": "Create payment quote for an existing Order. Supports `LIGHTNING` and `BITCOIN` (ie. on-chain) only. If `transactionMethod` is omitted, Zaprite tries `LIGHTNING` first and falls back to `BITCOIN` when the Order checkout does not offer Lightning.<br/><br/>Required API key scope: `orders.create`",
        "tags": [
          "Orders"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "orderId": "od_abc123",
                "transactionMethod": "LIGHTNING"
              },
              "schema": {
                "type": "object",
                "properties": {
                  "orderId": {
                    "type": "string",
                    "description": "Zaprite `id` or `externalUniqId`"
                  },
                  "transactionMethod": {
                    "description": "Payment method to use. Defaults to `LIGHTNING`; if omitted and Lightning is unavailable, Zaprite will try `BITCOIN` (ie. on-chain).",
                    "type": "string",
                    "enum": [
                      "BITCOIN",
                      "LIGHTNING"
                    ]
                  }
                },
                "required": [
                  "orderId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "example": {
                  "method": "LIGHTNING",
                  "paymentUrl": "lightning:lnbc...",
                  "btcAmount": 1400,
                  "orderAmount": 100,
                  "orderCurrency": "USD",
                  "btcRate": 0.07142857142857142
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "method": {
                      "type": "string",
                      "enum": [
                        "BITCOIN",
                        "LIGHTNING"
                      ]
                    },
                    "paymentUrl": {
                      "type": "string",
                      "example": "lightning:lnbc...",
                      "description": "`lightning:` or `bitcoin:` payment URL that can be rendered as a QR code or opened by a compatible wallet."
                    },
                    "btcAmount": {
                      "example": 1400,
                      "description": "Bitcoin amount to pay, denominated in sats.",
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "orderAmount": {
                      "example": 100,
                      "description": "Order amount covered by this quote, denominated in the smallest unit of `orderCurrency`. If that Order already received a payment, this is only the remaining amount to pay.",
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "orderCurrency": {
                      "type": "string",
                      "enum": [
                        "USD",
                        "USDC",
                        "USDT",
                        "BTC",
                        "LBTC",
                        "ALL",
                        "DZD",
                        "ARS",
                        "AMD",
                        "AUD",
                        "AZN",
                        "BHD",
                        "BDT",
                        "BYN",
                        "BMD",
                        "BOB",
                        "BAM",
                        "BRL",
                        "BGN",
                        "KHR",
                        "CAD",
                        "CLP",
                        "CNY",
                        "COP",
                        "CRC",
                        "HRK",
                        "CUP",
                        "CZK",
                        "DKK",
                        "DOP",
                        "EGP",
                        "EUR",
                        "GEL",
                        "GHS",
                        "GTQ",
                        "HNL",
                        "HKD",
                        "HUF",
                        "ISK",
                        "INR",
                        "IDR",
                        "IRR",
                        "IQD",
                        "ILS",
                        "JMD",
                        "JPY",
                        "JOD",
                        "KZT",
                        "KES",
                        "KWD",
                        "KGS",
                        "LBP",
                        "MKD",
                        "MYR",
                        "MUR",
                        "MXN",
                        "MDL",
                        "MNT",
                        "MAD",
                        "MMK",
                        "NAD",
                        "NPR",
                        "TWD",
                        "NZD",
                        "NIO",
                        "NGN",
                        "NOK",
                        "OMR",
                        "PKR",
                        "PAB",
                        "PEN",
                        "PHP",
                        "PLN",
                        "GBP",
                        "QAR",
                        "RON",
                        "RUB",
                        "SAR",
                        "RSD",
                        "SGD",
                        "ZAR",
                        "KRW",
                        "SSP",
                        "VES",
                        "LKR",
                        "SEK",
                        "CHF",
                        "THB",
                        "TTD",
                        "TND",
                        "TRY",
                        "UGX",
                        "UAH",
                        "AED",
                        "UYU",
                        "UZS",
                        "VND"
                      ],
                      "description": "Order currency for `orderAmount`."
                    },
                    "btcRate": {
                      "type": "number",
                      "example": 0.07142857142857142,
                      "description": "Exchange rate used to convert one sat into the smallest unit of `orderCurrency`."
                    }
                  },
                  "required": [
                    "method",
                    "paymentUrl",
                    "btcAmount",
                    "orderAmount",
                    "orderCurrency",
                    "btcRate"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "The input is invalid, or the Order has expired. `message` says which. Asking again returns the same error.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string",
                      "const": "BAD_REQUEST"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "message"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "message",
                    "code"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "message": "Order has expired",
                  "code": "BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, invalid, expired or suspended, or your organization cannot use this endpoint. `message` says which.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the `orders.create` scope. Add it to the key in your API settings, or use a key that has it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "The Order does not exist, or its checkout does not offer the requested payment method. `message` says which. Add a Lightning or on-chain connection to the checkout, or ask for the other method.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string",
                      "const": "NOT_FOUND"
                    }
                  },
                  "required": [
                    "message",
                    "code"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "message": "No LIGHTNING payment method available for this Order",
                  "code": "NOT_FOUND"
                }
              }
            }
          },
          "409": {
            "description": "The Order is already paid, so it takes no new quote.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string",
                      "const": "CONFLICT"
                    }
                  },
                  "required": [
                    "message",
                    "code"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "message": "Order is already paid",
                  "code": "CONFLICT"
                }
              }
            }
          },
          "412": {
            "description": "The payment method is on the checkout but cannot produce a quote for this Order right now. `message` says why. Ask for the other payment method, or try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string",
                      "const": "PRECONDITION_FAILED"
                    }
                  },
                  "required": [
                    "message",
                    "code"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "message": "Cannot pay this order with LIGHTNING",
                  "code": "PRECONDITION_FAILED"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/orders/{id}/clear-customer-pii": {
      "post": {
        "operationId": "order-clearCustomerPii",
        "summary": "Clear Customer PII",
        "description": "Delete the customer's personal data from an Order: name, email, phone, company, note, the address lines and the custom field answers. The address country stays, for tax records. Amounts, payments, items, label, tags and metadata stay too.<br/><br/>You can clear an Order with status `COMPLETE`, or a `PENDING` Order past its `expiresAt`. To clear a paid Order, first set its status to `COMPLETE` with `PATCH /orders/{id}`. To clear a `PENDING` Order with no expiry, first set its `expiresAt` to a past date the same way. Orders linked to a contact or an invoice, event Orders and P2P Orders cannot be cleared, and the response says why. Clearing an Order a second time changes nothing.<br/><br/>This cannot be undone.<br/><br/>Required API key scope: `orders.clearPii`",
        "tags": [
          "Orders"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "Zaprite `id` or `externalUniqId`"
            },
            "required": true,
            "description": "Zaprite `id` or `externalUniqId`"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "example": {
                  "id": "od_abc123",
                  "orgId": "abc123",
                  "orderType": "other",
                  "totalAmount": 100,
                  "currency": "USD",
                  "externalUniqId": "abc123",
                  "status": "COMPLETE",
                  "paidAt": "2024-02-25T11:04:09.656Z",
                  "expiresAt": "2024-03-25T11:04:09.656Z",
                  "countdownToExpiry": true,
                  "redirectUrl": "https://your-url.com",
                  "label": "Order label",
                  "checkoutUrl": "https://pay.zaprite.com/order/od_abc123#access=Xk2fQ9pLmT4wZa",
                  "receiptPdfUrl": null,
                  "customCheckoutId": null,
                  "eventTickets": [
                    {
                      "id": "et_123",
                      "paymentLinkItem": {
                        "id": "pi_123",
                        "title": "VIP Ticket"
                      }
                    }
                  ],
                  "orderItems": [
                    {
                      "id": "oi_123",
                      "label": "VIP Ticket",
                      "quantity": 1,
                      "paymentLinkItem": {
                        "id": "pi_123",
                        "title": "VIP Ticket"
                      }
                    }
                  ],
                  "invoice": null,
                  "contact": null,
                  "transactions": [
                    {
                      "amount": 1400,
                      "currency": "BTC",
                      "amountInOrderCurrency": 100,
                      "discountsInOrderCurrency": [],
                      "orderCurrency": "USD",
                      "amountInAccountingCurrency": 100,
                      "accountingCurrency": "USD",
                      "method": "BITCOIN",
                      "status": "PENDING",
                      "date": "2024-02-25T11:04:09.656Z",
                      "externalRef": "b340b455d25ae2379e3a22328c96421a8f5a4483848e01f14eee0abae89daabc"
                    }
                  ],
                  "paymentLink": null,
                  "customerData": {
                    "email": null,
                    "name": null,
                    "phone": null,
                    "address": {
                      "line1": null,
                      "line2": null,
                      "city": null,
                      "state": null,
                      "zipCode": null,
                      "countryCode": "US"
                    },
                    "note": null,
                    "company": null
                  },
                  "metadata": {
                    "custom_id": "12345",
                    "customer_reference": "ABC123"
                  },
                  "tags": [
                    "tag1",
                    "tag2"
                  ],
                  "allowSavePaymentProfile": false,
                  "customerFields": {
                    "address": "OPTIONAL",
                    "email": "REQUIRED",
                    "name": "OPTIONAL"
                  },
                  "promo": {
                    "code": "SAVE10",
                    "amountOff": 0,
                    "rateBipsOff": 1000,
                    "label": "10% Off"
                  },
                  "coupons": [
                    {
                      "code": "SAVE10",
                      "rateBipsOff": 1000,
                      "label": "10% Off",
                      "validUntil": null
                    },
                    {
                      "code": "VIP25",
                      "rateBipsOff": 2500,
                      "label": null,
                      "validUntil": "2099-12-31T23:59:59.000Z"
                    }
                  ],
                  "customerPiiClearedAt": "2024-04-25T11:04:09.656Z"
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "orgId": {
                      "type": "string",
                      "description": "Id of the Zaprite organization that created this order"
                    },
                    "orderType": {
                      "type": "string",
                      "enum": [
                        "invoice",
                        "apiInvoice",
                        "paymentLink",
                        "pos",
                        "event",
                        "wooCommerce",
                        "paymentRequest",
                        "apiOrder",
                        "other"
                      ]
                    },
                    "totalAmount": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991,
                      "description": "Total amount to be paid by the customer in currency smallest unit (e.g. cents or sats)"
                    },
                    "currency": {
                      "type": "string",
                      "enum": [
                        "USD",
                        "USDC",
                        "USDT",
                        "BTC",
                        "LBTC",
                        "ALL",
                        "DZD",
                        "ARS",
                        "AMD",
                        "AUD",
                        "AZN",
                        "BHD",
                        "BDT",
                        "BYN",
                        "BMD",
                        "BOB",
                        "BAM",
                        "BRL",
                        "BGN",
                        "KHR",
                        "CAD",
                        "CLP",
                        "CNY",
                        "COP",
                        "CRC",
                        "HRK",
                        "CUP",
                        "CZK",
                        "DKK",
                        "DOP",
                        "EGP",
                        "EUR",
                        "GEL",
                        "GHS",
                        "GTQ",
                        "HNL",
                        "HKD",
                        "HUF",
                        "ISK",
                        "INR",
                        "IDR",
                        "IRR",
                        "IQD",
                        "ILS",
                        "JMD",
                        "JPY",
                        "JOD",
                        "KZT",
                        "KES",
                        "KWD",
                        "KGS",
                        "LBP",
                        "MKD",
                        "MYR",
                        "MUR",
                        "MXN",
                        "MDL",
                        "MNT",
                        "MAD",
                        "MMK",
                        "NAD",
                        "NPR",
                        "TWD",
                        "NZD",
                        "NIO",
                        "NGN",
                        "NOK",
                        "OMR",
                        "PKR",
                        "PAB",
                        "PEN",
                        "PHP",
                        "PLN",
                        "GBP",
                        "QAR",
                        "RON",
                        "RUB",
                        "SAR",
                        "RSD",
                        "SGD",
                        "ZAR",
                        "KRW",
                        "SSP",
                        "VES",
                        "LKR",
                        "SEK",
                        "CHF",
                        "THB",
                        "TTD",
                        "TND",
                        "TRY",
                        "UGX",
                        "UAH",
                        "AED",
                        "UYU",
                        "UZS",
                        "VND"
                      ]
                    },
                    "externalUniqId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "PENDING",
                        "PROCESSING",
                        "PAID",
                        "OVERPAID",
                        "UNDERPAID",
                        "COMPLETE"
                      ],
                      "description": "`PENDING`: The order is pending payment</br>`PROCESSING`: The order received a payment but the transaction is still pending (ie. an on-chain transaction with 0 conf or manual bank transfer awaiting manual confirmation)</br>`PAID`: The order was paid but it requires manual fulfillment to be flagged as `COMPLETE`</br>`COMPLETE`: The order was paid and is complete</br>`OVERPAID`: The order received a payment that was more than the total amount</br>`UNDERPAID`: The order received a payment that was less than the total amount"
                    },
                    "paidAt": {
                      "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\"). `null` until the order is paid.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "expiresAt": {
                      "description": "Date in ISO 8601 format when this order expires. After this time, an order with no payment yet cannot be paid; a partly paid order can still be paid in full.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "countdownToExpiry": {
                      "type": "boolean",
                      "description": "If true and `expiresAt` is set, the checkout shows a countdown to `expiresAt` during its last 60 minutes."
                    },
                    "redirectUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "label": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "checkoutUrl": {
                      "type": "string",
                      "format": "uri",
                      "description": "Send your customer to this URL to complete the payment. It carries the order’s access token: use it as returned, do not build it from the order id."
                    },
                    "receiptPdfUrl": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uri"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "URL to download the Order receipt PDF, with the order’s access token. `null` until the order is paid."
                    },
                    "customCheckoutId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "contact": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "legalName": {
                              "type": "string"
                            },
                            "contactName": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "displayName": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "email": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "format": "email",
                                  "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "taxId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "defaultCurrency": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "enum": [
                                    "USD",
                                    "USDC",
                                    "USDT",
                                    "BTC",
                                    "LBTC",
                                    "ALL",
                                    "DZD",
                                    "ARS",
                                    "AMD",
                                    "AUD",
                                    "AZN",
                                    "BHD",
                                    "BDT",
                                    "BYN",
                                    "BMD",
                                    "BOB",
                                    "BAM",
                                    "BRL",
                                    "BGN",
                                    "KHR",
                                    "CAD",
                                    "CLP",
                                    "CNY",
                                    "COP",
                                    "CRC",
                                    "HRK",
                                    "CUP",
                                    "CZK",
                                    "DKK",
                                    "DOP",
                                    "EGP",
                                    "EUR",
                                    "GEL",
                                    "GHS",
                                    "GTQ",
                                    "HNL",
                                    "HKD",
                                    "HUF",
                                    "ISK",
                                    "INR",
                                    "IDR",
                                    "IRR",
                                    "IQD",
                                    "ILS",
                                    "JMD",
                                    "JPY",
                                    "JOD",
                                    "KZT",
                                    "KES",
                                    "KWD",
                                    "KGS",
                                    "LBP",
                                    "MKD",
                                    "MYR",
                                    "MUR",
                                    "MXN",
                                    "MDL",
                                    "MNT",
                                    "MAD",
                                    "MMK",
                                    "NAD",
                                    "NPR",
                                    "TWD",
                                    "NZD",
                                    "NIO",
                                    "NGN",
                                    "NOK",
                                    "OMR",
                                    "PKR",
                                    "PAB",
                                    "PEN",
                                    "PHP",
                                    "PLN",
                                    "GBP",
                                    "QAR",
                                    "RON",
                                    "RUB",
                                    "SAR",
                                    "RSD",
                                    "SGD",
                                    "ZAR",
                                    "KRW",
                                    "SSP",
                                    "VES",
                                    "LKR",
                                    "SEK",
                                    "CHF",
                                    "THB",
                                    "TTD",
                                    "TND",
                                    "TRY",
                                    "UGX",
                                    "UAH",
                                    "AED",
                                    "UYU",
                                    "UZS",
                                    "VND"
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "billingAddress": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "line1": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "line2": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "zipCode": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "city": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "state": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "countryCode": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "line1",
                                    "line2",
                                    "zipCode",
                                    "city",
                                    "state",
                                    "countryCode"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "paymentProfiles": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "externalId": {
                                    "type": "string"
                                  },
                                  "method": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  },
                                  "expiresAt": {
                                    "anyOf": [
                                      {
                                        "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "connection": {
                                    "type": "object",
                                    "properties": {
                                      "label": {
                                        "type": "string"
                                      },
                                      "pluginSlug": {
                                        "type": "string"
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "label",
                                      "pluginSlug",
                                      "id"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "sourceOrder": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "externalUniqId": {
                                            "type": [
                                              "string",
                                              "null"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "externalUniqId"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ],
                                    "description": "The Order that your customer was paying when saving this payment profile."
                                  }
                                },
                                "required": [
                                  "id",
                                  "externalId",
                                  "method",
                                  "label",
                                  "expiresAt",
                                  "connection",
                                  "sourceOrder"
                                ],
                                "additionalProperties": false
                              },
                              "description": "Active saved Payment Profiles for this contact. Can be used to pay Orders with the `charge` endpoint."
                            }
                          },
                          "required": [
                            "id",
                            "legalName",
                            "contactName",
                            "displayName",
                            "email",
                            "taxId",
                            "defaultCurrency",
                            "billingAddress",
                            "paymentProfiles"
                          ],
                          "additionalProperties": false,
                          "description": "Optional Zaprite contact associated with this order"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "invoice": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "number": {
                              "type": "string",
                              "description": "Invoice number, displayed on the invoice page and PDF"
                            },
                            "title": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "orgId": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "DRAFT",
                                "SENT",
                                "OVERDUE",
                                "PAID",
                                "OVERPAID",
                                "UNDERPAID",
                                "VOID"
                              ]
                            },
                            "footerNote": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "daysToPay": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "description": "Natural days from invoice date before the invoice is overdue. If null, invoice will be shown as \"DUE ON RECEIPT\""
                            },
                            "date": {
                              "type": "string",
                              "description": "Date of the invoice, displayed on the invoice page and PDF. Format: YYYY-MM-DD"
                            },
                            "purchaseOrderNumber": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "hideOrgAddress": {
                              "type": "boolean",
                              "description": "Organization address is hidden on the public invoice"
                            },
                            "hideOrgEmail": {
                              "type": "boolean",
                              "description": "Organization email is hidden on the public invoice"
                            },
                            "hideOrgName": {
                              "type": "boolean",
                              "description": "Organization name is hidden on the public invoice"
                            },
                            "sentAt": {
                              "description": "Date when the invoice was sent to the customer",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "voidedAt": {
                              "description": "Date when the invoice was voided",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "publicUrl": {
                              "type": "string",
                              "format": "uri",
                              "description": "URL to view the public invoice page. It carries the invoice’s access token: use it as returned, do not build it from the invoice id."
                            },
                            "customer": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    },
                                    "legalName": {
                                      "type": "string"
                                    },
                                    "contactName": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "displayName": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "email": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "format": "email",
                                          "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "taxId": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "defaultCurrency": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "enum": [
                                            "USD",
                                            "USDC",
                                            "USDT",
                                            "BTC",
                                            "LBTC",
                                            "ALL",
                                            "DZD",
                                            "ARS",
                                            "AMD",
                                            "AUD",
                                            "AZN",
                                            "BHD",
                                            "BDT",
                                            "BYN",
                                            "BMD",
                                            "BOB",
                                            "BAM",
                                            "BRL",
                                            "BGN",
                                            "KHR",
                                            "CAD",
                                            "CLP",
                                            "CNY",
                                            "COP",
                                            "CRC",
                                            "HRK",
                                            "CUP",
                                            "CZK",
                                            "DKK",
                                            "DOP",
                                            "EGP",
                                            "EUR",
                                            "GEL",
                                            "GHS",
                                            "GTQ",
                                            "HNL",
                                            "HKD",
                                            "HUF",
                                            "ISK",
                                            "INR",
                                            "IDR",
                                            "IRR",
                                            "IQD",
                                            "ILS",
                                            "JMD",
                                            "JPY",
                                            "JOD",
                                            "KZT",
                                            "KES",
                                            "KWD",
                                            "KGS",
                                            "LBP",
                                            "MKD",
                                            "MYR",
                                            "MUR",
                                            "MXN",
                                            "MDL",
                                            "MNT",
                                            "MAD",
                                            "MMK",
                                            "NAD",
                                            "NPR",
                                            "TWD",
                                            "NZD",
                                            "NIO",
                                            "NGN",
                                            "NOK",
                                            "OMR",
                                            "PKR",
                                            "PAB",
                                            "PEN",
                                            "PHP",
                                            "PLN",
                                            "GBP",
                                            "QAR",
                                            "RON",
                                            "RUB",
                                            "SAR",
                                            "RSD",
                                            "SGD",
                                            "ZAR",
                                            "KRW",
                                            "SSP",
                                            "VES",
                                            "LKR",
                                            "SEK",
                                            "CHF",
                                            "THB",
                                            "TTD",
                                            "TND",
                                            "TRY",
                                            "UGX",
                                            "UAH",
                                            "AED",
                                            "UYU",
                                            "UZS",
                                            "VND"
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "billingAddress": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "line1": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "line2": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "zipCode": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "city": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "state": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "countryCode": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "line1",
                                            "line2",
                                            "zipCode",
                                            "city",
                                            "state",
                                            "countryCode"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "paymentProfiles": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "externalId": {
                                            "type": "string"
                                          },
                                          "method": {
                                            "type": "string"
                                          },
                                          "label": {
                                            "type": "string"
                                          },
                                          "expiresAt": {
                                            "anyOf": [
                                              {
                                                "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                                                "type": "string"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "connection": {
                                            "type": "object",
                                            "properties": {
                                              "label": {
                                                "type": "string"
                                              },
                                              "pluginSlug": {
                                                "type": "string"
                                              },
                                              "id": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "label",
                                              "pluginSlug",
                                              "id"
                                            ],
                                            "additionalProperties": false
                                          },
                                          "sourceOrder": {
                                            "anyOf": [
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "id": {
                                                    "type": "string"
                                                  },
                                                  "externalUniqId": {
                                                    "type": [
                                                      "string",
                                                      "null"
                                                    ]
                                                  }
                                                },
                                                "required": [
                                                  "id",
                                                  "externalUniqId"
                                                ],
                                                "additionalProperties": false
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ],
                                            "description": "The Order that your customer was paying when saving this payment profile."
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "externalId",
                                          "method",
                                          "label",
                                          "expiresAt",
                                          "connection",
                                          "sourceOrder"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "description": "Active saved Payment Profiles for this contact. Can be used to pay Orders with the `charge` endpoint."
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "legalName",
                                    "contactName",
                                    "displayName",
                                    "email",
                                    "taxId",
                                    "defaultCurrency",
                                    "billingAddress",
                                    "paymentProfiles"
                                  ],
                                  "additionalProperties": false,
                                  "description": "**DEPRECATED:** Use `order.contact` instead"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "lineItems": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "description": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "unitPrice": {
                                    "description": "Price of the item in currency smallest unit (e.g. cents or sats)",
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  "quantity": {
                                    "type": "number",
                                    "description": "Quantity of units (Max 2 decimal places)"
                                  },
                                  "taxRateBips": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991,
                                    "description": "Tax rate in bips (e.g. 1234 for 12.34%)"
                                  },
                                  "taxAmount": {
                                    "description": "In currency smallest unit (e.g. cents or sats)",
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  "discountRateBips": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991,
                                    "description": "Discount rate in bips (e.g. 1234 for 12.34%)"
                                  },
                                  "discountAmount": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "id",
                                  "name",
                                  "description",
                                  "unitPrice",
                                  "quantity",
                                  "taxRateBips",
                                  "taxAmount",
                                  "discountRateBips",
                                  "discountAmount"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "discountRateBips": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991,
                              "description": "Discount on the whole invoice, in bips (e.g. 1000 for 10%). 0 if none"
                            },
                            "discountAmount": {
                              "description": "Fixed discount on the whole invoice, in currency smallest unit. 0 if none",
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "discountLabel": {
                              "description": "Label of the invoice discount in the totals",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "amounts": {
                              "type": "object",
                              "properties": {
                                "subtotal": {
                                  "type": "number"
                                },
                                "lineDiscounts": {
                                  "type": "number"
                                },
                                "invoiceDiscount": {
                                  "type": "number"
                                },
                                "tax": {
                                  "type": "number"
                                },
                                "total": {
                                  "type": "number"
                                }
                              },
                              "required": [
                                "subtotal",
                                "lineDiscounts",
                                "invoiceDiscount",
                                "tax",
                                "total"
                              ],
                              "additionalProperties": false,
                              "description": "Invoice totals in currency smallest unit: subtotal - lineDiscounts - invoiceDiscount + tax = total"
                            }
                          },
                          "required": [
                            "id",
                            "number",
                            "title",
                            "orgId",
                            "status",
                            "footerNote",
                            "daysToPay",
                            "date",
                            "purchaseOrderNumber",
                            "hideOrgAddress",
                            "hideOrgEmail",
                            "hideOrgName",
                            "sentAt",
                            "voidedAt",
                            "publicUrl",
                            "customer",
                            "lineItems",
                            "discountRateBips",
                            "discountAmount",
                            "discountLabel",
                            "amounts"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Set only if the order is for a Zaprite invoice (`orderType=\"invoice\"` or `\"apiInvoice\"`), `null` otherwise"
                    },
                    "paymentLink": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "title": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "title"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Set only if the order was created from a Payment Link (`orderType=\"paymentLink\"`), `null` otherwise"
                    },
                    "transactions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "date": {
                            "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                            "type": "string"
                          },
                          "amount": {
                            "description": "Transaction amount in currency smallest unit (e.g. cents or sats)",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "currency": {
                            "type": "string",
                            "enum": [
                              "USD",
                              "USDC",
                              "USDT",
                              "BTC",
                              "LBTC",
                              "ALL",
                              "DZD",
                              "ARS",
                              "AMD",
                              "AUD",
                              "AZN",
                              "BHD",
                              "BDT",
                              "BYN",
                              "BMD",
                              "BOB",
                              "BAM",
                              "BRL",
                              "BGN",
                              "KHR",
                              "CAD",
                              "CLP",
                              "CNY",
                              "COP",
                              "CRC",
                              "HRK",
                              "CUP",
                              "CZK",
                              "DKK",
                              "DOP",
                              "EGP",
                              "EUR",
                              "GEL",
                              "GHS",
                              "GTQ",
                              "HNL",
                              "HKD",
                              "HUF",
                              "ISK",
                              "INR",
                              "IDR",
                              "IRR",
                              "IQD",
                              "ILS",
                              "JMD",
                              "JPY",
                              "JOD",
                              "KZT",
                              "KES",
                              "KWD",
                              "KGS",
                              "LBP",
                              "MKD",
                              "MYR",
                              "MUR",
                              "MXN",
                              "MDL",
                              "MNT",
                              "MAD",
                              "MMK",
                              "NAD",
                              "NPR",
                              "TWD",
                              "NZD",
                              "NIO",
                              "NGN",
                              "NOK",
                              "OMR",
                              "PKR",
                              "PAB",
                              "PEN",
                              "PHP",
                              "PLN",
                              "GBP",
                              "QAR",
                              "RON",
                              "RUB",
                              "SAR",
                              "RSD",
                              "SGD",
                              "ZAR",
                              "KRW",
                              "SSP",
                              "VES",
                              "LKR",
                              "SEK",
                              "CHF",
                              "THB",
                              "TTD",
                              "TND",
                              "TRY",
                              "UGX",
                              "UAH",
                              "AED",
                              "UYU",
                              "UZS",
                              "VND"
                            ]
                          },
                          "amountInOrderCurrency": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Transaction amount denominated in the currency of the Order and in smallest unit (e.g. cents or sats)"
                          },
                          "discountsInOrderCurrency": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "amountOff": {
                                  "description": "Amount of the discount denominated in `orderCurrency` and in smallest unit (e.g cents or sats). Negative value means a premium was applied.",
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "rateBipsOff": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991,
                                  "description": "Rate of the discount in bips (e.g. 1234 for 12.34%). Negative value means a premium was applied."
                                },
                                "paymentType": {
                                  "type": "string",
                                  "enum": [
                                    "FIAT",
                                    "BITCOIN",
                                    "LIGHTNING",
                                    "STABLECOIN"
                                  ],
                                  "description": "Type of payments this discount applies to"
                                }
                              },
                              "required": [
                                "amountOff",
                                "rateBipsOff",
                                "paymentType"
                              ],
                              "additionalProperties": false
                            },
                            "description": "List premiums and discounts applied to this transaction. Note: The amount retained as payment for the Order is `amountInOrderCurrency + sum(discountsInChargeCurrency.amount)`"
                          },
                          "orderCurrency": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "USD",
                                  "USDC",
                                  "USDT",
                                  "BTC",
                                  "LBTC",
                                  "ALL",
                                  "DZD",
                                  "ARS",
                                  "AMD",
                                  "AUD",
                                  "AZN",
                                  "BHD",
                                  "BDT",
                                  "BYN",
                                  "BMD",
                                  "BOB",
                                  "BAM",
                                  "BRL",
                                  "BGN",
                                  "KHR",
                                  "CAD",
                                  "CLP",
                                  "CNY",
                                  "COP",
                                  "CRC",
                                  "HRK",
                                  "CUP",
                                  "CZK",
                                  "DKK",
                                  "DOP",
                                  "EGP",
                                  "EUR",
                                  "GEL",
                                  "GHS",
                                  "GTQ",
                                  "HNL",
                                  "HKD",
                                  "HUF",
                                  "ISK",
                                  "INR",
                                  "IDR",
                                  "IRR",
                                  "IQD",
                                  "ILS",
                                  "JMD",
                                  "JPY",
                                  "JOD",
                                  "KZT",
                                  "KES",
                                  "KWD",
                                  "KGS",
                                  "LBP",
                                  "MKD",
                                  "MYR",
                                  "MUR",
                                  "MXN",
                                  "MDL",
                                  "MNT",
                                  "MAD",
                                  "MMK",
                                  "NAD",
                                  "NPR",
                                  "TWD",
                                  "NZD",
                                  "NIO",
                                  "NGN",
                                  "NOK",
                                  "OMR",
                                  "PKR",
                                  "PAB",
                                  "PEN",
                                  "PHP",
                                  "PLN",
                                  "GBP",
                                  "QAR",
                                  "RON",
                                  "RUB",
                                  "SAR",
                                  "RSD",
                                  "SGD",
                                  "ZAR",
                                  "KRW",
                                  "SSP",
                                  "VES",
                                  "LKR",
                                  "SEK",
                                  "CHF",
                                  "THB",
                                  "TTD",
                                  "TND",
                                  "TRY",
                                  "UGX",
                                  "UAH",
                                  "AED",
                                  "UYU",
                                  "UZS",
                                  "VND"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Currency of the Order this transaction is paying for. For example, when paying an USD invoice in BTC, transaction `currency` would be USD and `orderCurrency` USD."
                          },
                          "accountingCurrency": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "USD",
                                  "USDC",
                                  "USDT",
                                  "BTC",
                                  "LBTC",
                                  "ALL",
                                  "DZD",
                                  "ARS",
                                  "AMD",
                                  "AUD",
                                  "AZN",
                                  "BHD",
                                  "BDT",
                                  "BYN",
                                  "BMD",
                                  "BOB",
                                  "BAM",
                                  "BRL",
                                  "BGN",
                                  "KHR",
                                  "CAD",
                                  "CLP",
                                  "CNY",
                                  "COP",
                                  "CRC",
                                  "HRK",
                                  "CUP",
                                  "CZK",
                                  "DKK",
                                  "DOP",
                                  "EGP",
                                  "EUR",
                                  "GEL",
                                  "GHS",
                                  "GTQ",
                                  "HNL",
                                  "HKD",
                                  "HUF",
                                  "ISK",
                                  "INR",
                                  "IDR",
                                  "IRR",
                                  "IQD",
                                  "ILS",
                                  "JMD",
                                  "JPY",
                                  "JOD",
                                  "KZT",
                                  "KES",
                                  "KWD",
                                  "KGS",
                                  "LBP",
                                  "MKD",
                                  "MYR",
                                  "MUR",
                                  "MXN",
                                  "MDL",
                                  "MNT",
                                  "MAD",
                                  "MMK",
                                  "NAD",
                                  "NPR",
                                  "TWD",
                                  "NZD",
                                  "NIO",
                                  "NGN",
                                  "NOK",
                                  "OMR",
                                  "PKR",
                                  "PAB",
                                  "PEN",
                                  "PHP",
                                  "PLN",
                                  "GBP",
                                  "QAR",
                                  "RON",
                                  "RUB",
                                  "SAR",
                                  "RSD",
                                  "SGD",
                                  "ZAR",
                                  "KRW",
                                  "SSP",
                                  "VES",
                                  "LKR",
                                  "SEK",
                                  "CHF",
                                  "THB",
                                  "TTD",
                                  "TND",
                                  "TRY",
                                  "UGX",
                                  "UAH",
                                  "AED",
                                  "UYU",
                                  "UZS",
                                  "VND"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "The is the currency configured for your Organization"
                          },
                          "amountInAccountingCurrency": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Transaction amount denominated in accounting currency and in smallest unit (e.g. cents or sats)"
                          },
                          "method": {
                            "type": "string",
                            "enum": [
                              "BITCOIN",
                              "LIQUID",
                              "LIGHTNING",
                              "BANK",
                              "CARD",
                              "CASH",
                              "CHECK",
                              "GIFTCARD",
                              "COUPON",
                              "APPLEPAY",
                              "GOOGLEPAY",
                              "CASHAPP_PAY",
                              "INTERAC",
                              "ACH",
                              "SEPA",
                              "UNKNOWN",
                              "WIRE_TRANSFER",
                              "VENMO",
                              "PAYPAL",
                              "REVOLUT_PAY",
                              "NO_CHARGE",
                              "TETHER",
                              "USDCIRCLE"
                            ]
                          },
                          "externalRef": {
                            "description": "External reference for the transaction. (e.g. Bitcoin txId, Stripe transaction ID...)",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "PENDING",
                              "CONFIRMED",
                              "CANCELED"
                            ]
                          }
                        },
                        "required": [
                          "date",
                          "amount",
                          "currency",
                          "amountInOrderCurrency",
                          "discountsInOrderCurrency",
                          "orderCurrency",
                          "accountingCurrency",
                          "amountInAccountingCurrency",
                          "method",
                          "externalRef",
                          "status"
                        ],
                        "additionalProperties": false
                      },
                      "description": "All transactions this Order received"
                    },
                    "customerData": {
                      "type": "object",
                      "properties": {
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "address": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "line1": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "line2": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "zipCode": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "city": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "state": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "countryCode": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "line1",
                                "line2",
                                "zipCode",
                                "city",
                                "state",
                                "countryCode"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "note": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "company": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "email",
                        "name",
                        "phone",
                        "address",
                        "note",
                        "company"
                      ],
                      "additionalProperties": {},
                      "description": "Customer data collected on payment links if you enabled customer fields. Custom field values are included as additional keys."
                    },
                    "customerFields": {
                      "type": "object",
                      "properties": {
                        "address": {
                          "type": "string",
                          "enum": [
                            "REQUIRED",
                            "OPTIONAL"
                          ]
                        },
                        "email": {
                          "type": "string",
                          "enum": [
                            "REQUIRED",
                            "OPTIONAL"
                          ]
                        },
                        "name": {
                          "type": "string",
                          "enum": [
                            "REQUIRED",
                            "OPTIONAL"
                          ]
                        },
                        "phone": {
                          "type": "string",
                          "enum": [
                            "REQUIRED",
                            "OPTIONAL"
                          ]
                        },
                        "note": {
                          "type": "string",
                          "enum": [
                            "REQUIRED",
                            "OPTIONAL"
                          ]
                        }
                      },
                      "additionalProperties": false,
                      "description": "Configuration for fields displayed on checkout page to collect customer data"
                    },
                    "metadata": {
                      "default": {},
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": "string"
                      },
                      "description": "Custom metadata for this order"
                    },
                    "tags": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Custom tags for this order"
                    },
                    "allowSavePaymentProfile": {
                      "default": false,
                      "type": "boolean",
                      "description": "If true and the selected payment method supports autopay, then the customer will be able to save their payment profile for future payments."
                    },
                    "eventTickets": {
                      "default": [],
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "paymentLinkItem": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "title": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "title"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "id",
                          "paymentLinkItem"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Event tickets issued for this order (empty if none)."
                    },
                    "orderItems": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "label": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "quantity": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "paymentLinkItem": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "title": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "title"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "label",
                          "quantity",
                          "paymentLinkItem"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Order items for this order. Empty if none."
                    },
                    "promo": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "code": {
                              "description": "Coupon code applied to this order",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "amountOff": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991,
                              "description": "Fixed amount discounted from the order total in currency smallest unit (e.g. cents or sats)"
                            },
                            "rateBipsOff": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991,
                              "description": "Percentage discount rate in bips (e.g. 1000 for 10%). Applied before taxes."
                            },
                            "label": {
                              "description": "Display label for the coupon",
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "code",
                            "amountOff",
                            "rateBipsOff",
                            "label"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Coupon applied to this order. `null` if none."
                    },
                    "coupons": {
                      "default": [],
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string",
                            "description": "Code that the customer enters at checkout"
                          },
                          "rateBipsOff": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991,
                            "description": "Percentage discount in bips (e.g. 1000 for 10%)"
                          },
                          "label": {
                            "description": "Display label for the coupon",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "validUntil": {
                            "description": "Date in ISO 8601 format after which the customer can no longer apply this coupon. `null` if it has no end date.",
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "code",
                          "rateBipsOff",
                          "label",
                          "validUntil"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Coupons that the customer can apply at checkout, set with `coupons` when the Order was created with the API. Empty if none."
                    },
                    "customerPiiClearedAt": {
                      "description": "Date in ISO 8601 format when the customer PII of this order was cleared with `POST /orders/{id}/clear-customer-pii`. `null` if it was never cleared.",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "orgId",
                    "orderType",
                    "totalAmount",
                    "currency",
                    "externalUniqId",
                    "status",
                    "paidAt",
                    "expiresAt",
                    "countdownToExpiry",
                    "redirectUrl",
                    "label",
                    "checkoutUrl",
                    "receiptPdfUrl",
                    "customCheckoutId",
                    "contact",
                    "invoice",
                    "paymentLink",
                    "transactions",
                    "customerData",
                    "customerFields",
                    "metadata",
                    "tags",
                    "allowSavePaymentProfile",
                    "eventTickets",
                    "orderItems",
                    "promo",
                    "coupons",
                    "customerPiiClearedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "The Order cannot be cleared. Either its status does not allow it yet, or it is linked to a contact or an invoice, or it is an event or P2P Order. `message` says which. For a status problem, complete or expire the Order first, then clear it again.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string",
                      "const": "BAD_REQUEST"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "message"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "message",
                    "code"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "message": "Only COMPLETE orders, or PENDING orders past their expiresAt, can be cleared",
                  "code": "BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, invalid, expired or suspended, or your organization cannot use this endpoint. `message` says which.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the `orders.clearPii` scope. Add it to the key in your API settings, or use a key that has it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contacts": {
      "post": {
        "operationId": "contact-create",
        "summary": "Create Contact",
        "description": "Create a Zaprite Contact. You can then link this contact to Zaprite Orders.<br/><br/>Required API key scope: `contacts.create`",
        "tags": [
          "Contacts"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "contactName": "John",
                "displayName": "John Doe",
                "legalName": "John Doe",
                "email": "john@doe.com",
                "defaultCurrency": "USD"
              },
              "schema": {
                "type": "object",
                "properties": {
                  "contactName": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "displayName": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "legalName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "email": {
                    "type": "string",
                    "maxLength": 255,
                    "format": "email",
                    "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                  },
                  "internalNote": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "taxId": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "defaultCurrency": {
                    "type": "string",
                    "enum": [
                      "USD",
                      "USDC",
                      "USDT",
                      "BTC",
                      "LBTC",
                      "ALL",
                      "DZD",
                      "ARS",
                      "AMD",
                      "AUD",
                      "AZN",
                      "BHD",
                      "BDT",
                      "BYN",
                      "BMD",
                      "BOB",
                      "BAM",
                      "BRL",
                      "BGN",
                      "KHR",
                      "CAD",
                      "CLP",
                      "CNY",
                      "COP",
                      "CRC",
                      "HRK",
                      "CUP",
                      "CZK",
                      "DKK",
                      "DOP",
                      "EGP",
                      "EUR",
                      "GEL",
                      "GHS",
                      "GTQ",
                      "HNL",
                      "HKD",
                      "HUF",
                      "ISK",
                      "INR",
                      "IDR",
                      "IRR",
                      "IQD",
                      "ILS",
                      "JMD",
                      "JPY",
                      "JOD",
                      "KZT",
                      "KES",
                      "KWD",
                      "KGS",
                      "LBP",
                      "MKD",
                      "MYR",
                      "MUR",
                      "MXN",
                      "MDL",
                      "MNT",
                      "MAD",
                      "MMK",
                      "NAD",
                      "NPR",
                      "TWD",
                      "NZD",
                      "NIO",
                      "NGN",
                      "NOK",
                      "OMR",
                      "PKR",
                      "PAB",
                      "PEN",
                      "PHP",
                      "PLN",
                      "GBP",
                      "QAR",
                      "RON",
                      "RUB",
                      "SAR",
                      "RSD",
                      "SGD",
                      "ZAR",
                      "KRW",
                      "SSP",
                      "VES",
                      "LKR",
                      "SEK",
                      "CHF",
                      "THB",
                      "TTD",
                      "TND",
                      "TRY",
                      "UGX",
                      "UAH",
                      "AED",
                      "UYU",
                      "UZS",
                      "VND"
                    ]
                  },
                  "billingAddress": {
                    "type": "object",
                    "properties": {
                      "countryCode": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "line1": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 255
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "line2": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 255
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "zipCode": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 10
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "city": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 255
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "state": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 255
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    }
                  }
                },
                "required": [
                  "legalName",
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "example": {
                  "id": "123",
                  "legalName": "John Doe",
                  "contactName": "John",
                  "displayName": "John Doe",
                  "email": "john@doe.com",
                  "defaultCurrency": "USD",
                  "taxId": "123456",
                  "billingAddress": {
                    "line1": "123 Main St",
                    "line2": null,
                    "city": "San Francisco",
                    "zipCode": "94103",
                    "countryCode": "US",
                    "state": "CA"
                  },
                  "paymentProfiles": [
                    {
                      "id": "123",
                      "externalId": "123",
                      "method": "card",
                      "label": "Visa 1234",
                      "connection": {
                        "label": "Square",
                        "pluginSlug": "square",
                        "id": "123"
                      },
                      "expiresAt": null,
                      "sourceOrder": {
                        "id": "123",
                        "externalUniqId": "123"
                      }
                    }
                  ]
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "legalName": {
                      "type": "string"
                    },
                    "contactName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "displayName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "email": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "email",
                          "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "taxId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "defaultCurrency": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "USD",
                            "USDC",
                            "USDT",
                            "BTC",
                            "LBTC",
                            "ALL",
                            "DZD",
                            "ARS",
                            "AMD",
                            "AUD",
                            "AZN",
                            "BHD",
                            "BDT",
                            "BYN",
                            "BMD",
                            "BOB",
                            "BAM",
                            "BRL",
                            "BGN",
                            "KHR",
                            "CAD",
                            "CLP",
                            "CNY",
                            "COP",
                            "CRC",
                            "HRK",
                            "CUP",
                            "CZK",
                            "DKK",
                            "DOP",
                            "EGP",
                            "EUR",
                            "GEL",
                            "GHS",
                            "GTQ",
                            "HNL",
                            "HKD",
                            "HUF",
                            "ISK",
                            "INR",
                            "IDR",
                            "IRR",
                            "IQD",
                            "ILS",
                            "JMD",
                            "JPY",
                            "JOD",
                            "KZT",
                            "KES",
                            "KWD",
                            "KGS",
                            "LBP",
                            "MKD",
                            "MYR",
                            "MUR",
                            "MXN",
                            "MDL",
                            "MNT",
                            "MAD",
                            "MMK",
                            "NAD",
                            "NPR",
                            "TWD",
                            "NZD",
                            "NIO",
                            "NGN",
                            "NOK",
                            "OMR",
                            "PKR",
                            "PAB",
                            "PEN",
                            "PHP",
                            "PLN",
                            "GBP",
                            "QAR",
                            "RON",
                            "RUB",
                            "SAR",
                            "RSD",
                            "SGD",
                            "ZAR",
                            "KRW",
                            "SSP",
                            "VES",
                            "LKR",
                            "SEK",
                            "CHF",
                            "THB",
                            "TTD",
                            "TND",
                            "TRY",
                            "UGX",
                            "UAH",
                            "AED",
                            "UYU",
                            "UZS",
                            "VND"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "billingAddress": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "line1": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "line2": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "zipCode": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "city": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "state": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "countryCode": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "line1",
                            "line2",
                            "zipCode",
                            "city",
                            "state",
                            "countryCode"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "paymentProfiles": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "externalId": {
                            "type": "string"
                          },
                          "method": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "expiresAt": {
                            "anyOf": [
                              {
                                "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "connection": {
                            "type": "object",
                            "properties": {
                              "label": {
                                "type": "string"
                              },
                              "pluginSlug": {
                                "type": "string"
                              },
                              "id": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "label",
                              "pluginSlug",
                              "id"
                            ],
                            "additionalProperties": false
                          },
                          "sourceOrder": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "externalUniqId": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "externalUniqId"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "The Order that your customer was paying when saving this payment profile."
                          }
                        },
                        "required": [
                          "id",
                          "externalId",
                          "method",
                          "label",
                          "expiresAt",
                          "connection",
                          "sourceOrder"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Active saved Payment Profiles for this contact. Can be used to pay Orders with the `charge` endpoint."
                    }
                  },
                  "required": [
                    "id",
                    "legalName",
                    "contactName",
                    "displayName",
                    "email",
                    "taxId",
                    "defaultCurrency",
                    "billingAddress",
                    "paymentProfiles"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, invalid, expired or suspended, or your organization cannot use this endpoint. `message` says which.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the `contacts.create` scope. Add it to the key in your API settings, or use a key that has it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "contact-search",
        "summary": "List Contacts",
        "description": "List Zaprite Contacts. Returns up to 100 contacts per request.<br/><br/>Required API key scope: `contacts.read`",
        "tags": [
          "Contacts"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "email",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "schema": {
              "default": 1,
              "type": "number",
              "minimum": 1,
              "description": "Page number. 1 for first page"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "legalName": {
                            "type": "string"
                          },
                          "contactName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "displayName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "email": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "email",
                                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "taxId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "defaultCurrency": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "USD",
                                  "USDC",
                                  "USDT",
                                  "BTC",
                                  "LBTC",
                                  "ALL",
                                  "DZD",
                                  "ARS",
                                  "AMD",
                                  "AUD",
                                  "AZN",
                                  "BHD",
                                  "BDT",
                                  "BYN",
                                  "BMD",
                                  "BOB",
                                  "BAM",
                                  "BRL",
                                  "BGN",
                                  "KHR",
                                  "CAD",
                                  "CLP",
                                  "CNY",
                                  "COP",
                                  "CRC",
                                  "HRK",
                                  "CUP",
                                  "CZK",
                                  "DKK",
                                  "DOP",
                                  "EGP",
                                  "EUR",
                                  "GEL",
                                  "GHS",
                                  "GTQ",
                                  "HNL",
                                  "HKD",
                                  "HUF",
                                  "ISK",
                                  "INR",
                                  "IDR",
                                  "IRR",
                                  "IQD",
                                  "ILS",
                                  "JMD",
                                  "JPY",
                                  "JOD",
                                  "KZT",
                                  "KES",
                                  "KWD",
                                  "KGS",
                                  "LBP",
                                  "MKD",
                                  "MYR",
                                  "MUR",
                                  "MXN",
                                  "MDL",
                                  "MNT",
                                  "MAD",
                                  "MMK",
                                  "NAD",
                                  "NPR",
                                  "TWD",
                                  "NZD",
                                  "NIO",
                                  "NGN",
                                  "NOK",
                                  "OMR",
                                  "PKR",
                                  "PAB",
                                  "PEN",
                                  "PHP",
                                  "PLN",
                                  "GBP",
                                  "QAR",
                                  "RON",
                                  "RUB",
                                  "SAR",
                                  "RSD",
                                  "SGD",
                                  "ZAR",
                                  "KRW",
                                  "SSP",
                                  "VES",
                                  "LKR",
                                  "SEK",
                                  "CHF",
                                  "THB",
                                  "TTD",
                                  "TND",
                                  "TRY",
                                  "UGX",
                                  "UAH",
                                  "AED",
                                  "UYU",
                                  "UZS",
                                  "VND"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "billingAddress": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "line1": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "line2": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "zipCode": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "city": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "state": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "countryCode": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "line1",
                                  "line2",
                                  "zipCode",
                                  "city",
                                  "state",
                                  "countryCode"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "paymentProfiles": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "externalId": {
                                  "type": "string"
                                },
                                "method": {
                                  "type": "string"
                                },
                                "label": {
                                  "type": "string"
                                },
                                "expiresAt": {
                                  "anyOf": [
                                    {
                                      "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "connection": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string"
                                    },
                                    "pluginSlug": {
                                      "type": "string"
                                    },
                                    "id": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "label",
                                    "pluginSlug",
                                    "id"
                                  ],
                                  "additionalProperties": false
                                },
                                "sourceOrder": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string"
                                        },
                                        "externalUniqId": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "externalUniqId"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "The Order that your customer was paying when saving this payment profile."
                                }
                              },
                              "required": [
                                "id",
                                "externalId",
                                "method",
                                "label",
                                "expiresAt",
                                "connection",
                                "sourceOrder"
                              ],
                              "additionalProperties": false
                            },
                            "description": "Active saved Payment Profiles for this contact. Can be used to pay Orders with the `charge` endpoint."
                          }
                        },
                        "required": [
                          "id",
                          "legalName",
                          "contactName",
                          "displayName",
                          "email",
                          "taxId",
                          "defaultCurrency",
                          "billingAddress",
                          "paymentProfiles"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "itemsCount": {
                          "type": "number"
                        },
                        "pagesCount": {
                          "type": "number"
                        },
                        "page": {
                          "type": "number"
                        },
                        "perPage": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "itemsCount",
                        "pagesCount",
                        "page",
                        "perPage"
                      ],
                      "additionalProperties": false,
                      "description": "Pagination metadata"
                    }
                  },
                  "required": [
                    "items",
                    "meta"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, invalid, expired or suspended, or your organization cannot use this endpoint. `message` says which.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the `contacts.read` scope. Add it to the key in your API settings, or use a key that has it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contacts/{id}": {
      "put": {
        "operationId": "contact-update",
        "summary": "Update Contact",
        "description": "Update a Zaprite Contact. Only provided fields are updated.<br/><br/>Required API key scope: `contacts.update`",
        "tags": [
          "Contacts"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "id": "123",
                "email": "new-email@doe.com",
                "contactName": null
              },
              "schema": {
                "type": "object",
                "properties": {
                  "contactName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "displayName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "legalName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "email": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255,
                        "format": "email",
                        "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "internalNote": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 1000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "taxId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "defaultCurrency": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "USD",
                          "USDC",
                          "USDT",
                          "BTC",
                          "LBTC",
                          "ALL",
                          "DZD",
                          "ARS",
                          "AMD",
                          "AUD",
                          "AZN",
                          "BHD",
                          "BDT",
                          "BYN",
                          "BMD",
                          "BOB",
                          "BAM",
                          "BRL",
                          "BGN",
                          "KHR",
                          "CAD",
                          "CLP",
                          "CNY",
                          "COP",
                          "CRC",
                          "HRK",
                          "CUP",
                          "CZK",
                          "DKK",
                          "DOP",
                          "EGP",
                          "EUR",
                          "GEL",
                          "GHS",
                          "GTQ",
                          "HNL",
                          "HKD",
                          "HUF",
                          "ISK",
                          "INR",
                          "IDR",
                          "IRR",
                          "IQD",
                          "ILS",
                          "JMD",
                          "JPY",
                          "JOD",
                          "KZT",
                          "KES",
                          "KWD",
                          "KGS",
                          "LBP",
                          "MKD",
                          "MYR",
                          "MUR",
                          "MXN",
                          "MDL",
                          "MNT",
                          "MAD",
                          "MMK",
                          "NAD",
                          "NPR",
                          "TWD",
                          "NZD",
                          "NIO",
                          "NGN",
                          "NOK",
                          "OMR",
                          "PKR",
                          "PAB",
                          "PEN",
                          "PHP",
                          "PLN",
                          "GBP",
                          "QAR",
                          "RON",
                          "RUB",
                          "SAR",
                          "RSD",
                          "SGD",
                          "ZAR",
                          "KRW",
                          "SSP",
                          "VES",
                          "LKR",
                          "SEK",
                          "CHF",
                          "THB",
                          "TTD",
                          "TND",
                          "TRY",
                          "UGX",
                          "UAH",
                          "AED",
                          "UYU",
                          "UZS",
                          "VND"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "billingAddress": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "countryCode": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "line1": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 255
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "line2": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 255
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "zipCode": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 10
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "city": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 255
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "state": {
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 255
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "example": {
                  "id": "123",
                  "legalName": "John Doe",
                  "contactName": "John",
                  "displayName": "John Doe",
                  "email": "john@doe.com",
                  "defaultCurrency": "USD",
                  "taxId": "123456",
                  "billingAddress": {
                    "line1": "123 Main St",
                    "line2": null,
                    "city": "San Francisco",
                    "zipCode": "94103",
                    "countryCode": "US",
                    "state": "CA"
                  },
                  "paymentProfiles": [
                    {
                      "id": "123",
                      "externalId": "123",
                      "method": "card",
                      "label": "Visa 1234",
                      "connection": {
                        "label": "Square",
                        "pluginSlug": "square",
                        "id": "123"
                      },
                      "expiresAt": null,
                      "sourceOrder": {
                        "id": "123",
                        "externalUniqId": "123"
                      }
                    }
                  ]
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "legalName": {
                      "type": "string"
                    },
                    "contactName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "displayName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "email": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "email",
                          "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "taxId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "defaultCurrency": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "USD",
                            "USDC",
                            "USDT",
                            "BTC",
                            "LBTC",
                            "ALL",
                            "DZD",
                            "ARS",
                            "AMD",
                            "AUD",
                            "AZN",
                            "BHD",
                            "BDT",
                            "BYN",
                            "BMD",
                            "BOB",
                            "BAM",
                            "BRL",
                            "BGN",
                            "KHR",
                            "CAD",
                            "CLP",
                            "CNY",
                            "COP",
                            "CRC",
                            "HRK",
                            "CUP",
                            "CZK",
                            "DKK",
                            "DOP",
                            "EGP",
                            "EUR",
                            "GEL",
                            "GHS",
                            "GTQ",
                            "HNL",
                            "HKD",
                            "HUF",
                            "ISK",
                            "INR",
                            "IDR",
                            "IRR",
                            "IQD",
                            "ILS",
                            "JMD",
                            "JPY",
                            "JOD",
                            "KZT",
                            "KES",
                            "KWD",
                            "KGS",
                            "LBP",
                            "MKD",
                            "MYR",
                            "MUR",
                            "MXN",
                            "MDL",
                            "MNT",
                            "MAD",
                            "MMK",
                            "NAD",
                            "NPR",
                            "TWD",
                            "NZD",
                            "NIO",
                            "NGN",
                            "NOK",
                            "OMR",
                            "PKR",
                            "PAB",
                            "PEN",
                            "PHP",
                            "PLN",
                            "GBP",
                            "QAR",
                            "RON",
                            "RUB",
                            "SAR",
                            "RSD",
                            "SGD",
                            "ZAR",
                            "KRW",
                            "SSP",
                            "VES",
                            "LKR",
                            "SEK",
                            "CHF",
                            "THB",
                            "TTD",
                            "TND",
                            "TRY",
                            "UGX",
                            "UAH",
                            "AED",
                            "UYU",
                            "UZS",
                            "VND"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "billingAddress": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "line1": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "line2": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "zipCode": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "city": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "state": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "countryCode": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "line1",
                            "line2",
                            "zipCode",
                            "city",
                            "state",
                            "countryCode"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "paymentProfiles": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "externalId": {
                            "type": "string"
                          },
                          "method": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "expiresAt": {
                            "anyOf": [
                              {
                                "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "connection": {
                            "type": "object",
                            "properties": {
                              "label": {
                                "type": "string"
                              },
                              "pluginSlug": {
                                "type": "string"
                              },
                              "id": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "label",
                              "pluginSlug",
                              "id"
                            ],
                            "additionalProperties": false
                          },
                          "sourceOrder": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "externalUniqId": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "externalUniqId"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "The Order that your customer was paying when saving this payment profile."
                          }
                        },
                        "required": [
                          "id",
                          "externalId",
                          "method",
                          "label",
                          "expiresAt",
                          "connection",
                          "sourceOrder"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Active saved Payment Profiles for this contact. Can be used to pay Orders with the `charge` endpoint."
                    }
                  },
                  "required": [
                    "id",
                    "legalName",
                    "contactName",
                    "displayName",
                    "email",
                    "taxId",
                    "defaultCurrency",
                    "billingAddress",
                    "paymentProfiles"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, invalid, expired or suspended, or your organization cannot use this endpoint. `message` says which.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the `contacts.update` scope. Add it to the key in your API settings, or use a key that has it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "contact-delete",
        "summary": "Delete Contact",
        "description": "Delete a Zaprite Contact<br/><br/>Required API key scope: `contacts.delete`",
        "tags": [
          "Contacts"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, invalid, expired or suspended, or your organization cannot use this endpoint. `message` says which.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the `contacts.delete` scope. Add it to the key in your API settings, or use a key that has it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "contact-get",
        "summary": "Get Contact",
        "description": "Get a Zaprite Contact<br/><br/>Required API key scope: `contacts.get` or `contacts.read`",
        "tags": [
          "Contacts"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "legalName": {
                      "type": "string"
                    },
                    "contactName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "displayName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "email": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "email",
                          "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "taxId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "defaultCurrency": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "USD",
                            "USDC",
                            "USDT",
                            "BTC",
                            "LBTC",
                            "ALL",
                            "DZD",
                            "ARS",
                            "AMD",
                            "AUD",
                            "AZN",
                            "BHD",
                            "BDT",
                            "BYN",
                            "BMD",
                            "BOB",
                            "BAM",
                            "BRL",
                            "BGN",
                            "KHR",
                            "CAD",
                            "CLP",
                            "CNY",
                            "COP",
                            "CRC",
                            "HRK",
                            "CUP",
                            "CZK",
                            "DKK",
                            "DOP",
                            "EGP",
                            "EUR",
                            "GEL",
                            "GHS",
                            "GTQ",
                            "HNL",
                            "HKD",
                            "HUF",
                            "ISK",
                            "INR",
                            "IDR",
                            "IRR",
                            "IQD",
                            "ILS",
                            "JMD",
                            "JPY",
                            "JOD",
                            "KZT",
                            "KES",
                            "KWD",
                            "KGS",
                            "LBP",
                            "MKD",
                            "MYR",
                            "MUR",
                            "MXN",
                            "MDL",
                            "MNT",
                            "MAD",
                            "MMK",
                            "NAD",
                            "NPR",
                            "TWD",
                            "NZD",
                            "NIO",
                            "NGN",
                            "NOK",
                            "OMR",
                            "PKR",
                            "PAB",
                            "PEN",
                            "PHP",
                            "PLN",
                            "GBP",
                            "QAR",
                            "RON",
                            "RUB",
                            "SAR",
                            "RSD",
                            "SGD",
                            "ZAR",
                            "KRW",
                            "SSP",
                            "VES",
                            "LKR",
                            "SEK",
                            "CHF",
                            "THB",
                            "TTD",
                            "TND",
                            "TRY",
                            "UGX",
                            "UAH",
                            "AED",
                            "UYU",
                            "UZS",
                            "VND"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "billingAddress": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "line1": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "line2": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "zipCode": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "city": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "state": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "countryCode": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "line1",
                            "line2",
                            "zipCode",
                            "city",
                            "state",
                            "countryCode"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "paymentProfiles": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "externalId": {
                            "type": "string"
                          },
                          "method": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "expiresAt": {
                            "anyOf": [
                              {
                                "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "connection": {
                            "type": "object",
                            "properties": {
                              "label": {
                                "type": "string"
                              },
                              "pluginSlug": {
                                "type": "string"
                              },
                              "id": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "label",
                              "pluginSlug",
                              "id"
                            ],
                            "additionalProperties": false
                          },
                          "sourceOrder": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "externalUniqId": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "externalUniqId"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "The Order that your customer was paying when saving this payment profile."
                          }
                        },
                        "required": [
                          "id",
                          "externalId",
                          "method",
                          "label",
                          "expiresAt",
                          "connection",
                          "sourceOrder"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Active saved Payment Profiles for this contact. Can be used to pay Orders with the `charge` endpoint."
                    }
                  },
                  "required": [
                    "id",
                    "legalName",
                    "contactName",
                    "displayName",
                    "email",
                    "taxId",
                    "defaultCurrency",
                    "billingAddress",
                    "paymentProfiles"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, invalid, expired or suspended, or your organization cannot use this endpoint. `message` says which.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the `contacts.get` or `contacts.read` scope. Add it to the key in your API settings, or use a key that has it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payment-links/{id}": {
      "get": {
        "operationId": "paymentLink-get",
        "summary": "Get Payment Link",
        "description": "Get a Payment Link by its id, including its items.<br/><br/>Required API key scope: `paymentLinks.get` or `paymentLinks.read`",
        "tags": [
          "Payment Links"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "example": {
                  "id": "pl_abc123",
                  "orgId": "abc123",
                  "createdAt": "2024-02-25T11:04:09.656Z",
                  "type": "EVENT",
                  "title": "Bitcoin Conference 2024",
                  "descriptionHtml": "<p>Join us for two days of talks and workshops.</p>",
                  "currency": "USD",
                  "taxRateBips": 0,
                  "published": true,
                  "url": "https://pay.zaprite.com/pl_abc123",
                  "redirectUrl": null,
                  "tags": [
                    "conference"
                  ],
                  "requireFulfillment": false,
                  "startDate": "2024-06-01",
                  "startTime": "09:00",
                  "endDate": "2024-06-02",
                  "endTime": "18:00",
                  "timeZone": "America/New_York",
                  "imageUrl": null,
                  "items": [
                    {
                      "id": "pli_123",
                      "createdAt": "2024-02-25T11:04:09.656Z",
                      "title": "General Admission",
                      "descriptionHtml": null,
                      "unitPrice": 5000,
                      "taxRateBips": 0,
                      "maxPerOrder": 10,
                      "stock": 100,
                      "active": true,
                      "hidden": false,
                      "nonTransferable": false,
                      "position": 0,
                      "imageUrl": null
                    },
                    {
                      "id": "pli_456",
                      "createdAt": "2024-02-25T11:04:09.656Z",
                      "title": "VIP",
                      "descriptionHtml": "<p>Includes backstage access.</p>",
                      "unitPrice": 10000,
                      "taxRateBips": 0,
                      "maxPerOrder": 2,
                      "stock": 10,
                      "active": true,
                      "hidden": false,
                      "nonTransferable": true,
                      "position": 1,
                      "imageUrl": null
                    }
                  ]
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "orgId": {
                      "type": "string",
                      "description": "Id of the Zaprite organization that owns this payment link"
                    },
                    "createdAt": {
                      "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "POS",
                        "GENERIC",
                        "EVENT"
                      ],
                      "description": "`GENERIC`: a standard payment link<br/>`POS`: a point-of-sale payment link<br/>`EVENT`: an event selling tickets"
                    },
                    "title": {
                      "type": "string"
                    },
                    "descriptionHtml": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "currency": {
                      "type": "string",
                      "enum": [
                        "USD",
                        "USDC",
                        "USDT",
                        "BTC",
                        "LBTC",
                        "ALL",
                        "DZD",
                        "ARS",
                        "AMD",
                        "AUD",
                        "AZN",
                        "BHD",
                        "BDT",
                        "BYN",
                        "BMD",
                        "BOB",
                        "BAM",
                        "BRL",
                        "BGN",
                        "KHR",
                        "CAD",
                        "CLP",
                        "CNY",
                        "COP",
                        "CRC",
                        "HRK",
                        "CUP",
                        "CZK",
                        "DKK",
                        "DOP",
                        "EGP",
                        "EUR",
                        "GEL",
                        "GHS",
                        "GTQ",
                        "HNL",
                        "HKD",
                        "HUF",
                        "ISK",
                        "INR",
                        "IDR",
                        "IRR",
                        "IQD",
                        "ILS",
                        "JMD",
                        "JPY",
                        "JOD",
                        "KZT",
                        "KES",
                        "KWD",
                        "KGS",
                        "LBP",
                        "MKD",
                        "MYR",
                        "MUR",
                        "MXN",
                        "MDL",
                        "MNT",
                        "MAD",
                        "MMK",
                        "NAD",
                        "NPR",
                        "TWD",
                        "NZD",
                        "NIO",
                        "NGN",
                        "NOK",
                        "OMR",
                        "PKR",
                        "PAB",
                        "PEN",
                        "PHP",
                        "PLN",
                        "GBP",
                        "QAR",
                        "RON",
                        "RUB",
                        "SAR",
                        "RSD",
                        "SGD",
                        "ZAR",
                        "KRW",
                        "SSP",
                        "VES",
                        "LKR",
                        "SEK",
                        "CHF",
                        "THB",
                        "TTD",
                        "TND",
                        "TRY",
                        "UGX",
                        "UAH",
                        "AED",
                        "UYU",
                        "UZS",
                        "VND"
                      ]
                    },
                    "taxRateBips": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991,
                      "description": "Tax rate in bips (e.g. 1000 for 10%) used when the payment link has no items (donation, POS, etc.). Items define their own tax rate."
                    },
                    "published": {
                      "type": "boolean",
                      "description": "If false, the public payment link page is not accessible."
                    },
                    "url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Public URL of the payment link"
                    },
                    "redirectUrl": {
                      "description": "If set, the checkout redirects to this URL after the payment is complete.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "tags": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Tags added to the Orders created from this payment link."
                    },
                    "requireFulfillment": {
                      "type": "boolean",
                      "description": "If true, paid orders are marked as `PAID` rather than `COMPLETE` and must be completed manually."
                    },
                    "startDate": {
                      "description": "Events only. Start date in `YYYY-MM-DD` format.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "startTime": {
                      "description": "Events only. Start time in `HH:mm` format.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "endDate": {
                      "description": "Events only. End date in `YYYY-MM-DD` format.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "endTime": {
                      "description": "Events only. End time in `HH:mm` format.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "timeZone": {
                      "description": "Events only. IANA time zone.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "imageUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "createdAt": {
                            "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                            "type": "string"
                          },
                          "title": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "descriptionHtml": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "unitPrice": {
                            "description": "Price per unit in the payment link currency smallest unit (e.g. cents for USD, satoshis for BTC).",
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "taxRateBips": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991,
                            "description": "Tax rate applied to this item in bips (e.g. 1000 for 10%)."
                          },
                          "maxPerOrder": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991,
                            "description": "Maximum number of units a customer can buy in a single order. `0` means unlimited."
                          },
                          "stock": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Remaining number of units that can be ordered. `null` means unlimited stock. `0` means the item cannot be purchased anymore."
                          },
                          "active": {
                            "type": "boolean"
                          },
                          "hidden": {
                            "type": "boolean",
                            "description": "If true, this item is not shown on the public payment link page and cannot be purchased directly."
                          },
                          "nonTransferable": {
                            "type": "boolean",
                            "description": "Event tickets only. If true, tickets issued for this item cannot be transferred to another person."
                          },
                          "position": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991,
                            "description": "Position of the item in the payment link items list."
                          },
                          "imageUrl": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "createdAt",
                          "title",
                          "descriptionHtml",
                          "unitPrice",
                          "taxRateBips",
                          "maxPerOrder",
                          "stock",
                          "active",
                          "hidden",
                          "nonTransferable",
                          "position",
                          "imageUrl"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Items that can be ordered from this payment link (products, ticket types...). Empty if the customer chooses the amount to pay (donation, POS, etc.)."
                    }
                  },
                  "required": [
                    "id",
                    "orgId",
                    "createdAt",
                    "type",
                    "title",
                    "descriptionHtml",
                    "currency",
                    "taxRateBips",
                    "published",
                    "url",
                    "redirectUrl",
                    "tags",
                    "requireFulfillment",
                    "startDate",
                    "startTime",
                    "endDate",
                    "endTime",
                    "timeZone",
                    "imageUrl",
                    "items"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, invalid, expired or suspended, or your organization cannot use this endpoint. `message` says which.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the `paymentLinks.get` or `paymentLinks.read` scope. Add it to the key in your API settings, or use a key that has it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payment-links": {
      "get": {
        "operationId": "paymentLink-search",
        "summary": "List Payment Links",
        "description": "Retrieve a paginated list of Payment Links, including their items (products, ticket types...). Supports filtering by payment link type, published state, title and creation date. Returns up to 100 results per page.<br/><br/>Required API key scope: `paymentLinks.read`",
        "tags": [
          "Payment Links"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "schema": {
              "default": 1,
              "type": "number",
              "minimum": 1,
              "description": "Page number. 1 for first page"
            }
          },
          {
            "in": "query",
            "name": "search",
            "schema": {
              "description": "Free text search in the payment link title.",
              "type": "string"
            },
            "description": "Free text search in the payment link title."
          },
          {
            "in": "query",
            "name": "type",
            "schema": {
              "description": "Filter by payment link type: `GENERIC`, `POS` or `EVENT`. Repeat the parameter to pass multiple values. Comma-separated is not supported.",
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "POS",
                  "GENERIC",
                  "EVENT"
                ]
              }
            },
            "description": "Filter by payment link type: `GENERIC`, `POS` or `EVENT`. Repeat the parameter to pass multiple values. Comma-separated is not supported."
          },
          {
            "in": "query",
            "name": "published",
            "schema": {
              "description": "Filter by published state.",
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            },
            "description": "Filter by published state."
          },
          {
            "in": "query",
            "name": "createdAtMin",
            "schema": {
              "description": "Filter payment links created after this date (ISO 8601 - e.g. \"2021-01-01T00:00:00.000Z\").",
              "format": "datetime string",
              "type": "string"
            },
            "description": "Filter payment links created after this date (ISO 8601 - e.g. \"2021-01-01T00:00:00.000Z\")."
          },
          {
            "in": "query",
            "name": "createdAtMax",
            "schema": {
              "description": "Filter payment links created before this date (ISO 8601 - e.g. \"2021-01-01T00:00:00.000Z\").",
              "format": "datetime string",
              "type": "string"
            },
            "description": "Filter payment links created before this date (ISO 8601 - e.g. \"2021-01-01T00:00:00.000Z\")."
          },
          {
            "in": "query",
            "name": "sortBy",
            "schema": {
              "default": "createdAt",
              "type": "string",
              "enum": [
                "createdAt",
                "title"
              ]
            }
          },
          {
            "in": "query",
            "name": "sortOrder",
            "schema": {
              "default": "desc",
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "example": {
                  "items": [
                    {
                      "id": "pl_abc123",
                      "orgId": "abc123",
                      "createdAt": "2024-02-25T11:04:09.656Z",
                      "type": "EVENT",
                      "title": "Bitcoin Conference 2024",
                      "descriptionHtml": "<p>Join us for two days of talks and workshops.</p>",
                      "currency": "USD",
                      "taxRateBips": 0,
                      "published": true,
                      "url": "https://pay.zaprite.com/pl_abc123",
                      "redirectUrl": null,
                      "tags": [
                        "conference"
                      ],
                      "requireFulfillment": false,
                      "startDate": "2024-06-01",
                      "startTime": "09:00",
                      "endDate": "2024-06-02",
                      "endTime": "18:00",
                      "timeZone": "America/New_York",
                      "imageUrl": null,
                      "items": [
                        {
                          "id": "pli_123",
                          "createdAt": "2024-02-25T11:04:09.656Z",
                          "title": "General Admission",
                          "descriptionHtml": null,
                          "unitPrice": 5000,
                          "taxRateBips": 0,
                          "maxPerOrder": 10,
                          "stock": 100,
                          "active": true,
                          "hidden": false,
                          "nonTransferable": false,
                          "position": 0,
                          "imageUrl": null
                        },
                        {
                          "id": "pli_456",
                          "createdAt": "2024-02-25T11:04:09.656Z",
                          "title": "VIP",
                          "descriptionHtml": "<p>Includes backstage access.</p>",
                          "unitPrice": 10000,
                          "taxRateBips": 0,
                          "maxPerOrder": 2,
                          "stock": 10,
                          "active": true,
                          "hidden": false,
                          "nonTransferable": true,
                          "position": 1,
                          "imageUrl": null
                        }
                      ]
                    }
                  ],
                  "meta": {
                    "itemsCount": 1,
                    "pagesCount": 1,
                    "page": 1,
                    "perPage": 100
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "orgId": {
                            "type": "string",
                            "description": "Id of the Zaprite organization that owns this payment link"
                          },
                          "createdAt": {
                            "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "POS",
                              "GENERIC",
                              "EVENT"
                            ],
                            "description": "`GENERIC`: a standard payment link<br/>`POS`: a point-of-sale payment link<br/>`EVENT`: an event selling tickets"
                          },
                          "title": {
                            "type": "string"
                          },
                          "descriptionHtml": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "currency": {
                            "type": "string",
                            "enum": [
                              "USD",
                              "USDC",
                              "USDT",
                              "BTC",
                              "LBTC",
                              "ALL",
                              "DZD",
                              "ARS",
                              "AMD",
                              "AUD",
                              "AZN",
                              "BHD",
                              "BDT",
                              "BYN",
                              "BMD",
                              "BOB",
                              "BAM",
                              "BRL",
                              "BGN",
                              "KHR",
                              "CAD",
                              "CLP",
                              "CNY",
                              "COP",
                              "CRC",
                              "HRK",
                              "CUP",
                              "CZK",
                              "DKK",
                              "DOP",
                              "EGP",
                              "EUR",
                              "GEL",
                              "GHS",
                              "GTQ",
                              "HNL",
                              "HKD",
                              "HUF",
                              "ISK",
                              "INR",
                              "IDR",
                              "IRR",
                              "IQD",
                              "ILS",
                              "JMD",
                              "JPY",
                              "JOD",
                              "KZT",
                              "KES",
                              "KWD",
                              "KGS",
                              "LBP",
                              "MKD",
                              "MYR",
                              "MUR",
                              "MXN",
                              "MDL",
                              "MNT",
                              "MAD",
                              "MMK",
                              "NAD",
                              "NPR",
                              "TWD",
                              "NZD",
                              "NIO",
                              "NGN",
                              "NOK",
                              "OMR",
                              "PKR",
                              "PAB",
                              "PEN",
                              "PHP",
                              "PLN",
                              "GBP",
                              "QAR",
                              "RON",
                              "RUB",
                              "SAR",
                              "RSD",
                              "SGD",
                              "ZAR",
                              "KRW",
                              "SSP",
                              "VES",
                              "LKR",
                              "SEK",
                              "CHF",
                              "THB",
                              "TTD",
                              "TND",
                              "TRY",
                              "UGX",
                              "UAH",
                              "AED",
                              "UYU",
                              "UZS",
                              "VND"
                            ]
                          },
                          "taxRateBips": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991,
                            "description": "Tax rate in bips (e.g. 1000 for 10%) used when the payment link has no items (donation, POS, etc.). Items define their own tax rate."
                          },
                          "published": {
                            "type": "boolean",
                            "description": "If false, the public payment link page is not accessible."
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Public URL of the payment link"
                          },
                          "redirectUrl": {
                            "description": "If set, the checkout redirects to this URL after the payment is complete.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "tags": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Tags added to the Orders created from this payment link."
                          },
                          "requireFulfillment": {
                            "type": "boolean",
                            "description": "If true, paid orders are marked as `PAID` rather than `COMPLETE` and must be completed manually."
                          },
                          "startDate": {
                            "description": "Events only. Start date in `YYYY-MM-DD` format.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "startTime": {
                            "description": "Events only. Start time in `HH:mm` format.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "endDate": {
                            "description": "Events only. End date in `YYYY-MM-DD` format.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "endTime": {
                            "description": "Events only. End time in `HH:mm` format.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "timeZone": {
                            "description": "Events only. IANA time zone.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "imageUrl": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "items": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "createdAt": {
                                  "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                                  "type": "string"
                                },
                                "title": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "descriptionHtml": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "unitPrice": {
                                  "description": "Price per unit in the payment link currency smallest unit (e.g. cents for USD, satoshis for BTC).",
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "taxRateBips": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991,
                                  "description": "Tax rate applied to this item in bips (e.g. 1000 for 10%)."
                                },
                                "maxPerOrder": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991,
                                  "description": "Maximum number of units a customer can buy in a single order. `0` means unlimited."
                                },
                                "stock": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "Remaining number of units that can be ordered. `null` means unlimited stock. `0` means the item cannot be purchased anymore."
                                },
                                "active": {
                                  "type": "boolean"
                                },
                                "hidden": {
                                  "type": "boolean",
                                  "description": "If true, this item is not shown on the public payment link page and cannot be purchased directly."
                                },
                                "nonTransferable": {
                                  "type": "boolean",
                                  "description": "Event tickets only. If true, tickets issued for this item cannot be transferred to another person."
                                },
                                "position": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991,
                                  "description": "Position of the item in the payment link items list."
                                },
                                "imageUrl": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "createdAt",
                                "title",
                                "descriptionHtml",
                                "unitPrice",
                                "taxRateBips",
                                "maxPerOrder",
                                "stock",
                                "active",
                                "hidden",
                                "nonTransferable",
                                "position",
                                "imageUrl"
                              ],
                              "additionalProperties": false
                            },
                            "description": "Items that can be ordered from this payment link (products, ticket types...). Empty if the customer chooses the amount to pay (donation, POS, etc.)."
                          }
                        },
                        "required": [
                          "id",
                          "orgId",
                          "createdAt",
                          "type",
                          "title",
                          "descriptionHtml",
                          "currency",
                          "taxRateBips",
                          "published",
                          "url",
                          "redirectUrl",
                          "tags",
                          "requireFulfillment",
                          "startDate",
                          "startTime",
                          "endDate",
                          "endTime",
                          "timeZone",
                          "imageUrl",
                          "items"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "itemsCount": {
                          "type": "number"
                        },
                        "pagesCount": {
                          "type": "number"
                        },
                        "page": {
                          "type": "number"
                        },
                        "perPage": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "itemsCount",
                        "pagesCount",
                        "page",
                        "perPage"
                      ],
                      "additionalProperties": false,
                      "description": "Pagination metadata"
                    }
                  },
                  "required": [
                    "items",
                    "meta"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, invalid, expired or suspended, or your organization cannot use this endpoint. `message` says which.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the `paymentLinks.read` scope. Add it to the key in your API settings, or use a key that has it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tickets/{id}": {
      "get": {
        "operationId": "ticket-get",
        "summary": "Get Ticket",
        "description": "Retrieve a single event ticket by id.<br/><br/>Required API key scope: `tickets.get` or `tickets.read`",
        "tags": [
          "Tickets"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Sensitive, unguessable ticket identifier. Anyone with this ID can use the ticket at the door."
                    },
                    "ticketUrl": {
                      "type": "string",
                      "description": "URL for viewing this ticket, with its access token. If you issue tickets with sendTicketsToCustomer set to false, this is the URL you need to communicate to your customer. Use it as returned: a ticket URL built from the ID alone stops opening 3 months after the event. Anyone with the ticket URL can view or use the ticket."
                    },
                    "createdAt": {
                      "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "ISSUED",
                        "CANCELED",
                        "CHECKED_IN",
                        "TRANSFERRED"
                      ]
                    },
                    "persistentOwnerEmail": {
                      "description": "When set, this email retains transfer rights for the ticket after a transfer. This can be set when issuing tickets from a CSV file.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "transferredByOrderId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "order": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "customerName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "customerEmail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "customerName",
                        "customerEmail"
                      ],
                      "additionalProperties": false
                    },
                    "paymentLink": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "title"
                      ],
                      "additionalProperties": false
                    },
                    "paymentLinkItem": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "title": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "title"
                      ],
                      "additionalProperties": false
                    },
                    "activity": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "createdAt": {
                            "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                            "type": "string"
                          },
                          "action": {
                            "type": "string",
                            "enum": [
                              "CHECK_IN",
                              "SCAN",
                              "CANCEL",
                              "REACTIVATE"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "createdAt",
                          "action"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Activity log entries for the ticket, ordered from newest to oldest."
                    }
                  },
                  "required": [
                    "id",
                    "ticketUrl",
                    "createdAt",
                    "status",
                    "persistentOwnerEmail",
                    "transferredByOrderId",
                    "order",
                    "paymentLink",
                    "paymentLinkItem",
                    "activity"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, invalid, expired or suspended, or your organization cannot use this endpoint. `message` says which.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the `tickets.get` or `tickets.read` scope. Add it to the key in your API settings, or use a key that has it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tickets": {
      "get": {
        "operationId": "ticket-search",
        "summary": "List Tickets",
        "description": "Retrieve a paginated list of event tickets with support for filtering by event, ticket type, status, and creation date.<br/><br/>Required API key scope: `tickets.read`",
        "tags": [
          "Tickets"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "schema": {
              "default": 1,
              "type": "number",
              "minimum": 1,
              "description": "Page number. 1 for first page"
            }
          },
          {
            "in": "query",
            "name": "paymentLinkId",
            "schema": {
              "description": "Filter tickets for a specific event. This is the id of the event `PaymentLink`.",
              "type": "string"
            },
            "description": "Filter tickets for a specific event. This is the id of the event `PaymentLink`."
          },
          {
            "in": "query",
            "name": "paymentLinkItemId",
            "schema": {
              "description": "Filter tickets for a specific ticket type within an event. This is the id of the event `PaymentLinkItem`.",
              "type": "string"
            },
            "description": "Filter tickets for a specific ticket type within an event. This is the id of the event `PaymentLinkItem`."
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "description": "Filter by ticket status. Repeat the parameter to pass multiple values. Comma-separated is not supported.",
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "ISSUED",
                  "CANCELED",
                  "CHECKED_IN",
                  "TRANSFERRED"
                ]
              }
            },
            "description": "Filter by ticket status. Repeat the parameter to pass multiple values. Comma-separated is not supported."
          },
          {
            "in": "query",
            "name": "createdAtMin",
            "schema": {
              "description": "Filter tickets created after this date (ISO 8601 - e.g. \"2021-01-01T00:00:00.000Z\").",
              "format": "datetime string",
              "type": "string"
            },
            "description": "Filter tickets created after this date (ISO 8601 - e.g. \"2021-01-01T00:00:00.000Z\")."
          },
          {
            "in": "query",
            "name": "createdAtMax",
            "schema": {
              "description": "Filter tickets created before this date (ISO 8601 - e.g. \"2021-01-01T00:00:00.000Z\").",
              "format": "datetime string",
              "type": "string"
            },
            "description": "Filter tickets created before this date (ISO 8601 - e.g. \"2021-01-01T00:00:00.000Z\")."
          },
          {
            "in": "query",
            "name": "sortBy",
            "schema": {
              "default": "createdAt",
              "type": "string",
              "enum": [
                "createdAt",
                "status"
              ]
            }
          },
          {
            "in": "query",
            "name": "sortOrder",
            "schema": {
              "default": "desc",
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Sensitive, unguessable ticket identifier. Anyone with this ID can use the ticket at the door."
                          },
                          "ticketUrl": {
                            "type": "string",
                            "description": "URL for viewing this ticket, with its access token. If you issue tickets with sendTicketsToCustomer set to false, this is the URL you need to communicate to your customer. Use it as returned: a ticket URL built from the ID alone stops opening 3 months after the event. Anyone with the ticket URL can view or use the ticket."
                          },
                          "createdAt": {
                            "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "ISSUED",
                              "CANCELED",
                              "CHECKED_IN",
                              "TRANSFERRED"
                            ]
                          },
                          "persistentOwnerEmail": {
                            "description": "When set, this email retains transfer rights for the ticket after a transfer. This can be set when issuing tickets from a CSV file.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "transferredByOrderId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "order": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "customerName": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "customerEmail": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "customerName",
                              "customerEmail"
                            ],
                            "additionalProperties": false
                          },
                          "paymentLink": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "title": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "title"
                            ],
                            "additionalProperties": false
                          },
                          "paymentLinkItem": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "title": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "title"
                            ],
                            "additionalProperties": false
                          },
                          "activity": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "createdAt": {
                                  "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                                  "type": "string"
                                },
                                "action": {
                                  "type": "string",
                                  "enum": [
                                    "CHECK_IN",
                                    "SCAN",
                                    "CANCEL",
                                    "REACTIVATE"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "createdAt",
                                "action"
                              ],
                              "additionalProperties": false
                            },
                            "description": "Activity log entries for the ticket, ordered from newest to oldest."
                          }
                        },
                        "required": [
                          "id",
                          "ticketUrl",
                          "createdAt",
                          "status",
                          "persistentOwnerEmail",
                          "transferredByOrderId",
                          "order",
                          "paymentLink",
                          "paymentLinkItem",
                          "activity"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "itemsCount": {
                          "type": "number"
                        },
                        "pagesCount": {
                          "type": "number"
                        },
                        "page": {
                          "type": "number"
                        },
                        "perPage": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "itemsCount",
                        "pagesCount",
                        "page",
                        "perPage"
                      ],
                      "additionalProperties": false,
                      "description": "Pagination metadata"
                    }
                  },
                  "required": [
                    "items",
                    "meta"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, invalid, expired or suspended, or your organization cannot use this endpoint. `message` says which.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the `tickets.read` scope. Add it to the key in your API settings, or use a key that has it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tickets/issue": {
      "post": {
        "operationId": "ticket-issueTickets",
        "summary": "Issue Tickets",
        "description": "Issue no-charge tickets to attendees for an event. Attendees receive their tickets by email unless sendTicketsToCustomer is false, ticket inventory can be updated automatically, and a persistent owner can be set to retain transfer rights. Standard Ticket Fees apply. Importing from another platform? Contact sales@zaprite.com to discuss pricing options.<br/><br/>Required API key scope: `tickets.issue`",
        "tags": [
          "Tickets"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "paymentLinkItemId": {
                    "type": "string",
                    "description": "Ticket type id within the event."
                  },
                  "tickets": {
                    "minItems": 1,
                    "maxItems": 1000,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "email": {
                          "type": "string",
                          "format": "email",
                          "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$",
                          "description": "The email address of the attendee."
                        },
                        "name": {
                          "description": "The name of the attendee.",
                          "type": "string"
                        },
                        "company": {
                          "description": "The company of the attendee.",
                          "type": "string"
                        },
                        "quantity": {
                          "default": 1,
                          "description": "The quantity of tickets to create for this attendee. Max 100.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 100
                        }
                      },
                      "required": [
                        "email"
                      ]
                    },
                    "description": "The list of tickets to create. At most 1000 tickets (sum of quantities) per request."
                  },
                  "decrementStock": {
                    "type": "boolean",
                    "description": "Whether to decrement ticket type stock by the number of created tickets."
                  },
                  "sendTicketsToCustomer": {
                    "default": true,
                    "description": "Whether to send issued tickets by email. Defaults to true. If false, you are responsible for distributing tickets.",
                    "type": "boolean"
                  },
                  "persistentOwnerEmail": {
                    "description": "When set, only the owner can transfer these tickets, even if assigned to someone else. The owner will receive an email notification with a link to manage the tickets.",
                    "type": "string",
                    "format": "email",
                    "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                  },
                  "idempotencyKey": {
                    "description": "Optional arbitrary client-defined value for this request. Use it to prevent accidentally creating duplicate tickets when retrying a request: reusing the same idempotencyKey with the same input returns the originally created tickets; reusing it with different input is rejected.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  }
                },
                "required": [
                  "paymentLinkItemId",
                  "tickets",
                  "decrementStock"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Sensitive, unguessable ticket identifier. Anyone with this ID can use the ticket at the door."
                      },
                      "ticketUrl": {
                        "type": "string",
                        "description": "URL for viewing this ticket, with its access token. If you issue tickets with sendTicketsToCustomer set to false, this is the URL you need to communicate to your customer. Use it as returned: a ticket URL built from the ID alone stops opening 3 months after the event. Anyone with the ticket URL can view or use the ticket."
                      },
                      "createdAt": {
                        "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                        "type": "string"
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "ISSUED",
                          "CANCELED",
                          "CHECKED_IN",
                          "TRANSFERRED"
                        ]
                      },
                      "persistentOwnerEmail": {
                        "description": "When set, this email retains transfer rights for the ticket after a transfer. This can be set when issuing tickets from a CSV file.",
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "transferredByOrderId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "order": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "customerName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "customerEmail": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "customerName",
                          "customerEmail"
                        ],
                        "additionalProperties": false
                      },
                      "paymentLink": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "title"
                        ],
                        "additionalProperties": false
                      },
                      "paymentLinkItem": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "title": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "title"
                        ],
                        "additionalProperties": false
                      },
                      "activity": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "createdAt": {
                              "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                              "type": "string"
                            },
                            "action": {
                              "type": "string",
                              "enum": [
                                "CHECK_IN",
                                "SCAN",
                                "CANCEL",
                                "REACTIVATE"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "createdAt",
                            "action"
                          ],
                          "additionalProperties": false
                        },
                        "description": "Activity log entries for the ticket, ordered from newest to oldest."
                      }
                    },
                    "required": [
                      "id",
                      "ticketUrl",
                      "createdAt",
                      "status",
                      "persistentOwnerEmail",
                      "transferredByOrderId",
                      "order",
                      "paymentLink",
                      "paymentLinkItem",
                      "activity"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "The input is invalid, or the ticket type does not have enough stock for this request. `message` gives the available and requested quantities. Ask for fewer tickets, raise the stock, or send `decrementStock: false`.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string",
                      "const": "BAD_REQUEST"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "message"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "message",
                    "code"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "message": "Not enough stock. Available: 2, Requested: 5",
                  "code": "BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, invalid, expired or suspended, or your organization cannot use this endpoint. `message` says which.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the `tickets.issue` scope. Add it to the key in your API settings, or use a key that has it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "No ticket type with this `paymentLinkItemId` exists in your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string",
                      "const": "NOT_FOUND"
                    }
                  },
                  "required": [
                    "message",
                    "code"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "message": "Ticket type not found",
                  "code": "NOT_FOUND"
                }
              }
            }
          },
          "409": {
            "description": "This `idempotencyKey` was already used with different input. Use a new key for a new request. Sending the original input again returns the tickets it created.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string",
                      "const": "CONFLICT"
                    }
                  },
                  "required": [
                    "message",
                    "code"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "message": "Ticket import with this idempotencyKey already exists with different input",
                  "code": "CONFLICT"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tickets/{id}/activity": {
      "post": {
        "operationId": "ticket-addActivity",
        "summary": "Add Ticket Activity",
        "description": "Record an activity on an event ticket. Use `CHECK_IN` to admit an attendee at the door, `SCAN` to log a scan without changing the status, or `CANCEL` and `REACTIVATE` to manage ticket lifecycle. Returns the updated ticket.<br/><br/>Required API key scope: `tickets.manage`",
        "tags": [
          "Tickets"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "Ticket id."
            },
            "required": true,
            "description": "Ticket id."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "CHECK_IN",
                      "SCAN",
                      "CANCEL",
                      "REACTIVATE"
                    ],
                    "description": "Activity to record on the ticket. `CHECK_IN` admits the attendee at the door, `SCAN` only logs the scan without changing status, `CANCEL` cancels the ticket, and `REACTIVATE` restores a previously canceled ticket."
                  },
                  "paymentLinkId": {
                    "type": "string",
                    "description": "Optional event id to validate against. If provided and the ticket belongs to a different event, the request is rejected."
                  },
                  "force": {
                    "type": "boolean",
                    "description": "If true, allow `CHECK_IN` even when the ticket is already CHECKED_IN. Useful to record a re-entry. Defaults to false."
                  },
                  "updateStock": {
                    "type": "boolean",
                    "description": "If true, increment available stock on `CANCEL` and decrement on `REACTIVATE`. Defaults to false."
                  }
                },
                "required": [
                  "action"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Sensitive, unguessable ticket identifier. Anyone with this ID can use the ticket at the door."
                    },
                    "ticketUrl": {
                      "type": "string",
                      "description": "URL for viewing this ticket, with its access token. If you issue tickets with sendTicketsToCustomer set to false, this is the URL you need to communicate to your customer. Use it as returned: a ticket URL built from the ID alone stops opening 3 months after the event. Anyone with the ticket URL can view or use the ticket."
                    },
                    "createdAt": {
                      "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "ISSUED",
                        "CANCELED",
                        "CHECKED_IN",
                        "TRANSFERRED"
                      ]
                    },
                    "persistentOwnerEmail": {
                      "description": "When set, this email retains transfer rights for the ticket after a transfer. This can be set when issuing tickets from a CSV file.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "transferredByOrderId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "order": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "customerName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "customerEmail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "customerName",
                        "customerEmail"
                      ],
                      "additionalProperties": false
                    },
                    "paymentLink": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "title"
                      ],
                      "additionalProperties": false
                    },
                    "paymentLinkItem": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "title": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "title"
                      ],
                      "additionalProperties": false
                    },
                    "activity": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "createdAt": {
                            "description": "Date in ISO 8601 format (e.g. \"2021-01-01T00:00:00.000Z\")",
                            "type": "string"
                          },
                          "action": {
                            "type": "string",
                            "enum": [
                              "CHECK_IN",
                              "SCAN",
                              "CANCEL",
                              "REACTIVATE"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "createdAt",
                          "action"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Activity log entries for the ticket, ordered from newest to oldest."
                    }
                  },
                  "required": [
                    "id",
                    "ticketUrl",
                    "createdAt",
                    "status",
                    "persistentOwnerEmail",
                    "transferredByOrderId",
                    "order",
                    "paymentLink",
                    "paymentLinkItem",
                    "activity"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "The input is invalid, or the ticket refuses this action: it is already checked in, canceled or transferred, or it belongs to another event than `paymentLinkId`. `message` says which. To record a re-entry on a checked-in ticket, send `force: true`. A canceled ticket only accepts `REACTIVATE`.",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string",
                      "const": "BAD_REQUEST"
                    },
                    "issues": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "message"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "message",
                    "code"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "message": "Ticket already checked in",
                  "code": "BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, invalid, expired or suspended, or your organization cannot use this endpoint. `message` says which.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the `tickets.manage` scope. Add it to the key in your API settings, or use a key that has it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhooks": {
      "post": {
        "operationId": "webhook-create",
        "summary": "Create Webhook",
        "description": "Create a webhook to receive notifications about events in your Zaprite organization.<br/><br/>A key with the `webhooks.create` scope can register a URL that receives order events, customer data included. Delivery continues after the key expires or is deleted.<br/><br/>Required API key scope: `webhooks.create`",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "url": "https://example.com/webhooks/zaprite",
                "label": "My Webhook"
              },
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "The URL that will receive webhook requests"
                  },
                  "label": {
                    "description": "Optional label for the webhook",
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "url"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "example": {
                  "id": "clxyz123456",
                  "url": "https://example.com/webhooks/zaprite",
                  "label": "My Webhook",
                  "createdAt": "2024-01-01T00:00:00.000Z"
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string",
                      "format": "uri",
                      "description": "The URL that will receive webhook requests"
                    },
                    "label": {
                      "description": "Optional label for the webhook",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "description": "When the webhook was created",
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "url",
                    "label",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, invalid, expired or suspended, or your organization cannot use this endpoint. `message` says which.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the `webhooks.create` scope. Add it to the key in your API settings, or use a key that has it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "webhook-list",
        "summary": "List Webhooks",
        "description": "List all webhooks configured for your Zaprite organization. Returns up to 100 webhooks per request.<br/><br/>Required API key scope: `webhooks.read`",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "schema": {
              "default": 1,
              "type": "number",
              "minimum": 1,
              "description": "Page number. 1 for first page"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "The URL that will receive webhook requests"
                          },
                          "label": {
                            "description": "Optional label for the webhook",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "description": "When the webhook was created",
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "url",
                          "label",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "itemsCount": {
                          "type": "number"
                        },
                        "pagesCount": {
                          "type": "number"
                        },
                        "page": {
                          "type": "number"
                        },
                        "perPage": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "itemsCount",
                        "pagesCount",
                        "page",
                        "perPage"
                      ],
                      "additionalProperties": false,
                      "description": "Pagination metadata"
                    }
                  },
                  "required": [
                    "items",
                    "meta"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, invalid, expired or suspended, or your organization cannot use this endpoint. `message` says which.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the `webhooks.read` scope. Add it to the key in your API settings, or use a key that has it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhooks/{id}": {
      "delete": {
        "operationId": "webhook-delete",
        "summary": "Delete Webhook",
        "description": "Delete a webhook from your Zaprite organization.<br/><br/>Required API key scope: `webhooks.delete`",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.BAD_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, invalid, expired or suspended, or your organization cannot use this endpoint. `message` says which.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.UNAUTHORIZED"
                }
              }
            }
          },
          "403": {
            "description": "The API key does not have the `webhooks.delete` scope. Add it to the key in your API settings, or use a key that has it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.FORBIDDEN"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.NOT_FOUND"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error.INTERNAL_SERVER_ERROR"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "error.BAD_REQUEST": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "The error message",
            "example": "Invalid input data"
          },
          "code": {
            "type": "string",
            "description": "The error code",
            "example": "BAD_REQUEST"
          },
          "issues": {
            "description": "An array of issues that were responsible for the error",
            "example": [],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "message"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "message",
          "code"
        ],
        "additionalProperties": false,
        "title": "Invalid input data error (400)",
        "description": "The error information",
        "example": {
          "code": "BAD_REQUEST",
          "message": "Invalid input data",
          "issues": []
        }
      },
      "error.UNAUTHORIZED": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "The error message",
            "example": "Authorization not provided"
          },
          "code": {
            "type": "string",
            "description": "The error code",
            "example": "UNAUTHORIZED"
          },
          "issues": {
            "description": "An array of issues that were responsible for the error",
            "example": [],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "message"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "message",
          "code"
        ],
        "additionalProperties": false,
        "title": "Authorization not provided error (401)",
        "description": "The error information",
        "example": {
          "code": "UNAUTHORIZED",
          "message": "Authorization not provided",
          "issues": []
        }
      },
      "error.FORBIDDEN": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "The error message",
            "example": "Insufficient access"
          },
          "code": {
            "type": "string",
            "description": "The error code",
            "example": "FORBIDDEN"
          },
          "issues": {
            "description": "An array of issues that were responsible for the error",
            "example": [],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "message"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "message",
          "code"
        ],
        "additionalProperties": false,
        "title": "Insufficient access error (403)",
        "description": "The error information",
        "example": {
          "code": "FORBIDDEN",
          "message": "Insufficient access",
          "issues": []
        }
      },
      "error.INTERNAL_SERVER_ERROR": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "The error message",
            "example": "Internal server error"
          },
          "code": {
            "type": "string",
            "description": "The error code",
            "example": "INTERNAL_SERVER_ERROR"
          },
          "issues": {
            "description": "An array of issues that were responsible for the error",
            "example": [],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "message"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "message",
          "code"
        ],
        "additionalProperties": false,
        "title": "Internal server error error (500)",
        "description": "The error information",
        "example": {
          "code": "INTERNAL_SERVER_ERROR",
          "message": "Internal server error",
          "issues": []
        }
      },
      "error.NOT_FOUND": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "The error message",
            "example": "Not found"
          },
          "code": {
            "type": "string",
            "description": "The error code",
            "example": "NOT_FOUND"
          },
          "issues": {
            "description": "An array of issues that were responsible for the error",
            "example": [],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "message"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "message",
          "code"
        ],
        "additionalProperties": false,
        "title": "Not found error (404)",
        "description": "The error information",
        "example": {
          "code": "NOT_FOUND",
          "message": "Not found",
          "issues": []
        }
      }
    },
    "securitySchemes": {
      "Authorization": {
        "type": "http",
        "scheme": "bearer",
        "description": "Enter your Zaprite API key. You can find and manage your keys in your [Zaprite API settings](https://app.zaprite.com/org/default/settings/api)."
      }
    }
  },
  "webhooks": {
    "order.change": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "order.change",
        "description": "Sent to your own server when an Order status changes. You can use this hook to detect paid orders.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "eventType": {
                    "type": "string",
                    "const": "order.change"
                  },
                  "orderId": {
                    "type": "string",
                    "description": "You can get order details by fetching the Order"
                  },
                  "orgId": {
                    "type": "string",
                    "description": "ID of the Zaprite Organization"
                  }
                },
                "required": [
                  "eventType",
                  "orderId",
                  "orgId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return a **200** status to indicate that the data was received successfully. If your server returns an error HTTP code, we will retry sending multiple times then abandon the message if all attempts failed."
          }
        }
      }
    },
    "invoice.sent": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "invoice.sent",
        "description": "Sent to your own server when an invoice is sent.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "eventType": {
                    "type": "string",
                    "const": "invoice.sent"
                  },
                  "orderId": {
                    "type": "string",
                    "description": "You can get invoice details by fetching the related Order"
                  },
                  "orgId": {
                    "type": "string",
                    "description": "ID of the Zaprite Organization"
                  }
                },
                "required": [
                  "eventType",
                  "orderId",
                  "orgId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return a **200** status to indicate that the data was received successfully. If your server returns an error HTTP code, we will retry sending multiple times then abandon the message if all attempts failed."
          }
        }
      }
    },
    "invoice.voided": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "invoice.voided",
        "description": "Sent to your own server when an invoice is voided.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "eventType": {
                    "type": "string",
                    "const": "invoice.voided"
                  },
                  "orderId": {
                    "type": "string",
                    "description": "You can get invoice details by fetching the related Order"
                  },
                  "orgId": {
                    "type": "string",
                    "description": "ID of the Zaprite Organization"
                  }
                },
                "required": [
                  "eventType",
                  "orderId",
                  "orgId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return a **200** status to indicate that the data was received successfully. If your server returns an error HTTP code, we will retry sending multiple times then abandon the message if all attempts failed."
          }
        }
      }
    },
    "contact.updated": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "contact.updated",
        "description": "Sent to your own server when a Contact is updated.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "eventType": {
                    "type": "string",
                    "const": "contact.updated"
                  },
                  "contactId": {
                    "type": "string",
                    "description": "You can get Contact details by fetching the Contact"
                  },
                  "orgId": {
                    "type": "string",
                    "description": "ID of the Zaprite Organization"
                  }
                },
                "required": [
                  "eventType",
                  "contactId",
                  "orgId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return a **200** status to indicate that the data was received successfully. If your server returns an error HTTP code, we will retry sending multiple times then abandon the message if all attempts failed."
          }
        }
      }
    },
    "ticket.change": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "ticket.change",
        "description": "Sent to your own server when an existing Event Ticket changes.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "eventType": {
                    "type": "string",
                    "const": "ticket.change"
                  },
                  "ticketId": {
                    "type": "string",
                    "description": "ID of the Zaprite Ticket"
                  },
                  "orgId": {
                    "type": "string",
                    "description": "ID of the Zaprite Organization"
                  }
                },
                "required": [
                  "eventType",
                  "ticketId",
                  "orgId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return a **200** status to indicate that the data was received successfully. If your server returns an error HTTP code, we will retry sending multiple times then abandon the message if all attempts failed."
          }
        }
      }
    },
    "paymentProfile.created": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "paymentProfile.created",
        "description": "Sent to your server when a Payment Profile is created",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "eventType": {
                    "type": "string",
                    "const": "paymentProfile.created"
                  },
                  "orgId": {
                    "type": "string"
                  },
                  "contactId": {
                    "type": "string"
                  },
                  "paymentProfileId": {
                    "type": "string"
                  }
                },
                "required": [
                  "eventType",
                  "orgId",
                  "contactId",
                  "paymentProfileId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return a **200** status to indicate that the data was received successfully. If your server returns an error HTTP code, we will retry sending multiple times then abandon the message if all attempts failed."
          }
        }
      }
    },
    "paymentProfile.updated": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "paymentProfile.updated",
        "description": "Sent to your server when a Payment Profile is updated",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "eventType": {
                    "type": "string",
                    "const": "paymentProfile.updated"
                  },
                  "orgId": {
                    "type": "string"
                  },
                  "contactId": {
                    "type": "string"
                  },
                  "paymentProfileId": {
                    "type": "string"
                  }
                },
                "required": [
                  "eventType",
                  "orgId",
                  "contactId",
                  "paymentProfileId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return a **200** status to indicate that the data was received successfully. If your server returns an error HTTP code, we will retry sending multiple times then abandon the message if all attempts failed."
          }
        }
      }
    },
    "paymentProfile.deleted": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "paymentProfile.deleted",
        "description": "Sent to your server when a Payment Profile is deleted",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "eventType": {
                    "type": "string",
                    "const": "paymentProfile.deleted"
                  },
                  "orgId": {
                    "type": "string"
                  },
                  "contactId": {
                    "type": "string"
                  },
                  "paymentProfileId": {
                    "type": "string"
                  }
                },
                "required": [
                  "eventType",
                  "orgId",
                  "contactId",
                  "paymentProfileId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return a **200** status to indicate that the data was received successfully. If your server returns an error HTTP code, we will retry sending multiple times then abandon the message if all attempts failed."
          }
        }
      }
    }
  }
}
