{"openapi":"3.1.0","info":{"title":"UnoPago API","description":"The UnoPago API lets you bill your customers and collect from them: create\ninvoices and plans, send buyers to a hosted checkout, and get a webhook when\nthey pay.\n\nBase URL: `https://api.unopago.com`. Requests and responses are JSON.\n\n## Quickstart\n\n1. Create an API key in the UnoPago console, under\n   **Configuración → Claves API** (https://panel.unopago.com/settings/api).\n2. Create a checkout session:\n\n   ```bash\n   curl https://api.unopago.com/v1/checkout-sessions \\\n     -H \"Authorization: Bearer $UNOPAGO_API_KEY\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\"items\": [{\"description\": \"Tuition\", \"quantity\": 1, \"amount\": 25}],\n          \"currency\": \"USD\", \"externalId\": \"ORD-10293\"}'\n   ```\n\n3. Send the buyer to the `url` in the response, or frame its\n   `iframeUrl` on your site (see **Embedding the checkout**).\n4. Subscribe to `checkout_session_paid`, or read the session with\n   `GET /v1/checkout-sessions/{id}` until its `status` is `PAID`.\n\n## Authentication\n\nSend your API key in the `Authorization` header:\n\n```http\nAuthorization: Bearer eyJhbGciOiJIUzI1NiJ9...\n```\n\n- A key belongs to one account, and every request only sees that account's data.\n  A platform's key can also act for one of its connected accounts with the\n  `UnoPago-Account` header (see **Connected accounts**).\n- Keys don't expire. Deactivate a key in the console to revoke it.\n- `GET /v1/public/exchange-rates/latest` needs no key. Every other endpoint,\n  including the rest of `/v1/public/`, does.\n- A missing or revoked key gets `401 UNAUTHORIZED`.\n\n## Errors\n\nEvery error has the same body:\n\n```json\n{\n  \"message\": \"IDs de factura inválidos. Una o más facturas ya están pagadas\",\n  \"code\": \"BAD_REQUEST\"\n}\n```\n\n| `code` | HTTP | Meaning |\n| --- | --- | --- |\n| `BAD_REQUEST` | 400 | The input is invalid, or a business rule refused it. On a validation error, `issues` lists each field that failed. |\n| `UNAUTHORIZED` | 401 | No valid API key. |\n| `FORBIDDEN` | 403 | Your account is deactivated or in maintenance, or suspended (writes only), or the endpoint's module isn't active on it, or `UnoPago-Account` names an account that isn't one of your connected accounts. Keys have no scopes. |\n| `NOT_FOUND` | 404 | The resource doesn't exist in your account. |\n| `CONFLICT` | 409 | It already exists, or its state changed. |\n| `PRECONDITION_FAILED` | 412 | A business rule refused it. |\n| `TOO_MANY_REQUESTS` | 429 | Too many attempts. Wait and retry. |\n| `TIMEOUT` | 408 | A bank or service we depend on took too long. Retry. |\n| `INTERNAL_SERVER_ERROR` | 500 | Our fault. Safe to retry a read. |\n| `SERVICE_UNAVAILABLE` | 503 | A bank or service we depend on is down. Retry later. |\n| `GATEWAY_TIMEOUT` | 504 | A bank or service we depend on can't be reached. Retry later. |\n\nWhen a business rule refuses a request, `message` is Spanish copy written for\nyour end users, so you can show it as is. Other errors aren't:\n\n- A validation error says `Input validation failed` and lists each failing\n  field in `issues`.\n- A `401` or `403` carries a `message` such as `UNAUTHORIZED` or\n  `ACCOUNT_SUSPENDED`, while `code` stays `UNAUTHORIZED` or `FORBIDDEN`.\n\nSome refusals also carry `data.errorCode` (for example `CHARGE_REJECTED`)\nfor your code to branch on.\n\nError bodies never carry `data.path` (the internal procedure name): branch on\n`code`, `data.errorCode` or `data.validationError` instead. A `500` answers\nwith the generic message `Internal server error`; the detail stays in our logs.\n\n## Pagination\n\nList endpoints use one of two styles. Each endpoint's parameters say which.\n\n- **Pages**: send `page` (from 1) and `pageSize`. The response has\n  `results`, `total` and `totalPages`.\n- **Cursor**: send `limit`, then pass the `nextCursor` of each response as\n  `cursor` to get the next one. On the last page `nextCursor` is `null` or\n  missing.\n\n## Amounts and currencies\n\n- Amounts are decimal numbers in the currency's main unit: `25.5` is 25.50 USD, not cents.\n- Currencies are `VES`, `USD` and `EUR`. Checkout sessions accept\n  `USD` and `VES` only.\n\n## Taxes (IVA)\n\nA checkout session's IVA is computed one of two ways, chosen with\n`automaticTax` when you create it. A session can't mix them.\n\n**UnoPago computes it (default).** Leave `automaticTax` out, or send\n`{\"enabled\": true}`. IVA goes on every line that isn't `exento`: a line\nwith a `productId` at its product's rate (16%, 8% or 31%), any other line at the\ngeneral 16%. The order UnoPago records can be fiscally printed or emitted.\n\n```json\n{\n  \"currency\": \"USD\",\n  \"items\": [\n    {\"description\": \"Zapatos\", \"quantity\": 2, \"amount\": 50},\n    {\"description\": \"Libro\", \"quantity\": 1, \"amount\": 5, \"exento\": true}\n  ]\n}\n```\n\nWith the general 16%: `subtotal` 105, `ivaAmount` 16 (16% of 100),\n`amount` 121, and `ivaBreakdown`\n`[{\"rate\": 0.16, \"rateBase\": 100, \"amount\": 16}]`: the exempt line is in the\nsubtotal but not in the taxable base.\n\n**You compute it.** Use this when your own system already prices the IVA and\nissues the fiscal invoice, and UnoPago only collects the payment. Send\n`{\"enabled\": false}` and each taxed line's IVA in `taxes`:\n\n```json\n{\n  \"currency\": \"USD\",\n  \"automaticTax\": {\"enabled\": false},\n  \"items\": [\n    {\"description\": \"Zapatos\", \"quantity\": 2, \"amount\": 50,\n     \"taxes\": [{\"type\": \"IVA\", \"rate\": 0.16, \"amount\": 16}]},\n    {\"description\": \"Envío\", \"quantity\": 1, \"amount\": 5}\n  ]\n}\n```\n\nThe response has `subtotal` 105, `ivaRate` 0.16, `ivaAmount` 16 and\n`amount` 121, and the buyer pays exactly that.\n\n- `rate` is `0.08`, `0.16` or `0.31` (8%, 16% or 31%). Any other rate,\n  like `0.12` or `0.075`, is refused.\n- `taxes[].amount` is optional. When you send it, it is the IVA for the\n  **whole line**, not per unit, with at most 2 decimals, and it may differ from\n  `rate` × `amount` × `quantity` by at most 0.02. The IVA per rate is the\n  sum of your amounts, so the buyer pays your total to the cent. When you leave\n  it out, UnoPago computes the IVA per rate: `rate` × the rate's base, rounded\n  once. Send it on every taxed line or on none.\n\n  Three lines of 10.03 at 16% sent with `amount` 1.60 each: `ivaAmount`\n  4.80, `amount` 34.89. The same lines without `amount`: 30.09 × 0.16 =\n  `ivaAmount` 4.81, `amount` 34.90.\n- The response's `items[].taxes[].amount` is the line's share of its rate's\n  IVA, not necessarily what you sent: a leftover cent goes to the line whose\n  share was cut the most, so the shares always add up to the rate's\n  `ivaBreakdown` entry. Sent as 1.60, 1.60 and 1.61, the lines answer 1.61,\n  1.60 and 1.60.\n- A line without `taxes` is exempt. Don't send `exento` or `productId`:\n  your system prices every line.\n- Lines may use different rates. `ivaBreakdown` sums your IVA per rate, each\n  with its taxable base, and `ivaRate` is `null` when there is more than one:\n\n  ```json\n  {\"automaticTax\": {\"enabled\": false},\n   \"items\": [\n     {\"description\": \"Zapatos\", \"quantity\": 2, \"amount\": 50,\n      \"taxes\": [{\"type\": \"IVA\", \"rate\": 0.16, \"amount\": 16}]},\n     {\"description\": \"Arroz\", \"quantity\": 1, \"amount\": 20,\n      \"taxes\": [{\"type\": \"IVA\", \"rate\": 0.08, \"amount\": 1.6}]}]}\n  ```\n\n  The response has `ivaAmount` 17.6, `amount` 137.6 and\n  `ivaBreakdown` `[{\"rate\": 0.16, \"rateBase\": 100, \"amount\": 16},\n  {\"rate\": 0.08, \"rateBase\": 20, \"amount\": 1.6}]`.\n- When the payment confirms, UnoPago records the customer, the order (with\n  your IVA) and the payment, as usual. That order **can't be fiscally printed\n  or emitted**, since you invoice the sale in your own system.\n\nEach of these is refused with `400` and a Spanish `message`:\n\n| Request | `message` |\n| --- | --- |\n| `taxes` on a line without `automaticTax.enabled: false` | Los impuestos por línea solo se envían con automaticTax desactivado. |\n| `productId` with `automaticTax.enabled: false` | Con automaticTax desactivado, los ítems no usan productos del catálogo. |\n| `exento` with `automaticTax.enabled: false` | Con automaticTax desactivado no se envía exento: una línea sin impuestos es exenta. |\n| `taxes[].amount` on some taxed lines but not on others | Envía el monto del IVA en todas las líneas con impuestos o en ninguna. |\n| A line whose `taxes[].amount` differs from `rate` × its base by more than 0.02 | El IVA de la línea *N* es *monto* y su monto × cantidad × tasa da *esperado*. Si incluye el IVA de otra línea, envía taxes también en esa línea. |\n\n## Embedding the checkout\n\nSend `iframeAllowedOrigins` when you create the session and the response\nincludes `iframeUrl`: a form-only version of the checkout you can frame on\nyour site.\n\n```bash\ncurl https://api.unopago.com/v1/checkout-sessions \\\n  -H \"Authorization: Bearer $UNOPAGO_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"items\": [{\"description\": \"Tuition\", \"quantity\": 1, \"amount\": 25}],\n       \"currency\": \"USD\",\n       \"iframeAllowedOrigins\": [\"https://shop.example.com\"]}'\n```\n\n`iframeUrl` is `null` when you omit the allowlist (or send an empty\narray). Each entry is an exact origin — scheme, host and optional port, with\nno path, wildcard or credentials; at most 10. Production requires `https`,\nexcept on localhost.\n\n```html\n<iframe\n  id=\"unopago-checkout\"\n  src=\"https://checkout.unopago.com/embed/pay/...\"\n  style=\"width: 100%; border: 0\"\n  title=\"Pago\"\n></iframe>\n```\n\nThe URL is signed and the page allows framing only from the origins you\nlisted; don't change it. If your own page sets a Content-Security-Policy, add\nthe checkout host to its `frame-src` directive, e.g.\n`frame-src https://checkout.unopago.com`.\n\nThe iframe posts to `window.parent`:\n\n| `type` | Payload | When |\n| --- | --- | --- |\n| `ready` | — | The page loaded. |\n| `resize` | `height` | The content's height changed. Set the iframe's height in pixels. |\n| `success` | — | The payment was confirmed. |\n\nEvery message has `source: \"unopago-checkout\"`. Check\n`event.origin === \"https://checkout.unopago.com\"` and\n`event.source === iframe.contentWindow` before acting. Attach the listener\nbefore setting the iframe's `src`.\n\nA failed, expired or canceled session sends no `postMessage`. Subscribe to\n`checkout_session_expired` and `checkout_session_canceled`, or poll\n`GET /v1/checkout-sessions/{id}`; a `postMessage`-only listener would wait\nforever.\n\n`successUrl` and `cancelUrl` are not used inside the iframe. The iframe\nnever navigates; navigate from your page when you receive `success`.\n\n`success` is a user-interface signal, not proof of payment: subscribe to\n`checkout_session_paid` or confirm the session with\n`GET /v1/checkout-sessions/{id}` and check `status: \"PAID\"` before you\nfulfil the order.\n\n## Checkout appearance\n\nThe checkout paints with the account's \"Tema\" settings. Send `appearance`\nto change them for one session. Each field comes from the session's\n`appearance` when it is sent, else from the account's settings, else from\nUnoPago's own look:\n\n```json\n{\"appearance\": {\"mode\": \"dark\", \"colorPrimary\": \"#0a7d4f\",\n                \"saturation\": 30, \"lightness\": 97,\n                \"borderStyle\": \"rounded\",\n                \"showMerchantName\": false, \"showTotal\": false}}\n```\n\n`saturation` and `lightness` are integers from 0 to 100: how much the\nsurfaces around `colorPrimary` are tinted. The console's presets are a good\nreference: Neutro (`0`/`98`), Suave (`30`/`97`) and Intenso\n(`60`/`95`). `borderStyle` is `square`, `soft`, `medium` or\n`rounded`.\n\n`showMerchantName` and `showTotal` only affect the embedded checkout\n(`iframeUrl`): they show \"Pagando a\" with the account's name and the total\nin its header. Set them to `false` to leave those out; the pay button still\nshows the amount, and the hosted page (`url`) always shows both. They are\n`true` unless the account's settings turned them off.\n\nUnknown keys are refused with `400`. The session returns what it was created\nwith as `appearance` (`null` without one), and a retry with the same\n`externalId` and a different `appearance` is refused with `409`.\n\n## Importing in bulk\n\nFour endpoints take a spreadsheet's rows and do in one call what the console's\nimport dialogs do:\n\n| Endpoint | What it does |\n| --- | --- |\n| `POST /v1/imports/people/preview` | Resolves customers and students against the account without writing: what it would create, what it would skip and why, and the section and representative each student resolves to. |\n| `POST /v1/imports/people` | Creates the rows the preview announced; a row that stopped resolving is skipped and counted. |\n| `POST /v1/invoices/debt-import/preview` | Resolves each debt row to a student or customer and groups them into one invoice per person and due date; returns the groups, the unresolved rows, those an earlier import already billed, and the unverified issuance allowance. |\n| `POST /v1/invoices/debt-import` | Issues the invoices, dropping any student and due date an earlier import already billed, whatever its `importId`. |\n\nCall the preview first: it is how you learn which rows cannot be resolved, and\nit is what the write endpoint's counts are relative to. Each table takes at most\n1,000 rows, and a debt import at most 1,000 lines. An account without the\n`STUDENTS` module can import customers but not students.\n\nThe debt import is idempotent by student and due date: an invoice for that pair\nfrom an earlier import, through this API or the console, is left out and\ncounted in `alreadyIssuedCount`. A retry after a partial run is safe; send the\nsame rows again to finish it.\n\n## Webhooks\n\nUnoPago sends a `POST` to your endpoint when something happens. Register\nendpoints in the console, under **Configuración → Webhooks**; the signing\nsecret is shown when you create one. Each event's payload is documented\nunder **Webhook events**. A platform receives its connected accounts' events\non separate endpoints (see **Connected accounts**).\n\n| Event | When |\n| --- | --- |\n| `invoice_created` | An invoice is created. |\n| `invoice_updated` | An invoice changes. |\n| `invoice_paid` | An invoice is fully paid. |\n| `payment_received` | A payment is recorded. |\n| `checkout_session_partially_paid` | A payment pays part of a checkout session; the rest is still to pay. One per such payment. |\n| `checkout_session_paid` | A checkout session is fully paid. Use it as the fulfilment signal: it carries your `externalId`. |\n| `checkout_session_expired` | A checkout session passes its `expiresAt` without being paid. A bank payment the buyer started before can still be confirmed later: the session then sends `checkout_session_paid` or `checkout_session_partially_paid`. |\n| `checkout_session_canceled` | A checkout session is canceled. |\n| `settlement_completed` | UnoPago pays out to your bank account. It lists the payments it covers. |\n| `settlement_failed` | The bank refuses a payout. The money stays owed; UnoPago reviews it and sends it again, or cancels it. |\n| `settlement_canceled` | UnoPago cancels a payout that was never sent. Its payments are paid in a later payout once UnoPago clears them. |\n| `account_verified` | UnoPago approves the account's verification. |\n| `account_verification_rejected` | UnoPago rejects the account's verification. It carries `rejectionReason`. |\n\nA payout to one of your vendors sends the same three `settlement_*` events,\nwith `vendor` (see **Vendors**).\n\nA checkout integration listens to `checkout_session_*`: every one carries the\nwhole session, with `amountPaid`, `amountRemaining` and `paymentIds`.\nA billing integration listens to `payment_received` and `invoice_*`, which\ncarry `checkoutSessionId` when the money came through a checkout.\n\nAnswer with any `2xx`. Anything else, or no answer, is retried up to 20\ntimes, waiting longer each time, up to an hour between attempts: several hours\nin all.\n\n### Check the signature\n\nEvery delivery carries a `Webhook-Signature` header:\n\n```http\nWebhook-Signature: t=1761235200,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd\n```\n\n`v1` is the hex HMAC-SHA256 of `<t>.<raw body>`, keyed with your signing\nsecret. Compute it over the raw body, before parsing the JSON:\n\n```js\nimport crypto from \"node:crypto\";\n\nfunction isValidSignature(header, rawBody, secret) {\n  const { t, v1 } = Object.fromEntries(\n    header.split(\",\").map((part) => part.split(\"=\")),\n  );\n  const expected = crypto\n    .createHmac(\"sha256\", secret)\n    .update(`${t}.${rawBody}`)\n    .digest(\"hex\");\n  return (\n    v1?.length === expected.length &&\n    crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(v1))\n  );\n}\n```\n\nReject a delivery whose `t` is more than a few minutes old, so a captured\nrequest can't be replayed.\n\n## Connected accounts\n\nA platform (a marketplace, for example) sells through accounts it creates for\nits sellers: its **connected accounts**. A connected account is an UnoPago\naccount with no users and no console login; the platform acts for it with its\nown API key. UnoPago turns this on for your account. Until it does, these\nendpoints answer `403`.\n\n### Create a connected account\n\n```bash\ncurl https://api.unopago.com/v1/accounts \\\n  -H \"Authorization: Bearer $UNOPAGO_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"externalId\": \"rest-42\", \"name\": \"Restaurante 42\",\n       \"nationalId\": \"J401234567\",\n       \"bankAccount\": {\"bankCode\": \"0134\",\n                       \"accountNumber\": \"01340000000000004421\",\n                       \"holderName\": \"Restaurante 42 C.A.\"},\n       \"paymentMethods\": {\"C2P\": {\"isPayerCharged\": true}}}'\n```\n\n```json\n{\n  \"id\": \"cm3r42k8x0001ab12cd34ef56\",\n  \"externalId\": \"rest-42\",\n  \"name\": \"Restaurante 42\",\n  \"status\": \"ACTIVE\",\n  \"verified\": false,\n  \"bankAccount\": {\n    \"bankCode\": \"0134\",\n    \"accountNumberLast4\": \"4421\",\n    \"status\": \"PENDING_CONFIRMATION\"\n  }\n}\n```\n\nThe response, abridged: it also has the account's other details and\n`createdAt`.\n\n- Keep the `id`: it is how you act for the account. `externalId` is your own\n  id, unique among your connected accounts (`409` on a repeat).\n- The account sells with C2P and immediate debit, both on. `isPayerCharged`\n  (default `false`) makes the buyer pay UnoPago's fee on top of the price.\n- UnoPago charges a connected account your account's fee rate, out of each\n  sale.\n- `nationalId` is the RIF with no dashes: `J` and 9 digits.\n- The bank account is held by `nationalId`. `accountNumber` is the 20 digits,\n  starting with `bankCode`; `accountType` is `CHECKING` (default) or\n  `SAVINGS`. It isn't paid out to until one of your owners confirms it (see\n  **Confirming bank accounts**).\n- Sales are collected at once, but paid out only after UnoPago verifies the\n  account (`verified: true`; see **Verify a connected account**).\n\n`GET /v1/accounts` lists your connected accounts and\n`GET /v1/accounts/{accountId}` returns one with its bank account.\n\n### Act as a connected account\n\nSend your own key and the account's `id` in `UnoPago-Account`. The request\nthen works on that account, as if it were its own key:\n\n```bash\ncurl https://api.unopago.com/v1/checkout-sessions \\\n  -H \"Authorization: Bearer $UNOPAGO_API_KEY\" \\\n  -H \"UnoPago-Account: cm3r42k8x0001ab12cd34ef56\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"items\": [{\"description\": \"Combo 3\", \"quantity\": 1, \"amount\": 10}],\n       \"currency\": \"USD\", \"externalId\": \"order-9812\"}'\n```\n\n- The session, and the customer, invoice and payment it creates when paid,\n  belong to the connected account, not to yours.\n- `GET /v1/balance` returns what the account is owed and not paid out yet\n  (`pendingVes`); `GET /v1/settlements` what was paid out.\n- Without the header, a request acts on your own account. Call\n  `/v1/accounts` without it.\n- A connected account has only C2P and immediate debit:\n  `POST /v1/payment-methods` and `DELETE /v1/payment-methods/{id}` are\n  refused, and `PUT /v1/payment-methods/{id}` changes only `enabled` and\n  `isPayerCharged`. `PUT /v1/settings` is refused too: use\n  `PATCH /v1/accounts/{accountId}`.\n- On your own account, `isPayerCharged` also applies to `STRIPE_CARD`: the\n  buyer pays Stripe's estimated fee plus UnoPago's, and sees the total before\n  paying.\n\nBoth accounts' status gates the request: if either is deactivated or in\nmaintenance, it is refused; if either is suspended, only reads work. The header\nitself is refused with `403`:\n\n| Case | `message` |\n| --- | --- |\n| Your account doesn't have connected accounts on | Tu cuenta no tiene activas las cuentas conectadas. |\n| The id isn't one of your connected accounts, or doesn't exist | La cuenta no pertenece a esta plataforma. |\n\n### Update or deactivate a connected account\n\n```bash\ncurl -X PATCH https://api.unopago.com/v1/accounts/cm3r42k8x0001ab12cd34ef56 \\\n  -H \"Authorization: Bearer $UNOPAGO_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"phoneNumber\": \"+584241234567\", \"address\": \"Av. Libertador, Caracas\"}'\n```\n\n- Send only what changes: `name`, `nationalId`, `phoneNumber`, `address`,\n  `description` or `bankAccount`.\n- A new `nationalId` comes with a `bankAccount` held by it (`400`\n  otherwise).\n- Once UnoPago verifies the account, its name and RIF are fixed (`412`).\n- A new `bankAccount` replaces the current one, and payouts wait until one of\n  your owners confirms it. Sending the same one again (same bank, number,\n  holder and `accountType`) changes nothing. Leaving out `accountType` means\n  `CHECKING`, so resend `SAVINGS` if that is what it was.\n\n`POST /v1/accounts/{accountId}/deactivate` stops the account from collecting,\nat once and for good. A connected account is never deleted or moved to another\nplatform, and a deactivated one can't be updated. UnoPago still pays out what\nit is owed, by hand rather than in the daily payout.\n\n### Verify a connected account\n\nUnoPago pays a connected account out only once it has checked the account's\ndocument: the RIF for a company, the cédula for a person. You upload it in\nthree steps.\n\n1. Request an upload URL:\n\n```bash\ncurl https://api.unopago.com/v1/accounts/cm3r42k8x0001ab12cd34ef56/verification/upload-url \\\n  -H \"Authorization: Bearer $UNOPAGO_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"fileName\": \"rif.pdf\", \"contentType\": \"application/pdf\", \"size\": 184320}'\n```\n\n```json\n{\n  \"fileKey\": \"cm3r42k8x0001ab12cd34ef56/5b0c7e7e-3f1a-4d8e-9c1b-2a6f0d9e4c11.pdf\",\n  \"upload\": {\n    \"url\": \"https://…\",\n    \"method\": \"PUT\",\n    \"headers\": { \"Content-Type\": \"application/pdf\" },\n    \"expiresAt\": \"2026-11-12T14:15:00.000Z\"\n  }\n}\n```\n\n2. Upload the file to `upload.url` with `upload.method` and exactly the\n   headers from the response, before `upload.expiresAt` (15 minutes):\n\n```bash\ncurl -X PUT \"$UPLOAD_URL\" \\\n  -H \"Content-Type: application/pdf\" \\\n  --data-binary @rif.pdf\n```\n\n3. Submit its `fileKey`:\n\n```bash\ncurl https://api.unopago.com/v1/accounts/cm3r42k8x0001ab12cd34ef56/verification \\\n  -H \"Authorization: Bearer $UNOPAGO_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"fileKey\": \"cm3r42k8x0001ab12cd34ef56/5b0c7e7e-3f1a-4d8e-9c1b-2a6f0d9e4c11.pdf\"}'\n```\n\n```json\n{\n  \"status\": \"IN_REVIEW\",\n  \"requiredDocumentType\": \"RIF\",\n  \"rejectionReason\": null,\n  \"submittedAt\": \"2026-11-12T14:03:27.000Z\"\n}\n```\n\n- The file is a JPG, PNG, WEBP or PDF, up to 10 MB. The submit checks the\n  uploaded file's size: a larger one is deleted and refused (`400`).\n- The account needs its `nationalId` first (`412` otherwise).\n  `requiredDocumentType` says which document UnoPago expects.\n- UnoPago reviews the document by hand. `GET /v1/accounts/{accountId}/verification`\n  returns its `status`: `null` before anything is submitted, then\n  `IN_REVIEW`, and `VERIFIED` or `REJECTED`.\n- Your **Cuentas conectadas** endpoints receive `account_verified` or\n  `account_verification_rejected` (with its `rejectionReason`) as soon as\n  UnoPago reviews it, with `account` set to the connected account: there is\n  no need to poll `GET …/verification`.\n- A document is accepted only when none was submitted before or after a\n  rejection (`409` while it is `IN_REVIEW` or `VERIFIED`). If it is\n  `REJECTED`, `rejectionReason` says why: request a new URL and upload it\n  again.\n- A deactivated account can't be verified (`412`).\n\n#### Try it end to end\n\nThe upload goes to `upload.url`, not to this API, so it can't be tried from\nthis page. This script runs the three steps with `curl` and `jq`, taking\nthe upload URL and its headers from the response:\n\n```bash\n#!/usr/bin/env bash\n# Usage: UNOPAGO_API_KEY=... ./verify.sh <accountId> <file>\nset -euo pipefail\n\nACCOUNT_ID=\"$1\"\nFILE=\"$2\"\nNAME=$(basename \"$FILE\")\nCONTENT_TYPE=$(file --brief --mime-type \"$FILE\")\nSIZE=$(wc -c < \"$FILE\" | tr -d ' ')\n\nupload=$(curl -sSf https://api.unopago.com/v1/accounts/$ACCOUNT_ID/verification/upload-url \\\n  -H \"Authorization: Bearer $UNOPAGO_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d \"{\\\"fileName\\\": \\\"$NAME\\\", \\\"contentType\\\": \\\"$CONTENT_TYPE\\\", \\\"size\\\": $SIZE}\")\n\ncurl -sSf -X PUT \"$(jq -r .upload.url <<< \"$upload\")\" \\\n  -H \"Content-Type: $(jq -r '.upload.headers[\"Content-Type\"]' <<< \"$upload\")\" \\\n  --data-binary \"@$FILE\"\n\ncurl -sSf https://api.unopago.com/v1/accounts/$ACCOUNT_ID/verification \\\n  -H \"Authorization: Bearer $UNOPAGO_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d \"{\\\"fileKey\\\": \\\"$(jq -r .fileKey <<< \"$upload\")\\\"}\" | jq\n```\n\n### Confirming bank accounts\n\nA bank account you send for a connected account, when you create it or with\n`PATCH`, is `PENDING_CONFIRMATION`:\n\n- Every owner of your account gets an email about it.\n- Nothing is paid out to it, automatically or by UnoPago by hand, until one of\n  your owners confirms it in the console, under **Cuentas conectadas**\n  (https://panel.unopago.com/connected-accounts), with a one-time code. One code confirms\n  several at once. It can't be confirmed through the API.\n- Sales are still collected meanwhile; the money waits for the confirmation.\n\nWhile UnoPago holds your own account's payouts, it holds your connected\naccounts' too.\n\n### Webhooks for connected accounts\n\nA connected account has no webhook endpoints. Its events go to your endpoints\nwhose scope is **Cuentas conectadas**, set on the endpoint in the console.\nYour own events go only to your **Mi cuenta** endpoints.\n\nEvery delivery of a connected account's event has the account's `id` in a\ntop-level `account`. Your own events don't have it:\n\n```json\n{\n  \"id\": \"cm3wh9e2b0004qa77te1xk0p2\",\n  \"eventType\": \"settlement_completed\",\n  \"account\": \"cm3r42k8x0001ab12cd34ef56\",\n  \"createdAt\": \"2026-11-11T20:05:12.000Z\",\n  \"data\": {\n    \"settlement\": {\n      \"status\": \"COMPLETED\",\n      \"netAmount\": \"475.20\",\n      \"paymentCount\": 1,\n      \"paymentIds\": [\"cm3p8y1z70002ms55ad9qv3c1\"],\n      \"bankAccount\": {\"bankCode\": \"0134\", \"accountNumberLast4\": \"4421\"}\n    }\n  }\n}\n```\n\nThe events are the ones listed under **Webhooks**. UnoPago never emails a\nconnected account, so the payout events are how you learn about its money:\n\n- `settlement_completed`: it was paid. `paymentIds` are the payments you\n  already got in `payment_received`, so you can match the payout to your\n  orders.\n- `settlement_failed`: the bank refused the payout. The money stays owed.\n  UnoPago can send it again, and each new failure is a new event.\n- `settlement_canceled`: UnoPago canceled the payout; its payments go in a\n  later one.\n\n## Vendors\n\nA **vendor** is someone your account pays a part of its orders to: the\nrestaurant and the courier behind a delivery app, for example. A vendor has no\nUnoPago account, no login and no fees. It is a name, a RIF and the bank account\nit is paid in. On each checkout session you say how much of the order is each\nvendor's (`splits`); UnoPago pays every vendor its part and you keep the rest.\nUnoPago turns this on for your account. Until it does, these endpoints answer\n`403`.\n\n### Create a vendor\n\n```bash\ncurl https://api.unopago.com/v1/vendors \\\n  -H \"Authorization: Bearer $UNOPAGO_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"externalId\": \"rest-42\", \"name\": \"Restaurante 42\",\n       \"nationalId\": \"J401234567\",\n       \"bankAccount\": {\"bankCode\": \"0134\",\n                       \"accountNumber\": \"01340000000000004421\",\n                       \"holderName\": \"Restaurante 42 C.A.\"}}'\n```\n\n```json\n{\n  \"id\": \"cm9x2k4q80001s6v1h3d7e2ab\",\n  \"externalId\": \"rest-42\",\n  \"name\": \"Restaurante 42\",\n  \"status\": \"ACTIVE\",\n  \"payoutsEnabled\": false,\n  \"pendingVes\": \"0.00\",\n  \"bankAccount\": {\n    \"bankCode\": \"0134\",\n    \"accountNumberLast4\": \"4421\",\n    \"status\": \"PENDING_CONFIRMATION\"\n  }\n}\n```\n\nThe response, abridged.\n\n- Keep the `id`: it is what `splits` names. `externalId` is your own id,\n  unique among your vendors (`409` on a repeat).\n- The bank account is held by `nationalId` and starts as\n  `PENDING_CONFIRMATION`. Every owner of your account gets an email about it,\n  and one of them confirms it in the console, under **Proveedores**\n  (https://panel.unopago.com/vendors), with a one-time code. It can't be confirmed through\n  the API. That confirmation also turns `payoutsEnabled` to `true`.\n- A vendor can be named in orders before that. Its parts are collected and\n  wait (`pendingVes`) until the bank account is confirmed.\n- `PATCH /v1/vendors/{vendorId}` changes the name, `externalId` or bank\n  account. A new bank account replaces the current one and waits for a new\n  confirmation. The RIF changes only together with the bank account, and not at\n  all once the vendor's bank account has been confirmed.\n- `POST /v1/vendors/{vendorId}/deactivate` stops the vendor from being named\n  in new orders; what it is already owed is still paid.\n  `POST /v1/vendors/{vendorId}/activate` undoes it.\n- A platform registers its vendors on itself: these endpoints are refused with\n  `UnoPago-Account`. Its connected accounts' sessions can name them.\n\n### Split an order\n\n```bash\ncurl https://api.unopago.com/v1/checkout-sessions \\\n  -H \"Authorization: Bearer $UNOPAGO_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"externalId\": \"order-9812\", \"currency\": \"USD\",\n       \"items\": [{\"description\": \"Combo 3\", \"quantity\": 1, \"amount\": 10},\n                 {\"description\": \"Delivery\", \"quantity\": 1, \"amount\": 2}],\n       \"splits\": [{\"vendor\": \"cm9x2k4q80001s6v1h3d7e2ab\", \"amount\": 9},\n                  {\"vendor\": \"cm9x2k4q80002s6v1h3d7e2ac\", \"amount\": 2}]}'\n```\n\nEach `amount` is in the session's `currency`. Up to 10 splits, each vendor\nonce, each at least `0.01`. You keep the rest and pay UnoPago's fee on the\nwhole charge. With the dollar at Bs. 40 and a fee of 2.5 %:\n\n| | Bs. |\n| --- | --- |\n| The buyer pays | 480.00 |\n| UnoPago's fee, on all of it | −12.00 |\n| Restaurante 42 | −360.00 |\n| The courier | −80.00 |\n| You | 28.00 |\n\n- What is left for you after the fee must be more than zero, with each of\n  the methods your account collects with.\n- A session with splits is paid by C2P or immediate debit only, in one\n  payment. Pago Móvil is not offered for it.\n- The splits are fixed with the session: the same `externalId` with other\n  splits is refused (`409`), and a paid order's splits can't be changed or\n  taken back.\n- The buyer sees nothing about them. The sale is yours: the customer, the\n  invoice and the payment for the whole amount are recorded in your account,\n  as for any session.\n- Every session carries its `splits` back, in the responses and in the\n  `checkout_session_*` events, each with the vendor's `externalId` and, once\n  the session is `PAID`, its `amountVes`: the bolívares UnoPago pays that\n  vendor, the split at the rate of the payment.\n- The vendors are checked again when the buyer pays. If one was deactivated\n  since, the buyer is told the order can't be paid right now and is not\n  charged.\n\nA session with splits is refused when it is created:\n\n| Case | Status | `message` |\n| --- | --- | --- |\n| A vendor that is not yours, or does not exist | `400` | El proveedor … no existe en tu cuenta. |\n| A deactivated vendor | `400` | El proveedor … está inactivo. |\n| The splits leave you nothing after the fee | `400` | El reparto no deja saldo en tu cuenta para cubrir la comisión. |\n| Vendors are not on for the account that owns them | `403` | El módulo Proveedores no está activo para esta cuenta. |\n| Your account has neither C2P nor immediate debit on | `412` | Un pedido con reparto se cobra con C2P o débito inmediato, y tu cuenta no tiene ninguno de los dos activo. |\n\n### Payouts to vendors\n\nEach payout run pays you your part and each vendor its own, in separate\ntransfers. A vendor is paid once its bank account is confirmed, and only while\nyour own account is being paid: if UnoPago holds your payouts, it holds your\nvendors' too.\n\n- `GET /v1/vendors/{vendorId}` returns `pendingVes`, what the vendor is owed\n  and not paid out yet. `GET /v1/settlements?vendorId=…` lists its payouts.\n- Your own settlements carry `totalSplits`, the part of their payments that\n  was your vendors': `netAmount` is\n  `totalAmount − totalFees − totalSplits`.\n- UnoPago never contacts a vendor. Each of its payouts sends you\n  `settlement_completed`, `settlement_failed` or `settlement_canceled` with\n  `vendor`, which is `null` on your own payouts:\n\n```json\n{\n  \"id\": \"cm3wh9e2b0005qa77te1xk0p3\",\n  \"eventType\": \"settlement_completed\",\n  \"createdAt\": \"2026-11-11T20:05:14.000Z\",\n  \"data\": {\n    \"settlement\": {\n      \"status\": \"COMPLETED\",\n      \"totalAmount\": \"360\",\n      \"totalFees\": \"0\",\n      \"totalSplits\": \"0\",\n      \"netAmount\": \"360\",\n      \"vendor\": {\"id\": \"cm9x2k4q80001s6v1h3d7e2ab\", \"externalId\": \"rest-42\"},\n      \"paymentIds\": [\"cm3p8y1z70002ms55ad9qv3c1\"],\n      \"bankAccount\": {\"bankCode\": \"0134\", \"accountNumberLast4\": \"4421\"}\n    }\n  }\n}\n```\n\n- These events go to your **Mi cuenta** endpoints, never to the **Cuentas\n  conectadas** ones, also when the vendor was paid from your connected\n  accounts' orders. Subscribe an endpoint of your own to the three.\n- One payment can be in several payouts, yours and each vendor's. Read\n  `vendor` before counting a payout's `netAmount` as money in your bank.\n\n### When a vendor's payout fails\n\n`settlement_failed` with `vendor` means the transfer to the vendor did not go\nthrough. Its money stays owed and shows in `pendingVes`.\n\n- Most often the bank refused the account. Send the right one with\n  `PATCH /v1/vendors/{vendorId}` and have one of your owners confirm it in the\n  console. The confirmation releases the refused payout: you get\n  `settlement_canceled` for it, and the next run pays the same parts to the\n  new account, as a settlement with a new `id`.\n- The event does not say why the payout failed. If no `settlement_canceled`\n  follows the confirmation, it was not the bank's refusal: UnoPago is reviewing\n  that payout, and will send it again or cancel it.","version":"1.0.0"},"servers":[{"url":"https://api.unopago.com"}],"tags":[{"name":"Checkout Sessions","description":"A payment page hosted by UnoPago. Create a session with the items, send the buyer to its `url` (or frame its `iframeUrl` on your site), and read the session until its status is `PAID`."},{"name":"Invoices","description":"What a customer owes. An invoice is `UNPAID` when issued, `OVERDUE` past its due date, `PENDING` while a payment is in flight (a reported transfer or an online charge), `PARTIAL` once part is paid, then `PAID`. A `VOIDED` invoice never changes again."},{"name":"Payments","description":"Payments received, and the invoices they were applied to."},{"name":"Settlements","description":"The payouts UnoPago deposits into your bank accounts, each grouping the payments it covers."},{"name":"Payment claims","description":"Public endpoints a payer uses to report a bank transfer. The claim stays pending until it is reconciled."},{"name":"Plans","description":"Recurring billing. A plan issues invoices to its subscribed customers on its billing cycle, from `WEEKLY` to `ANNUAL`."},{"name":"Subscriptions","description":"The link between a customer and a plan."},{"name":"Customers","description":"Who pays. Look a customer up by its UnoPago id or by your own `externalId`."},{"name":"Tags","description":"Free-form labels to group customers and students."},{"name":"Imports","description":"Bulk imports of customers, students and debts from the spreadsheet the console assistant reads."},{"name":"Students","description":"Schools only. Each student belongs to at most one customer, their guardian."},{"name":"Grades","description":"Schools only. The school's grades, with their sections."},{"name":"Sections","description":"Schools only. The sections of each grade."},{"name":"Products","description":"The catalog used on invoices and plans."},{"name":"Product Units","description":"The units products are sold in."},{"name":"Invoice print job","description":"The queue of invoices to print on a fiscal printer, and their control numbers."},{"name":"Account Settings","description":"Your account's details."},{"name":"Account Payment Methods","description":"The methods your customers can pay you with."},{"name":"Connected accounts","description":"Accounts that sell through yours, when your account is a platform. Act for one with your API key and the `UnoPago-Account: <id>` header."},{"name":"Vendors","description":"The people and companies your account pays a part of its orders to. Each has a bank account, which an owner of your account confirms in UnoPago before anything is paid to it."},{"name":"Bank Transactions","description":"Movements on your bank accounts, which UnoPago uses to reconcile payments."},{"name":"Exchange rates","description":"The rates UnoPago converts between bolívares and foreign currencies with."},{"name":"Webhooks","x-displayName":"Webhook endpoints","description":"Calls you make to UnoPago: list your registered webhook endpoints and the deliveries sent to them. The payloads themselves are under Webhook events."},{"name":"Webhook events","description":"Requests UnoPago sends to you: a `POST` to each of your endpoints when one of these events happens. Answer with any `2xx`."}],"externalDocs":{"url":"https://api.unopago.com"},"paths":{"/v1/settings":{"put":{"operationId":"account-updateAccount","summary":"Modify Account information","tags":["Account Settings"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"nationalId":{"type":"string"},"phoneNumber":{"type":"string"},"address":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["SCHOOL","COMMERCE"]},"mainCurrency":{"type":"string","enum":["VES","USD","EUR"]},"defaultPricingMode":{"type":"string","enum":["CURRENCY","REFERENCE"]}},"required":["name"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["SCHOOL","COMMERCE"]},"status":{"type":"string","enum":["ACTIVE","MAINTENANCE","SUSPENDED","DEACTIVATED"]},"mainCurrency":{"type":"string","enum":["VES","USD","EUR"]},"defaultPricingMode":{"type":"string","enum":["CURRENCY","REFERENCE"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"name":{"type":"string"},"description":{"type":"string"},"isTest":{"type":"boolean"},"nationalId":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"address":{"type":["string","null"]},"image":{"type":["string","null"]},"accountNotificationSettingId":{"type":["string","null"]},"merchantId":{"type":["string","null"]},"platformAccountId":{"type":["string","null"]},"externalId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["type","status","mainCurrency","defaultPricingMode","id","name","description","isTest","nationalId","phoneNumber","address","image","accountNotificationSettingId","merchantId","platformAccountId","externalId","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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-methods":{"get":{"operationId":"accountPaymentMethods-getAccountPaymentMethods","summary":"Get account payment methods","description":"Cada método trae `scopes`, los canales donde el dueño lo dejó encendido; se ofrece en un canal cuando además está activo y ese canal puede cobrarlo. Con `scope` devuelve solo los que se ofrecen en ese canal.","tags":["Account Payment Methods"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"enabled","schema":{"type":"boolean"}},{"in":"query","name":"method","schema":{"type":"string","enum":["BANK_TRANSFER","ZELLE","C2P","IMMEDIATE_DEBIT","P2P","CASH","POS","CUSTOMER_CREDIT","STRIPE_ACH","STRIPE_CARD","DEBIT_CARD","PAYROLL","BINANCE_PAY","LEDGER_FEE"]}},{"in":"query","name":"isDefault","schema":{"type":"boolean"}},{"in":"query","name":"scope","schema":{"type":"string","enum":["PORTAL","CHECKOUT","KIOSK"],"description":"Solo los métodos que se ofrecen en este canal: PORTAL, CHECKOUT o KIOSK."}},{"in":"query","name":"isPortal","schema":{"description":"Con `true`, igual que `scope=PORTAL`; con `false` no filtra. Se mantiene por compatibilidad.","type":"boolean"}},{"in":"query","name":"isKiosk","schema":{"description":"Con `true`, igual que `scope=KIOSK`; con `false` no filtra. Se mantiene por compatibilidad.","type":"boolean"}},{"in":"query","name":"includeAvailability","schema":{"type":"boolean"}},{"in":"query","name":"includeLedgerFee","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"method":{"type":"string","enum":["BANK_TRANSFER","ZELLE","C2P","IMMEDIATE_DEBIT","P2P","CASH","POS","CUSTOMER_CREDIT","STRIPE_ACH","STRIPE_CARD","DEBIT_CARD","PAYROLL","BINANCE_PAY","LEDGER_FEE"]},"scopes":{"type":"array","items":{"type":"string","enum":["PORTAL","CHECKOUT","KIOSK"]}},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"isDefault":{"type":"boolean"},"displayName":{"type":"string"},"enabled":{"type":"boolean"},"isPayerCharged":{"type":"boolean"},"fee":{"type":["number","null"]},"processorId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"bankAccounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountPaymentMethodId":{"type":"string"},"bankAccountId":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"bankAccount":{"type":"object","properties":{"type":{"type":"string","enum":["CHECKING","SAVINGS","ZELLE","BINANCE"]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"bankName":{"type":"string","enum":["A100BANCO","BANCAMIGA","BANCARIBE","BANESCO","BDV","BFC","BNC","MERCANTIL","PROVINCIAL","BANCO_DEL_TESORO","BANCO_PLAZA","SOFITASA","BANCO_ACTIVO","BANCO_AGRICOLA","BANCO_BICENTENARIO","BANCO_CARONI","BANCO_EXTERIOR","BANCRECER","BANFANB","BANGENTE","BANPLUS","DELSUR","R4","VENEZOLANO_DE_CREDITO","BANK_OF_AMERICA","AMERANT_BANK","US_BANK","WELLS_FARGO","BINANCE"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"name":{"type":"string"},"accountHolderName":{"type":"string"},"isActive":{"type":"boolean"},"nationalId":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"pagoMovilQrUrl":{"type":["string","null"]},"identifier":{"type":"string"},"last4":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["type","currency","bankName","id","accountId","name","accountHolderName","isActive","nationalId","phoneNumber","pagoMovilQrUrl","identifier","last4","createdAt","updatedAt"],"additionalProperties":false}},"required":["id","accountPaymentMethodId","bankAccountId","createdAt","updatedAt","bankAccount"],"additionalProperties":false}},"processor":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["UNOPAGO","STRIPE"]}},"required":["id","type"],"additionalProperties":false},{"type":"null"}]},"availability":{"anyOf":[{"type":"object","properties":{"available":{"type":"boolean"},"message":{"type":["string","null"]}},"required":["available","message"],"additionalProperties":false},{"type":"null"}]},"ledgerFee":{"anyOf":[{"type":"object","properties":{"feeRate":{"type":"string"},"minFee":{"type":"string"}},"required":["feeRate","minFee"],"additionalProperties":false},{"type":"null"}]}},"required":["method","scopes","id","accountId","isDefault","displayName","enabled","isPayerCharged","fee","processorId","createdAt","updatedAt","bankAccounts","processor","availability","ledgerFee"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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"}}}}}},"post":{"operationId":"accountPaymentMethods-createAccountPaymentMethod","summary":"Create account payment method","description":"Un método con cuentas bancarias se confirma desde UnoPago con el código del dueño: por API responde 403. Los métodos sin cuentas se crean con una API key.","tags":["Account Payment Methods"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"displayName":{"type":"string"},"method":{"type":"string","enum":["BANK_TRANSFER","ZELLE","C2P","IMMEDIATE_DEBIT","P2P","CASH","POS","CUSTOMER_CREDIT","STRIPE_ACH","STRIPE_CARD","DEBIT_CARD","PAYROLL","BINANCE_PAY","LEDGER_FEE"],"description":"Any payment method but PAYROLL and LEDGER_FEE, which only their own endpoints record."},"isDefault":{"default":false,"type":"boolean"},"bankAccountIds":{"type":"array","items":{"type":"string"}},"fee":{"type":"number","minimum":0},"isPayerCharged":{"default":false,"type":"boolean"},"otpCode":{"type":"string","minLength":6,"maxLength":6}},"required":["displayName","method"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"method":{"type":"string","enum":["BANK_TRANSFER","ZELLE","C2P","IMMEDIATE_DEBIT","P2P","CASH","POS","CUSTOMER_CREDIT","STRIPE_ACH","STRIPE_CARD","DEBIT_CARD","PAYROLL","BINANCE_PAY","LEDGER_FEE"]},"scopes":{"type":"array","items":{"type":"string","enum":["PORTAL","CHECKOUT","KIOSK"]}},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"isDefault":{"type":"boolean"},"displayName":{"type":"string"},"enabled":{"type":"boolean"},"isPayerCharged":{"type":"boolean"},"fee":{"type":["number","null"]},"processorId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["method","scopes","id","accountId","isDefault","displayName","enabled","isPayerCharged","fee","processorId","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/payment-methods/{accountPaymentMethodId}":{"delete":{"operationId":"accountPaymentMethods-deleteAccountPaymentMethod","summary":"Delete account payment method","description":"Un método con cuentas bancarias ligadas se confirma desde UnoPago con el código del dueño: por API responde 403. Los métodos sin cuentas se borran con una API key.","tags":["Account Payment Methods"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"accountPaymentMethodId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true},{"in":"query","name":"otpCode","schema":{"type":"string","minLength":6,"maxLength":6}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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"}}}}}},"put":{"operationId":"accountPaymentMethods-updateAccountPaymentMethod","summary":"Update account payment method","description":"Cambiar las cuentas destino, o deshabilitar un método report con cuentas ligadas, se confirma desde UnoPago con el código del dueño: por API responde 403. Renombrar o cambiar otros campos sin tocar el destino sigue permitido con una API key, incluidos los canales (`scopes`).","tags":["Account Payment Methods"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"accountPaymentMethodId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"displayName":{"type":"string"},"enabled":{"type":"boolean"},"bankAccountIds":{"type":"array","items":{"type":"string"}},"isDefault":{"type":"boolean"},"fee":{"type":"number"},"isPayerCharged":{"type":"boolean"},"scopes":{"type":"array","items":{"type":"string","enum":["PORTAL","CHECKOUT","KIOSK"]},"description":"Los canales donde el dueño deja encendido el método: PORTAL (portal y app, enlaces de pago y asistente de WhatsApp), CHECKOUT (checkout y tienda) y KIOSK. Se ofrece en un canal cuando además está activo y ese canal puede cobrarlo. Se envía la lista completa: un canal que falta queda apagado, y uno que no puede cobrar el método (por ejemplo KIOSK en un C2P) se descarta. No pide el código del dueño. Una cuenta conectada no puede cambiarlos (403)."},"otpCode":{"type":"string","minLength":6,"maxLength":6}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"method":{"type":"string","enum":["BANK_TRANSFER","ZELLE","C2P","IMMEDIATE_DEBIT","P2P","CASH","POS","CUSTOMER_CREDIT","STRIPE_ACH","STRIPE_CARD","DEBIT_CARD","PAYROLL","BINANCE_PAY","LEDGER_FEE"]},"scopes":{"type":"array","items":{"type":"string","enum":["PORTAL","CHECKOUT","KIOSK"]}},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"isDefault":{"type":"boolean"},"displayName":{"type":"string"},"enabled":{"type":"boolean"},"isPayerCharged":{"type":"boolean"},"fee":{"type":["number","null"]},"processorId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["method","scopes","id","accountId","isDefault","displayName","enabled","isPayerCharged","fee","processorId","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/accounts":{"post":{"operationId":"connectedAccounts-create","summary":"Create a connected account","description":"Creates an account that sells through yours, with C2P and immediate debit on. Act for it with your API key and the `UnoPago-Account` header. Its bank account is not paid out until an owner of your account confirms it in UnoPago.","tags":["Connected accounts"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"externalId":{"description":"Your own id for the account, unique among your connected accounts.","type":"string","minLength":1,"maxLength":255},"name":{"type":"string","minLength":1},"nationalId":{"type":"string","minLength":2,"maxLength":10,"pattern":"^[JVEGP]"},"phoneNumber":{"description":"The business's phone, e.g. `+584241234567`.","type":"string","pattern":"^(?:[01]\\d{3}-?\\d{7}|\\+58(?!0)\\d{3}-?\\d{7}|\\+(?!58)\\d{1,3}\\d{3}-?\\d{7})$"},"address":{"type":"string","maxLength":500},"description":{"type":"string","maxLength":500},"bankAccount":{"type":"object","properties":{"bankCode":{"type":"string","pattern":"^\\d{4}$","description":"SUDEBAN code of the bank, e.g. `0134`."},"accountNumber":{"type":"string","pattern":"^\\d{20}$"},"holderName":{"type":"string","minLength":1},"accountType":{"default":"CHECKING","type":"string","enum":["CHECKING","SAVINGS"]}},"required":["bankCode","accountNumber","holderName"],"description":"Where the account's sales are paid out, held by `nationalId`. Not paid until an owner of your account confirms it in UnoPago."},"paymentMethods":{"default":{},"description":"Whether the buyer pays UnoPago's fee on top of the price, per method. Both methods are created enabled; `isPayerCharged` defaults to false.","type":"object","properties":{"C2P":{"type":"object","properties":{"isPayerCharged":{"type":"boolean"}},"required":["isPayerCharged"]},"IMMEDIATE_DEBIT":{"type":"object","properties":{"isPayerCharged":{"type":"boolean"}},"required":["isPayerCharged"]}}}},"required":["name","nationalId","bankAccount"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":["string","null"]},"name":{"type":"string"},"nationalId":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"address":{"type":["string","null"]},"description":{"type":"string"},"status":{"type":"string","enum":["ACTIVE","MAINTENANCE","SUSPENDED","DEACTIVATED"]},"verified":{"type":"boolean","description":"Verified by UnoPago. Sales are collected before, but paid out only after. The review's status is in `GET /v1/accounts/{accountId}/verification`."},"createdAt":{"type":"string"},"bankAccount":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"bankCode":{"type":"string"},"accountNumberLast4":{"type":"string"},"holderName":{"type":"string"},"status":{"type":"string","enum":["PENDING_CONFIRMATION","CONFIRMED"],"description":"`PENDING_CONFIRMATION` until an owner of your account confirms it in UnoPago; nothing is paid out to it before."},"createdAt":{"type":"string"}},"required":["id","bankCode","accountNumberLast4","holderName","status","createdAt"],"additionalProperties":false},{"type":"null"}]}},"required":["id","externalId","name","nationalId","phoneNumber","address","description","status","verified","createdAt","bankAccount"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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":"connectedAccounts-list","summary":"List connected accounts","tags":["Connected accounts"],"security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":["string","null"]},"name":{"type":"string"},"nationalId":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"address":{"type":["string","null"]},"description":{"type":"string"},"status":{"type":"string","enum":["ACTIVE","MAINTENANCE","SUSPENDED","DEACTIVATED"]},"verified":{"type":"boolean","description":"Verified by UnoPago. Sales are collected before, but paid out only after. The review's status is in `GET /v1/accounts/{accountId}/verification`."},"createdAt":{"type":"string"}},"required":["id","externalId","name","nationalId","phoneNumber","address","description","status","verified","createdAt"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/accounts/{accountId}":{"get":{"operationId":"connectedAccounts-get","summary":"Get a connected account","tags":["Connected accounts"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"accountId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":["string","null"]},"name":{"type":"string"},"nationalId":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"address":{"type":["string","null"]},"description":{"type":"string"},"status":{"type":"string","enum":["ACTIVE","MAINTENANCE","SUSPENDED","DEACTIVATED"]},"verified":{"type":"boolean","description":"Verified by UnoPago. Sales are collected before, but paid out only after. The review's status is in `GET /v1/accounts/{accountId}/verification`."},"createdAt":{"type":"string"},"bankAccount":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"bankCode":{"type":"string"},"accountNumberLast4":{"type":"string"},"holderName":{"type":"string"},"status":{"type":"string","enum":["PENDING_CONFIRMATION","CONFIRMED"],"description":"`PENDING_CONFIRMATION` until an owner of your account confirms it in UnoPago; nothing is paid out to it before."},"createdAt":{"type":"string"}},"required":["id","bankCode","accountNumberLast4","holderName","status","createdAt"],"additionalProperties":false},{"type":"null"}]}},"required":["id","externalId","name","nationalId","phoneNumber","address","description","status","verified","createdAt","bankAccount"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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"}}}}}},"patch":{"operationId":"connectedAccounts-update","summary":"Update a connected account","description":"Where a connected account's details are changed: name, RIF, phone, address, description and bank account (`PUT /v1/settings` is refused for it). Name and RIF are fixed once UnoPago verifies the account; a new RIF comes with its bank account. A new bank account replaces the current one and is not paid out until an owner of your account confirms it.","tags":["Connected accounts"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"accountId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"nationalId":{"type":"string","minLength":2,"maxLength":10,"pattern":"^[JVEGP]"},"phoneNumber":{"description":"The business's phone, e.g. `+584241234567`.","type":"string","pattern":"^(?:[01]\\d{3}-?\\d{7}|\\+58(?!0)\\d{3}-?\\d{7}|\\+(?!58)\\d{1,3}\\d{3}-?\\d{7})$"},"address":{"type":"string","maxLength":500},"description":{"type":"string","maxLength":500},"bankAccount":{"description":"A new payout bank account. It replaces the current one and is not paid until an owner of your account confirms it in UnoPago.","type":"object","properties":{"bankCode":{"type":"string","pattern":"^\\d{4}$","description":"SUDEBAN code of the bank, e.g. `0134`."},"accountNumber":{"type":"string","pattern":"^\\d{20}$"},"holderName":{"type":"string","minLength":1},"accountType":{"default":"CHECKING","type":"string","enum":["CHECKING","SAVINGS"]}},"required":["bankCode","accountNumber","holderName"]}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":["string","null"]},"name":{"type":"string"},"nationalId":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"address":{"type":["string","null"]},"description":{"type":"string"},"status":{"type":"string","enum":["ACTIVE","MAINTENANCE","SUSPENDED","DEACTIVATED"]},"verified":{"type":"boolean","description":"Verified by UnoPago. Sales are collected before, but paid out only after. The review's status is in `GET /v1/accounts/{accountId}/verification`."},"createdAt":{"type":"string"},"bankAccount":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"bankCode":{"type":"string"},"accountNumberLast4":{"type":"string"},"holderName":{"type":"string"},"status":{"type":"string","enum":["PENDING_CONFIRMATION","CONFIRMED"],"description":"`PENDING_CONFIRMATION` until an owner of your account confirms it in UnoPago; nothing is paid out to it before."},"createdAt":{"type":"string"}},"required":["id","bankCode","accountNumberLast4","holderName","status","createdAt"],"additionalProperties":false},{"type":"null"}]}},"required":["id","externalId","name","nationalId","phoneNumber","address","description","status","verified","createdAt","bankAccount"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/accounts/{accountId}/deactivate":{"post":{"operationId":"connectedAccounts-deactivate","summary":"Deactivate a connected account","description":"Stops the account from collecting, at once and for good. A connected account is never deleted or moved to another platform.","tags":["Connected accounts"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"accountId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":["string","null"]},"name":{"type":"string"},"nationalId":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"address":{"type":["string","null"]},"description":{"type":"string"},"status":{"type":"string","enum":["ACTIVE","MAINTENANCE","SUSPENDED","DEACTIVATED"]},"verified":{"type":"boolean","description":"Verified by UnoPago. Sales are collected before, but paid out only after. The review's status is in `GET /v1/accounts/{accountId}/verification`."},"createdAt":{"type":"string"}},"required":["id","externalId","name","nationalId","phoneNumber","address","description","status","verified","createdAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/accounts/{accountId}/verification":{"get":{"operationId":"connectedAccounts-getVerification","summary":"Get a connected account's verification","description":"Where the account's verification stands and which document it needs. The account collects before it is verified, but is paid out only after. When `REJECTED`, `rejectionReason` says why: upload a new document.","tags":["Connected accounts"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"accountId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"anyOf":[{"type":"string","enum":["IN_REVIEW","VERIFIED","REJECTED"]},{"type":"null"}],"description":"`null` until a document is submitted. `IN_REVIEW` while UnoPago reviews it, then `VERIFIED` or `REJECTED`."},"requiredDocumentType":{"anyOf":[{"type":"string","enum":["CEDULA","RIF"]},{"type":"null"}],"description":"The document to upload, from the account's `nationalId`: `RIF` for a company, `CEDULA` for a person. `null` while the account has no `nationalId`."},"rejectionReason":{"description":"Why UnoPago rejected the document. Set only when `REJECTED`.","type":["string","null"]},"submittedAt":{"type":["string","null"]}},"required":["status","requiredDocumentType","rejectionReason","submittedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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"}}}}}},"post":{"operationId":"connectedAccounts-submitVerification","summary":"Submit a verification document","description":"Sends the uploaded file, by its `fileKey` alone, to UnoPago for review and returns the verification `IN_REVIEW`. The uploaded file must be there and weigh 10 MB at most; a larger one is deleted and refused. Allowed only when no document was submitted before or the last one was rejected. UnoPago reviews it by hand; the account's payouts are held until it is verified.","tags":["Connected accounts"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"accountId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fileKey":{"type":"string","minLength":1}},"required":["fileKey"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"anyOf":[{"type":"string","enum":["IN_REVIEW","VERIFIED","REJECTED"]},{"type":"null"}],"description":"`null` until a document is submitted. `IN_REVIEW` while UnoPago reviews it, then `VERIFIED` or `REJECTED`."},"requiredDocumentType":{"anyOf":[{"type":"string","enum":["CEDULA","RIF"]},{"type":"null"}],"description":"The document to upload, from the account's `nationalId`: `RIF` for a company, `CEDULA` for a person. `null` while the account has no `nationalId`."},"rejectionReason":{"description":"Why UnoPago rejected the document. Set only when `REJECTED`.","type":["string","null"]},"submittedAt":{"type":["string","null"]}},"required":["status","requiredDocumentType","rejectionReason","submittedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/accounts/{accountId}/verification/upload-url":{"post":{"operationId":"connectedAccounts-createVerificationUploadUrl","summary":"Request an upload URL for a verification document","description":"Returns the `fileKey` and how to upload the file: `PUT` it to `upload.url` with exactly `upload.headers`, before `upload.expiresAt` (15 minutes), then submit the `fileKey` with `POST /v1/accounts/{accountId}/verification`. JPG, PNG, WEBP or PDF, up to 10 MB. Refused while a document is in review or once the account is verified.","tags":["Connected accounts"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"accountId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":255},"contentType":{"type":"string","enum":["image/jpeg","image/png","image/webp","application/pdf"]},"size":{"type":"integer","exclusiveMinimum":0,"maximum":10485760}},"required":["fileName","contentType","size"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"fileKey":{"type":"string","description":"Submit it with `POST /v1/accounts/{accountId}/verification` once the file is uploaded."},"upload":{"type":"object","properties":{"url":{"type":"string","description":"Where to send the file."},"method":{"type":"string","const":"PUT"},"headers":{"type":"object","properties":{"Content-Type":{"type":"string"}},"required":["Content-Type"],"additionalProperties":false,"description":"Send exactly these headers with the `PUT`."},"expiresAt":{"description":"After this, `url` no longer accepts the file.","type":"string"}},"required":["url","method","headers","expiresAt"],"additionalProperties":false}},"required":["fileKey","upload"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/balance":{"get":{"operationId":"connectedAccounts-balance","summary":"Get the pending balance","description":"What UnoPago owes the account and has not paid out yet, in bolívares. With `UnoPago-Account`, the connected account's. Paid amounts are in `GET /v1/settlements`.","tags":["Connected accounts"],"security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"string"},"currency":{"type":"string","const":"VES"},"pendingVes":{"type":"string"}},"required":["account","currency","pendingVes"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/public/bank-accounts":{"get":{"operationId":"bankAccounts-getAvailableBankAccounts","summary":"Get available bank accounts","description":"Lists the authenticated account's active bank accounts, the destinations a bank transfer payment claim can name.","tags":["Payment claims"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["CHECKING","SAVINGS","ZELLE","BINANCE"]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"bankName":{"type":"string","enum":["A100BANCO","BANCAMIGA","BANCARIBE","BANESCO","BDV","BFC","BNC","MERCANTIL","PROVINCIAL","BANCO_DEL_TESORO","BANCO_PLAZA","SOFITASA","BANCO_ACTIVO","BANCO_AGRICOLA","BANCO_BICENTENARIO","BANCO_CARONI","BANCO_EXTERIOR","BANCRECER","BANFANB","BANGENTE","BANPLUS","DELSUR","R4","VENEZOLANO_DE_CREDITO","BANK_OF_AMERICA","AMERANT_BANK","US_BANK","WELLS_FARGO","BINANCE"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"name":{"type":"string"},"accountHolderName":{"type":"string"},"isActive":{"type":"boolean"},"nationalId":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"pagoMovilQrUrl":{"type":["string","null"]},"identifier":{"type":"string"},"last4":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["type","currency","bankName","id","accountId","name","accountHolderName","isActive","nationalId","phoneNumber","pagoMovilQrUrl","identifier","last4","createdAt","updatedAt"],"additionalProperties":false}}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/bank-transactions":{"get":{"operationId":"bankTransactions-getPaginatedBankTransactions","summary":"Get all bank transactions","description":"This API is used to get bank transactions by bank account. It supports pagination and search ","tags":["Bank Transactions"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":50,"type":"number","maximum":100}},{"in":"query","name":"sortKey","schema":{"default":"date","type":"string","enum":["date","bankAccount","amount"]}},{"in":"query","name":"sortDirection","schema":{"default":"desc","type":"string","enum":["asc","desc"]}},{"in":"query","name":"bankAccountId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true},{"in":"query","name":"startDate","schema":{"type":"string"}},{"in":"query","name":"endDate","schema":{"type":"string"}},{"in":"query","name":"bankTransactionStatus","schema":{"type":"string","enum":["PENDING","ACCEPTED","UNASSOCIATED","ALL"]}},{"in":"query","name":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["MERCANTIL_WEBHOOK","BNC_WEBHOOK","MERCANTIL_API","BNC_API","BANESCO_API","PLAZA_API","BINANCE_API","C2P","STRIPE_ACH","TRANSACTION_FILE","FORCE_PAYMENT","MANUAL","API"]},"bankName":{"type":"string","enum":["A100BANCO","BANCAMIGA","BANCARIBE","BANESCO","BDV","BFC","BNC","MERCANTIL","PROVINCIAL","BANCO_DEL_TESORO","BANCO_PLAZA","SOFITASA","BANCO_ACTIVO","BANCO_AGRICOLA","BANCO_BICENTENARIO","BANCO_CARONI","BANCO_EXTERIOR","BANCRECER","BANFANB","BANGENTE","BANPLUS","DELSUR","R4","VENEZOLANO_DE_CREDITO","BANK_OF_AMERICA","AMERANT_BANK","US_BANK","WELLS_FARGO","BINANCE"]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"asset":{"anyOf":[{"type":"string","enum":["USDT","USDC"]},{"type":"null"}]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"bankAccountId":{"type":"string"},"transactionFileId":{"type":["string","null"]},"paymentClaimId":{"type":["string","null"]},"bncWebhookPaymentEventId":{"type":["string","null"]},"mercantilWebhookPaymentEventId":{"type":["string","null"]},"duplicationKey":{"type":["string","null"]},"amount":{"type":"number"},"date":{"type":"string"},"description":{"type":"string"},"referenceCode":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"payment":{"anyOf":[{"type":"object","properties":{"currency":{"type":"string","enum":["VES","USD","EUR"]},"receiverBankName":{"anyOf":[{"type":"string","enum":["A100BANCO","BANCAMIGA","BANCARIBE","BANESCO","BDV","BFC","BNC","MERCANTIL","PROVINCIAL","BANCO_DEL_TESORO","BANCO_PLAZA","SOFITASA","BANCO_ACTIVO","BANCO_AGRICOLA","BANCO_BICENTENARIO","BANCO_CARONI","BANCO_EXTERIOR","BANCRECER","BANFANB","BANGENTE","BANPLUS","DELSUR","R4","VENEZOLANO_DE_CREDITO","BANK_OF_AMERICA","AMERANT_BANK","US_BANK","WELLS_FARGO","BINANCE"]},{"type":"null"}]},"method":{"type":"string","enum":["BANK_TRANSFER","ZELLE","C2P","IMMEDIATE_DEBIT","P2P","CASH","POS","CUSTOMER_CREDIT","STRIPE_ACH","STRIPE_CARD","DEBIT_CARD","PAYROLL","BINANCE_PAY","LEDGER_FEE"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"customerId":{"type":"string"},"amount":{"type":"number"},"transactionDate":{"type":"string"},"rateDate":{"type":["string","null"]},"referenceCode":{"type":["string","null"]},"externalId":{"type":["string","null"]},"receiverBankHolderName":{"type":["string","null"]},"receiverBankNationalId":{"type":["string","null"]},"customerFullName":{"type":["string","null"]},"customerNationalId":{"type":["string","null"]},"customerPhoneNumber":{"type":["string","null"]},"customerBankAccountNumber":{"type":["string","null"]},"customerEmail":{"type":["string","null"]},"customerNote":{"type":["string","null"]},"customerIpAddress":{"type":["string","null"]},"customerUserAgent":{"type":["string","null"]},"isAutoPay":{"type":"boolean"},"bankAccountId":{"type":["string","null"]},"paymentClaimId":{"type":["string","null"]},"bankTransactionId":{"type":["string","null"]},"createdById":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"splitAmount":{"type":["number","null"]}},"required":["currency","receiverBankName","method","id","accountId","customerId","amount","transactionDate","rateDate","referenceCode","externalId","receiverBankHolderName","receiverBankNationalId","customerFullName","customerNationalId","customerPhoneNumber","customerBankAccountNumber","customerEmail","customerNote","customerIpAddress","customerUserAgent","isAutoPay","bankAccountId","paymentClaimId","bankTransactionId","createdById","createdAt","updatedAt","splitAmount"],"additionalProperties":false},{"type":"null"}]},"paymentClaim":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["PENDING","ACCEPTED","REJECTED"]},"purpose":{"type":"string","enum":["INVOICE","COUNTER_DEPOSIT"]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"paymentMethod":{"type":"string","enum":["BANK_TRANSFER","ZELLE","C2P","IMMEDIATE_DEBIT","P2P","CASH","POS","CUSTOMER_CREDIT","STRIPE_ACH","STRIPE_CARD","DEBIT_CARD","PAYROLL","BINANCE_PAY","LEDGER_FEE"]},"createdFrom":{"type":"string","enum":["ADMIN","CONTACT_PORTAL","CUSTOMER_PORTAL","API","CHATBOT","CHECKOUT"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"customerId":{"type":["string","null"]},"amount":{"type":"number"},"date":{"type":"string"},"screenshotUrl":{"type":["string","null"]},"referenceCode":{"type":["string","null"]},"issuerBankId":{"type":["string","null"]},"bankAccountId":{"type":["string","null"]},"customerFullName":{"type":["string","null"]},"customerNationalId":{"type":["string","null"]},"customerPhoneNumber":{"type":["string","null"]},"customerEmail":{"type":["string","null"]},"customerNote":{"type":["string","null"]},"customerIpAddress":{"type":["string","null"]},"customerUserAgent":{"type":["string","null"]},"paymentClaimCode":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"exchangeRate":{"type":["number","null"]}},"required":["status","purpose","currency","paymentMethod","createdFrom","id","accountId","customerId","amount","date","screenshotUrl","referenceCode","issuerBankId","bankAccountId","customerFullName","customerNationalId","customerPhoneNumber","customerEmail","customerNote","customerIpAddress","customerUserAgent","paymentClaimCode","createdAt","updatedAt","exchangeRate"],"additionalProperties":false},{"type":"null"}]},"reconciliations":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string","enum":["PENDING","ACCEPTED","REJECTED"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"paymentClaimId":{"type":"string"},"bankTransactionId":{"type":"string"},"perfectMatch":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"paymentClaim":{"type":"object","properties":{"status":{"type":"string","enum":["PENDING","ACCEPTED","REJECTED"]},"purpose":{"type":"string","enum":["INVOICE","COUNTER_DEPOSIT"]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"paymentMethod":{"type":"string","enum":["BANK_TRANSFER","ZELLE","C2P","IMMEDIATE_DEBIT","P2P","CASH","POS","CUSTOMER_CREDIT","STRIPE_ACH","STRIPE_CARD","DEBIT_CARD","PAYROLL","BINANCE_PAY","LEDGER_FEE"]},"createdFrom":{"type":"string","enum":["ADMIN","CONTACT_PORTAL","CUSTOMER_PORTAL","API","CHATBOT","CHECKOUT"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"customerId":{"type":["string","null"]},"amount":{"type":"number"},"date":{"type":"string"},"screenshotUrl":{"type":["string","null"]},"referenceCode":{"type":["string","null"]},"issuerBankId":{"type":["string","null"]},"bankAccountId":{"type":["string","null"]},"customerFullName":{"type":["string","null"]},"customerNationalId":{"type":["string","null"]},"customerPhoneNumber":{"type":["string","null"]},"customerEmail":{"type":["string","null"]},"customerNote":{"type":["string","null"]},"customerIpAddress":{"type":["string","null"]},"customerUserAgent":{"type":["string","null"]},"paymentClaimCode":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"exchangeRate":{"type":["number","null"]},"bankAccount":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["CHECKING","SAVINGS","ZELLE","BINANCE"]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"bankName":{"type":"string","enum":["A100BANCO","BANCAMIGA","BANCARIBE","BANESCO","BDV","BFC","BNC","MERCANTIL","PROVINCIAL","BANCO_DEL_TESORO","BANCO_PLAZA","SOFITASA","BANCO_ACTIVO","BANCO_AGRICOLA","BANCO_BICENTENARIO","BANCO_CARONI","BANCO_EXTERIOR","BANCRECER","BANFANB","BANGENTE","BANPLUS","DELSUR","R4","VENEZOLANO_DE_CREDITO","BANK_OF_AMERICA","AMERANT_BANK","US_BANK","WELLS_FARGO","BINANCE"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"name":{"type":"string"},"accountHolderName":{"type":"string"},"isActive":{"type":"boolean"},"nationalId":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"pagoMovilQrUrl":{"type":["string","null"]},"identifier":{"type":"string"},"last4":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["type","currency","bankName","id","accountId","name","accountHolderName","isActive","nationalId","phoneNumber","pagoMovilQrUrl","identifier","last4","createdAt","updatedAt"],"additionalProperties":false},{"type":"null"}]},"customer":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"externalId":{"type":["string","null"]},"mainContactId":{"type":["string","null"]},"nationalId":{"type":["string","null"]},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"address":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","accountId","externalId","mainContactId","nationalId","firstName","lastName","email","phoneNumber","address","createdAt","updatedAt"],"additionalProperties":false},{"type":"null"}]},"invoicePaymentClaims":{"type":"array","items":{"type":"object","properties":{"pricingMode":{"type":"string","enum":["CURRENCY","REFERENCE"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"invoiceId":{"type":"string"},"paymentClaimId":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["pricingMode","id","accountId","invoiceId","paymentClaimId","createdAt","updatedAt"],"additionalProperties":false}},"binancePayTolerance":{"description":"For a Binance Pay claim, how many dollars the order's amount may differ from the reported one and still confirm it; null for other payment methods.","type":["number","null"]}},"required":["status","purpose","currency","paymentMethod","createdFrom","id","accountId","customerId","amount","date","screenshotUrl","referenceCode","issuerBankId","bankAccountId","customerFullName","customerNationalId","customerPhoneNumber","customerEmail","customerNote","customerIpAddress","customerUserAgent","paymentClaimCode","createdAt","updatedAt","exchangeRate","bankAccount","customer","invoicePaymentClaims","binancePayTolerance"],"additionalProperties":false}},"required":["status","id","accountId","paymentClaimId","bankTransactionId","perfectMatch","createdAt","updatedAt","paymentClaim"],"additionalProperties":false}},"settlementDeposit":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"ledgerSettlementId":{"type":"string"},"netAmount":{"type":"number"},"bankReference":{"type":["string","null"]},"paymentCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"processedAt":{"type":"string"},"status":{"type":"string","enum":["PENDING","RECONCILED","UNRECONCILED"]},"reconciledAt":{"type":["string","null"]}},"required":["id","ledgerSettlementId","netAmount","bankReference","paymentCount","processedAt","status","reconciledAt"],"additionalProperties":false,"description":"The UnoPago settlement this movement is the transfer of: one deposit for many payments. Null when the movement is not a settlement's transfer."},{"type":"null"}]}},"required":["source","bankName","currency","asset","id","accountId","bankAccountId","transactionFileId","paymentClaimId","bncWebhookPaymentEventId","mercantilWebhookPaymentEventId","duplicationKey","amount","date","description","referenceCode","createdAt","updatedAt","payment","paymentClaim","reconciliations","settlementDeposit"],"additionalProperties":false}},"total":{"type":"number"},"totalPages":{"type":"number"},"nextCursor":{"description":"The cursor to get the next page of results","type":["string","null"]},"exchangeRates":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"rate":{"type":"number"},"rateDate":{"type":"string"},"daysAhead":{"type":"number"}},"required":["rate","rateDate","daysAhead"],"additionalProperties":false}}},"required":["results","total","totalPages"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/bank-transaction":{"post":{"operationId":"bankTransactions-createBankTransaction","summary":"Create a new bank transaction","description":"This API is used to create a new bank transaction.","tags":["Bank Transactions"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"number","minimum":0.01},"description":{"type":"string"},"last4":{"type":"string","minLength":4,"maxLength":4},"identifier":{"type":"string"},"transactionDate":{"type":"string"},"referenceCode":{"type":"string"}},"required":["amount","description","transactionDate","referenceCode"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"string","enum":["MERCANTIL_WEBHOOK","BNC_WEBHOOK","MERCANTIL_API","BNC_API","BANESCO_API","PLAZA_API","BINANCE_API","C2P","STRIPE_ACH","TRANSACTION_FILE","FORCE_PAYMENT","MANUAL","API"]},"bankName":{"type":"string","enum":["A100BANCO","BANCAMIGA","BANCARIBE","BANESCO","BDV","BFC","BNC","MERCANTIL","PROVINCIAL","BANCO_DEL_TESORO","BANCO_PLAZA","SOFITASA","BANCO_ACTIVO","BANCO_AGRICOLA","BANCO_BICENTENARIO","BANCO_CARONI","BANCO_EXTERIOR","BANCRECER","BANFANB","BANGENTE","BANPLUS","DELSUR","R4","VENEZOLANO_DE_CREDITO","BANK_OF_AMERICA","AMERANT_BANK","US_BANK","WELLS_FARGO","BINANCE"]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"asset":{"anyOf":[{"type":"string","enum":["USDT","USDC"]},{"type":"null"}]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"bankAccountId":{"type":"string"},"transactionFileId":{"type":["string","null"]},"paymentClaimId":{"type":["string","null"]},"bncWebhookPaymentEventId":{"type":["string","null"]},"mercantilWebhookPaymentEventId":{"type":["string","null"]},"duplicationKey":{"type":["string","null"]},"amount":{"type":"number"},"date":{"type":"string"},"description":{"type":"string"},"referenceCode":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["source","bankName","currency","asset","id","accountId","bankAccountId","transactionFileId","paymentClaimId","bncWebhookPaymentEventId","mercantilWebhookPaymentEventId","duplicationKey","amount","date","description","referenceCode","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/bank-transaction/{bankTransactionId}":{"put":{"operationId":"bankTransactions-updateBankTransaction","summary":"Update a bank transaction","description":"This API is used to update a bank transaction.","tags":["Bank Transactions"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"bankTransactionId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"number","minimum":0.01},"description":{"type":"string"},"referenceCode":{"type":"string"},"date":{"type":"string"},"bankAccountId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"string","enum":["MERCANTIL_WEBHOOK","BNC_WEBHOOK","MERCANTIL_API","BNC_API","BANESCO_API","PLAZA_API","BINANCE_API","C2P","STRIPE_ACH","TRANSACTION_FILE","FORCE_PAYMENT","MANUAL","API"]},"bankName":{"type":"string","enum":["A100BANCO","BANCAMIGA","BANCARIBE","BANESCO","BDV","BFC","BNC","MERCANTIL","PROVINCIAL","BANCO_DEL_TESORO","BANCO_PLAZA","SOFITASA","BANCO_ACTIVO","BANCO_AGRICOLA","BANCO_BICENTENARIO","BANCO_CARONI","BANCO_EXTERIOR","BANCRECER","BANFANB","BANGENTE","BANPLUS","DELSUR","R4","VENEZOLANO_DE_CREDITO","BANK_OF_AMERICA","AMERANT_BANK","US_BANK","WELLS_FARGO","BINANCE"]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"asset":{"anyOf":[{"type":"string","enum":["USDT","USDC"]},{"type":"null"}]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"bankAccountId":{"type":"string"},"transactionFileId":{"type":["string","null"]},"paymentClaimId":{"type":["string","null"]},"bncWebhookPaymentEventId":{"type":["string","null"]},"mercantilWebhookPaymentEventId":{"type":["string","null"]},"duplicationKey":{"type":["string","null"]},"amount":{"type":"number"},"date":{"type":"string"},"description":{"type":"string"},"referenceCode":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["source","bankName","currency","asset","id","accountId","bankAccountId","transactionFileId","paymentClaimId","bncWebhookPaymentEventId","mercantilWebhookPaymentEventId","duplicationKey","amount","date","description","referenceCode","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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":"bankTransactions-deleteBankTransaction","summary":"Delete a bank transaction","description":"This API is used to delete a bank transaction.","tags":["Bank Transactions"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"bankTransactionId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/parse-email-transaction":{"post":{"operationId":"bankTransactions-createBankTransactionParsingEmail","summary":"Parse a transaction from an email","description":"This API is used to parse a transaction from an email.","tags":["Bank Transactions"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string"},"referenceCode":{"type":"string"}},"required":["content","referenceCode"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"string","enum":["MERCANTIL_WEBHOOK","BNC_WEBHOOK","MERCANTIL_API","BNC_API","BANESCO_API","PLAZA_API","BINANCE_API","C2P","STRIPE_ACH","TRANSACTION_FILE","FORCE_PAYMENT","MANUAL","API"]},"bankName":{"type":"string","enum":["A100BANCO","BANCAMIGA","BANCARIBE","BANESCO","BDV","BFC","BNC","MERCANTIL","PROVINCIAL","BANCO_DEL_TESORO","BANCO_PLAZA","SOFITASA","BANCO_ACTIVO","BANCO_AGRICOLA","BANCO_BICENTENARIO","BANCO_CARONI","BANCO_EXTERIOR","BANCRECER","BANFANB","BANGENTE","BANPLUS","DELSUR","R4","VENEZOLANO_DE_CREDITO","BANK_OF_AMERICA","AMERANT_BANK","US_BANK","WELLS_FARGO","BINANCE"]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"asset":{"anyOf":[{"type":"string","enum":["USDT","USDC"]},{"type":"null"}]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"bankAccountId":{"type":"string"},"transactionFileId":{"type":["string","null"]},"paymentClaimId":{"type":["string","null"]},"bncWebhookPaymentEventId":{"type":["string","null"]},"mercantilWebhookPaymentEventId":{"type":["string","null"]},"duplicationKey":{"type":["string","null"]},"amount":{"type":"number"},"date":{"type":"string"},"description":{"type":"string"},"referenceCode":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["source","bankName","currency","asset","id","accountId","bankAccountId","transactionFileId","paymentClaimId","bncWebhookPaymentEventId","mercantilWebhookPaymentEventId","duplicationKey","amount","date","description","referenceCode","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/checkout-sessions":{"post":{"operationId":"checkoutSessions-create","summary":"Create a hosted checkout session","tags":["Checkout Sessions"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"externalId":{"description":"Your id for this session. Sending the same `externalId` again returns the existing session instead of creating another; with different items (a line's IVA `rate` included, and the IVA per rate), `automaticTax`, currency, iframe origins, `appearance` or `splits` it is refused with `409`. How the IVA of a rate is split over its lines is not compared. Once a payment has issued the session's order, its items and IVA are no longer compared, since staff may have edited the order.","example":"ORD-10293","type":"string","minLength":1,"maxLength":128},"currency":{"type":"string","enum":["VES","USD","EUR"],"description":"A `USD` or `EUR` total is converted to bolívares at the day's BCV rate; the buyer always pays in bolívares.","example":"USD"},"automaticTax":{"description":"Who computes the IVA. Left out or `true`: UnoPago adds IVA to the non-`exento` lines (a product line at its product's rate, any other at 16 %), and the order it records can be fiscally invoiced. `false`: you send each line's IVA rate (and optionally its amount) in `items[].taxes`, and the order can't be fiscally printed or emitted, since you invoice the sale in your own system. See **Taxes (IVA)**.","example":{"enabled":false},"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]},"items":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"description":{"type":"string","minLength":1,"maxLength":200},"productId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"quantity":{"type":"integer","minimum":1,"maximum":1000000},"amount":{"type":"number","minimum":0.01,"maximum":1000000000},"exento":{"type":"boolean"},"taxes":{"maxItems":1,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"IVA"},"rate":{"type":"number"},"amount":{"type":"number","minimum":0,"maximum":1000000000,"multipleOf":0.01}},"required":["type","rate"]}}},"required":["quantity"],"description":"`taxes` is only accepted with `automaticTax.enabled: false`: at most one entry, `type: \"IVA\"`, with the `rate` (`0.08`, `0.16` or `0.31`) and, optionally, the `amount` of IVA for the whole line (not per unit, at most 2 decimals), in `currency`, within 0.02 of `rate` × `amount` × `quantity`. Send `amount` on every taxed line or on none: sent, the IVA per rate is the sum of your amounts; left out, UnoPago computes it per rate. Without `automaticTax` a line can't have `productId` or `exento`, and a line without `taxes` is exempt. Lines may use different rates: `ivaBreakdown` sums them per rate."},"description":"What is sold. Each `amount` is a net unit price in `currency`, multiplied by `quantity`. A line with a `productId` takes its `description`, `amount` and `exento` from the product when they are left out. A sent `amount` or `exento` that doesn't match the product is refused; a sent `description` is kept. A line without one needs `description` and `amount`. The server adds IVA to the non-`exento` lines (a product line at its product's rate, any other at 16 %), unless `automaticTax.enabled` is `false` and the lines bring their own `taxes`; the total is never an input.","example":[{"description":"Tuition","quantity":1,"amount":25},{"productId":"cm9x2k4q80001s6v1h3d7e2ab","quantity":2}]},"splits":{"description":"The parts of the order you owe to vendors, each an `amount` in `currency` for a `vendor` id (see **Vendors**; needs the Proveedores module). Up to 10, each vendor once. UnoPago pays every vendor its part and you keep the rest, paying UnoPago's fee on the whole charge: what is left for you after the fee must be more than zero. A session with `splits` is paid by C2P or immediate debit only, in one payment. The buyer is shown nothing about them. An empty list is a session without splits.","example":[{"vendor":"cm9x2k4q80001s6v1h3d7e2ab","amount":9},{"vendor":"cm9x2k4q80002s6v1h3d7e2ac","amount":2}],"maxItems":10,"type":"array","items":{"type":"object","properties":{"vendor":{"type":"string","minLength":1,"maxLength":128},"amount":{"type":"number","minimum":0.01}},"required":["vendor","amount"]}},"reference":{"description":"Shown to the buyer on the checkout page.","example":"Order 10293","type":"string","maxLength":128},"description":{"description":"Shown to the buyer on the checkout page.","example":"October tuition","type":"string","maxLength":500},"buyerName":{"description":"Prefills the payment form.","example":"María Pérez","type":"string","maxLength":100},"buyerEmail":{"example":"maria@example.com","type":"string","maxLength":128,"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,}$"},"buyerNationalId":{"description":"The buyer's cédula or RIF, e.g. `V12345678` or `J123456789`. Prefills the payment form; the buyer can change it.","example":"V12345678","type":"string","minLength":2,"maxLength":10,"pattern":"^[JVEGP]"},"buyerPhoneNumber":{"description":"The Venezuelan mobile affiliated to the buyer's bank, e.g. `04141234567` or `+584141234567`. Prefills the payment form; the buyer can change it.","example":"+584141234567","type":"string","pattern":"^(?:[01]\\d{3}-?\\d{7}|\\+58(?!0)\\d{3}-?\\d{7}|\\+(?!58)\\d{1,3}\\d{3}-?\\d{7})$"},"buyerBankCode":{"description":"The buyer's bank, as its four-digit code (e.g. `0105` for Mercantil). Prefills the bank in either payment method; the buyer can change it.","example":"0105","type":"string"},"metadata":{"default":{},"description":"Your own data, stored with the session.","example":{"orderId":"10293"},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/__schema0"}},"successUrl":{"description":"Where the buyer is sent after paying.","example":"https://shop.example.com/orders/10293","type":"string","format":"uri"},"cancelUrl":{"description":"The checkout page's way back whenever the session isn't `PAID`: while it's open or `PROCESSING`, and on the expired, canceled or failed screens. Without it, the page shows no way back.","example":"https://shop.example.com/cart","type":"string","format":"uri"},"iframeAllowedOrigins":{"description":"The origins allowed to frame `iframeUrl`, e.g. `https://shop.example.com`. Exact origins only: scheme + host + optional port, no path, wildcard or credentials; at most 10. Send it and the response carries a signed `iframeUrl`; omit it (or send `[]`) and `iframeUrl` is `null`. `http` is accepted for local testing; production requires `https` except on localhost. Part of the idempotent `externalId` check.","example":["https://shop.example.com"],"maxItems":10,"type":"array","items":{"type":"string","maxLength":255}},"appearance":{"description":"The session's own look in the checkout, over the account's \"Tema\" settings. Every field is optional; one left out keeps the account's. `mode` is `light` or `dark`; `colorPrimary` is `#RRGGBB`; `saturation` and `lightness` are integers from 0 to 100 that tint the surfaces around the colour (the console's presets: Neutro 0/98, Suave 30/97, Intenso 60/95); `borderStyle` is `square`, `soft`, `medium` or `rounded`; `showMerchantName` shows \"Pagando a\" and the account's name in the embedded checkout, `true` unless the account turned it off; `showTotal` shows the total in the embedded checkout's header, `true` unless the account turned it off, and the pay button shows the amount either way. Unknown keys are refused. Part of the idempotent `externalId` check.","example":{"mode":"dark","colorPrimary":"#0a7d4f","saturation":30,"lightness":97,"borderStyle":"rounded","showMerchantName":false,"showTotal":false},"type":"object","properties":{"mode":{"type":"string","enum":["light","dark"]},"colorPrimary":{"type":"string","pattern":"^#[0-9A-F]{6}$"},"saturation":{"type":"integer","minimum":0,"maximum":100},"lightness":{"type":"integer","minimum":0,"maximum":100},"borderStyle":{"type":"string","enum":["square","soft","medium","rounded"]},"showMerchantName":{"type":"boolean"},"showTotal":{"type":"boolean"}},"additionalProperties":false},"expiresInMinutes":{"default":30,"description":"Minutes until the session expires and can't be paid.","type":"integer","minimum":5,"maximum":1440}},"required":["currency","items"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$","example":"cm9x2k4q80001s6v1h3d7e2ab"},"externalId":{"description":"Your id for this session.","example":"ORD-10293","type":["string","null"]},"status":{"type":"string","enum":["OPEN","PROCESSING","PAID","FAILED","EXPIRED","CANCELED"],"description":"`OPEN` until the buyer pays. `PROCESSING` while a bank charge is confirmed: it becomes `PAID`, or goes back to `OPEN` (`EXPIRED` if past `expiresAt`) when the bank rejects it. `PAID`, `EXPIRED` and `CANCELED` are final. `FAILED` is reserved and not used today.","example":"OPEN"},"automaticTax":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false,"description":"Whether UnoPago computed the IVA from your account's settings. `false` when the session was created with your own IVA per line: see `items[].taxes`.","example":{"enabled":true}},"items":{"type":"array","items":{"type":"object","properties":{"productId":{"type":["string","null"]},"description":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount":{"type":"number"},"exento":{"type":"boolean"},"taxes":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"IVA"},"rate":{"type":"number"},"amount":{"type":"number"}},"required":["type","rate","amount"],"additionalProperties":false},"description":"The line's IVA when `automaticTax.enabled` is `false`: the rate you sent, and the line's share of the IVA at that rate. The IVA is kept per rate and shared back over its lines, a leftover cent going to the line whose share was cut the most, so the shares always add up to the rate's `ivaBreakdown` entry. Always empty when UnoPago computes the IVA."}},"required":["productId","description","quantity","amount","exento","taxes"],"additionalProperties":false},"description":"What is sold. A product line carries its product's price, `exento` and IVA rate as they were when the session was created: a later change to the product never reaches it. Without `automaticTax`, a line without `taxes` is `exento: true`.","example":[{"productId":null,"description":"Tuition","quantity":1,"amount":25,"exento":false,"taxes":[]}]},"subtotal":{"type":"number","description":"The items' net total, before discounts and IVA.","example":25},"ivaRate":{"description":"The general IVA rate (`0.16`) when the session carries IVA: a product line is taxed at its product's own rate, which may be another one, and every other non-`exento` line at this one. `null` when the account applies none. Without `automaticTax`, the rate your lines' `taxes` share, or `null` when no line has any or they use more than one: `ivaBreakdown` lists them.","example":0.16,"type":["number","null"]},"ivaAmount":{"type":"number","description":"The IVA the buyer pays: each non-`exento` item's rate on its amount, summed per rate in `ivaBreakdown`, or without `automaticTax`, per rate, the sum of the `taxes[].amount` you sent, or `rate` × the rate's base when you sent none.","example":4},"ivaBreakdown":{"type":"array","items":{"type":"object","properties":{"rate":{"type":"number","example":0.16},"rateBase":{"type":"number","description":"The taxable base the rate applies to, in `currency`.","example":25},"amount":{"type":"number","example":4}},"required":["rate","rateBase","amount"],"additionalProperties":false},"description":"`ivaAmount` per rate, each with its taxable base, highest rate first. When UnoPago computes the IVA, one per rate its lines use; without `automaticTax`, one per distinct `rate` in your lines' `taxes`. Empty when no IVA applies.","example":[{"rate":0.16,"rateBase":25,"amount":4}]},"amount":{"type":"number","description":"What the buyer pays, in `currency`: `subtotal + ivaAmount`, less any discount you add to the order after a first payment.","example":29},"currency":{"type":"string","enum":["VES","USD","EUR"],"example":"USD"},"amountVes":{"type":"number","description":"What the buyer pays in bolívares: `amount` times `exchangeRate`. While the session is `open` it is computed at today's BCV rate, so it changes when a new rate starts. Once a payment claims the session (`processing`, `paid`) it is what that payment charges; once it closes (`expired`, `canceled`) it stays at the rate of the day it closed. Equal to `amount` for `VES`.","example":5234.5},"exchangeRate":{"description":"Bolívares per unit of `currency`. `null` for `VES`.","example":180.5,"type":["number","null"]},"exchangeRateDate":{"description":"The date of the BCV publication `exchangeRate` comes from. `null` for `VES`.","type":["string","null"]},"amountPaid":{"type":"number","description":"What the session has been paid so far, in `currency`, on `amount` (fees not included). A session can be paid in parts, and a payment recorded into its invoice outside the checkout counts too. Still counts what was paid once a partly paid session is canceled.","example":8},"amountRemaining":{"type":"number","description":"`amount` minus `amountPaid`, never below 0, whatever the `status`: read `status` to know whether it can still be paid.","example":21},"splits":{"type":"array","items":{"type":"object","properties":{"vendor":{"type":"string","description":"The vendor's id."},"externalId":{"description":"Your own id for the vendor, when it has one.","example":"rest-42","type":["string","null"]},"amount":{"type":"number","description":"The vendor's part of the order, in `currency`.","example":9},"amountVes":{"description":"The same part in bolívares, at the rate of the payment that paid the session: what UnoPago pays the vendor. `null` until the session is `PAID`.","example":360,"type":["number","null"]}},"required":["vendor","externalId","amount","amountVes"],"additionalProperties":false},"description":"The parts of the order owed to vendors: the `splits` the session was created with, in no particular order. Empty for a session without them."},"reference":{"example":"Order 10293","type":["string","null"]},"description":{"example":"October tuition","type":["string","null"]},"buyerName":{"example":"María Pérez","type":["string","null"]},"buyerEmail":{"example":"maria@example.com","type":["string","null"]},"url":{"type":"string","format":"uri","description":"The hosted checkout page. Send the buyer here, or use `iframeUrl` to embed the form on your site."},"iframeUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}],"description":"A form-only version of the checkout, for an `<iframe>` on one of the origins sent in `iframeAllowedOrigins`. `null` when the session has no allowlist. The URL is signed: don't change it. See the API guide's \"Embedding the checkout\" section for the `postMessage` events.","example":"https://checkout.unopago.com/embed/pay/6Xo1...?payload=eyJ2Ijox...&sig=..."},"appearance":{"anyOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["light","dark"]},"colorPrimary":{"type":"string","pattern":"^#[0-9A-F]{6}$"},"saturation":{"type":"integer","minimum":0,"maximum":100},"lightness":{"type":"integer","minimum":0,"maximum":100},"borderStyle":{"type":"string","enum":["square","soft","medium","rounded"]},"showMerchantName":{"type":"boolean"},"showTotal":{"type":"boolean"}},"additionalProperties":false},{"type":"null"}],"description":"The `appearance` the session was created with. `null` when it was created without one: the checkout uses the account's \"Tema\" settings.","example":{"colorPrimary":"#0a7d4f","borderStyle":"rounded"}},"paidAt":{"type":["string","null"]},"expiresAt":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","externalId","status","automaticTax","items","subtotal","ivaRate","ivaAmount","ivaBreakdown","amount","currency","amountVes","exchangeRate","exchangeRateDate","amountPaid","amountRemaining","splits","reference","description","buyerName","buyerEmail","url","iframeUrl","appearance","paidAt","expiresAt","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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":"checkoutSessions-list","summary":"List checkout sessions","tags":["Checkout Sessions"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"status","schema":{"type":"string","enum":["OPEN","PROCESSING","PAID","FAILED","EXPIRED","CANCELED"]}},{"in":"query","name":"page","schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"in":"query","name":"pageSize","schema":{"default":25,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$","example":"cm9x2k4q80001s6v1h3d7e2ab"},"externalId":{"description":"Your id for this session.","example":"ORD-10293","type":["string","null"]},"status":{"type":"string","enum":["OPEN","PROCESSING","PAID","FAILED","EXPIRED","CANCELED"],"description":"`OPEN` until the buyer pays. `PROCESSING` while a bank charge is confirmed: it becomes `PAID`, or goes back to `OPEN` (`EXPIRED` if past `expiresAt`) when the bank rejects it. `PAID`, `EXPIRED` and `CANCELED` are final. `FAILED` is reserved and not used today.","example":"OPEN"},"automaticTax":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false,"description":"Whether UnoPago computed the IVA from your account's settings. `false` when the session was created with your own IVA per line: see `items[].taxes`.","example":{"enabled":true}},"items":{"type":"array","items":{"type":"object","properties":{"productId":{"type":["string","null"]},"description":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount":{"type":"number"},"exento":{"type":"boolean"},"taxes":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"IVA"},"rate":{"type":"number"},"amount":{"type":"number"}},"required":["type","rate","amount"],"additionalProperties":false},"description":"The line's IVA when `automaticTax.enabled` is `false`: the rate you sent, and the line's share of the IVA at that rate. The IVA is kept per rate and shared back over its lines, a leftover cent going to the line whose share was cut the most, so the shares always add up to the rate's `ivaBreakdown` entry. Always empty when UnoPago computes the IVA."}},"required":["productId","description","quantity","amount","exento","taxes"],"additionalProperties":false},"description":"What is sold. A product line carries its product's price, `exento` and IVA rate as they were when the session was created: a later change to the product never reaches it. Without `automaticTax`, a line without `taxes` is `exento: true`.","example":[{"productId":null,"description":"Tuition","quantity":1,"amount":25,"exento":false,"taxes":[]}]},"subtotal":{"type":"number","description":"The items' net total, before discounts and IVA.","example":25},"ivaRate":{"description":"The general IVA rate (`0.16`) when the session carries IVA: a product line is taxed at its product's own rate, which may be another one, and every other non-`exento` line at this one. `null` when the account applies none. Without `automaticTax`, the rate your lines' `taxes` share, or `null` when no line has any or they use more than one: `ivaBreakdown` lists them.","example":0.16,"type":["number","null"]},"ivaAmount":{"type":"number","description":"The IVA the buyer pays: each non-`exento` item's rate on its amount, summed per rate in `ivaBreakdown`, or without `automaticTax`, per rate, the sum of the `taxes[].amount` you sent, or `rate` × the rate's base when you sent none.","example":4},"ivaBreakdown":{"type":"array","items":{"type":"object","properties":{"rate":{"type":"number","example":0.16},"rateBase":{"type":"number","description":"The taxable base the rate applies to, in `currency`.","example":25},"amount":{"type":"number","example":4}},"required":["rate","rateBase","amount"],"additionalProperties":false},"description":"`ivaAmount` per rate, each with its taxable base, highest rate first. When UnoPago computes the IVA, one per rate its lines use; without `automaticTax`, one per distinct `rate` in your lines' `taxes`. Empty when no IVA applies.","example":[{"rate":0.16,"rateBase":25,"amount":4}]},"amount":{"type":"number","description":"What the buyer pays, in `currency`: `subtotal + ivaAmount`, less any discount you add to the order after a first payment.","example":29},"currency":{"type":"string","enum":["VES","USD","EUR"],"example":"USD"},"amountVes":{"type":"number","description":"What the buyer pays in bolívares: `amount` times `exchangeRate`. While the session is `open` it is computed at today's BCV rate, so it changes when a new rate starts. Once a payment claims the session (`processing`, `paid`) it is what that payment charges; once it closes (`expired`, `canceled`) it stays at the rate of the day it closed. Equal to `amount` for `VES`.","example":5234.5},"exchangeRate":{"description":"Bolívares per unit of `currency`. `null` for `VES`.","example":180.5,"type":["number","null"]},"exchangeRateDate":{"description":"The date of the BCV publication `exchangeRate` comes from. `null` for `VES`.","type":["string","null"]},"amountPaid":{"type":"number","description":"What the session has been paid so far, in `currency`, on `amount` (fees not included). A session can be paid in parts, and a payment recorded into its invoice outside the checkout counts too. Still counts what was paid once a partly paid session is canceled.","example":8},"amountRemaining":{"type":"number","description":"`amount` minus `amountPaid`, never below 0, whatever the `status`: read `status` to know whether it can still be paid.","example":21},"splits":{"type":"array","items":{"type":"object","properties":{"vendor":{"type":"string","description":"The vendor's id."},"externalId":{"description":"Your own id for the vendor, when it has one.","example":"rest-42","type":["string","null"]},"amount":{"type":"number","description":"The vendor's part of the order, in `currency`.","example":9},"amountVes":{"description":"The same part in bolívares, at the rate of the payment that paid the session: what UnoPago pays the vendor. `null` until the session is `PAID`.","example":360,"type":["number","null"]}},"required":["vendor","externalId","amount","amountVes"],"additionalProperties":false},"description":"The parts of the order owed to vendors: the `splits` the session was created with, in no particular order. Empty for a session without them."},"reference":{"example":"Order 10293","type":["string","null"]},"description":{"example":"October tuition","type":["string","null"]},"buyerName":{"example":"María Pérez","type":["string","null"]},"buyerEmail":{"example":"maria@example.com","type":["string","null"]},"url":{"type":"string","format":"uri","description":"The hosted checkout page. Send the buyer here, or use `iframeUrl` to embed the form on your site."},"iframeUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}],"description":"A form-only version of the checkout, for an `<iframe>` on one of the origins sent in `iframeAllowedOrigins`. `null` when the session has no allowlist. The URL is signed: don't change it. See the API guide's \"Embedding the checkout\" section for the `postMessage` events.","example":"https://checkout.unopago.com/embed/pay/6Xo1...?payload=eyJ2Ijox...&sig=..."},"appearance":{"anyOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["light","dark"]},"colorPrimary":{"type":"string","pattern":"^#[0-9A-F]{6}$"},"saturation":{"type":"integer","minimum":0,"maximum":100},"lightness":{"type":"integer","minimum":0,"maximum":100},"borderStyle":{"type":"string","enum":["square","soft","medium","rounded"]},"showMerchantName":{"type":"boolean"},"showTotal":{"type":"boolean"}},"additionalProperties":false},{"type":"null"}],"description":"The `appearance` the session was created with. `null` when it was created without one: the checkout uses the account's \"Tema\" settings.","example":{"colorPrimary":"#0a7d4f","borderStyle":"rounded"}},"paidAt":{"type":["string","null"]},"expiresAt":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","externalId","status","automaticTax","items","subtotal","ivaRate","ivaAmount","ivaBreakdown","amount","currency","amountVes","exchangeRate","exchangeRateDate","amountPaid","amountRemaining","splits","reference","description","buyerName","buyerEmail","url","iframeUrl","appearance","paidAt","expiresAt","createdAt","updatedAt"],"additionalProperties":false}},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pageSize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["results","total","page","pageSize","totalPages"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/checkout-sessions/{id}":{"get":{"operationId":"checkoutSessions-get","summary":"Get a checkout session","tags":["Checkout Sessions"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$","example":"cm9x2k4q80001s6v1h3d7e2ab"},"externalId":{"description":"Your id for this session.","example":"ORD-10293","type":["string","null"]},"status":{"type":"string","enum":["OPEN","PROCESSING","PAID","FAILED","EXPIRED","CANCELED"],"description":"`OPEN` until the buyer pays. `PROCESSING` while a bank charge is confirmed: it becomes `PAID`, or goes back to `OPEN` (`EXPIRED` if past `expiresAt`) when the bank rejects it. `PAID`, `EXPIRED` and `CANCELED` are final. `FAILED` is reserved and not used today.","example":"OPEN"},"automaticTax":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false,"description":"Whether UnoPago computed the IVA from your account's settings. `false` when the session was created with your own IVA per line: see `items[].taxes`.","example":{"enabled":true}},"items":{"type":"array","items":{"type":"object","properties":{"productId":{"type":["string","null"]},"description":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount":{"type":"number"},"exento":{"type":"boolean"},"taxes":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"IVA"},"rate":{"type":"number"},"amount":{"type":"number"}},"required":["type","rate","amount"],"additionalProperties":false},"description":"The line's IVA when `automaticTax.enabled` is `false`: the rate you sent, and the line's share of the IVA at that rate. The IVA is kept per rate and shared back over its lines, a leftover cent going to the line whose share was cut the most, so the shares always add up to the rate's `ivaBreakdown` entry. Always empty when UnoPago computes the IVA."}},"required":["productId","description","quantity","amount","exento","taxes"],"additionalProperties":false},"description":"What is sold. A product line carries its product's price, `exento` and IVA rate as they were when the session was created: a later change to the product never reaches it. Without `automaticTax`, a line without `taxes` is `exento: true`.","example":[{"productId":null,"description":"Tuition","quantity":1,"amount":25,"exento":false,"taxes":[]}]},"subtotal":{"type":"number","description":"The items' net total, before discounts and IVA.","example":25},"ivaRate":{"description":"The general IVA rate (`0.16`) when the session carries IVA: a product line is taxed at its product's own rate, which may be another one, and every other non-`exento` line at this one. `null` when the account applies none. Without `automaticTax`, the rate your lines' `taxes` share, or `null` when no line has any or they use more than one: `ivaBreakdown` lists them.","example":0.16,"type":["number","null"]},"ivaAmount":{"type":"number","description":"The IVA the buyer pays: each non-`exento` item's rate on its amount, summed per rate in `ivaBreakdown`, or without `automaticTax`, per rate, the sum of the `taxes[].amount` you sent, or `rate` × the rate's base when you sent none.","example":4},"ivaBreakdown":{"type":"array","items":{"type":"object","properties":{"rate":{"type":"number","example":0.16},"rateBase":{"type":"number","description":"The taxable base the rate applies to, in `currency`.","example":25},"amount":{"type":"number","example":4}},"required":["rate","rateBase","amount"],"additionalProperties":false},"description":"`ivaAmount` per rate, each with its taxable base, highest rate first. When UnoPago computes the IVA, one per rate its lines use; without `automaticTax`, one per distinct `rate` in your lines' `taxes`. Empty when no IVA applies.","example":[{"rate":0.16,"rateBase":25,"amount":4}]},"amount":{"type":"number","description":"What the buyer pays, in `currency`: `subtotal + ivaAmount`, less any discount you add to the order after a first payment.","example":29},"currency":{"type":"string","enum":["VES","USD","EUR"],"example":"USD"},"amountVes":{"type":"number","description":"What the buyer pays in bolívares: `amount` times `exchangeRate`. While the session is `open` it is computed at today's BCV rate, so it changes when a new rate starts. Once a payment claims the session (`processing`, `paid`) it is what that payment charges; once it closes (`expired`, `canceled`) it stays at the rate of the day it closed. Equal to `amount` for `VES`.","example":5234.5},"exchangeRate":{"description":"Bolívares per unit of `currency`. `null` for `VES`.","example":180.5,"type":["number","null"]},"exchangeRateDate":{"description":"The date of the BCV publication `exchangeRate` comes from. `null` for `VES`.","type":["string","null"]},"amountPaid":{"type":"number","description":"What the session has been paid so far, in `currency`, on `amount` (fees not included). A session can be paid in parts, and a payment recorded into its invoice outside the checkout counts too. Still counts what was paid once a partly paid session is canceled.","example":8},"amountRemaining":{"type":"number","description":"`amount` minus `amountPaid`, never below 0, whatever the `status`: read `status` to know whether it can still be paid.","example":21},"splits":{"type":"array","items":{"type":"object","properties":{"vendor":{"type":"string","description":"The vendor's id."},"externalId":{"description":"Your own id for the vendor, when it has one.","example":"rest-42","type":["string","null"]},"amount":{"type":"number","description":"The vendor's part of the order, in `currency`.","example":9},"amountVes":{"description":"The same part in bolívares, at the rate of the payment that paid the session: what UnoPago pays the vendor. `null` until the session is `PAID`.","example":360,"type":["number","null"]}},"required":["vendor","externalId","amount","amountVes"],"additionalProperties":false},"description":"The parts of the order owed to vendors: the `splits` the session was created with, in no particular order. Empty for a session without them."},"reference":{"example":"Order 10293","type":["string","null"]},"description":{"example":"October tuition","type":["string","null"]},"buyerName":{"example":"María Pérez","type":["string","null"]},"buyerEmail":{"example":"maria@example.com","type":["string","null"]},"url":{"type":"string","format":"uri","description":"The hosted checkout page. Send the buyer here, or use `iframeUrl` to embed the form on your site."},"iframeUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}],"description":"A form-only version of the checkout, for an `<iframe>` on one of the origins sent in `iframeAllowedOrigins`. `null` when the session has no allowlist. The URL is signed: don't change it. See the API guide's \"Embedding the checkout\" section for the `postMessage` events.","example":"https://checkout.unopago.com/embed/pay/6Xo1...?payload=eyJ2Ijox...&sig=..."},"appearance":{"anyOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["light","dark"]},"colorPrimary":{"type":"string","pattern":"^#[0-9A-F]{6}$"},"saturation":{"type":"integer","minimum":0,"maximum":100},"lightness":{"type":"integer","minimum":0,"maximum":100},"borderStyle":{"type":"string","enum":["square","soft","medium","rounded"]},"showMerchantName":{"type":"boolean"},"showTotal":{"type":"boolean"}},"additionalProperties":false},{"type":"null"}],"description":"The `appearance` the session was created with. `null` when it was created without one: the checkout uses the account's \"Tema\" settings.","example":{"colorPrimary":"#0a7d4f","borderStyle":"rounded"}},"paidAt":{"type":["string","null"]},"expiresAt":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","externalId","status","automaticTax","items","subtotal","ivaRate","ivaAmount","ivaBreakdown","amount","currency","amountVes","exchangeRate","exchangeRateDate","amountPaid","amountRemaining","splits","reference","description","buyerName","buyerEmail","url","iframeUrl","appearance","paidAt","expiresAt","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/checkout-sessions/{id}/cancel":{"post":{"operationId":"checkoutSessions-cancel","summary":"Cancel an open checkout session","tags":["Checkout Sessions"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$","example":"cm9x2k4q80001s6v1h3d7e2ab"},"externalId":{"description":"Your id for this session.","example":"ORD-10293","type":["string","null"]},"status":{"type":"string","enum":["OPEN","PROCESSING","PAID","FAILED","EXPIRED","CANCELED"],"description":"`OPEN` until the buyer pays. `PROCESSING` while a bank charge is confirmed: it becomes `PAID`, or goes back to `OPEN` (`EXPIRED` if past `expiresAt`) when the bank rejects it. `PAID`, `EXPIRED` and `CANCELED` are final. `FAILED` is reserved and not used today.","example":"OPEN"},"automaticTax":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false,"description":"Whether UnoPago computed the IVA from your account's settings. `false` when the session was created with your own IVA per line: see `items[].taxes`.","example":{"enabled":true}},"items":{"type":"array","items":{"type":"object","properties":{"productId":{"type":["string","null"]},"description":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount":{"type":"number"},"exento":{"type":"boolean"},"taxes":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"IVA"},"rate":{"type":"number"},"amount":{"type":"number"}},"required":["type","rate","amount"],"additionalProperties":false},"description":"The line's IVA when `automaticTax.enabled` is `false`: the rate you sent, and the line's share of the IVA at that rate. The IVA is kept per rate and shared back over its lines, a leftover cent going to the line whose share was cut the most, so the shares always add up to the rate's `ivaBreakdown` entry. Always empty when UnoPago computes the IVA."}},"required":["productId","description","quantity","amount","exento","taxes"],"additionalProperties":false},"description":"What is sold. A product line carries its product's price, `exento` and IVA rate as they were when the session was created: a later change to the product never reaches it. Without `automaticTax`, a line without `taxes` is `exento: true`.","example":[{"productId":null,"description":"Tuition","quantity":1,"amount":25,"exento":false,"taxes":[]}]},"subtotal":{"type":"number","description":"The items' net total, before discounts and IVA.","example":25},"ivaRate":{"description":"The general IVA rate (`0.16`) when the session carries IVA: a product line is taxed at its product's own rate, which may be another one, and every other non-`exento` line at this one. `null` when the account applies none. Without `automaticTax`, the rate your lines' `taxes` share, or `null` when no line has any or they use more than one: `ivaBreakdown` lists them.","example":0.16,"type":["number","null"]},"ivaAmount":{"type":"number","description":"The IVA the buyer pays: each non-`exento` item's rate on its amount, summed per rate in `ivaBreakdown`, or without `automaticTax`, per rate, the sum of the `taxes[].amount` you sent, or `rate` × the rate's base when you sent none.","example":4},"ivaBreakdown":{"type":"array","items":{"type":"object","properties":{"rate":{"type":"number","example":0.16},"rateBase":{"type":"number","description":"The taxable base the rate applies to, in `currency`.","example":25},"amount":{"type":"number","example":4}},"required":["rate","rateBase","amount"],"additionalProperties":false},"description":"`ivaAmount` per rate, each with its taxable base, highest rate first. When UnoPago computes the IVA, one per rate its lines use; without `automaticTax`, one per distinct `rate` in your lines' `taxes`. Empty when no IVA applies.","example":[{"rate":0.16,"rateBase":25,"amount":4}]},"amount":{"type":"number","description":"What the buyer pays, in `currency`: `subtotal + ivaAmount`, less any discount you add to the order after a first payment.","example":29},"currency":{"type":"string","enum":["VES","USD","EUR"],"example":"USD"},"amountVes":{"type":"number","description":"What the buyer pays in bolívares: `amount` times `exchangeRate`. While the session is `open` it is computed at today's BCV rate, so it changes when a new rate starts. Once a payment claims the session (`processing`, `paid`) it is what that payment charges; once it closes (`expired`, `canceled`) it stays at the rate of the day it closed. Equal to `amount` for `VES`.","example":5234.5},"exchangeRate":{"description":"Bolívares per unit of `currency`. `null` for `VES`.","example":180.5,"type":["number","null"]},"exchangeRateDate":{"description":"The date of the BCV publication `exchangeRate` comes from. `null` for `VES`.","type":["string","null"]},"amountPaid":{"type":"number","description":"What the session has been paid so far, in `currency`, on `amount` (fees not included). A session can be paid in parts, and a payment recorded into its invoice outside the checkout counts too. Still counts what was paid once a partly paid session is canceled.","example":8},"amountRemaining":{"type":"number","description":"`amount` minus `amountPaid`, never below 0, whatever the `status`: read `status` to know whether it can still be paid.","example":21},"splits":{"type":"array","items":{"type":"object","properties":{"vendor":{"type":"string","description":"The vendor's id."},"externalId":{"description":"Your own id for the vendor, when it has one.","example":"rest-42","type":["string","null"]},"amount":{"type":"number","description":"The vendor's part of the order, in `currency`.","example":9},"amountVes":{"description":"The same part in bolívares, at the rate of the payment that paid the session: what UnoPago pays the vendor. `null` until the session is `PAID`.","example":360,"type":["number","null"]}},"required":["vendor","externalId","amount","amountVes"],"additionalProperties":false},"description":"The parts of the order owed to vendors: the `splits` the session was created with, in no particular order. Empty for a session without them."},"reference":{"example":"Order 10293","type":["string","null"]},"description":{"example":"October tuition","type":["string","null"]},"buyerName":{"example":"María Pérez","type":["string","null"]},"buyerEmail":{"example":"maria@example.com","type":["string","null"]},"url":{"type":"string","format":"uri","description":"The hosted checkout page. Send the buyer here, or use `iframeUrl` to embed the form on your site."},"iframeUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}],"description":"A form-only version of the checkout, for an `<iframe>` on one of the origins sent in `iframeAllowedOrigins`. `null` when the session has no allowlist. The URL is signed: don't change it. See the API guide's \"Embedding the checkout\" section for the `postMessage` events.","example":"https://checkout.unopago.com/embed/pay/6Xo1...?payload=eyJ2Ijox...&sig=..."},"appearance":{"anyOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["light","dark"]},"colorPrimary":{"type":"string","pattern":"^#[0-9A-F]{6}$"},"saturation":{"type":"integer","minimum":0,"maximum":100},"lightness":{"type":"integer","minimum":0,"maximum":100},"borderStyle":{"type":"string","enum":["square","soft","medium","rounded"]},"showMerchantName":{"type":"boolean"},"showTotal":{"type":"boolean"}},"additionalProperties":false},{"type":"null"}],"description":"The `appearance` the session was created with. `null` when it was created without one: the checkout uses the account's \"Tema\" settings.","example":{"colorPrimary":"#0a7d4f","borderStyle":"rounded"}},"paidAt":{"type":["string","null"]},"expiresAt":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","externalId","status","automaticTax","items","subtotal","ivaRate","ivaAmount","ivaBreakdown","amount","currency","amountVes","exchangeRate","exchangeRateDate","amountPaid","amountRemaining","splits","reference","description","buyerName","buyerEmail","url","iframeUrl","appearance","paidAt","expiresAt","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/customers/{customerId}":{"get":{"operationId":"customers-getCustomerById","summary":"Get a customer by id","description":"This API is used to get a customer by id","tags":["Customers"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"customerId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerDetail"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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"}}}}}},"put":{"operationId":"customers-updateCustomer","summary":"Update a customer","description":"This API is used to update a customer","tags":["Customers"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"customerId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"externalId":{"type":["string","null"]},"firstName":{"type":"string","minLength":1,"maxLength":50},"lastName":{"type":"string","maxLength":50},"email":{"anyOf":[{"type":"string","maxLength":128,"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"}]},"phoneNumber":{"anyOf":[{"type":"string","pattern":"^(?:[01]\\d{3}-?\\d{7}|\\+58(?!0)\\d{3}-?\\d{7}|\\+(?!58)\\d{1,3}\\d{3}-?\\d{7})$"},{"type":"null"}]},"address":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"nationalId":{"anyOf":[{"type":"string","minLength":2,"maxLength":10,"pattern":"^[JVEGP]"},{"type":"null"}]},"syncActive":{"type":"boolean"}},"required":["firstName","lastName"],"description":"Input for updating a customer"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedCustomer"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/customers/external-id/{externalId}":{"get":{"operationId":"customers-getCustomerByExternalId","summary":"Get a customer by its external id","description":"Returns the customer whose current external id is exactly `externalId`. The match is exact: a cédula or RIF finds the customer only if it is that customer's external id.","tags":["Customers"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"externalId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/customers":{"get":{"operationId":"customers-getPaginatedCustomers","summary":"Get all customers","description":"This API is used to get all customers. It supports pagination","tags":["Customers"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":100,"type":"number","maximum":250}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"externalId":{"type":["string","null"]},"mainContactId":{"type":["string","null"]},"nationalId":{"type":["string","null"]},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"address":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"tags":{"type":"array","items":{"type":"object","properties":{"entityTypes":{"type":"array","items":{"type":"string","enum":["CUSTOMER","INVOICE","INVOICE_ITEM","SUBSCRIPTION","PLAN","PAYMENT","STUDENT","CONTACT","BANK_ACCOUNT","TRANSACTION_FILE","ENROLLMENT"]}},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"name":{"type":"string"},"emoji":{"type":["string","null"]},"color":{"type":["string","null"]},"description":{"type":["string","null"]},"isActive":{"type":"boolean"},"sortOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"deletedAt":{"type":["string","null"]}},"required":["entityTypes","id","accountId","name","emoji","color","description","isActive","sortOrder","createdAt","updatedAt","deletedAt"],"additionalProperties":false}},"syncedFrom":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","accountId","externalId","mainContactId","nationalId","firstName","lastName","email","phoneNumber","address","createdAt","updatedAt","tags","syncedFrom"],"additionalProperties":false}},"total":{"type":"number"},"totalPages":{"type":"number"},"nextCursor":{"description":"The cursor to get the next page of results","type":["string","null"]},"exchangeRates":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"rate":{"type":"number"},"rateDate":{"type":"string"},"daysAhead":{"type":"number"}},"required":["rate","rateDate","daysAhead"],"additionalProperties":false}}},"required":["results","total","totalPages"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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"}}}}}},"post":{"operationId":"customers-createCustomer","summary":"Create a customer","description":"This API is used to create a customer ","tags":["Customers"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"externalId":{"type":"string"},"firstName":{"type":"string","minLength":1,"maxLength":50},"lastName":{"type":"string","maxLength":50},"email":{"type":"string","maxLength":128,"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,}$"},"phoneNumber":{"type":"string","pattern":"^(?:[01]\\d{3}-?\\d{7}|\\+58(?!0)\\d{3}-?\\d{7}|\\+(?!58)\\d{1,3}\\d{3}-?\\d{7})$"},"address":{"type":"string","minLength":1,"maxLength":200},"nationalId":{"type":"string","minLength":2,"maxLength":10,"pattern":"^[JVEGP]"},"students":{"type":"array","items":{"type":"object","properties":{"firstName":{"type":"string","minLength":1,"maxLength":50},"customerId":{"anyOf":[{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},{"type":"null"}]},"lastName":{"type":"string","maxLength":50},"nationalId":{"anyOf":[{"type":"string","minLength":2,"maxLength":13,"pattern":"^(CE|[JVEGP])"},{"type":"null"}]},"nationality":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"gender":{"type":"string","enum":["MALE","FEMALE","OTHER"]},"dateOfBirth":{"type":["string","null"]},"enrollmentYear":{"anyOf":[{"type":"string","pattern":"^\\d{4}$"},{"type":"null"}]},"promoYear":{"anyOf":[{"type":"string","pattern":"^\\d{4}$"},{"type":"null"}]},"gradeId":{"anyOf":[{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},{"type":"null"}]},"sectionId":{"anyOf":[{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},{"type":"null"}]},"birthPlace":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"clothingSize":{"anyOf":[{"type":"string","enum":["XS","S","M","L","XL","XXL"]},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":128,"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"}]},"phoneNumber":{"anyOf":[{"type":"string","pattern":"^(?:[01]\\d{3}-?\\d{7}|\\+58(?!0)\\d{3}-?\\d{7}|\\+(?!58)\\d{1,3}\\d{3}-?\\d{7})$"},{"type":"null"}]},"externalId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"active":{"default":true,"type":"boolean"},"customerExternalId":{"type":["string","null"]}},"required":["firstName","lastName","gender"]}},"createContactInvite":{"default":false,"type":"boolean"}},"required":["firstName","lastName"],"description":"Input for creating a new customer"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedCustomer"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/customers/{customerId}/invoices":{"get":{"operationId":"customers-getCustomerInvoices","summary":"Get customer invoices","description":"This API is used to get a customer invoices","tags":["Customers"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"customerId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true},{"in":"query","name":"invoiceStatus","schema":{"minItems":1,"type":"array","items":{"type":"string","enum":["DRAFT","UNPAID","OVERDUE","PENDING","PARTIAL","PAID","VOIDED"]}},"required":true},{"in":"query","name":"isPrinted","schema":{"type":"boolean"}},{"in":"query","name":"search","schema":{"type":"string","maxLength":120}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":10,"type":"number","maximum":100}},{"in":"query","name":"sortKey","schema":{"default":"dueDate","type":"string","enum":["issueDate","dueDate","updatedAt"]}},{"in":"query","name":"sortDirection","schema":{"default":"desc","type":"string","enum":["asc","desc"]}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"lateFeeType":{"anyOf":[{"type":"string","enum":["PERCENTAGE","FIXED"]},{"type":"null"}]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"pricingMode":{"type":"string","enum":["CURRENCY","REFERENCE"]},"status":{"type":"string","enum":["DRAFT","UNPAID","OVERDUE","PENDING","PARTIAL","PAID","VOIDED"]},"source":{"type":"string","enum":["STANDARD","KIOSK","ONBOARDING","CHECKOUT"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"externalId":{"type":["string","null"]},"accountId":{"type":"string"},"customerId":{"type":["string","null"]},"printJobId":{"type":["string","null"]},"fiscalRecordId":{"type":["string","null"]},"billingDetailsId":{"type":["string","null"]},"description":{"type":["string","null"]},"issueDate":{"type":"string"},"dueDate":{"type":["string","null"]},"expired":{"type":"boolean"},"paidAt":{"type":["string","null"]},"voidedAt":{"type":["string","null"]},"planDate":{"type":["string","null"]},"billingRunKey":{"type":["string","null"]},"lateFee":{"type":["number","null"]},"fiscalInvoicing":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"details":{"type":"object","properties":{"invoiceItems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"description":{"type":"string"},"exento":{"type":"boolean"},"quantity":{"type":"number"},"unitPrice":{"type":"number"},"total":{"type":"number"},"totalWithDiscount":{"type":"number"},"discount":{"type":["number","null"]}},"required":["id","description","exento","quantity","unitPrice","total","totalWithDiscount","discount"],"additionalProperties":false}},"feesTotals":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["IGTF","IVA","PROCESSING_FEE"]},"rateBase":{"type":"number"},"rate":{"type":"number"},"total":{"type":"number"}},"required":["type","rateBase","rate","total"],"additionalProperties":false}},"subTotal":{"type":"number"},"lateFee":{"type":"number"},"total":{"type":"number"},"discountTotal":{"type":"number"},"discounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"amount":{"type":"number"},"description":{"type":"string"}},"required":["id","amount","description"],"additionalProperties":false}},"paymentCredits":{"description":"Total payments applied to the invoice","type":"number"},"transactionBalance":{"description":"Invoice balance due","type":"number"}},"required":["invoiceItems","feesTotals","subTotal","lateFee","total","discountTotal","discounts","paymentCredits","transactionBalance"],"additionalProperties":false},"items":{"type":"array","items":{"type":"object","properties":{"discountValueType":{"anyOf":[{"type":"string","enum":["PERCENTAGE","FIXED"]},{"type":"null"}]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"invoiceId":{"type":"string"},"productId":{"type":["string","null"]},"studentId":{"type":["string","null"]},"description":{"type":"string"},"amount":{"type":"number"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"exento":{"type":"boolean"},"isService":{"type":"boolean"},"subscriptionId":{"type":["string","null"]},"ivaRatePercent":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"discountValue":{"type":["number","null"]},"discountExpiresAt":{"type":["string","null"]},"discountExpired":{"type":["boolean","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["discountValueType","id","accountId","invoiceId","productId","studentId","description","amount","quantity","exento","isService","subscriptionId","ivaRatePercent","discountValue","discountExpiresAt","discountExpired","createdAt","updatedAt"],"additionalProperties":false}},"discounts":{"type":"array","items":{"type":"object","properties":{"valueType":{"type":"string","enum":["PERCENTAGE","FIXED"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"invoiceId":{"type":"string"},"fromPaymentId":{"type":["string","null"]},"description":{"type":"string"},"value":{"type":"number"},"expiresAt":{"type":["string","null"]},"expired":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["valueType","id","accountId","invoiceId","fromPaymentId","description","value","expiresAt","expired","createdAt","updatedAt"],"additionalProperties":false}},"transactions":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["ITEMS","DISCOUNT","LATE_FEE","IVA","IGTF","PROCESSING_FEE","PAYMENT","REFUND","RETENTION","EXCHANGE_DIFFERENCE","ADJUSTMENT"]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"customerId":{"type":"string"},"invoiceId":{"type":"string"},"statementId":{"type":["string","null"]},"description":{"type":"string"},"transactionDate":{"type":"string"},"exchangeRate":{"type":"number"},"rateDate":{"type":"string"},"credit":{"type":"number"},"debit":{"type":"number"},"paymentId":{"type":["string","null"]},"fromPaymentId":{"type":["string","null"]},"retentionId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["kind","currency","id","accountId","customerId","invoiceId","statementId","description","transactionDate","exchangeRate","rateDate","credit","debit","paymentId","fromPaymentId","retentionId","createdAt","updatedAt"],"additionalProperties":false}},"fees":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["IGTF","IVA","PROCESSING_FEE"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"invoiceId":{"type":"string"},"fromPaymentId":{"type":["string","null"]},"amount":{"type":"number"},"rate":{"type":"number"},"rateBase":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["type","id","accountId","invoiceId","fromPaymentId","amount","rate","rateBase","createdAt","updatedAt"],"additionalProperties":false}},"invoiceSequence":{"type":["string","null"]},"fiscalInvoice":{"anyOf":[{"$ref":"#/components/schemas/FiscalInvoice"},{"type":"null"}]}},"required":["lateFeeType","currency","pricingMode","status","source","id","externalId","accountId","customerId","printJobId","fiscalRecordId","billingDetailsId","description","issueDate","dueDate","expired","paidAt","voidedAt","planDate","billingRunKey","lateFee","fiscalInvoicing","createdAt","updatedAt","details","items","discounts","transactions","fees","fiscalInvoice"],"additionalProperties":false}},"total":{"type":"number"},"totalPages":{"type":"number"},"nextCursor":{"description":"The cursor to get the next page of results","type":["string","null"]},"exchangeRates":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"rate":{"type":"number"},"rateDate":{"type":"string"},"daysAhead":{"type":"number"}},"required":["rate","rateDate","daysAhead"],"additionalProperties":false}}},"required":["results","total","totalPages"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/customers/{customerId}/payments":{"get":{"operationId":"customers-getCustomerPayments","summary":"Get a customer payments","description":"This API is used to get a customer payments","tags":["Customers","Payments"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"customerId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":10,"type":"number","maximum":100}},{"in":"query","name":"search","schema":{"type":"string","maxLength":120}},{"in":"query","name":"sortKey","schema":{"default":"transactionDate","type":"string","enum":["transactionDate","amount"]}},{"in":"query","name":"sortDirection","schema":{"default":"desc","type":"string","enum":["asc","desc"]}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","enum":["VES","USD","EUR"]},"receiverBankName":{"anyOf":[{"type":"string","enum":["A100BANCO","BANCAMIGA","BANCARIBE","BANESCO","BDV","BFC","BNC","MERCANTIL","PROVINCIAL","BANCO_DEL_TESORO","BANCO_PLAZA","SOFITASA","BANCO_ACTIVO","BANCO_AGRICOLA","BANCO_BICENTENARIO","BANCO_CARONI","BANCO_EXTERIOR","BANCRECER","BANFANB","BANGENTE","BANPLUS","DELSUR","R4","VENEZOLANO_DE_CREDITO","BANK_OF_AMERICA","AMERANT_BANK","US_BANK","WELLS_FARGO","BINANCE"]},{"type":"null"}]},"method":{"type":"string","enum":["BANK_TRANSFER","ZELLE","C2P","IMMEDIATE_DEBIT","P2P","CASH","POS","CUSTOMER_CREDIT","STRIPE_ACH","STRIPE_CARD","DEBIT_CARD","PAYROLL","BINANCE_PAY","LEDGER_FEE"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"customerId":{"type":"string"},"amount":{"type":"number"},"transactionDate":{"type":"string"},"rateDate":{"type":["string","null"]},"referenceCode":{"type":["string","null"]},"externalId":{"type":["string","null"]},"receiverBankHolderName":{"type":["string","null"]},"receiverBankNationalId":{"type":["string","null"]},"customerFullName":{"type":["string","null"]},"customerNationalId":{"type":["string","null"]},"customerPhoneNumber":{"type":["string","null"]},"customerBankAccountNumber":{"type":["string","null"]},"customerEmail":{"type":["string","null"]},"customerNote":{"type":["string","null"]},"customerIpAddress":{"type":["string","null"]},"customerUserAgent":{"type":["string","null"]},"isAutoPay":{"type":"boolean"},"bankAccountId":{"type":["string","null"]},"paymentClaimId":{"type":["string","null"]},"bankTransactionId":{"type":["string","null"]},"createdById":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"splitAmount":{"type":["number","null"]},"paymentTransactions":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["ITEMS","DISCOUNT","LATE_FEE","IVA","IGTF","PROCESSING_FEE","PAYMENT","REFUND","RETENTION","EXCHANGE_DIFFERENCE","ADJUSTMENT"]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"customerId":{"type":"string"},"invoiceId":{"type":"string"},"statementId":{"type":["string","null"]},"description":{"type":"string"},"transactionDate":{"type":"string"},"exchangeRate":{"type":"number"},"rateDate":{"type":"string"},"credit":{"type":"number"},"debit":{"type":"number"},"paymentId":{"type":["string","null"]},"fromPaymentId":{"type":["string","null"]},"retentionId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["kind","currency","id","accountId","customerId","invoiceId","statementId","description","transactionDate","exchangeRate","rateDate","credit","debit","paymentId","fromPaymentId","retentionId","createdAt","updatedAt"],"additionalProperties":false}},"bankTransaction":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","enum":["MERCANTIL_WEBHOOK","BNC_WEBHOOK","MERCANTIL_API","BNC_API","BANESCO_API","PLAZA_API","BINANCE_API","C2P","STRIPE_ACH","TRANSACTION_FILE","FORCE_PAYMENT","MANUAL","API"]},"bankName":{"type":"string","enum":["A100BANCO","BANCAMIGA","BANCARIBE","BANESCO","BDV","BFC","BNC","MERCANTIL","PROVINCIAL","BANCO_DEL_TESORO","BANCO_PLAZA","SOFITASA","BANCO_ACTIVO","BANCO_AGRICOLA","BANCO_BICENTENARIO","BANCO_CARONI","BANCO_EXTERIOR","BANCRECER","BANFANB","BANGENTE","BANPLUS","DELSUR","R4","VENEZOLANO_DE_CREDITO","BANK_OF_AMERICA","AMERANT_BANK","US_BANK","WELLS_FARGO","BINANCE"]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"asset":{"anyOf":[{"type":"string","enum":["USDT","USDC"]},{"type":"null"}]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"bankAccountId":{"type":"string"},"transactionFileId":{"type":["string","null"]},"paymentClaimId":{"type":["string","null"]},"bncWebhookPaymentEventId":{"type":["string","null"]},"mercantilWebhookPaymentEventId":{"type":["string","null"]},"duplicationKey":{"type":["string","null"]},"amount":{"type":"number"},"date":{"type":"string"},"description":{"type":"string"},"referenceCode":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["source","bankName","currency","asset","id","accountId","bankAccountId","transactionFileId","paymentClaimId","bncWebhookPaymentEventId","mercantilWebhookPaymentEventId","duplicationKey","amount","date","description","referenceCode","createdAt","updatedAt"],"additionalProperties":false},{"type":"null"}]},"paymentAttachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"paymentId":{"type":["string","null"]},"paymentClaimId":{"type":["string","null"]},"customerTransactionId":{"type":["string","null"]},"fileName":{"type":"string"},"contentType":{"type":"string"},"attachmentUrl":{"type":"string"},"uploadedByCustomer":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","accountId","paymentId","paymentClaimId","customerTransactionId","fileName","contentType","attachmentUrl","uploadedByCustomer","createdAt","updatedAt"],"additionalProperties":false}}},"required":["currency","receiverBankName","method","id","accountId","customerId","amount","transactionDate","rateDate","referenceCode","externalId","receiverBankHolderName","receiverBankNationalId","customerFullName","customerNationalId","customerPhoneNumber","customerBankAccountNumber","customerEmail","customerNote","customerIpAddress","customerUserAgent","isAutoPay","bankAccountId","paymentClaimId","bankTransactionId","createdById","createdAt","updatedAt","splitAmount","paymentTransactions","bankTransaction","paymentAttachments"],"additionalProperties":false}},"total":{"type":"number"},"totalPages":{"type":"number"},"nextCursor":{"description":"The cursor to get the next page of results","type":["string","null"]},"exchangeRates":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"rate":{"type":"number"},"rateDate":{"type":"string"},"daysAhead":{"type":"number"}},"required":["rate","rateDate","daysAhead"],"additionalProperties":false}}},"required":["results","total","totalPages"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/customers/{customerId}/subscriptions":{"get":{"operationId":"customers-getCustomerSubscriptions","summary":"Get customer subscriptions","description":"This API is used to get customer subscriptions","tags":["Customers"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"customerId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true},{"in":"query","name":"planId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string","enum":["ACTIVE","INACTIVE"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"customerId":{"type":"string"},"planId":{"type":"string"},"externalId":{"type":["string","null"]},"name":{"type":"string"},"startDate":{"type":"string"},"endDate":{"type":["string","null"]},"nextBillingDate":{"type":["string","null"]},"studentId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"plan":{"type":"object","properties":{"schedule":{"type":"string","enum":["SUBSCRIPTION_START","PLAN_DATES"]},"billingCycle":{"anyOf":[{"type":"string","enum":["WEEKLY","BIWEEKLY","MONTHLY","QUARTERLY","SEMESTER","ANNUAL"]},{"type":"null"}]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"pricingMode":{"type":"string","enum":["CURRENCY","REFERENCE"]},"status":{"type":"string","enum":["ACTIVE","INACTIVE"]},"lateFeeType":{"anyOf":[{"type":"string","enum":["PERCENTAGE","FIXED"]},{"type":"null"}]},"discountValueType":{"anyOf":[{"type":"string","enum":["PERCENTAGE","FIXED"]},{"type":"null"}]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"price":{"type":"number"},"advanceBillingDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"advanceDueDateDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"startDate":{"type":"string"},"endDate":{"type":["string","null"]},"lateFee":{"type":["number","null"]},"discountValue":{"type":["number","null"]},"discountExpiresIn":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"singleInvoicePerSubscription":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["schedule","billingCycle","currency","pricingMode","status","lateFeeType","discountValueType","id","accountId","name","description","price","advanceBillingDays","advanceDueDateDays","startDate","endDate","lateFee","discountValue","discountExpiresIn","singleInvoicePerSubscription","createdAt","updatedAt"],"additionalProperties":false}},"required":["status","id","accountId","customerId","planId","externalId","name","startDate","endDate","nextBillingDate","studentId","createdAt","updatedAt","plan"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/customers/{customerId}/students":{"get":{"operationId":"customers-getStudents","summary":"Get students by customer id","description":"This API is used to get students by customer id","tags":["Students"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"customerId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StudentWithSyncSource"}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/customers/{customerId}/contacts/invite":{"post":{"operationId":"customers-createCustomerContactInvitation","summary":"Invite contact to a customer","description":"Invites a contact to be associated with a customer.","tags":["Customers"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"customerId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":128,"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,}$"},"phoneNumber":{"type":"string","pattern":"^(?:[01]\\d{3}-?\\d{7}|\\+58(?!0)\\d{3}-?\\d{7}|\\+(?!58)\\d{1,3}\\d{3}-?\\d{7})$"},"role":{"type":"string","enum":["PARENT","FAMILY","GUARDIAN","PAYER"]},"notificationMethod":{"default":"WHATSAPP","type":"string","enum":["WHATSAPP","SMS"]}},"required":["phoneNumber","role"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["PARENT","FAMILY","GUARDIAN","PAYER"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"customerId":{"type":"string"},"accountId":{"type":"string"},"email":{"type":["string","null"]},"phoneNumber":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["role","id","customerId","accountId","email","phoneNumber","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/customers/contacts/invite/{contactInviteId}":{"delete":{"operationId":"customers-deleteCustomerContactInvite","summary":"Delete invite from a contact","description":"Delete invite from a contact.","tags":["Customers"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"contactInviteId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/customers/{customerId}/contact/{contactId}":{"delete":{"operationId":"customers-unlinkCustomerContact","summary":"Delete the relation between a contact and a customer","description":"Delete the relation between a customer and a contact.","tags":["Customers"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"customerId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true},{"in":"path","name":"contactId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/imports/people/preview":{"post":{"operationId":"imports-previewPeopleImport","summary":"Preview a people import","description":"Resolves customers and students against the account without writing, and returns what the import would create and what it would leave out.","tags":["Imports"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customers":{"default":[],"maxItems":1000,"type":"array","items":{"type":"object","properties":{"externalId":{"type":"string"},"firstName":{"type":"string","minLength":1,"maxLength":50},"lastName":{"type":"string","maxLength":50},"email":{"type":"string","maxLength":128,"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,}$"},"phoneNumber":{"type":"string","pattern":"^(?:[01]\\d{3}-?\\d{7}|\\+58(?!0)\\d{3}-?\\d{7}|\\+(?!58)\\d{1,3}\\d{3}-?\\d{7})$"},"address":{"type":"string","minLength":1,"maxLength":200},"nationalId":{"type":"string","minLength":2,"maxLength":10,"pattern":"^[JVEGP]"}},"required":["firstName","lastName"]}},"students":{"default":[],"maxItems":1000,"type":"array","items":{"type":"object","properties":{"firstName":{"type":"string","minLength":1,"maxLength":50},"customerId":{"anyOf":[{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},{"type":"null"}]},"lastName":{"type":"string","maxLength":50},"nationalId":{"anyOf":[{"type":"string","minLength":2,"maxLength":13,"pattern":"^(CE|[JVEGP])"},{"type":"null"}]},"nationality":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"gender":{"type":"string","enum":["MALE","FEMALE","OTHER"]},"dateOfBirth":{"anyOf":[{"type":"string","format":"date","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])))$"},{"type":"null"}]},"enrollmentYear":{"anyOf":[{"type":"string","pattern":"^\\d{4}$"},{"type":"null"}]},"promoYear":{"anyOf":[{"type":"string","pattern":"^\\d{4}$"},{"type":"null"}]},"birthPlace":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"clothingSize":{"anyOf":[{"type":"string","enum":["XS","S","M","L","XL","XXL"]},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":128,"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"}]},"phoneNumber":{"anyOf":[{"type":"string","pattern":"^(?:[01]\\d{3}-?\\d{7}|\\+58(?!0)\\d{3}-?\\d{7}|\\+(?!58)\\d{1,3}\\d{3}-?\\d{7})$"},{"type":"null"}]},"externalId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"active":{"default":true,"type":"boolean"},"customerExternalId":{"type":["string","null"]},"guardianNationalId":{"type":"string","minLength":1},"guardianExternalId":{"type":"string","minLength":1},"grade":{"type":"string","minLength":1},"section":{"type":"string","minLength":1}},"required":["firstName","lastName","gender"]}}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"customers":{"type":"object","properties":{"create":{"type":"array","items":{"type":"object","properties":{"row":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["row"],"additionalProperties":false}},"skipped":{"type":"array","items":{"type":"object","properties":{"row":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reason":{"type":"string"},"detail":{"type":"string"}},"required":["row","reason"],"additionalProperties":false}}},"required":["create","skipped"],"additionalProperties":false},"students":{"type":"object","properties":{"create":{"type":"array","items":{"type":"object","properties":{"row":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"sectionId":{"type":["string","null"]},"representative":{"anyOf":[{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"id"},"id":{"type":"string"}},"required":["kind","id"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"external_id"},"externalId":{"type":"string"}},"required":["kind","externalId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"national_id"},"nationalId":{"type":"string"}},"required":["kind","nationalId"],"additionalProperties":false}]},{"type":"null"}]}},"required":["row","sectionId","representative"],"additionalProperties":false}},"skipped":{"type":"array","items":{"type":"object","properties":{"row":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"reason":{"type":"string"},"detail":{"type":"string"}},"required":["row","reason"],"additionalProperties":false}}},"required":["create","skipped"],"additionalProperties":false},"warnings":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"letter_only_collision"},"source":{"type":"string","enum":["customers","students"]},"row":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"nationalId":{"type":"string"}},"required":["kind","source","row","nationalId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"missing_section"},"source":{"type":"string","const":"students"},"row":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["kind","source","row"],"additionalProperties":false}]}}},"required":["customers","students","warnings"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/imports/people":{"post":{"operationId":"imports-importPeople","summary":"Import customers and students","description":"Creates every row the account resolves, and answers the created and skipped counts.","tags":["Imports"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customers":{"default":[],"maxItems":1000,"type":"array","items":{"type":"object","properties":{"externalId":{"type":"string"},"firstName":{"type":"string","minLength":1,"maxLength":50},"lastName":{"type":"string","maxLength":50},"email":{"type":"string","maxLength":128,"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,}$"},"phoneNumber":{"type":"string","pattern":"^(?:[01]\\d{3}-?\\d{7}|\\+58(?!0)\\d{3}-?\\d{7}|\\+(?!58)\\d{1,3}\\d{3}-?\\d{7})$"},"address":{"type":"string","minLength":1,"maxLength":200},"nationalId":{"type":"string","minLength":2,"maxLength":10,"pattern":"^[JVEGP]"}},"required":["firstName","lastName"]}},"students":{"default":[],"maxItems":1000,"type":"array","items":{"type":"object","properties":{"firstName":{"type":"string","minLength":1,"maxLength":50},"customerId":{"anyOf":[{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},{"type":"null"}]},"lastName":{"type":"string","maxLength":50},"nationalId":{"anyOf":[{"type":"string","minLength":2,"maxLength":13,"pattern":"^(CE|[JVEGP])"},{"type":"null"}]},"nationality":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"gender":{"type":"string","enum":["MALE","FEMALE","OTHER"]},"dateOfBirth":{"anyOf":[{"type":"string","format":"date","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])))$"},{"type":"null"}]},"enrollmentYear":{"anyOf":[{"type":"string","pattern":"^\\d{4}$"},{"type":"null"}]},"promoYear":{"anyOf":[{"type":"string","pattern":"^\\d{4}$"},{"type":"null"}]},"birthPlace":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"clothingSize":{"anyOf":[{"type":"string","enum":["XS","S","M","L","XL","XXL"]},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":128,"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"}]},"phoneNumber":{"anyOf":[{"type":"string","pattern":"^(?:[01]\\d{3}-?\\d{7}|\\+58(?!0)\\d{3}-?\\d{7}|\\+(?!58)\\d{1,3}\\d{3}-?\\d{7})$"},{"type":"null"}]},"externalId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"active":{"default":true,"type":"boolean"},"customerExternalId":{"type":["string","null"]},"guardianNationalId":{"type":"string","minLength":1},"guardianExternalId":{"type":"string","minLength":1},"grade":{"type":"string","minLength":1},"section":{"type":"string","minLength":1}},"required":["firstName","lastName","gender"]}}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"object","properties":{"customers":{"type":"integer","minimum":0,"maximum":9007199254740991},"students":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["customers","students"],"additionalProperties":false},"skipped":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991}}},"required":["created","skipped"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/invoices/debt-import/preview":{"post":{"operationId":"imports-previewDebtImport","summary":"Preview a debt import","description":"Resolves debts against the account without writing: the invoices the import would issue, the rows it cannot resolve, those already billed, and the unverified issuance allowance.","tags":["Imports"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"minItems":1,"type":"array","items":{"type":"object","properties":{"sourceRow":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"name":{"type":"string","minLength":1,"maxLength":200},"nationalId":{"type":"string","maxLength":30},"guardianNationalId":{"type":"string","maxLength":30},"concept":{"type":"string","minLength":1,"maxLength":150},"dueDate":{"type":"string","format":"date","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])))$"},"amount":{"type":"number","minimum":0.01,"maximum":1000000000}},"required":["sourceRow","name","concept","dueDate","amount"]}},"currency":{"type":"string","enum":["VES","USD","EUR"]}},"required":["rows","currency"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"object","properties":{"invoiceCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"subjectCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"total":{"type":"string"},"bornOverdueCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"notYetDueCount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["invoiceCount","subjectCount","total","bornOverdueCount","notYetDueCount"],"additionalProperties":false},"problems":{"type":"array","items":{"type":"object","properties":{"sourceRow":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"name":{"type":"string"},"resolution":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","const":"notFound"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","const":"ambiguous"},"candidateCount":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["status","candidateCount"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","const":"conflict"},"reason":{"type":"string","enum":["nationalIdsPointToDifferentSubjects","nameDoesNotMatchNationalId","nameMatchesAnotherNationalId"]}},"required":["status","reason"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","const":"missingGuardian"}},"required":["status"],"additionalProperties":false}]}},"required":["sourceRow","name","resolution"],"additionalProperties":false}},"groups":{"type":"array","items":{"type":"object","properties":{"subjectKey":{"type":"string"},"customerId":{"type":"string"},"dueDate":{"type":"string"},"amount":{"type":"string"}},"required":["subjectKey","customerId","dueDate","amount"],"additionalProperties":false}},"alreadyBilledCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"unverified":{"type":"object","properties":{"limitUsd":{"type":"number"},"issuedUsd":{"type":"string"},"remainingUsd":{"type":"string"},"totalUsd":{"type":"string"}},"required":["limitUsd","issuedUsd","remainingUsd","totalUsd"],"additionalProperties":false}},"required":["summary","problems","groups","alreadyBilledCount"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/invoices/debt-import":{"post":{"operationId":"imports-importDebtInvoices","summary":"Import debts","description":"Issues one invoice per student and due date, dropping the pairs an earlier import already issued, and answers the issued and skipped counts.","tags":["Imports"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"importId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"currency":{"type":"string","enum":["VES","USD","EUR"]},"notifyNotYetDue":{"type":"boolean"},"rows":{"minItems":1,"type":"array","items":{"type":"object","properties":{"sourceRow":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"name":{"type":"string","minLength":1,"maxLength":200},"nationalId":{"type":"string","maxLength":30},"guardianNationalId":{"type":"string","maxLength":30},"concept":{"type":"string","minLength":1,"maxLength":150},"dueDate":{"type":"string","format":"date","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])))$"},"amount":{"type":"number","minimum":0.01,"maximum":1000000000}},"required":["sourceRow","name","concept","dueDate","amount"]}}},"required":["importId","currency","notifyNotYetDue","rows"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"issuedCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"alreadyIssuedCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"problems":{"type":"array","items":{"type":"object","properties":{"sourceRow":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"name":{"type":"string"},"resolution":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","const":"notFound"}},"required":["status"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","const":"ambiguous"},"candidateCount":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["status","candidateCount"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","const":"conflict"},"reason":{"type":"string","enum":["nationalIdsPointToDifferentSubjects","nameDoesNotMatchNationalId","nameMatchesAnotherNationalId"]}},"required":["status","reason"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","const":"missingGuardian"}},"required":["status"],"additionalProperties":false}]}},"required":["sourceRow","name","resolution"],"additionalProperties":false}}},"required":["issuedCount","alreadyIssuedCount","problems"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/invoice-print-job":{"get":{"operationId":"invoicePrintJobs-getInvoicePrintJobQueue","summary":"Get the invoice print job queue","tags":["Invoice print job"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"limit","schema":{"default":5,"type":"number","maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"query","schema":{"type":"string"}},{"in":"query","name":"invoiceIds","schema":{"type":"string"}},{"in":"query","name":"startDate","schema":{"type":"string"}},{"in":"query","name":"endDate","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"account":{"type":"object","properties":{"description":{"type":"string"},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"name":{"type":"string"}},"required":["description","id","name"],"additionalProperties":false},"customer":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"email":{"type":"string","maxLength":128,"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,}$"},"externalId":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"nationalId":{"type":"string"},"phoneNumber":{"type":"string"},"address":{"type":"string"}},"required":["id","accountId","externalId","firstName","lastName","nationalId","phoneNumber","address"],"additionalProperties":false},"invoice":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"issueDate":{"type":"string"},"lateFee":{"type":"number"},"paidAt":{"type":"string"},"dueDate":{"type":["string","null"]},"printJobId":{"anyOf":[{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},{"type":"null"}]},"billingDetailsId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"feesTotals":{"type":"array","items":{"type":"object","properties":{"rateBase":{"type":"number"},"rate":{"type":"number"},"type":{"type":"string","enum":["IGTF","IVA","PROCESSING_FEE"]},"total":{"type":"number"},"exchangeRate":{"type":"number"}},"required":["rateBase","rate","type","total","exchangeRate"],"additionalProperties":false}},"invoiceItems":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"quantity":{"type":"number"},"total":{"type":"number"},"unitPrice":{"type":"number"}},"required":["description","quantity","total","unitPrice"],"additionalProperties":false}},"discounts":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"number"},"description":{"type":"string"}},"required":["amount","description"],"additionalProperties":false}},"subTotal":{"type":"number"},"total":{"type":"number"}},"required":["id","issueDate","lateFee","paidAt","dueDate","printJobId","feesTotals","invoiceItems","discounts","subTotal","total"],"additionalProperties":false},"payments":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"number"},"paymentDate":{"type":"string"}},"required":["amount","paymentDate"],"additionalProperties":false}}},"required":["account","customer","invoice","payments"],"additionalProperties":false}},"total":{"type":"number"},"totalPages":{"type":"number"},"nextCursor":{"description":"The cursor to get the next page of results","type":["string","null"]},"exchangeRates":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"rate":{"type":"number"},"rateDate":{"type":"string"},"daysAhead":{"type":"number"}},"required":["rate","rateDate","daysAhead"],"additionalProperties":false}}},"required":["results","total","totalPages"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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"}}}}}},"post":{"operationId":"invoicePrintJobs-createInvoicePrintJob","summary":"Create a print job for a specific invoice","description":"Creates a print job for a specific invoice","tags":["Invoice print job"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"invoiceId":{"type":"string","minLength":10,"format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"}},"required":["invoiceId"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"invoiceId":{"type":"string"},"invoiceSequence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"printDateTime":{"type":["string","null"]},"data":{"type":"object","properties":{"account":{"type":"object","properties":{"description":{"type":"string"},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"name":{"type":"string"}},"required":["description","id","name"],"additionalProperties":false},"customer":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"email":{"type":"string","maxLength":128,"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,}$"},"externalId":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"nationalId":{"type":"string"},"phoneNumber":{"type":"string"},"address":{"type":"string"}},"required":["id","accountId","externalId","firstName","lastName","nationalId","phoneNumber","address"],"additionalProperties":false},"invoice":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"issueDate":{"type":"string"},"lateFee":{"type":"number"},"paidAt":{"type":"string"},"dueDate":{"type":["string","null"]},"printJobId":{"anyOf":[{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},{"type":"null"}]},"billingDetailsId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"feesTotals":{"type":"array","items":{"type":"object","properties":{"rateBase":{"type":"number"},"rate":{"type":"number"},"type":{"type":"string","enum":["IGTF","IVA","PROCESSING_FEE"]},"total":{"type":"number"},"exchangeRate":{"type":"number"}},"required":["rateBase","rate","type","total","exchangeRate"],"additionalProperties":false}},"invoiceItems":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"quantity":{"type":"number"},"total":{"type":"number"},"unitPrice":{"type":"number"}},"required":["description","quantity","total","unitPrice"],"additionalProperties":false}},"discounts":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"number"},"description":{"type":"string"}},"required":["amount","description"],"additionalProperties":false}},"subTotal":{"type":"number"},"total":{"type":"number"}},"required":["id","issueDate","lateFee","paidAt","dueDate","printJobId","feesTotals","invoiceItems","discounts","subTotal","total"],"additionalProperties":false},"payments":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"number"},"paymentDate":{"type":"string"}},"required":["amount","paymentDate"],"additionalProperties":false}}},"required":["account","customer","invoice","payments"],"additionalProperties":false},"errorMessage":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","accountId","invoiceId","invoiceSequence","printDateTime","data","errorMessage","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/invoice-print-job/{invoiceId}/data":{"get":{"operationId":"invoicePrintJobs-getInvoicePrintJobData","summary":"Get the print job data for a specific invoice","tags":["Invoice print job"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"invoiceId","schema":{"type":"string","minLength":10,"format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"description":{"type":"string"},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"name":{"type":"string"}},"required":["description","id","name"],"additionalProperties":false},"customer":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"email":{"type":"string","maxLength":128,"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,}$"},"externalId":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"nationalId":{"type":"string"},"phoneNumber":{"type":"string"},"address":{"type":"string"}},"required":["id","accountId","externalId","firstName","lastName","nationalId","phoneNumber","address"],"additionalProperties":false},"invoice":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"issueDate":{"type":"string"},"lateFee":{"type":"number"},"paidAt":{"type":"string"},"dueDate":{"type":["string","null"]},"printJobId":{"anyOf":[{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},{"type":"null"}]},"billingDetailsId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"feesTotals":{"type":"array","items":{"type":"object","properties":{"rateBase":{"type":"number"},"rate":{"type":"number"},"type":{"type":"string","enum":["IGTF","IVA","PROCESSING_FEE"]},"total":{"type":"number"},"exchangeRate":{"type":"number"}},"required":["rateBase","rate","type","total","exchangeRate"],"additionalProperties":false}},"invoiceItems":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"quantity":{"type":"number"},"total":{"type":"number"},"unitPrice":{"type":"number"}},"required":["description","quantity","total","unitPrice"],"additionalProperties":false}},"discounts":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"number"},"description":{"type":"string"}},"required":["amount","description"],"additionalProperties":false}},"subTotal":{"type":"number"},"total":{"type":"number"}},"required":["id","issueDate","lateFee","paidAt","dueDate","printJobId","feesTotals","invoiceItems","discounts","subTotal","total"],"additionalProperties":false},"payments":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"number"},"paymentDate":{"type":"string"}},"required":["amount","paymentDate"],"additionalProperties":false}}},"required":["account","customer","invoice","payments"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/invoice-print-job/{invoicePrintJobId}":{"get":{"operationId":"invoicePrintJobs-getInvoicePrintJob","summary":"Get the invoice print job","tags":["Invoice print job"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"invoicePrintJobId","schema":{"type":"string","minLength":10,"format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"invoiceId":{"type":"string"},"invoiceSequence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"printDateTime":{"type":["string","null"]},"data":{"type":"object","properties":{"account":{"type":"object","properties":{"description":{"type":"string"},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"name":{"type":"string"}},"required":["description","id","name"],"additionalProperties":false},"customer":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"email":{"type":"string","maxLength":128,"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,}$"},"externalId":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"nationalId":{"type":"string"},"phoneNumber":{"type":"string"},"address":{"type":"string"}},"required":["id","accountId","externalId","firstName","lastName","nationalId","phoneNumber","address"],"additionalProperties":false},"invoice":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"issueDate":{"type":"string"},"lateFee":{"type":"number"},"paidAt":{"type":"string"},"dueDate":{"type":["string","null"]},"printJobId":{"anyOf":[{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},{"type":"null"}]},"billingDetailsId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"feesTotals":{"type":"array","items":{"type":"object","properties":{"rateBase":{"type":"number"},"rate":{"type":"number"},"type":{"type":"string","enum":["IGTF","IVA","PROCESSING_FEE"]},"total":{"type":"number"},"exchangeRate":{"type":"number"}},"required":["rateBase","rate","type","total","exchangeRate"],"additionalProperties":false}},"invoiceItems":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"quantity":{"type":"number"},"total":{"type":"number"},"unitPrice":{"type":"number"}},"required":["description","quantity","total","unitPrice"],"additionalProperties":false}},"discounts":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"number"},"description":{"type":"string"}},"required":["amount","description"],"additionalProperties":false}},"subTotal":{"type":"number"},"total":{"type":"number"}},"required":["id","issueDate","lateFee","paidAt","dueDate","printJobId","feesTotals","invoiceItems","discounts","subTotal","total"],"additionalProperties":false},"payments":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"number"},"paymentDate":{"type":"string"}},"required":["amount","paymentDate"],"additionalProperties":false}}},"required":["account","customer","invoice","payments"],"additionalProperties":false},"errorMessage":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","accountId","invoiceId","invoiceSequence","printDateTime","data","errorMessage","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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"}}}}}},"put":{"operationId":"invoicePrintJobs-updateInvoicePrintData","summary":"Update the invoice sequence number","tags":["Invoice print job"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"invoicePrintJobId","schema":{"type":"string","minLength":10,"format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"invoiceSequence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"printDateTime":{"type":"string"}},"required":["invoiceSequence"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/invoice-print-job/{invoicePrintJobId}/failed":{"put":{"operationId":"invoicePrintJobs-updateFailedPrintJob","summary":"Update the failed print job to include the error message","tags":["Invoice print job"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"invoicePrintJobId","schema":{"type":"string","minLength":10,"format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"errorMessage":{"type":"string","minLength":1}},"required":["errorMessage"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/invoice-print-job/{invoiceId}/delete-sequence":{"delete":{"operationId":"invoicePrintJobs-deleteInvoicePrintJobSequence","summary":"Remove an invoice number to voided invoice. It should only be used when the printed invoice has been voided by mistake or there was an error in assigning the invoice number..","tags":["Invoice print job"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"invoiceId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true},{"in":"query","name":"invoiceSequence","schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/invoice-print-job/{invoiceId}/add-sequence":{"put":{"operationId":"invoicePrintJobs-reportInvoicePrintJobSequence","summary":"Add an invoice number to the invoice print job. Should only be used in case of failed print jobs that were generated physically","tags":["Invoice print job"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"invoiceId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"invoiceSequence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["invoiceSequence"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/invoices/{invoiceId}":{"get":{"operationId":"invoices-getInvoiceById","summary":"Get an invoice by id","tags":["Invoices"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"invoiceId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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"}}}}}},"put":{"operationId":"invoices-adjustInvoice","summary":"Adjust an invoice","description":"Edits an invoice that is not `PAID` or `VOIDED`. Its `currency` can't change.","tags":["Invoices"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"invoiceId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string","maxLength":150},"currency":{"type":"string","enum":["VES","USD","EUR"]},"issueDate":{"default":"2026-12-05T06:40:43.802Z","type":"string"},"dueDate":{"description":"After this day the invoice is `OVERDUE` and the late fee, if any, applies.","example":"2026-10-15","type":"string"},"lateFee":{"description":"Added once `dueDate` has passed: a fixed amount, or a percentage of the items' subtotal, per `lateFeeType`.","example":5,"type":"number","minimum":0,"maximum":1000000000},"lateFeeType":{"example":"FIXED","type":"string","enum":["PERCENTAGE","FIXED"]},"accountPaymentMethodIds":{"description":"Ids from `GET /v1/payment-methods`. Replaces the methods this invoice is limited to. Omit it to keep the current ones; send `[]` to allow any of your account's methods.","type":"array","items":{"type":"string"}},"items":{"description":"A line with an `id` updates that line; one without adds a new line.","minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"description":{"type":"string","minLength":1,"example":"October tuition"},"productId":{"description":"The catalog product this line sells, if any. Then `amount` and `exento` must match the product's current price and exemption, or the request fails.","type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"studentId":{"description":"Schools only: the student this line is for.","type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"quantity":{"type":"number","minimum":1,"maximum":1000000,"example":1},"amount":{"type":"number","minimum":0.01,"maximum":1000000000,"description":"Unit price in the invoice's `currency`.","example":120},"exento":{"default":false,"description":"Exempt from IVA (VAT). Defaults to `false`; with a `productId` it must match the product's.","type":"boolean"},"isService":{"description":"The line is a service, which makes it part of the municipal retention's base. With a `productId` it is taken from the product, and a different value fails the request. Without one, an omitted value is `false` on a new line and leaves an existing line's value unchanged.","type":"boolean"},"discountValue":{"description":"A discount on this line: a percentage or a fixed amount, per `discountValueType`.","example":10,"anyOf":[{"type":"number","minimum":0,"maximum":1000000000},{"type":"null"}]},"discountValueType":{"example":"PERCENTAGE","anyOf":[{"type":"string","enum":["PERCENTAGE","FIXED"]},{"type":"null"}]},"discountExpiresAt":{"description":"The line discount stops applying after this date. Without it, it never expires.","type":["string","null"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"}},"required":["description","quantity","amount"]}},"discounts":{"default":[],"maxItems":5,"type":"array","items":{"type":"object","properties":{"expiresAt":{"description":"The discount stops applying after this date, e.g. an early-payment discount. Without it, it never expires.","type":["string","null"]},"description":{"type":"string","example":"Early payment"},"value":{"type":"number","minimum":0,"maximum":1000000000,"description":"A percentage or a fixed amount, per `valueType`.","example":5},"valueType":{"type":"string","enum":["PERCENTAGE","FIXED"],"example":"PERCENTAGE"},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"}},"required":["description","value","valueType"]}},"deletedItemIds":{"description":"Lines to remove from the invoice.","type":"array","items":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"}},"deletedDiscountIds":{"description":"Discounts to remove from the invoice.","type":"array","items":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"}}},"required":["currency"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/invoices/external-id/{externalId}":{"get":{"operationId":"invoices-getInvoiceByExternalId","summary":"Get an invoice by external id","tags":["Invoices"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"externalId","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/invoices/{invoiceId}/transactions":{"get":{"operationId":"invoices-getPaginatedInvoiceTransactions","summary":"Get all transactions related to an invoice with pagination.","tags":["Invoices"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"invoiceId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":10,"type":"number","maximum":100}},{"in":"query","name":"sortKey","schema":{"default":"transactionDate","type":"string","enum":["createdAt","transactionDate","debit","credit"]}},{"in":"query","name":"sortDirection","schema":{"default":"desc","type":"string","enum":["asc","desc"]}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["ITEMS","DISCOUNT","LATE_FEE","IVA","IGTF","PROCESSING_FEE","PAYMENT","REFUND","RETENTION","EXCHANGE_DIFFERENCE","ADJUSTMENT"]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"customerId":{"type":"string"},"invoiceId":{"type":"string"},"statementId":{"type":["string","null"]},"description":{"type":"string"},"transactionDate":{"type":"string"},"exchangeRate":{"type":"number"},"rateDate":{"type":"string"},"credit":{"type":"number"},"debit":{"type":"number"},"paymentId":{"type":["string","null"]},"fromPaymentId":{"type":["string","null"]},"retentionId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"fromPayment":{"anyOf":[{"type":"object","properties":{"transactionDate":{"type":"string"}},"required":["transactionDate"],"additionalProperties":false},{"type":"null"}]}},"required":["kind","currency","id","accountId","customerId","invoiceId","statementId","description","transactionDate","exchangeRate","rateDate","credit","debit","paymentId","fromPaymentId","retentionId","createdAt","updatedAt","fromPayment"],"additionalProperties":false}},"total":{"type":"number"},"totalPages":{"type":"number"},"nextCursor":{"description":"The cursor to get the next page of results","type":["string","null"]},"exchangeRates":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"rate":{"type":"number"},"rateDate":{"type":"string"},"daysAhead":{"type":"number"}},"required":["rate","rateDate","daysAhead"],"additionalProperties":false}}},"required":["results","total","totalPages"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/invoices/{invoiceId}/payments":{"get":{"operationId":"invoices-getPaginatedInvoicePayments","summary":"Get invoice payments with pagination","tags":["Invoices"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"invoiceId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":10,"type":"number","maximum":100}},{"in":"query","name":"sortKey","schema":{"default":"transactionDate","type":"string","enum":["transactionDate","amount"]}},{"in":"query","name":"sortDirection","schema":{"default":"desc","type":"string","enum":["asc","desc"]}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","enum":["VES","USD","EUR"]},"receiverBankName":{"anyOf":[{"type":"string","enum":["A100BANCO","BANCAMIGA","BANCARIBE","BANESCO","BDV","BFC","BNC","MERCANTIL","PROVINCIAL","BANCO_DEL_TESORO","BANCO_PLAZA","SOFITASA","BANCO_ACTIVO","BANCO_AGRICOLA","BANCO_BICENTENARIO","BANCO_CARONI","BANCO_EXTERIOR","BANCRECER","BANFANB","BANGENTE","BANPLUS","DELSUR","R4","VENEZOLANO_DE_CREDITO","BANK_OF_AMERICA","AMERANT_BANK","US_BANK","WELLS_FARGO","BINANCE"]},{"type":"null"}]},"method":{"type":"string","enum":["BANK_TRANSFER","ZELLE","C2P","IMMEDIATE_DEBIT","P2P","CASH","POS","CUSTOMER_CREDIT","STRIPE_ACH","STRIPE_CARD","DEBIT_CARD","PAYROLL","BINANCE_PAY","LEDGER_FEE"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"customerId":{"type":"string"},"amount":{"type":"number"},"transactionDate":{"type":"string"},"rateDate":{"type":["string","null"]},"referenceCode":{"type":["string","null"]},"externalId":{"type":["string","null"]},"receiverBankHolderName":{"type":["string","null"]},"receiverBankNationalId":{"type":["string","null"]},"customerFullName":{"type":["string","null"]},"customerNationalId":{"type":["string","null"]},"customerPhoneNumber":{"type":["string","null"]},"customerBankAccountNumber":{"type":["string","null"]},"customerEmail":{"type":["string","null"]},"customerNote":{"type":["string","null"]},"customerIpAddress":{"type":["string","null"]},"customerUserAgent":{"type":["string","null"]},"isAutoPay":{"type":"boolean"},"bankAccountId":{"type":["string","null"]},"paymentClaimId":{"type":["string","null"]},"bankTransactionId":{"type":["string","null"]},"createdById":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"splitAmount":{"type":["number","null"]},"paymentTransactions":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["ITEMS","DISCOUNT","LATE_FEE","IVA","IGTF","PROCESSING_FEE","PAYMENT","REFUND","RETENTION","EXCHANGE_DIFFERENCE","ADJUSTMENT"]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"customerId":{"type":"string"},"invoiceId":{"type":"string"},"statementId":{"type":["string","null"]},"description":{"type":"string"},"transactionDate":{"type":"string"},"exchangeRate":{"type":"number"},"rateDate":{"type":"string"},"credit":{"type":"number"},"debit":{"type":"number"},"paymentId":{"type":["string","null"]},"fromPaymentId":{"type":["string","null"]},"retentionId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["kind","currency","id","accountId","customerId","invoiceId","statementId","description","transactionDate","exchangeRate","rateDate","credit","debit","paymentId","fromPaymentId","retentionId","createdAt","updatedAt"],"additionalProperties":false}},"bankAccount":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["CHECKING","SAVINGS","ZELLE","BINANCE"]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"bankName":{"type":"string","enum":["A100BANCO","BANCAMIGA","BANCARIBE","BANESCO","BDV","BFC","BNC","MERCANTIL","PROVINCIAL","BANCO_DEL_TESORO","BANCO_PLAZA","SOFITASA","BANCO_ACTIVO","BANCO_AGRICOLA","BANCO_BICENTENARIO","BANCO_CARONI","BANCO_EXTERIOR","BANCRECER","BANFANB","BANGENTE","BANPLUS","DELSUR","R4","VENEZOLANO_DE_CREDITO","BANK_OF_AMERICA","AMERANT_BANK","US_BANK","WELLS_FARGO","BINANCE"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"name":{"type":"string"},"accountHolderName":{"type":"string"},"isActive":{"type":"boolean"},"nationalId":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"pagoMovilQrUrl":{"type":["string","null"]},"identifier":{"type":"string"},"last4":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["type","currency","bankName","id","accountId","name","accountHolderName","isActive","nationalId","phoneNumber","pagoMovilQrUrl","identifier","last4","createdAt","updatedAt"],"additionalProperties":false},{"type":"null"}]},"bankTransaction":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","enum":["MERCANTIL_WEBHOOK","BNC_WEBHOOK","MERCANTIL_API","BNC_API","BANESCO_API","PLAZA_API","BINANCE_API","C2P","STRIPE_ACH","TRANSACTION_FILE","FORCE_PAYMENT","MANUAL","API"]},"bankName":{"type":"string","enum":["A100BANCO","BANCAMIGA","BANCARIBE","BANESCO","BDV","BFC","BNC","MERCANTIL","PROVINCIAL","BANCO_DEL_TESORO","BANCO_PLAZA","SOFITASA","BANCO_ACTIVO","BANCO_AGRICOLA","BANCO_BICENTENARIO","BANCO_CARONI","BANCO_EXTERIOR","BANCRECER","BANFANB","BANGENTE","BANPLUS","DELSUR","R4","VENEZOLANO_DE_CREDITO","BANK_OF_AMERICA","AMERANT_BANK","US_BANK","WELLS_FARGO","BINANCE"]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"asset":{"anyOf":[{"type":"string","enum":["USDT","USDC"]},{"type":"null"}]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"bankAccountId":{"type":"string"},"transactionFileId":{"type":["string","null"]},"paymentClaimId":{"type":["string","null"]},"bncWebhookPaymentEventId":{"type":["string","null"]},"mercantilWebhookPaymentEventId":{"type":["string","null"]},"duplicationKey":{"type":["string","null"]},"amount":{"type":"number"},"date":{"type":"string"},"description":{"type":"string"},"referenceCode":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["source","bankName","currency","asset","id","accountId","bankAccountId","transactionFileId","paymentClaimId","bncWebhookPaymentEventId","mercantilWebhookPaymentEventId","duplicationKey","amount","date","description","referenceCode","createdAt","updatedAt"],"additionalProperties":false},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["name","email"],"additionalProperties":false},{"type":"null"}],"description":"The account user who registered the payment, when someone entered it by hand. Never the payer."},"paymentClaim":{"anyOf":[{"type":"object","properties":{"createdFrom":{"type":"string","enum":["ADMIN","CONTACT_PORTAL","CUSTOMER_PORTAL","API","CHATBOT","CHECKOUT"]}},"required":["createdFrom"],"additionalProperties":false},{"type":"null"}],"description":"The claim this payment reconciled, when it came from one. `createdFrom` says who reported it."},"hasPaymentAttempt":{"type":"boolean","description":"Whether a payer-initiated flow created the payment. A null `createdBy` alone does not mean the payer: API-token callers leave it null too."}},"required":["currency","receiverBankName","method","id","accountId","customerId","amount","transactionDate","rateDate","referenceCode","externalId","receiverBankHolderName","receiverBankNationalId","customerFullName","customerNationalId","customerPhoneNumber","customerBankAccountNumber","customerEmail","customerNote","customerIpAddress","customerUserAgent","isAutoPay","bankAccountId","paymentClaimId","bankTransactionId","createdById","createdAt","updatedAt","splitAmount","paymentTransactions","bankAccount","bankTransaction","createdBy","paymentClaim","hasPaymentAttempt"],"additionalProperties":false}},"total":{"type":"number"},"totalPages":{"type":"number"},"nextCursor":{"description":"The cursor to get the next page of results","type":["string","null"]},"exchangeRates":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"rate":{"type":"number"},"rateDate":{"type":"string"},"daysAhead":{"type":"number"}},"required":["rate","rateDate","daysAhead"],"additionalProperties":false}}},"required":["results","total","totalPages"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/invoices":{"get":{"operationId":"invoices-getInvoices","summary":"Get all invoices","tags":["Invoices"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"startDate","schema":{"type":"string"}},{"in":"query","name":"endDate","schema":{"type":"string"}},{"in":"query","name":"sortKey","schema":{"default":"issueDate","type":"string","enum":["firstName","issueDate","dueDate"]}},{"in":"query","name":"sortDirection","schema":{"default":"desc","type":"string","enum":["asc","desc"]}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":10,"type":"number","maximum":1000}},{"in":"query","name":"status","schema":{"type":"string","enum":["DRAFT","UNPAID","OVERDUE","PENDING","PARTIAL","PAID","VOIDED"]}},{"in":"query","name":"dueDateFrom","schema":{"type":"string"}},{"in":"query","name":"dueDateTo","schema":{"type":"string"}},{"in":"query","name":"agingBucket","schema":{"type":"string","enum":["DAYS_1_30","DAYS_31_60","DAYS_61_90","DAYS_90_PLUS"]}},{"in":"query","name":"isPrinted","schema":{"type":"boolean"}},{"in":"query","name":"subscriptionId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}},"total":{"type":"number"},"totalPages":{"type":"number"},"nextCursor":{"description":"The cursor to get the next page of results","type":["string","null"]},"exchangeRates":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"rate":{"type":"number"},"rateDate":{"type":"string"},"daysAhead":{"type":"number"}},"required":["rate","rateDate","daysAhead"],"additionalProperties":false}}},"required":["results","total","totalPages"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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"}}}}}},"post":{"operationId":"invoices-createInvoice","summary":"Create an invoice","description":"Issues an invoice to one customer. Its pricing mode is `CURRENCY` for a `VES` invoice, otherwise your account's default at that moment.","tags":["Invoices"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customerId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"externalId":{"description":"Your id for this invoice. Must be unique in your account.","example":"INV-2026-0042","type":"string"},"description":{"type":"string","maxLength":150},"currency":{"type":"string","enum":["VES","USD","EUR"]},"issueDate":{"default":"2026-12-05T06:40:43.804Z","type":"string"},"dueDate":{"description":"After this day the invoice is `OVERDUE` and the late fee, if any, applies.","example":"2026-10-15","type":"string"},"lateFee":{"description":"Added once `dueDate` has passed: a fixed amount, or a percentage of the items' subtotal, per `lateFeeType`.","example":5,"type":"number","minimum":0,"maximum":1000000000},"lateFeeType":{"example":"FIXED","type":"string","enum":["PERCENTAGE","FIXED"]},"accountPaymentMethodIds":{"description":"Ids from `GET /v1/payment-methods`. Limits how the customer can pay this invoice; without it, any of your account's methods.","type":"array","items":{"type":"string"}},"items":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"description":{"type":"string","minLength":1,"example":"October tuition"},"productId":{"description":"The catalog product this line sells, if any. Then `amount` and `exento` must match the product's current price and exemption, or the request fails.","type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"studentId":{"description":"Schools only: the student this line is for.","type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"quantity":{"type":"number","minimum":1,"maximum":1000000,"example":1},"amount":{"type":"number","minimum":0.01,"maximum":1000000000,"description":"Unit price in the invoice's `currency`.","example":120},"exento":{"default":false,"description":"Exempt from IVA (VAT). Defaults to `false`; with a `productId` it must match the product's.","type":"boolean"},"isService":{"description":"The line is a service, which makes it part of the municipal retention's base. With a `productId` it is taken from the product, and a different value fails the request. Without one, an omitted value is `false` on a new line and leaves an existing line's value unchanged.","type":"boolean"},"discountValue":{"description":"A discount on this line: a percentage or a fixed amount, per `discountValueType`.","example":10,"anyOf":[{"type":"number","minimum":0,"maximum":1000000000},{"type":"null"}]},"discountValueType":{"example":"PERCENTAGE","anyOf":[{"type":"string","enum":["PERCENTAGE","FIXED"]},{"type":"null"}]},"discountExpiresAt":{"description":"The line discount stops applying after this date. Without it, it never expires.","type":["string","null"]}},"required":["description","quantity","amount"]}},"discounts":{"default":[],"maxItems":5,"type":"array","items":{"type":"object","properties":{"expiresAt":{"description":"The discount stops applying after this date, e.g. an early-payment discount. Without it, it never expires.","type":["string","null"]},"description":{"type":"string","example":"Early payment"},"value":{"type":"number","minimum":0,"maximum":1000000000,"description":"A percentage or a fixed amount, per `valueType`.","example":5},"valueType":{"type":"string","enum":["PERCENTAGE","FIXED"],"example":"PERCENTAGE"}},"required":["description","value","valueType"]}}},"required":["customerId","currency","items"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/invoices/bulk":{"post":{"operationId":"invoices-bulkCreateInvoices","summary":"Create invoices in bulk for multiple customers","description":"Issues the same invoice (items, discounts, dates) to each customer in `customerInvoices`.","tags":["Invoices"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customerInvoices":{"minItems":1,"type":"array","items":{"type":"object","properties":{"customerId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"invoiceExternalId":{"description":"Your id for this customer's invoice. Must be unique in your account.","type":"string"}},"required":["customerId"]}},"currency":{"type":"string","enum":["VES","USD","EUR"]},"issueDate":{"default":"2026-12-05T06:40:43.804Z","type":"string"},"dueDate":{"description":"After this day the invoice is `OVERDUE` and the late fee, if any, applies.","example":"2026-10-15","type":"string"},"lateFee":{"description":"Added once `dueDate` has passed: a fixed amount, or a percentage of the items' subtotal, per `lateFeeType`.","example":5,"type":"number","minimum":0,"maximum":1000000000},"lateFeeType":{"example":"FIXED","type":"string","enum":["PERCENTAGE","FIXED"]},"accountPaymentMethodIds":{"description":"Ids from `GET /v1/payment-methods`. Limits how the customer can pay this invoice; without it, any of your account's methods.","type":"array","items":{"type":"string"}},"items":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"description":{"type":"string","minLength":1,"example":"October tuition"},"productId":{"description":"The catalog product this line sells, if any. Then `amount` and `exento` must match the product's current price and exemption, or the request fails.","type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"studentId":{"description":"Schools only: the student this line is for.","type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"quantity":{"type":"number","minimum":1,"maximum":1000000,"example":1},"amount":{"type":"number","minimum":0.01,"maximum":1000000000,"description":"Unit price in the invoice's `currency`.","example":120},"exento":{"default":false,"description":"Exempt from IVA (VAT). Defaults to `false`; with a `productId` it must match the product's.","type":"boolean"},"isService":{"description":"The line is a service, which makes it part of the municipal retention's base. With a `productId` it is taken from the product, and a different value fails the request. Without one, an omitted value is `false` on a new line and leaves an existing line's value unchanged.","type":"boolean"},"discountValue":{"description":"A discount on this line: a percentage or a fixed amount, per `discountValueType`.","example":10,"anyOf":[{"type":"number","minimum":0,"maximum":1000000000},{"type":"null"}]},"discountValueType":{"example":"PERCENTAGE","anyOf":[{"type":"string","enum":["PERCENTAGE","FIXED"]},{"type":"null"}]},"discountExpiresAt":{"description":"The line discount stops applying after this date. Without it, it never expires.","type":["string","null"]}},"required":["description","quantity","amount"]}},"discounts":{"default":[],"maxItems":5,"type":"array","items":{"type":"object","properties":{"expiresAt":{"description":"The discount stops applying after this date, e.g. an early-payment discount. Without it, it never expires.","type":["string","null"]},"description":{"type":"string","example":"Early payment"},"value":{"type":"number","minimum":0,"maximum":1000000000,"description":"A percentage or a fixed amount, per `valueType`.","example":5},"valueType":{"type":"string","enum":["PERCENTAGE","FIXED"],"example":"PERCENTAGE"}},"required":["description","value","valueType"]}}},"required":["customerInvoices","currency","items"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/invoices/{invoiceId}/item/{itemId}":{"delete":{"operationId":"invoices-deleteInvoiceItem","summary":"Delete an invoice item","tags":["Invoices"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"invoiceId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true},{"in":"path","name":"itemId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/invoices/{invoiceId}/discount-item/{discountItemId}":{"delete":{"operationId":"invoices-deleteDiscountItem","summary":"Delete an invoice discount item","tags":["Invoices"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"invoiceId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true},{"in":"path","name":"discountItemId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/invoices/{invoiceId}/void":{"put":{"operationId":"invoices-voidInvoice","summary":"Void an invoice","description":"Cancels an invoice for good: a `VOIDED` invoice never changes again. What was already paid on it goes back to the customer as credit. Refused while a payment claim or payment attempt on it is pending.","tags":["Invoices"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"invoiceId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/payments/{paymentId}":{"get":{"operationId":"payments-getPaymentById","summary":"Get a payment by id","tags":["Payments"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"paymentId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"currency":{"type":"string","enum":["VES","USD","EUR"]},"receiverBankName":{"anyOf":[{"type":"string","enum":["A100BANCO","BANCAMIGA","BANCARIBE","BANESCO","BDV","BFC","BNC","MERCANTIL","PROVINCIAL","BANCO_DEL_TESORO","BANCO_PLAZA","SOFITASA","BANCO_ACTIVO","BANCO_AGRICOLA","BANCO_BICENTENARIO","BANCO_CARONI","BANCO_EXTERIOR","BANCRECER","BANFANB","BANGENTE","BANPLUS","DELSUR","R4","VENEZOLANO_DE_CREDITO","BANK_OF_AMERICA","AMERANT_BANK","US_BANK","WELLS_FARGO","BINANCE"]},{"type":"null"}]},"method":{"type":"string","enum":["BANK_TRANSFER","ZELLE","C2P","IMMEDIATE_DEBIT","P2P","CASH","POS","CUSTOMER_CREDIT","STRIPE_ACH","STRIPE_CARD","DEBIT_CARD","PAYROLL","BINANCE_PAY","LEDGER_FEE"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"customerId":{"type":"string"},"amount":{"type":"number"},"transactionDate":{"type":"string"},"rateDate":{"type":["string","null"]},"referenceCode":{"type":["string","null"]},"externalId":{"type":["string","null"]},"receiverBankHolderName":{"type":["string","null"]},"receiverBankNationalId":{"type":["string","null"]},"customerFullName":{"type":["string","null"]},"customerNationalId":{"type":["string","null"]},"customerPhoneNumber":{"type":["string","null"]},"customerBankAccountNumber":{"type":["string","null"]},"customerEmail":{"type":["string","null"]},"customerNote":{"type":["string","null"]},"customerIpAddress":{"type":["string","null"]},"customerUserAgent":{"type":["string","null"]},"isAutoPay":{"type":"boolean"},"bankAccountId":{"type":["string","null"]},"paymentClaimId":{"type":["string","null"]},"bankTransactionId":{"type":["string","null"]},"createdById":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"splitAmount":{"type":["number","null"]},"customer":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"externalId":{"type":["string","null"]},"mainContactId":{"type":["string","null"]},"nationalId":{"type":["string","null"]},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"address":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","accountId","externalId","mainContactId","nationalId","firstName","lastName","email","phoneNumber","address","createdAt","updatedAt"],"additionalProperties":false},"bankAccount":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["CHECKING","SAVINGS","ZELLE","BINANCE"]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"bankName":{"type":"string","enum":["A100BANCO","BANCAMIGA","BANCARIBE","BANESCO","BDV","BFC","BNC","MERCANTIL","PROVINCIAL","BANCO_DEL_TESORO","BANCO_PLAZA","SOFITASA","BANCO_ACTIVO","BANCO_AGRICOLA","BANCO_BICENTENARIO","BANCO_CARONI","BANCO_EXTERIOR","BANCRECER","BANFANB","BANGENTE","BANPLUS","DELSUR","R4","VENEZOLANO_DE_CREDITO","BANK_OF_AMERICA","AMERANT_BANK","US_BANK","WELLS_FARGO","BINANCE"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"name":{"type":"string"},"accountHolderName":{"type":"string"},"isActive":{"type":"boolean"},"nationalId":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"pagoMovilQrUrl":{"type":["string","null"]},"identifier":{"type":"string"},"last4":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["type","currency","bankName","id","accountId","name","accountHolderName","isActive","nationalId","phoneNumber","pagoMovilQrUrl","identifier","last4","createdAt","updatedAt"],"additionalProperties":false},{"type":"null"}]},"paymentTransactions":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["ITEMS","DISCOUNT","LATE_FEE","IVA","IGTF","PROCESSING_FEE","PAYMENT","REFUND","RETENTION","EXCHANGE_DIFFERENCE","ADJUSTMENT"]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"customerId":{"type":"string"},"invoiceId":{"type":"string"},"statementId":{"type":["string","null"]},"description":{"type":"string"},"transactionDate":{"type":"string"},"exchangeRate":{"type":"number"},"rateDate":{"type":"string"},"credit":{"type":"number"},"debit":{"type":"number"},"paymentId":{"type":["string","null"]},"fromPaymentId":{"type":["string","null"]},"retentionId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["kind","currency","id","accountId","customerId","invoiceId","statementId","description","transactionDate","exchangeRate","rateDate","credit","debit","paymentId","fromPaymentId","retentionId","createdAt","updatedAt"],"additionalProperties":false}},"paymentClaim":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["PENDING","ACCEPTED","REJECTED"]},"purpose":{"type":"string","enum":["INVOICE","COUNTER_DEPOSIT"]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"paymentMethod":{"type":"string","enum":["BANK_TRANSFER","ZELLE","C2P","IMMEDIATE_DEBIT","P2P","CASH","POS","CUSTOMER_CREDIT","STRIPE_ACH","STRIPE_CARD","DEBIT_CARD","PAYROLL","BINANCE_PAY","LEDGER_FEE"]},"createdFrom":{"type":"string","enum":["ADMIN","CONTACT_PORTAL","CUSTOMER_PORTAL","API","CHATBOT","CHECKOUT"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"customerId":{"type":["string","null"]},"amount":{"type":"number"},"date":{"type":"string"},"screenshotUrl":{"type":["string","null"]},"referenceCode":{"type":["string","null"]},"issuerBankId":{"type":["string","null"]},"bankAccountId":{"type":["string","null"]},"customerFullName":{"type":["string","null"]},"customerNationalId":{"type":["string","null"]},"customerPhoneNumber":{"type":["string","null"]},"customerEmail":{"type":["string","null"]},"customerNote":{"type":["string","null"]},"customerIpAddress":{"type":["string","null"]},"customerUserAgent":{"type":["string","null"]},"paymentClaimCode":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"exchangeRate":{"type":["number","null"]}},"required":["status","purpose","currency","paymentMethod","createdFrom","id","accountId","customerId","amount","date","screenshotUrl","referenceCode","issuerBankId","bankAccountId","customerFullName","customerNationalId","customerPhoneNumber","customerEmail","customerNote","customerIpAddress","customerUserAgent","paymentClaimCode","createdAt","updatedAt","exchangeRate"],"additionalProperties":false},{"type":"null"}]}},"required":["currency","receiverBankName","method","id","accountId","customerId","amount","transactionDate","rateDate","referenceCode","externalId","receiverBankHolderName","receiverBankNationalId","customerFullName","customerNationalId","customerPhoneNumber","customerBankAccountNumber","customerEmail","customerNote","customerIpAddress","customerUserAgent","isAutoPay","bankAccountId","paymentClaimId","bankTransactionId","createdById","createdAt","updatedAt","splitAmount","customer","bankAccount","paymentTransactions","paymentClaim"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/payments":{"get":{"operationId":"payments-getPayments","summary":"Get all payments","tags":["Payments"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"startDate","schema":{"type":"string"}},{"in":"query","name":"endDate","schema":{"type":"string"}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":10,"type":"number","maximum":1000}},{"in":"query","name":"sortKey","schema":{"default":"createdAt","type":"string","enum":["createdAt","amount","firstName"]}},{"in":"query","name":"sortDirection","schema":{"default":"desc","type":"string","enum":["asc","desc"]}},{"in":"query","name":"subscriptionId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/Payment"}},"total":{"type":"number"},"totalPages":{"type":"number"},"nextCursor":{"description":"The cursor to get the next page of results","type":["string","null"]},"exchangeRates":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"rate":{"type":"number"},"rateDate":{"type":"string"},"daysAhead":{"type":"number"}},"required":["rate","rateDate","daysAhead"],"additionalProperties":false}}},"required":["results","total","totalPages"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/invoices/{invoiceId}/payroll-payments":{"post":{"operationId":"payments-createPayrollPayment","summary":"Record a payroll deduction against an invoice","tags":["Payments"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"invoiceId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conceptCode":{"type":"string","minLength":1,"maxLength":20,"description":"Payroll concept code (co_conce), e.g. E104."},"amount":{"type":"number","minimum":0.01,"multipleOf":0.01,"description":"Amount deducted, in VES, with two decimals."},"payrollDate":{"type":"string","format":"date","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])))$","description":"Day of the deduction (YYYY-MM-DD). Its rate converts the amount: `GET /v1/exchange-rates` returns it."},"employee":{"type":"object","properties":{"nationalId":{"type":"string","minLength":2,"maxLength":10,"pattern":"^[JVEGP]"},"fullName":{"type":"string","minLength":1,"maxLength":100}},"required":["nationalId","fullName"]},"note":{"type":"string"}},"required":["conceptCode","amount","payrollDate","employee"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"currency":{"type":"string","enum":["VES","USD","EUR"]},"receiverBankName":{"anyOf":[{"type":"string","enum":["A100BANCO","BANCAMIGA","BANCARIBE","BANESCO","BDV","BFC","BNC","MERCANTIL","PROVINCIAL","BANCO_DEL_TESORO","BANCO_PLAZA","SOFITASA","BANCO_ACTIVO","BANCO_AGRICOLA","BANCO_BICENTENARIO","BANCO_CARONI","BANCO_EXTERIOR","BANCRECER","BANFANB","BANGENTE","BANPLUS","DELSUR","R4","VENEZOLANO_DE_CREDITO","BANK_OF_AMERICA","AMERANT_BANK","US_BANK","WELLS_FARGO","BINANCE"]},{"type":"null"}]},"method":{"type":"string","enum":["BANK_TRANSFER","ZELLE","C2P","IMMEDIATE_DEBIT","P2P","CASH","POS","CUSTOMER_CREDIT","STRIPE_ACH","STRIPE_CARD","DEBIT_CARD","PAYROLL","BINANCE_PAY","LEDGER_FEE"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"customerId":{"type":"string"},"amount":{"type":"number"},"transactionDate":{"type":"string"},"rateDate":{"type":["string","null"]},"referenceCode":{"type":["string","null"]},"externalId":{"type":["string","null"]},"receiverBankHolderName":{"type":["string","null"]},"receiverBankNationalId":{"type":["string","null"]},"customerFullName":{"type":["string","null"]},"customerNationalId":{"type":["string","null"]},"customerPhoneNumber":{"type":["string","null"]},"customerBankAccountNumber":{"type":["string","null"]},"customerEmail":{"type":["string","null"]},"customerNote":{"type":["string","null"]},"customerIpAddress":{"type":["string","null"]},"customerUserAgent":{"type":["string","null"]},"isAutoPay":{"type":"boolean"},"bankAccountId":{"type":["string","null"]},"paymentClaimId":{"type":["string","null"]},"bankTransactionId":{"type":["string","null"]},"createdById":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"splitAmount":{"type":["number","null"]}},"required":["currency","receiverBankName","method","id","accountId","customerId","amount","transactionDate","rateDate","referenceCode","externalId","receiverBankHolderName","receiverBankNationalId","customerFullName","customerNationalId","customerPhoneNumber","customerBankAccountNumber","customerEmail","customerNote","customerIpAddress","customerUserAgent","isAutoPay","bankAccountId","paymentClaimId","bankTransactionId","createdById","createdAt","updatedAt","splitAmount"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/plans/{planId}":{"get":{"operationId":"plans-getPlanById","summary":"Get a plan by id","tags":["Plans"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"planId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"schedule":{"type":"string","enum":["SUBSCRIPTION_START","PLAN_DATES"]},"billingCycle":{"anyOf":[{"type":"string","enum":["WEEKLY","BIWEEKLY","MONTHLY","QUARTERLY","SEMESTER","ANNUAL"]},{"type":"null"}]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"pricingMode":{"type":"string","enum":["CURRENCY","REFERENCE"]},"status":{"type":"string","enum":["ACTIVE","INACTIVE"]},"lateFeeType":{"anyOf":[{"type":"string","enum":["PERCENTAGE","FIXED"]},{"type":"null"}]},"discountValueType":{"anyOf":[{"type":"string","enum":["PERCENTAGE","FIXED"]},{"type":"null"}]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"price":{"type":"number"},"advanceBillingDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"advanceDueDateDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"startDate":{"type":"string"},"endDate":{"type":["string","null"]},"lateFee":{"type":["number","null"]},"discountValue":{"type":["number","null"]},"discountExpiresIn":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"singleInvoicePerSubscription":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"paymentMethods":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"planId":{"type":"string"},"accountPaymentMethodId":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"accountPaymentMethod":{"type":"object","properties":{"method":{"type":"string","enum":["BANK_TRANSFER","ZELLE","C2P","IMMEDIATE_DEBIT","P2P","CASH","POS","CUSTOMER_CREDIT","STRIPE_ACH","STRIPE_CARD","DEBIT_CARD","PAYROLL","BINANCE_PAY","LEDGER_FEE"]},"scopes":{"type":"array","items":{"type":"string","enum":["PORTAL","CHECKOUT","KIOSK"]}},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"isDefault":{"type":"boolean"},"displayName":{"type":"string"},"enabled":{"type":"boolean"},"isPayerCharged":{"type":"boolean"},"fee":{"type":["number","null"]},"processorId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["method","scopes","id","accountId","isDefault","displayName","enabled","isPayerCharged","fee","processorId","createdAt","updatedAt"],"additionalProperties":false}},"required":["id","planId","accountPaymentMethodId","createdAt","updatedAt","accountPaymentMethod"],"additionalProperties":false}},"planProducts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"planId":{"type":"string"},"productId":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"product":{"type":"object","properties":{"currency":{"type":"string","enum":["VES","USD","EUR"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"unitId":{"type":["string","null"]},"externalId":{"type":["string","null"]},"code":{"type":["string","null"]},"name":{"type":"string"},"description":{"type":["string","null"]},"imageUrl":{"type":["string","null"]},"price":{"type":"number"},"exento":{"type":"boolean"},"isService":{"type":"boolean"},"isActive":{"type":"boolean"},"availableInPortal":{"type":"boolean"},"availableForSale":{"type":"boolean"},"availableInStorefront":{"type":"boolean"},"isSoldOut":{"type":"boolean"},"categoryId":{"type":["string","null"]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ivaRatePercent":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["currency","id","accountId","unitId","externalId","code","name","description","imageUrl","price","exento","isService","isActive","availableInPortal","availableForSale","availableInStorefront","isSoldOut","categoryId","position","ivaRatePercent","createdAt","updatedAt"],"additionalProperties":false}},"required":["id","accountId","planId","productId","quantity","amount","createdAt","updatedAt","product"],"additionalProperties":false}},"billingDates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"planId":{"type":"string"},"issueDate":{"type":"string"},"dueDate":{"type":"string"},"description":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","planId","issueDate","dueDate","description","createdAt","updatedAt"],"additionalProperties":false}},"_count":{"type":"object","properties":{"subscriptions":{"type":"number"}},"required":["subscriptions"],"additionalProperties":false}},"required":["schedule","billingCycle","currency","pricingMode","status","lateFeeType","discountValueType","id","accountId","name","description","price","advanceBillingDays","advanceDueDateDays","startDate","endDate","lateFee","discountValue","discountExpiresIn","singleInvoicePerSubscription","createdAt","updatedAt","paymentMethods","planProducts"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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":"plans-deletePlan","summary":"Delete a plan","description":"Deletes a plan with no subscriptions. A plan with any subscription, active or ended, is refused.","tags":["Plans"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"planId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/plans":{"get":{"operationId":"plans-getPlans","summary":"Get all plans","tags":["Plans"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"page","schema":{"default":1,"type":"number","minimum":1}},{"in":"query","name":"pageSize","schema":{"default":10,"type":"number","minimum":1,"maximum":1000}},{"in":"query","name":"status","schema":{"type":"string","enum":["ACTIVE","INACTIVE"]}},{"in":"query","name":"startDate","schema":{"type":"string"}},{"in":"query","name":"endDate","schema":{"type":"string"}},{"in":"query","name":"searchTerm","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"schedule":{"type":"string","enum":["SUBSCRIPTION_START","PLAN_DATES"]},"billingCycle":{"anyOf":[{"type":"string","enum":["WEEKLY","BIWEEKLY","MONTHLY","QUARTERLY","SEMESTER","ANNUAL"]},{"type":"null"}]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"pricingMode":{"type":"string","enum":["CURRENCY","REFERENCE"]},"status":{"type":"string","enum":["ACTIVE","INACTIVE"]},"lateFeeType":{"anyOf":[{"type":"string","enum":["PERCENTAGE","FIXED"]},{"type":"null"}]},"discountValueType":{"anyOf":[{"type":"string","enum":["PERCENTAGE","FIXED"]},{"type":"null"}]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"price":{"type":"number"},"advanceBillingDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"advanceDueDateDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"startDate":{"type":"string"},"endDate":{"type":["string","null"]},"lateFee":{"type":["number","null"]},"discountValue":{"type":["number","null"]},"discountExpiresIn":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"singleInvoicePerSubscription":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"paymentMethods":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"planId":{"type":"string"},"accountPaymentMethodId":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"accountPaymentMethod":{"type":"object","properties":{"method":{"type":"string","enum":["BANK_TRANSFER","ZELLE","C2P","IMMEDIATE_DEBIT","P2P","CASH","POS","CUSTOMER_CREDIT","STRIPE_ACH","STRIPE_CARD","DEBIT_CARD","PAYROLL","BINANCE_PAY","LEDGER_FEE"]},"scopes":{"type":"array","items":{"type":"string","enum":["PORTAL","CHECKOUT","KIOSK"]}},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"isDefault":{"type":"boolean"},"displayName":{"type":"string"},"enabled":{"type":"boolean"},"isPayerCharged":{"type":"boolean"},"fee":{"type":["number","null"]},"processorId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["method","scopes","id","accountId","isDefault","displayName","enabled","isPayerCharged","fee","processorId","createdAt","updatedAt"],"additionalProperties":false}},"required":["id","planId","accountPaymentMethodId","createdAt","updatedAt","accountPaymentMethod"],"additionalProperties":false}},"planProducts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"planId":{"type":"string"},"productId":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"product":{"type":"object","properties":{"currency":{"type":"string","enum":["VES","USD","EUR"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"unitId":{"type":["string","null"]},"externalId":{"type":["string","null"]},"code":{"type":["string","null"]},"name":{"type":"string"},"description":{"type":["string","null"]},"imageUrl":{"type":["string","null"]},"price":{"type":"number"},"exento":{"type":"boolean"},"isService":{"type":"boolean"},"isActive":{"type":"boolean"},"availableInPortal":{"type":"boolean"},"availableForSale":{"type":"boolean"},"availableInStorefront":{"type":"boolean"},"isSoldOut":{"type":"boolean"},"categoryId":{"type":["string","null"]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ivaRatePercent":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["currency","id","accountId","unitId","externalId","code","name","description","imageUrl","price","exento","isService","isActive","availableInPortal","availableForSale","availableInStorefront","isSoldOut","categoryId","position","ivaRatePercent","createdAt","updatedAt"],"additionalProperties":false}},"required":["id","accountId","planId","productId","quantity","amount","createdAt","updatedAt","product"],"additionalProperties":false}},"billingDates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"planId":{"type":"string"},"issueDate":{"type":"string"},"dueDate":{"type":"string"},"description":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","planId","issueDate","dueDate","description","createdAt","updatedAt"],"additionalProperties":false}},"_count":{"type":"object","properties":{"subscriptions":{"type":"number"}},"required":["subscriptions"],"additionalProperties":false}},"required":["schedule","billingCycle","currency","pricingMode","status","lateFeeType","discountValueType","id","accountId","name","description","price","advanceBillingDays","advanceDueDateDays","startDate","endDate","lateFee","discountValue","discountExpiresIn","singleInvoicePerSubscription","createdAt","updatedAt","paymentMethods","planProducts"],"additionalProperties":false}},"total":{"type":"number"},"totalPages":{"type":"number"},"nextCursor":{"description":"The cursor to get the next page of results","type":["string","null"]},"exchangeRates":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"rate":{"type":"number"},"rateDate":{"type":"string"},"daysAhead":{"type":"number"}},"required":["rate","rateDate","daysAhead"],"additionalProperties":false}}},"required":["results","total","totalPages"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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"}}}}}},"post":{"operationId":"plans-createPlan","summary":"Create a monthly or weekly plan","tags":["Plans"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":4},"description":{"type":["string","null"]},"startDate":{"type":"string"},"endDate":{"type":"string"},"currency":{"default":"USD","type":"string","enum":["VES","USD","EUR"]},"status":{"default":"ACTIVE","type":"string","enum":["ACTIVE","INACTIVE"]},"schedule":{"default":"SUBSCRIPTION_START","type":"string","enum":["SUBSCRIPTION_START","PLAN_DATES"]},"billingCycle":{"default":"MONTHLY","anyOf":[{"type":"string","enum":["WEEKLY","BIWEEKLY","MONTHLY","QUARTERLY","SEMESTER","ANNUAL"]},{"type":"null"}]},"advanceBillingDays":{"type":"number","minimum":0},"advanceDueDateDays":{"type":"number","minimum":0,"maximum":300},"price":{"type":"number","minimum":1},"lateFee":{"type":"number","minimum":0},"lateFeeType":{"type":"string","enum":["PERCENTAGE","FIXED"]},"discountExpiresIn":{"type":"number","minimum":0},"discountValue":{"type":"number","minimum":0},"discountValueType":{"type":"string","enum":["PERCENTAGE","FIXED"]},"billingDates":{"type":"array","items":{"type":"object","properties":{"issueDate":{"type":"string"},"dueDate":{"type":"string"},"description":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]}},"required":["issueDate","dueDate"]}},"accountPaymentMethodIds":{"type":"array","items":{"type":"string"}},"singleInvoicePerSubscription":{"type":"boolean"},"planProducts":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"productId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"quantity":{"default":1,"type":"integer","minimum":1,"maximum":1},"amount":{"type":"number","minimum":0}},"required":["productId","amount"]}}},"required":["name","startDate","price"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"schedule":{"type":"string","enum":["SUBSCRIPTION_START","PLAN_DATES"]},"billingCycle":{"anyOf":[{"type":"string","enum":["WEEKLY","BIWEEKLY","MONTHLY","QUARTERLY","SEMESTER","ANNUAL"]},{"type":"null"}]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"pricingMode":{"type":"string","enum":["CURRENCY","REFERENCE"]},"status":{"type":"string","enum":["ACTIVE","INACTIVE"]},"lateFeeType":{"anyOf":[{"type":"string","enum":["PERCENTAGE","FIXED"]},{"type":"null"}]},"discountValueType":{"anyOf":[{"type":"string","enum":["PERCENTAGE","FIXED"]},{"type":"null"}]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"price":{"type":"number"},"advanceBillingDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"advanceDueDateDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"startDate":{"type":"string"},"endDate":{"type":["string","null"]},"lateFee":{"type":["number","null"]},"discountValue":{"type":["number","null"]},"discountExpiresIn":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"singleInvoicePerSubscription":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["schedule","billingCycle","currency","pricingMode","status","lateFeeType","discountValueType","id","accountId","name","description","price","advanceBillingDays","advanceDueDateDays","startDate","endDate","lateFee","discountValue","discountExpiresIn","singleInvoicePerSubscription","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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"}}}}}},"put":{"operationId":"plans-modifyPlan","summary":"Modify an existing plan","tags":["Plans"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":4},"description":{"type":["string","null"]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"status":{"type":"string","enum":["ACTIVE","INACTIVE"]},"schedule":{"type":"string","enum":["SUBSCRIPTION_START","PLAN_DATES"]},"billingCycle":{"anyOf":[{"type":"string","enum":["WEEKLY","BIWEEKLY","MONTHLY","QUARTERLY","SEMESTER","ANNUAL"]},{"type":"null"}]},"advanceBillingDays":{"type":"number","minimum":0},"advanceDueDateDays":{"type":"number","minimum":0,"maximum":300},"price":{"type":"number","minimum":1},"lateFee":{"type":"number","minimum":0},"lateFeeType":{"type":"string","enum":["PERCENTAGE","FIXED"]},"discountExpiresIn":{"type":"number","minimum":0},"discountValue":{"type":"number","minimum":0},"discountValueType":{"type":"string","enum":["PERCENTAGE","FIXED"]},"billingDates":{"type":"array","items":{"type":"object","properties":{"issueDate":{"type":"string"},"dueDate":{"type":"string"},"description":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]}},"required":["issueDate","dueDate"]}},"accountPaymentMethodIds":{"type":"array","items":{"type":"string"}},"singleInvoicePerSubscription":{"type":"boolean"},"planProducts":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"productId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"quantity":{"default":1,"type":"integer","minimum":1,"maximum":1},"amount":{"type":"number","minimum":0}},"required":["productId","amount"]}},"planId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"}},"required":["name","price","planId"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"schedule":{"type":"string","enum":["SUBSCRIPTION_START","PLAN_DATES"]},"billingCycle":{"anyOf":[{"type":"string","enum":["WEEKLY","BIWEEKLY","MONTHLY","QUARTERLY","SEMESTER","ANNUAL"]},{"type":"null"}]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"pricingMode":{"type":"string","enum":["CURRENCY","REFERENCE"]},"status":{"type":"string","enum":["ACTIVE","INACTIVE"]},"lateFeeType":{"anyOf":[{"type":"string","enum":["PERCENTAGE","FIXED"]},{"type":"null"}]},"discountValueType":{"anyOf":[{"type":"string","enum":["PERCENTAGE","FIXED"]},{"type":"null"}]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"price":{"type":"number"},"advanceBillingDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"advanceDueDateDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"startDate":{"type":"string"},"endDate":{"type":["string","null"]},"lateFee":{"type":["number","null"]},"discountValue":{"type":["number","null"]},"discountExpiresIn":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"singleInvoicePerSubscription":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["schedule","billingCycle","currency","pricingMode","status","lateFeeType","discountValueType","id","accountId","name","description","price","advanceBillingDays","advanceDueDateDays","startDate","endDate","lateFee","discountValue","discountExpiresIn","singleInvoicePerSubscription","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/plans/{planId}/subscriptions":{"get":{"operationId":"plans-getPlanSubscriptions","summary":"Get subscriptions of a plan","tags":["Plans","Subscriptions"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"planId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string","enum":["ACTIVE","INACTIVE"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"customerId":{"type":"string"},"planId":{"type":"string"},"externalId":{"type":["string","null"]},"name":{"type":"string"},"startDate":{"type":"string"},"endDate":{"type":["string","null"]},"nextBillingDate":{"type":["string","null"]},"studentId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"customer":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"firstName":{"type":"string"},"lastName":{"type":"string"},"nationalId":{"type":["string","null"]},"externalId":{"type":["string","null"]}},"required":["id","firstName","lastName","nationalId","externalId"],"additionalProperties":false},"student":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"firstName":{"type":"string"},"lastName":{"type":"string"},"nationalId":{"type":["string","null"]},"externalId":{"type":["string","null"]}},"required":["id","firstName","lastName","nationalId","externalId"],"additionalProperties":false}},"required":["status","id","accountId","customerId","planId","externalId","name","startDate","endDate","nextBillingDate","studentId","createdAt","updatedAt","customer"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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"}}}}}},"post":{"operationId":"subscriptions-createSubscription","summary":"Subscribe to a plan","tags":["Plans"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"planId","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customerId":{"type":"string"},"name":{"type":"string","minLength":1},"startDate":{"type":"string"},"endDate":{"type":"string"},"studentId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"}},"required":["customerId","name","startDate"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ACTIVE","INACTIVE"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"customerId":{"type":"string"},"planId":{"type":"string"},"externalId":{"type":["string","null"]},"name":{"type":"string"},"startDate":{"type":"string"},"endDate":{"type":["string","null"]},"nextBillingDate":{"type":["string","null"]},"studentId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["status","id","accountId","customerId","planId","externalId","name","startDate","endDate","nextBillingDate","studentId","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/products":{"get":{"operationId":"products-getProducts","summary":"Get products","tags":["Products"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"onlyActive","schema":{"type":"boolean","default":false}},{"in":"query","name":"onlyAvailableForSale","schema":{"type":"boolean","default":false}},{"in":"query","name":"currency","schema":{"type":"string","enum":["VES","USD","EUR"]}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","enum":["VES","USD","EUR"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"unitId":{"type":["string","null"]},"externalId":{"type":["string","null"]},"code":{"type":["string","null"]},"name":{"type":"string"},"description":{"type":["string","null"]},"imageUrl":{"type":["string","null"]},"price":{"type":"number"},"exento":{"type":"boolean"},"isService":{"type":"boolean"},"isActive":{"type":"boolean"},"availableInPortal":{"type":"boolean"},"availableForSale":{"type":"boolean"},"availableInStorefront":{"type":"boolean"},"isSoldOut":{"type":"boolean"},"categoryId":{"type":["string","null"]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ivaRatePercent":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"unit":{"anyOf":[{"type":"object","properties":{"category":{"type":"string","enum":["COUNT","WEIGHT","VOLUME","LENGTH"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"isActive":{"type":"boolean"},"isBaseUnit":{"type":"boolean"},"baseUnitId":{"type":["string","null"]},"conversionNumerator":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"conversionDenominator":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"decimalPrecision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["category","id","accountId","name","description","isActive","isBaseUnit","baseUnitId","conversionNumerator","conversionDenominator","decimalPrecision","createdAt","updatedAt"],"additionalProperties":false},{"type":"null"}]}},"required":["currency","id","accountId","unitId","externalId","code","name","description","imageUrl","price","exento","isService","isActive","availableInPortal","availableForSale","availableInStorefront","isSoldOut","categoryId","position","ivaRatePercent","createdAt","updatedAt","unit"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/products/paginated":{"get":{"operationId":"products-getPaginatedProducts","summary":"Get paginated products","tags":["Products"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":100,"type":"number","minimum":1,"maximum":250}},{"in":"query","name":"searchTerm","schema":{"type":"string"}},{"in":"query","name":"isActive","schema":{"type":"boolean"}},{"in":"query","name":"exento","schema":{"type":"boolean"}},{"in":"query","name":"isService","schema":{"type":"boolean"}},{"in":"query","name":"unitId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"}},{"in":"query","name":"currency","schema":{"type":"string","enum":["VES","USD","EUR"]}},{"in":"query","name":"sortKey","schema":{"default":"name","type":"string","enum":["externalId","name","unit","price","currency","exento","isService","isActive"]}},{"in":"query","name":"sortDirection","schema":{"default":"asc","type":"string","enum":["asc","desc"]}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","enum":["VES","USD","EUR"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"unitId":{"type":["string","null"]},"externalId":{"type":["string","null"]},"code":{"type":["string","null"]},"name":{"type":"string"},"description":{"type":["string","null"]},"imageUrl":{"type":["string","null"]},"price":{"type":"number"},"exento":{"type":"boolean"},"isService":{"type":"boolean"},"isActive":{"type":"boolean"},"availableInPortal":{"type":"boolean"},"availableForSale":{"type":"boolean"},"availableInStorefront":{"type":"boolean"},"isSoldOut":{"type":"boolean"},"categoryId":{"type":["string","null"]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ivaRatePercent":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"unit":{"anyOf":[{"type":"object","properties":{"category":{"type":"string","enum":["COUNT","WEIGHT","VOLUME","LENGTH"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"isActive":{"type":"boolean"},"isBaseUnit":{"type":"boolean"},"baseUnitId":{"type":["string","null"]},"conversionNumerator":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"conversionDenominator":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"decimalPrecision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["category","id","accountId","name","description","isActive","isBaseUnit","baseUnitId","conversionNumerator","conversionDenominator","decimalPrecision","createdAt","updatedAt"],"additionalProperties":false},{"type":"null"}]}},"required":["currency","id","accountId","unitId","externalId","code","name","description","imageUrl","price","exento","isService","isActive","availableInPortal","availableForSale","availableInStorefront","isSoldOut","categoryId","position","ivaRatePercent","createdAt","updatedAt","unit"],"additionalProperties":false}},"total":{"type":"number"},"totalPages":{"type":"number"},"nextCursor":{"description":"The cursor to get the next page of results","type":["string","null"]},"exchangeRates":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"rate":{"type":"number"},"rateDate":{"type":"string"},"daysAhead":{"type":"number"}},"required":["rate","rateDate","daysAhead"],"additionalProperties":false}}},"required":["results","total","totalPages"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/products/save":{"post":{"operationId":"products-saveProduct","summary":"Create or update a product","tags":["Products"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"externalId":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"code":{"anyOf":[{"type":"string","pattern":"^[a-zA-Z0-9]{1,6}$"},{"type":"null"}]},"name":{"type":"string","minLength":1,"maxLength":255},"description":{"type":"string","maxLength":500},"price":{"default":0,"type":"number","minimum":0},"currency":{"default":"USD","type":"string","enum":["VES","USD","EUR"]},"unitName":{"type":"string","minLength":1,"maxLength":120},"unitId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"exento":{"default":false,"type":"boolean"},"isService":{"default":false,"type":"boolean"},"availableInPortal":{"type":"boolean"},"availableForSale":{"type":"boolean"},"ivaRatePercent":{"anyOf":[{"type":"number","enum":[8,16,31]},{"type":"null"}]},"isActive":{"default":true,"type":"boolean"},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"availableInStorefront":{"type":"boolean"},"isSoldOut":{"type":"boolean"},"categoryId":{"anyOf":[{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},{"type":"null"}]},"imageUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"confirmDeactivateAssociatedPlans":{"default":false,"type":"boolean"},"confirmPriceChangeAssociatedPlans":{"default":false,"type":"boolean"}},"required":["name"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"currency":{"type":"string","enum":["VES","USD","EUR"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"unitId":{"type":["string","null"]},"externalId":{"type":["string","null"]},"code":{"type":["string","null"]},"name":{"type":"string"},"description":{"type":["string","null"]},"imageUrl":{"type":["string","null"]},"price":{"type":"number"},"exento":{"type":"boolean"},"isService":{"type":"boolean"},"isActive":{"type":"boolean"},"availableInPortal":{"type":"boolean"},"availableForSale":{"type":"boolean"},"availableInStorefront":{"type":"boolean"},"isSoldOut":{"type":"boolean"},"categoryId":{"type":["string","null"]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ivaRatePercent":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"unit":{"anyOf":[{"type":"object","properties":{"category":{"type":"string","enum":["COUNT","WEIGHT","VOLUME","LENGTH"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"isActive":{"type":"boolean"},"isBaseUnit":{"type":"boolean"},"baseUnitId":{"type":["string","null"]},"conversionNumerator":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"conversionDenominator":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"decimalPrecision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["category","id","accountId","name","description","isActive","isBaseUnit","baseUnitId","conversionNumerator","conversionDenominator","decimalPrecision","createdAt","updatedAt"],"additionalProperties":false},{"type":"null"}]}},"required":["currency","id","accountId","unitId","externalId","code","name","description","imageUrl","price","exento","isService","isActive","availableInPortal","availableForSale","availableInStorefront","isSoldOut","categoryId","position","ivaRatePercent","createdAt","updatedAt","unit"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/products/bulk":{"post":{"operationId":"products-createProducts","summary":"Create products in bulk","tags":["Products"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"products":{"minItems":1,"maxItems":1000,"type":"array","items":{"$ref":"#/components/schemas/Product"}}},"required":["products"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"number"}},"required":["count"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/products/{productId}":{"delete":{"operationId":"products-deleteProduct","summary":"Delete a product","tags":["Products"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"productId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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":"products-getProductById","summary":"Get a product by id","tags":["Products"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"productId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"currency":{"type":"string","enum":["VES","USD","EUR"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"unitId":{"type":["string","null"]},"externalId":{"type":["string","null"]},"code":{"type":["string","null"]},"name":{"type":"string"},"description":{"type":["string","null"]},"imageUrl":{"type":["string","null"]},"price":{"type":"number"},"exento":{"type":"boolean"},"isService":{"type":"boolean"},"isActive":{"type":"boolean"},"availableInPortal":{"type":"boolean"},"availableForSale":{"type":"boolean"},"availableInStorefront":{"type":"boolean"},"isSoldOut":{"type":"boolean"},"categoryId":{"type":["string","null"]},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ivaRatePercent":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"unit":{"anyOf":[{"type":"object","properties":{"category":{"type":"string","enum":["COUNT","WEIGHT","VOLUME","LENGTH"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"isActive":{"type":"boolean"},"isBaseUnit":{"type":"boolean"},"baseUnitId":{"type":["string","null"]},"conversionNumerator":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"conversionDenominator":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"decimalPrecision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["category","id","accountId","name","description","isActive","isBaseUnit","baseUnitId","conversionNumerator","conversionDenominator","decimalPrecision","createdAt","updatedAt"],"additionalProperties":false},{"type":"null"}]}},"required":["currency","id","accountId","unitId","externalId","code","name","description","imageUrl","price","exento","isService","isActive","availableInPortal","availableForSale","availableInStorefront","isSoldOut","categoryId","position","ivaRatePercent","createdAt","updatedAt","unit"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/product-units":{"get":{"operationId":"productUnits-getProductUnits","summary":"Get product units","tags":["Product Units"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"onlyActive","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string","enum":["COUNT","WEIGHT","VOLUME","LENGTH"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"isActive":{"type":"boolean"},"isBaseUnit":{"type":"boolean"},"baseUnitId":{"type":["string","null"]},"conversionNumerator":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"conversionDenominator":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"decimalPrecision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["category","id","accountId","name","description","isActive","isBaseUnit","baseUnitId","conversionNumerator","conversionDenominator","decimalPrecision","createdAt","updatedAt"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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"}}}}}},"post":{"operationId":"productUnits-saveProductUnit","summary":"Create or update a product unit","tags":["Product Units"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","maxLength":500},"isActive":{"default":true,"type":"boolean"},"category":{"type":"string","enum":["COUNT","WEIGHT","VOLUME","LENGTH"]},"isBaseUnit":{"type":"boolean"},"baseUnitId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"conversionNumerator":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"conversionDenominator":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"decimalPrecision":{"type":"integer","minimum":0,"maximum":6}},"required":["name"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"category":{"type":"string","enum":["COUNT","WEIGHT","VOLUME","LENGTH"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"isActive":{"type":"boolean"},"isBaseUnit":{"type":"boolean"},"baseUnitId":{"type":["string","null"]},"conversionNumerator":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"conversionDenominator":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"decimalPrecision":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["category","id","accountId","name","description","isActive","isBaseUnit","baseUnitId","conversionNumerator","conversionDenominator","decimalPrecision","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/product-units/{unitId}":{"delete":{"operationId":"productUnits-deleteProductUnit","summary":"Delete a product unit","tags":["Product Units"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"unitId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/settlements":{"get":{"operationId":"settlements-getSettlements","summary":"List settlements","description":"The payouts UnoPago has deposited into your bank accounts, newest first by creation. Only completed settlements are listed. Amounts are decimal strings in bolívares (`VES`), the currency of every settlement: `netAmount`, what was deposited, is `totalAmount − totalFees − totalSplits`, where `totalSplits` is the part of those payments owed to vendors (`splits` on their checkout sessions), each paid in a payout of its own. With `vendorId`, the payouts deposited into that vendor's bank account instead. `startDate`/`endDate` filter by `processedAt`; an `endDate` at exactly midnight UTC is treated as that date and includes the whole day — send a timestamp to use an exclusive bound.","tags":["Settlements"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"page","schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"in":"query","name":"pageSize","schema":{"default":10,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"merchantBankAccountId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"}},{"in":"query","name":"vendorId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"}},{"in":"query","name":"bankReference","schema":{"type":"string"}},{"in":"query","name":"startDate","schema":{"type":"string"}},{"in":"query","name":"endDate","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"totalAmount":{"type":"string"},"totalFees":{"type":"string"},"totalSplits":{"default":"0","type":"string"},"netAmount":{"type":"string"},"paymentCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bankReference":{"type":["string","null"]},"processedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"bankAccount":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"bankCode":{"type":"string","enum":["C0105","C0102","C0134","C0114","C0191","C0171","C0156","C0172","C0166","C0175","C0128","C0163","C0115","C0138","C0108","C0137","C0168","C0177","C0146","C0174","C0151","C0157","C0169","C0104"]},"accountNumber":{"type":"string"},"accountType":{"type":"string","enum":["CHECKING","SAVINGS"]}},"required":["id","bankCode","accountNumber","accountType"],"additionalProperties":false},"deposit":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["PENDING","RECONCILED","UNRECONCILED"],"description":"`RECONCILED`: the transfer was found among your bank's movements. `PENDING`: not yet. `UNRECONCILED`: your statement already covers the days after the payout and the transfer is not in it."},"reconciledAt":{"type":["string","null"]},"bankTransaction":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"date":{"type":"string"},"referenceCode":{"type":"string"},"amount":{"type":"string"}},"required":["id","date","referenceCode","amount"],"additionalProperties":false},{"type":"null"}],"description":"The bank movement the transfer became."}},"required":["id","status","reconciledAt","bankTransaction"],"additionalProperties":false},{"type":"null"}],"description":"What became of the payout in your bank. `null` for a vendor's payout, which lands in the vendor's bank, and for a payout UnoPago has no record of reaching yours."}},"required":["id","totalAmount","totalFees","totalSplits","netAmount","paymentCount","bankReference","processedAt","createdAt","bankAccount","deposit"],"additionalProperties":false}},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pageSize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["results","total","page","pageSize","totalPages"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/students/{id}":{"get":{"operationId":"students-getStudent","summary":"Get a student","description":"This API is used to get a student","tags":["Students"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"gender":{"type":"string","enum":["MALE","FEMALE","OTHER"]},"clothingSize":{"anyOf":[{"type":"string","enum":["XS","S","M","L","XL","XXL"]},{"type":"null"}]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"customerId":{"type":["string","null"]},"accountId":{"type":"string"},"externalId":{"type":["string","null"]},"reenrollmentSettingsId":{"type":["string","null"]},"firstName":{"type":"string"},"lastName":{"type":"string"},"nationalId":{"type":["string","null"]},"nationality":{"type":["string","null"]},"dateOfBirth":{"type":["string","null"]},"enrollmentYear":{"type":["string","null"]},"promoYear":{"type":["string","null"]},"sectionId":{"type":["string","null"]},"birthPlace":{"type":["string","null"]},"email":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"active":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"customer":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"externalId":{"type":["string","null"]},"mainContactId":{"type":["string","null"]},"nationalId":{"type":["string","null"]},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"address":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","accountId","externalId","mainContactId","nationalId","firstName","lastName","email","phoneNumber","address","createdAt","updatedAt"],"additionalProperties":false},{"type":"null"}]},"section":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"name":{"type":"string"},"accountId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"gradeId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"grade":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"name":{"type":"string"},"description":{"type":["string","null"]},"level":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","accountId","name","description","level","createdAt","updatedAt"],"additionalProperties":false}},"required":["id","name","accountId","gradeId","createdAt","updatedAt","grade"],"additionalProperties":false},{"type":"null"}]},"reenrollmentSettings":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"startDate":{"type":["string","null"]},"endDate":{"type":["string","null"]}},"required":["name","startDate","endDate"],"additionalProperties":false},{"type":"null"}]},"enrollmentsStudent":{"type":"array","items":{"type":"object","properties":{"enrollment":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["PENDING","APPROVED","REJECTED"]},"enrollmentSettingsId":{"type":"string"}},"required":["id","status","enrollmentSettingsId"],"additionalProperties":false}},"required":["enrollment"],"additionalProperties":false}},"reenrollmentInvoicePaid":{"type":"boolean"},"syncedFrom":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"detachedFrom":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["gender","clothingSize","id","customerId","accountId","externalId","reenrollmentSettingsId","firstName","lastName","nationalId","nationality","dateOfBirth","enrollmentYear","promoYear","sectionId","birthPlace","email","phoneNumber","active","createdAt","updatedAt","customer","section","reenrollmentSettings","enrollmentsStudent","reenrollmentInvoicePaid","syncedFrom","detachedFrom"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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"}}}}}},"put":{"operationId":"students-updateStudent","summary":"Update a student","description":"This API is used to update a student","tags":["Students"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1,"format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"firstName":{"type":"string","minLength":1,"maxLength":50},"customerId":{"anyOf":[{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},{"type":"null"}]},"lastName":{"type":"string","maxLength":50},"nationalId":{"anyOf":[{"type":"string","minLength":2,"maxLength":13,"pattern":"^(CE|[JVEGP])"},{"type":"null"}]},"nationality":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"gender":{"type":"string","enum":["MALE","FEMALE","OTHER"]},"dateOfBirth":{"type":["string","null"]},"enrollmentYear":{"anyOf":[{"type":"string","pattern":"^\\d{4}$"},{"type":"null"}]},"promoYear":{"anyOf":[{"type":"string","pattern":"^\\d{4}$"},{"type":"null"}]},"gradeId":{"anyOf":[{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},{"type":"null"}]},"sectionId":{"anyOf":[{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},{"type":"null"}]},"birthPlace":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"clothingSize":{"anyOf":[{"type":"string","enum":["XS","S","M","L","XL","XXL"]},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":128,"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"}]},"phoneNumber":{"anyOf":[{"type":"string","pattern":"^(?:[01]\\d{3}-?\\d{7}|\\+58(?!0)\\d{3}-?\\d{7}|\\+(?!58)\\d{1,3}\\d{3}-?\\d{7})$"},{"type":"null"}]},"externalId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"active":{"default":true,"type":"boolean"},"syncActive":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Student"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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":"students-deleteStudent","summary":"Delete a student","description":"This API is used to delete a student","tags":["Students"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/students":{"get":{"operationId":"students-getPaginatedStudents","summary":"Get all students","description":"This API is used to get all students. It supports pagination","tags":["Students"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":100,"type":"number","maximum":250}},{"in":"query","name":"searchTerm","schema":{"type":"string"}},{"in":"query","name":"gender","schema":{"type":"string","enum":["MALE","FEMALE","OTHER"]}},{"in":"query","name":"promoYear","schema":{"type":"string"}},{"in":"query","name":"enrollmentYear","schema":{"type":"string"}},{"in":"query","name":"clothingSize","schema":{"type":"string","enum":["XS","S","M","L","XL","XXL"]}},{"in":"query","name":"active","schema":{"type":"boolean"}},{"in":"query","name":"planId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"}},{"in":"query","name":"gradeId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"}},{"in":"query","name":"reenrollmentSettingsId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"}},{"in":"query","name":"tagId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"gender":{"type":"string","enum":["MALE","FEMALE","OTHER"]},"clothingSize":{"anyOf":[{"type":"string","enum":["XS","S","M","L","XL","XXL"]},{"type":"null"}]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"customerId":{"type":["string","null"]},"accountId":{"type":"string"},"externalId":{"type":["string","null"]},"reenrollmentSettingsId":{"type":["string","null"]},"firstName":{"type":"string"},"lastName":{"type":"string"},"nationalId":{"type":["string","null"]},"nationality":{"type":["string","null"]},"dateOfBirth":{"type":["string","null"]},"enrollmentYear":{"type":["string","null"]},"promoYear":{"type":["string","null"]},"sectionId":{"type":["string","null"]},"birthPlace":{"type":["string","null"]},"email":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"active":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"customer":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"externalId":{"type":["string","null"]},"mainContactId":{"type":["string","null"]},"nationalId":{"type":["string","null"]},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"address":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","accountId","externalId","mainContactId","nationalId","firstName","lastName","email","phoneNumber","address","createdAt","updatedAt"],"additionalProperties":false},{"type":"null"}]},"section":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"name":{"type":"string"},"accountId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"gradeId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"grade":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"name":{"type":"string"},"description":{"type":["string","null"]},"level":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","accountId","name","description","level","createdAt","updatedAt"],"additionalProperties":false}},"required":["id","name","accountId","gradeId","createdAt","updatedAt","grade"],"additionalProperties":false},{"type":"null"}]},"subscriptions":{"type":"array","items":{"type":"object","properties":{"plan":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"required":["plan"],"additionalProperties":false}},"tags":{"type":"array","items":{"type":"object","properties":{"entityTypes":{"type":"array","items":{"type":"string","enum":["CUSTOMER","INVOICE","INVOICE_ITEM","SUBSCRIPTION","PLAN","PAYMENT","STUDENT","CONTACT","BANK_ACCOUNT","TRANSACTION_FILE","ENROLLMENT"]}},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"name":{"type":"string"},"emoji":{"type":["string","null"]},"color":{"type":["string","null"]},"description":{"type":["string","null"]},"isActive":{"type":"boolean"},"sortOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"deletedAt":{"type":["string","null"]}},"required":["entityTypes","id","accountId","name","emoji","color","description","isActive","sortOrder","createdAt","updatedAt","deletedAt"],"additionalProperties":false}},"syncedFrom":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["gender","clothingSize","id","customerId","accountId","externalId","reenrollmentSettingsId","firstName","lastName","nationalId","nationality","dateOfBirth","enrollmentYear","promoYear","sectionId","birthPlace","email","phoneNumber","active","createdAt","updatedAt","customer","section","subscriptions","tags","syncedFrom"],"additionalProperties":false}},"total":{"type":"number"},"totalPages":{"type":"number"},"nextCursor":{"description":"The cursor to get the next page of results","type":["string","null"]},"exchangeRates":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"rate":{"type":"number"},"rateDate":{"type":"string"},"daysAhead":{"type":"number"}},"required":["rate","rateDate","daysAhead"],"additionalProperties":false}}},"required":["results","total","totalPages"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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"}}}}}},"post":{"operationId":"students-createStudent","summary":"Create a student","description":"This API is used to create a student and associate it to a customer","tags":["Students"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"firstName":{"type":"string","minLength":1,"maxLength":50},"customerId":{"anyOf":[{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},{"type":"null"}]},"lastName":{"type":"string","maxLength":50},"nationalId":{"anyOf":[{"type":"string","minLength":2,"maxLength":13,"pattern":"^(CE|[JVEGP])"},{"type":"null"}]},"nationality":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"gender":{"type":"string","enum":["MALE","FEMALE","OTHER"]},"dateOfBirth":{"type":["string","null"]},"enrollmentYear":{"anyOf":[{"type":"string","pattern":"^\\d{4}$"},{"type":"null"}]},"promoYear":{"anyOf":[{"type":"string","pattern":"^\\d{4}$"},{"type":"null"}]},"gradeId":{"anyOf":[{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},{"type":"null"}]},"sectionId":{"anyOf":[{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},{"type":"null"}]},"birthPlace":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"clothingSize":{"anyOf":[{"type":"string","enum":["XS","S","M","L","XL","XXL"]},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":128,"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"}]},"phoneNumber":{"anyOf":[{"type":"string","pattern":"^(?:[01]\\d{3}-?\\d{7}|\\+58(?!0)\\d{3}-?\\d{7}|\\+(?!58)\\d{1,3}\\d{3}-?\\d{7})$"},{"type":"null"}]},"externalId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"active":{"default":true,"type":"boolean"},"customerExternalId":{"type":["string","null"]}},"required":["firstName","lastName","gender"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Student"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/students/link-customer":{"put":{"operationId":"students-linkCustomer","summary":"Link a student to a customer","description":"This API is used to link a student to a customer","tags":["Students"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"studentId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"customerId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"}},"required":["studentId","customerId"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Student"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/students/unlink-customer":{"put":{"operationId":"students-unlinkCustomer","summary":"Unlink a student from a customer","description":"This API is used to unlink a student from a customer","tags":["Students"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"studentId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"customerId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"}},"required":["studentId","customerId"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Student"}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/plans/{planId}/subscriptions/bulk":{"post":{"operationId":"subscriptions-createSubscriptionsBulk","summary":"Bulk subscribe customers to a plan","tags":["Plans"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"planId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customerIds":{"minItems":1,"type":"array","items":{"type":"string","minLength":1}},"name":{"type":"string","minLength":1},"startDate":{"type":"string"},"endDate":{"type":"string"}},"required":["customerIds","name","startDate"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"schedule":{"type":"string","enum":["SUBSCRIPTION_START","PLAN_DATES"]},"billingCycle":{"anyOf":[{"type":"string","enum":["WEEKLY","BIWEEKLY","MONTHLY","QUARTERLY","SEMESTER","ANNUAL"]},{"type":"null"}]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"pricingMode":{"type":"string","enum":["CURRENCY","REFERENCE"]},"status":{"type":"string","enum":["ACTIVE","INACTIVE"]},"lateFeeType":{"anyOf":[{"type":"string","enum":["PERCENTAGE","FIXED"]},{"type":"null"}]},"discountValueType":{"anyOf":[{"type":"string","enum":["PERCENTAGE","FIXED"]},{"type":"null"}]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"price":{"type":"number"},"advanceBillingDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"advanceDueDateDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"startDate":{"type":"string"},"endDate":{"type":["string","null"]},"lateFee":{"type":["number","null"]},"discountValue":{"type":["number","null"]},"discountExpiresIn":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"singleInvoicePerSubscription":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["schedule","billingCycle","currency","pricingMode","status","lateFeeType","discountValueType","id","accountId","name","description","price","advanceBillingDays","advanceDueDateDays","startDate","endDate","lateFee","discountValue","discountExpiresIn","singleInvoicePerSubscription","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/plans/{planId}/subscriptions/{subscriptionId}":{"delete":{"operationId":"subscriptions-deleteSubscription","summary":"Unsubscribe from a plan","description":"Deletes a subscription that has no orders. A subscription with orders is ended instead: it becomes INACTIVE, its end date moves to the day before its first unbilled cycle, and its orders are kept. Ending one that is already inactive succeeds without changes.","tags":["Plans"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"planId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true},{"in":"path","name":"subscriptionId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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"}}}}}},"put":{"operationId":"subscriptions-updateSubscription","summary":"Update customer subscription information","tags":["Plans"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"subscriptionId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true},{"in":"path","name":"planId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"startDate":{"type":"string"},"endDate":{"type":["string","null"]},"status":{"type":"string","enum":["ACTIVE","INACTIVE"]},"studentId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"}},"required":["name","endDate","status"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ACTIVE","INACTIVE"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"customerId":{"type":"string"},"planId":{"type":"string"},"externalId":{"type":["string","null"]},"name":{"type":"string"},"startDate":{"type":"string"},"endDate":{"type":["string","null"]},"nextBillingDate":{"type":["string","null"]},"studentId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["status","id","accountId","customerId","planId","externalId","name","startDate","endDate","nextBillingDate","studentId","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/grades":{"get":{"operationId":"grades-getGrades","summary":"Retrieve all grades for the current account, including their associated sections, ordered by level.","tags":["Grades"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"name":{"type":"string"},"description":{"type":["string","null"]},"level":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"sections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"name":{"type":"string"},"accountId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"gradeId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","accountId","gradeId","createdAt","updatedAt"],"additionalProperties":false}}},"required":["id","accountId","name","description","level","createdAt","updatedAt","sections"],"additionalProperties":false}}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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"}}}}}},"post":{"operationId":"grades-saveGrade","summary":"Create a new grade or update an existing grade for the current account.","tags":["Grades"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"gradeId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"name":{"type":"string"},"description":{"type":"string"},"level":{"type":"number"}},"required":["name","level"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"name":{"type":"string"},"description":{"type":"string"},"level":{"type":"number"}},"required":["id","name","level"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/grades/{gradeId}":{"get":{"operationId":"grades-getGradeById","summary":"Retrieve a specific grade by its ID, including all related sections.","tags":["Grades"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"gradeId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"name":{"type":"string"},"description":{"type":["string","null"]},"level":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"sections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"name":{"type":"string"},"accountId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"gradeId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","accountId","gradeId","createdAt","updatedAt"],"additionalProperties":false}}},"required":["id","accountId","name","description","level","createdAt","updatedAt","sections"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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":"grades-deleteGrade","summary":"Delete a grade and all its associated sections by grade ID.","tags":["Grades"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"gradeId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/grades/sections/{sectionId}":{"get":{"operationId":"grades-getSectionById","summary":"Retrieve a specific section by its ID, including its associated grade.","tags":["Sections"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"sectionId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"name":{"type":"string"},"grade":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"name":{"type":"string"},"description":{"type":["string","null"]},"level":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","description","level"],"additionalProperties":false}},"required":["id","name","grade"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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":"grades-deleteSection","summary":"Delete a section by its ID from a specific grade.","tags":["Sections"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"sectionId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/grades/sections":{"post":{"operationId":"grades-saveSection","summary":"Create a new section or update an existing section for a specific grade.","tags":["Sections"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sectionId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"name":{"type":"string"},"gradeId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"}},"required":["name","gradeId"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/tags":{"get":{"operationId":"tags-getAvailableTags","summary":"Get available tags for the account","tags":["Tags"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"entityType","schema":{"type":"string","enum":["CUSTOMER","INVOICE","INVOICE_ITEM","SUBSCRIPTION","PLAN","PAYMENT","STUDENT","CONTACT","BANK_ACCOUNT","TRANSACTION_FILE","ENROLLMENT"]}},{"in":"query","name":"onlyActive","schema":{"type":"boolean","default":true}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"entityTypes":{"type":"array","items":{"type":"string","enum":["CUSTOMER","INVOICE","INVOICE_ITEM","SUBSCRIPTION","PLAN","PAYMENT","STUDENT","CONTACT","BANK_ACCOUNT","TRANSACTION_FILE","ENROLLMENT"]}},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"name":{"type":"string"},"emoji":{"type":["string","null"]},"color":{"type":["string","null"]},"description":{"type":["string","null"]},"isActive":{"type":"boolean"},"sortOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"deletedAt":{"type":["string","null"]}},"required":["entityTypes","id","accountId","name","emoji","color","description","isActive","sortOrder","createdAt","updatedAt","deletedAt"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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"}}}}}},"post":{"operationId":"tags-saveTag","summary":"Create or update a tag","tags":["Tags"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"name":{"type":"string","minLength":1,"maxLength":100},"emoji":{"type":"string","maxLength":10},"color":{"type":"string","pattern":"^#[0-9A-F]{6}$"},"description":{"type":"string","maxLength":500},"sortOrder":{"type":"integer","minimum":0,"maximum":9007199254740991},"entityTypes":{"default":["CUSTOMER"],"minItems":1,"type":"array","items":{"type":"string","enum":["CUSTOMER","INVOICE","INVOICE_ITEM","SUBSCRIPTION","PLAN","PAYMENT","STUDENT","CONTACT","BANK_ACCOUNT","TRANSACTION_FILE","ENROLLMENT"]}},"isActive":{"type":"boolean"}},"required":["name"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"entityTypes":{"type":"array","items":{"type":"string","enum":["CUSTOMER","INVOICE","INVOICE_ITEM","SUBSCRIPTION","PLAN","PAYMENT","STUDENT","CONTACT","BANK_ACCOUNT","TRANSACTION_FILE","ENROLLMENT"]}},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"name":{"type":"string"},"emoji":{"type":["string","null"]},"color":{"type":["string","null"]},"description":{"type":["string","null"]},"isActive":{"type":"boolean"},"sortOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"deletedAt":{"type":["string","null"]}},"required":["entityTypes","id","accountId","name","emoji","color","description","isActive","sortOrder","createdAt","updatedAt","deletedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/tags/{tagId}":{"delete":{"operationId":"tags-deleteTag","summary":"Delete a tag","tags":["Tags"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"tagId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/customers/{customerId}/tags":{"post":{"operationId":"tags-assignTagToCustomer","summary":"Assign a tag to a customer","tags":["Tags"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"customerId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tagId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"}},"required":["tagId"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"customerId":{"type":"string"},"tagId":{"type":"string"},"metadata":{"anyOf":[{"$ref":"#/components/schemas/__schema1"},{"type":"null"}]},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"]}},"required":["id","accountId","customerId","tagId","metadata","createdAt","createdBy"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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":"tags-getCustomerTags","summary":"Get tags assigned to a customer","tags":["Tags"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"customerId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"customerId":{"type":"string"},"tagId":{"type":"string"},"metadata":{"anyOf":[{"$ref":"#/components/schemas/__schema1"},{"type":"null"}]},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"]},"tag":{"type":"object","properties":{"entityTypes":{"type":"array","items":{"type":"string","enum":["CUSTOMER","INVOICE","INVOICE_ITEM","SUBSCRIPTION","PLAN","PAYMENT","STUDENT","CONTACT","BANK_ACCOUNT","TRANSACTION_FILE","ENROLLMENT"]}},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"name":{"type":"string"},"emoji":{"type":["string","null"]},"color":{"type":["string","null"]},"description":{"type":["string","null"]},"isActive":{"type":"boolean"},"sortOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"deletedAt":{"type":["string","null"]}},"required":["entityTypes","id","accountId","name","emoji","color","description","isActive","sortOrder","createdAt","updatedAt","deletedAt"],"additionalProperties":false}},"required":["id","accountId","customerId","tagId","metadata","createdAt","createdBy","tag"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/customers/{customerId}/tags/{tagId}":{"delete":{"operationId":"tags-removeTagFromCustomer","summary":"Remove a tag from a customer","tags":["Tags"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"customerId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true},{"in":"path","name":"tagId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/students/{studentId}/tags":{"post":{"operationId":"tags-assignTagToStudent","summary":"Assign a tag to a student","tags":["Tags"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"studentId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tagId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"}},"required":["tagId"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"studentId":{"type":"string"},"tagId":{"type":"string"},"metadata":{"anyOf":[{"$ref":"#/components/schemas/__schema1"},{"type":"null"}]},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"]}},"required":["id","accountId","studentId","tagId","metadata","createdAt","createdBy"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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":"tags-getStudentTags","summary":"Get tags assigned to a student","tags":["Tags"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"studentId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"studentId":{"type":"string"},"tagId":{"type":"string"},"metadata":{"anyOf":[{"$ref":"#/components/schemas/__schema1"},{"type":"null"}]},"createdAt":{"type":"string"},"createdBy":{"type":["string","null"]},"tag":{"type":"object","properties":{"entityTypes":{"type":"array","items":{"type":"string","enum":["CUSTOMER","INVOICE","INVOICE_ITEM","SUBSCRIPTION","PLAN","PAYMENT","STUDENT","CONTACT","BANK_ACCOUNT","TRANSACTION_FILE","ENROLLMENT"]}},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"name":{"type":"string"},"emoji":{"type":["string","null"]},"color":{"type":["string","null"]},"description":{"type":["string","null"]},"isActive":{"type":"boolean"},"sortOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"deletedAt":{"type":["string","null"]}},"required":["entityTypes","id","accountId","name","emoji","color","description","isActive","sortOrder","createdAt","updatedAt","deletedAt"],"additionalProperties":false}},"required":["id","accountId","studentId","tagId","metadata","createdAt","createdBy","tag"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/students/{studentId}/tags/{tagId}":{"delete":{"operationId":"tags-removeTagFromStudent","summary":"Remove a tag from a student","tags":["Tags"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"studentId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true},{"in":"path","name":"tagId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/webhook-events/{eventId}":{"get":{"operationId":"webhookEvents-getWebhookEventById","summary":"Get a webhook event by id","tags":["Webhooks"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"eventId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"webhookId":{"type":"string"},"eventType":{"type":"string"},"entityId":{"type":["string","null"]},"connectedAccountId":{"type":["string","null"]},"url":{"type":"string"},"data":{"description":"This contains the data that will be sent to the webhook endpoint","example":{"id":"string","payment":{}},"$ref":"#/components/schemas/JsonValue"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","accountId","webhookId","eventType","entityId","connectedAccountId","url","data","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/vendors":{"post":{"operationId":"vendors-create","summary":"Create a vendor","description":"Registers someone your account pays a part of its orders to: a name, a RIF and the bank account it is paid in. The bank account is not paid out until an owner of your account confirms it in UnoPago.","tags":["Vendors"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"externalId":{"description":"Your own id for the vendor, unique among your vendors.","type":"string","minLength":1,"maxLength":255},"name":{"type":"string","minLength":1,"maxLength":255},"nationalId":{"type":"string","minLength":2,"maxLength":10,"pattern":"^[JVEGP]","description":"The vendor's RIF or cédula, e.g. `J401234567`. It is the holder of the bank account."},"bankAccount":{"type":"object","properties":{"bankCode":{"type":"string","pattern":"^\\d{4}$","description":"SUDEBAN code of the bank, e.g. `0134`."},"accountNumber":{"type":"string","pattern":"^\\d{20}$"},"holderName":{"type":"string","minLength":1},"accountType":{"default":"CHECKING","type":"string","enum":["CHECKING","SAVINGS"]}},"required":["bankCode","accountNumber","holderName"],"description":"Where the vendor is paid, held by `nationalId`. Not paid until an owner of your account confirms it in UnoPago."}},"required":["name","nationalId","bankAccount"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":["string","null"]},"name":{"type":"string"},"nationalId":{"type":"string"},"status":{"type":"string","enum":["ACTIVE","INACTIVE"],"description":"`INACTIVE` is refused in new orders. What the vendor is already owed is still paid."},"payoutsEnabled":{"type":"boolean","description":"Whether UnoPago pays the vendor at its next payout run: true once an owner of your account has confirmed its bank account. What it is owed before then waits."},"pendingVes":{"type":"string","description":"What UnoPago owes the vendor and has not paid out yet, in bolívares."},"bankAccount":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"bankCode":{"type":"string"},"accountNumberLast4":{"type":"string"},"holderName":{"type":"string"},"status":{"type":"string","enum":["PENDING_CONFIRMATION","CONFIRMED"],"description":"`PENDING_CONFIRMATION` until an owner of your account confirms it in UnoPago; nothing is paid out to it before."},"createdAt":{"type":"string"}},"required":["id","bankCode","accountNumberLast4","holderName","status","createdAt"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","externalId","name","nationalId","status","payoutsEnabled","pendingVes","bankAccount","createdAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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":"vendors-list","summary":"List vendors","tags":["Vendors"],"security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":["string","null"]},"name":{"type":"string"},"nationalId":{"type":"string"},"status":{"type":"string","enum":["ACTIVE","INACTIVE"],"description":"`INACTIVE` is refused in new orders. What the vendor is already owed is still paid."},"payoutsEnabled":{"type":"boolean","description":"Whether UnoPago pays the vendor at its next payout run: true once an owner of your account has confirmed its bank account. What it is owed before then waits."},"pendingVes":{"type":"string","description":"What UnoPago owes the vendor and has not paid out yet, in bolívares."},"bankAccount":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"bankCode":{"type":"string"},"accountNumberLast4":{"type":"string"},"holderName":{"type":"string"},"status":{"type":"string","enum":["PENDING_CONFIRMATION","CONFIRMED"],"description":"`PENDING_CONFIRMATION` until an owner of your account confirms it in UnoPago; nothing is paid out to it before."},"createdAt":{"type":"string"}},"required":["id","bankCode","accountNumberLast4","holderName","status","createdAt"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","externalId","name","nationalId","status","payoutsEnabled","pendingVes","bankAccount","createdAt"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/vendors/{vendorId}":{"get":{"operationId":"vendors-get","summary":"Get a vendor","tags":["Vendors"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"vendorId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":["string","null"]},"name":{"type":"string"},"nationalId":{"type":"string"},"status":{"type":"string","enum":["ACTIVE","INACTIVE"],"description":"`INACTIVE` is refused in new orders. What the vendor is already owed is still paid."},"payoutsEnabled":{"type":"boolean","description":"Whether UnoPago pays the vendor at its next payout run: true once an owner of your account has confirmed its bank account. What it is owed before then waits."},"pendingVes":{"type":"string","description":"What UnoPago owes the vendor and has not paid out yet, in bolívares."},"bankAccount":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"bankCode":{"type":"string"},"accountNumberLast4":{"type":"string"},"holderName":{"type":"string"},"status":{"type":"string","enum":["PENDING_CONFIRMATION","CONFIRMED"],"description":"`PENDING_CONFIRMATION` until an owner of your account confirms it in UnoPago; nothing is paid out to it before."},"createdAt":{"type":"string"}},"required":["id","bankCode","accountNumberLast4","holderName","status","createdAt"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","externalId","name","nationalId","status","payoutsEnabled","pendingVes","bankAccount","createdAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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"}}}}}},"patch":{"operationId":"vendors-update","summary":"Update a vendor","description":"Changes a vendor's name, `externalId` or bank account. A new bank account replaces the current one and is not paid out until an owner of your account confirms it. The RIF changes only together with the bank account, and not at all once the vendor is verified.","tags":["Vendors"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"vendorId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"externalId":{"type":"string","minLength":1,"maxLength":255},"name":{"type":"string","minLength":1,"maxLength":255},"nationalId":{"description":"A new RIF, accepted only together with `bankAccount` and only while the vendor is not verified.","type":"string","minLength":2,"maxLength":10,"pattern":"^[JVEGP]"},"bankAccount":{"description":"A new bank account. It replaces the current one and is not paid until an owner of your account confirms it in UnoPago.","type":"object","properties":{"bankCode":{"type":"string","pattern":"^\\d{4}$","description":"SUDEBAN code of the bank, e.g. `0134`."},"accountNumber":{"type":"string","pattern":"^\\d{20}$"},"holderName":{"type":"string","minLength":1},"accountType":{"default":"CHECKING","type":"string","enum":["CHECKING","SAVINGS"]}},"required":["bankCode","accountNumber","holderName"]}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":["string","null"]},"name":{"type":"string"},"nationalId":{"type":"string"},"status":{"type":"string","enum":["ACTIVE","INACTIVE"],"description":"`INACTIVE` is refused in new orders. What the vendor is already owed is still paid."},"payoutsEnabled":{"type":"boolean","description":"Whether UnoPago pays the vendor at its next payout run: true once an owner of your account has confirmed its bank account. What it is owed before then waits."},"pendingVes":{"type":"string","description":"What UnoPago owes the vendor and has not paid out yet, in bolívares."},"bankAccount":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"bankCode":{"type":"string"},"accountNumberLast4":{"type":"string"},"holderName":{"type":"string"},"status":{"type":"string","enum":["PENDING_CONFIRMATION","CONFIRMED"],"description":"`PENDING_CONFIRMATION` until an owner of your account confirms it in UnoPago; nothing is paid out to it before."},"createdAt":{"type":"string"}},"required":["id","bankCode","accountNumberLast4","holderName","status","createdAt"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","externalId","name","nationalId","status","payoutsEnabled","pendingVes","bankAccount","createdAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/vendors/{vendorId}/deactivate":{"post":{"operationId":"vendors-deactivate","summary":"Deactivate a vendor","description":"Stops the vendor from being named in new orders. What it is already owed is still paid.","tags":["Vendors"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"vendorId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":["string","null"]},"name":{"type":"string"},"nationalId":{"type":"string"},"status":{"type":"string","enum":["ACTIVE","INACTIVE"],"description":"`INACTIVE` is refused in new orders. What the vendor is already owed is still paid."},"payoutsEnabled":{"type":"boolean","description":"Whether UnoPago pays the vendor at its next payout run: true once an owner of your account has confirmed its bank account. What it is owed before then waits."},"pendingVes":{"type":"string","description":"What UnoPago owes the vendor and has not paid out yet, in bolívares."},"bankAccount":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"bankCode":{"type":"string"},"accountNumberLast4":{"type":"string"},"holderName":{"type":"string"},"status":{"type":"string","enum":["PENDING_CONFIRMATION","CONFIRMED"],"description":"`PENDING_CONFIRMATION` until an owner of your account confirms it in UnoPago; nothing is paid out to it before."},"createdAt":{"type":"string"}},"required":["id","bankCode","accountNumberLast4","holderName","status","createdAt"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","externalId","name","nationalId","status","payoutsEnabled","pendingVes","bankAccount","createdAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/vendors/{vendorId}/activate":{"post":{"operationId":"vendors-activate","summary":"Reactivate a vendor","tags":["Vendors"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"vendorId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":["string","null"]},"name":{"type":"string"},"nationalId":{"type":"string"},"status":{"type":"string","enum":["ACTIVE","INACTIVE"],"description":"`INACTIVE` is refused in new orders. What the vendor is already owed is still paid."},"payoutsEnabled":{"type":"boolean","description":"Whether UnoPago pays the vendor at its next payout run: true once an owner of your account has confirmed its bank account. What it is owed before then waits."},"pendingVes":{"type":"string","description":"What UnoPago owes the vendor and has not paid out yet, in bolívares."},"bankAccount":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"bankCode":{"type":"string"},"accountNumberLast4":{"type":"string"},"holderName":{"type":"string"},"status":{"type":"string","enum":["PENDING_CONFIRMATION","CONFIRMED"],"description":"`PENDING_CONFIRMATION` until an owner of your account confirms it in UnoPago; nothing is paid out to it before."},"createdAt":{"type":"string"}},"required":["id","bankCode","accountNumberLast4","holderName","status","createdAt"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","externalId","name","nationalId","status","payoutsEnabled","pendingVes","bankAccount","createdAt"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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":{"get":{"operationId":"webhooks-getWebhooks","summary":"Get all webhooks endpoints","tags":["Webhooks"],"security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"scope":{"type":"string","enum":["ACCOUNT","CONNECTED_ACCOUNTS"]},"events":{"type":"array","items":{"type":"string","enum":["INVOICE_CREATED","INVOICE_UPDATED","INVOICE_PAID","PAYMENT_RECEIVED","CHECKOUT_SESSION_PAID","CHECKOUT_SESSION_EXPIRED","CHECKOUT_SESSION_CANCELED","CHECKOUT_SESSION_PARTIALLY_PAID","SETTLEMENT_COMPLETED","SETTLEMENT_FAILED","SETTLEMENT_CANCELED","ACCOUNT_VERIFIED","ACCOUNT_VERIFICATION_REJECTED"]}},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"url":{"type":"string"},"description":{"type":"string"},"active":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["scope","events","id","accountId","url","description","active","createdAt","updatedAt"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/{webhookId}/events":{"get":{"operationId":"webhooks-getWebhookEvents","summary":"Get all events for a webhook endpoint","description":"This API is used to get all events for a webhook endpoint","tags":["Webhooks"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"webhookId","schema":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"required":true},{"in":"query","name":"page","schema":{"default":1,"type":"number","minimum":1}},{"in":"query","name":"pageSize","schema":{"default":10,"type":"number","minimum":1,"maximum":1000}},{"in":"query","name":"startDate","schema":{"type":"string"}},{"in":"query","name":"endDate","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"webhookId":{"type":"string"},"eventType":{"type":"string"},"entityId":{"type":["string","null"]},"connectedAccountId":{"type":["string","null"]},"url":{"type":"string"},"data":{"description":"This contains the data that will be sent to the webhook endpoint","example":{"id":"string","payment":{}},"$ref":"#/components/schemas/JsonValue"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","accountId","webhookId","eventType","entityId","connectedAccountId","url","data","createdAt","updatedAt"],"additionalProperties":false}},"total":{"type":"number"},"totalPages":{"type":"number"},"nextCursor":{"description":"The cursor to get the next page of results","type":["string","null"]},"exchangeRates":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"rate":{"type":"number"},"rateDate":{"type":"string"},"daysAhead":{"type":"number"}},"required":["rate","rateDate","daysAhead"],"additionalProperties":false}}},"required":["results","total","totalPages"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/public/bank-transfer":{"post":{"operationId":"bankTransfers-submitBankTransfer","summary":"Submit a bank transfer payment claim","description":"Submits a bank transfer payment claim for invoices of the authenticated account.","tags":["Payment claims"],"security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"invoiceIds":{"type":"array","items":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"}},"bankAccountId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"amount":{"type":"number","minimum":0},"paymentMethod":{"type":"string","enum":["BANK_TRANSFER","P2P","ZELLE"]},"date":{"type":"string"},"referenceCode":{"type":"string"},"issuerBankId":{"type":"string"},"nationalId":{"type":"string","minLength":2,"maxLength":10,"pattern":"^[JVEGP]"},"customerFullName":{"type":"string","minLength":1,"maxLength":100},"customerPhoneNumber":{"type":"string","pattern":"^(?:[01]\\d{3}-?\\d{7}|\\+58(?!0)\\d{3}-?\\d{7}|\\+(?!58)\\d{1,3}\\d{3}-?\\d{7})$"},"issuerZelleEmail":{"type":"string","maxLength":128,"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,}$"},"currency":{"type":"string","enum":["VES","USD","EUR"]},"customerNote":{"type":"string","maxLength":200},"customerBankId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"retryCount":{"default":0,"type":"number"},"screenshotUrl":{"type":"string","format":"uri"}},"required":["invoiceIds","bankAccountId","amount","paymentMethod","date","referenceCode","customerFullName","currency"]}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["PENDING","ACCEPTED","REJECTED"]},"purpose":{"type":"string","enum":["INVOICE","COUNTER_DEPOSIT"]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"paymentMethod":{"type":"string","enum":["BANK_TRANSFER","ZELLE","C2P","IMMEDIATE_DEBIT","P2P","CASH","POS","CUSTOMER_CREDIT","STRIPE_ACH","STRIPE_CARD","DEBIT_CARD","PAYROLL","BINANCE_PAY","LEDGER_FEE"]},"createdFrom":{"type":"string","enum":["ADMIN","CONTACT_PORTAL","CUSTOMER_PORTAL","API","CHATBOT","CHECKOUT"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"customerId":{"type":["string","null"]},"amount":{"type":"number"},"date":{"type":"string"},"screenshotUrl":{"type":["string","null"]},"referenceCode":{"type":["string","null"]},"issuerBankId":{"type":["string","null"]},"bankAccountId":{"type":["string","null"]},"customerFullName":{"type":["string","null"]},"customerNationalId":{"type":["string","null"]},"customerPhoneNumber":{"type":["string","null"]},"customerEmail":{"type":["string","null"]},"customerNote":{"type":["string","null"]},"customerIpAddress":{"type":["string","null"]},"customerUserAgent":{"type":["string","null"]},"paymentClaimCode":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"exchangeRate":{"type":["number","null"]},"paymentTransactionFound":{"type":"boolean"},"paymentCreated":{"type":"boolean"}},"required":["status","purpose","currency","paymentMethod","createdFrom","id","accountId","customerId","amount","date","screenshotUrl","referenceCode","issuerBankId","bankAccountId","customerFullName","customerNationalId","customerPhoneNumber","customerEmail","customerNote","customerIpAddress","customerUserAgent","paymentClaimCode","createdAt","updatedAt","exchangeRate"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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/public/exchange-rates/latest":{"get":{"operationId":"exchangeRate-getLatestExchangeRates","summary":"Get the latest stored exchange rate per currency","description":"This API is public and returns the most recently published stored rate for each tracked currency, or for a single currency when `currency` is given. `date` is the day the rate applies to, and which side of today it falls on depends on the currency. `USD` and `EUR` come from the BCV at its *Fecha Valor*, which is published ahead of the day itself — so the newest row can be dated in the future, and is the rate that will apply then. `USDT` is an average of the previous day's Binance P2P quotes, published the morning after — so the newest row is dated in the past, normally yesterday.","tags":["Exchange rates"],"parameters":[{"in":"query","name":"currency","schema":{"type":"string","enum":["USD","USDT","EUR"],"description":"Restrict the result to a single tracked currency."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","enum":["USD","USDT","EUR"]},"date":{"type":"string","format":"date","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])))$","description":"`YYYY-MM-DD`. `date` is the day the rate applies to, and which side of today it falls on depends on the currency. `USD` and `EUR` come from the BCV at its *Fecha Valor*, which is published ahead of the day itself — so the newest row can be dated in the future, and is the rate that will apply then. `USDT` is an average of the previous day's Binance P2P quotes, published the morning after — so the newest row is dated in the past, normally yesterday."},"rate":{"type":"number","description":"Bs. (VES) per 1 unit of `currency`."}},"required":["currency","date","rate"],"additionalProperties":false}}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"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/exchange-rates":{"get":{"operationId":"exchangeRate-getExchangeRateByDate","summary":"Get the exchange rate a payment on a given day converts at","description":"Returns the rate a payment dated `date` converts at. The `date` in the response is the publication that rate comes from, which can differ from the day requested: a weekend resolves to the following Monday's publication, and a day with no publication to the latest one before it.","tags":["Exchange rates"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"currency","schema":{"type":"string","enum":["USD","EUR"],"description":"Currency to price in bolívares."},"required":true,"description":"Currency to price in bolívares."},{"in":"query","name":"date","schema":{"type":"string","format":"date","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])))$","description":"Day of the payment (YYYY-MM-DD)."},"required":true,"description":"Day of the payment (YYYY-MM-DD)."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"currency":{"type":"string","enum":["USD","USDT","EUR"]},"date":{"type":"string","format":"date","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])))$","description":"`YYYY-MM-DD`. `date` is the day the rate applies to, and which side of today it falls on depends on the currency. `USD` and `EUR` come from the BCV at its *Fecha Valor*, which is published ahead of the day itself — so the newest row can be dated in the future, and is the rate that will apply then. `USDT` is an average of the previous day's Binance P2P quotes, published the morning after — so the newest row is dated in the past, normally yesterday."},"rate":{"type":"number","description":"Bs. (VES) per 1 unit of `currency`."}},"required":["currency","date","rate"],"additionalProperties":false}}}},"400":{"description":"Invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.BAD_REQUEST"}}}},"401":{"description":"Authorization not provided","content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.UNAUTHORIZED"}}}},"403":{"description":"Insufficient access","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":{"Product":{"type":"object","properties":{"externalId":{"type":"string","minLength":1,"maxLength":100},"code":{"type":"string","pattern":"^[a-zA-Z0-9]{1,6}$"},"name":{"type":"string","minLength":1,"maxLength":255},"description":{"type":"string","maxLength":500},"price":{"default":0,"type":"number","minimum":0},"currency":{"default":"USD","type":"string","enum":["VES","USD","EUR"]},"unitName":{"type":"string","minLength":1,"maxLength":120},"unitId":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"exento":{"default":false,"type":"boolean"},"isService":{"default":false,"type":"boolean"},"availableInPortal":{"default":false,"type":"boolean"},"availableForSale":{"default":false,"type":"boolean"},"ivaRatePercent":{"anyOf":[{"type":"number","enum":[8,16,31]},{"type":"null"}]},"isActive":{"default":true,"type":"boolean"}},"required":["name"]},"__schema0":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/__schema0"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/__schema0"}}]},"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.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":[]}},"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":[]}},"CustomerDetail":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"externalId":{"type":["string","null"]},"mainContactId":{"type":["string","null"]},"nationalId":{"type":["string","null"]},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"address":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]},"foundContact":{"type":"object","properties":{"gender":{"anyOf":[{"type":"string","enum":["MALE","FEMALE","OTHER"]},{"type":"null"}]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"externalId":{"type":["string","null"]},"email":{"type":["string","null"]},"phoneNumber":{"type":"string"},"emailVerified":{"type":["string","null"]},"phoneVerified":{"type":["string","null"]},"firstStepsStartedAt":{"type":["string","null"]},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"nationalId":{"type":["string","null"]},"dateOfBirth":{"type":["string","null"]},"nationality":{"type":["string","null"]},"address":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["gender","id","externalId","email","phoneNumber","emailVerified","phoneVerified","firstStepsStartedAt","firstName","lastName","nationalId","dateOfBirth","nationality","address","createdAt","updatedAt"],"additionalProperties":false},"syncedFrom":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"detachedFrom":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["id","accountId","externalId","mainContactId","nationalId","firstName","lastName","email","phoneNumber","address","createdAt","updatedAt","syncedFrom","detachedFrom"],"additionalProperties":false},"SavedCustomer":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"externalId":{"type":["string","null"]},"mainContactId":{"type":["string","null"]},"nationalId":{"type":["string","null"]},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"address":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"foundContact":{"type":"object","properties":{"gender":{"anyOf":[{"type":"string","enum":["MALE","FEMALE","OTHER"]},{"type":"null"}]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"externalId":{"type":["string","null"]},"email":{"type":["string","null"]},"phoneNumber":{"type":"string"},"emailVerified":{"type":["string","null"]},"phoneVerified":{"type":["string","null"]},"firstStepsStartedAt":{"type":["string","null"]},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"nationalId":{"type":["string","null"]},"dateOfBirth":{"type":["string","null"]},"nationality":{"type":["string","null"]},"address":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["gender","id","externalId","email","phoneNumber","emailVerified","phoneVerified","firstStepsStartedAt","firstName","lastName","nationalId","dateOfBirth","nationality","address","createdAt","updatedAt"],"additionalProperties":false},"payerLinkPending":{"type":"boolean","description":"True when the customer's phone belongs to a payer who was not linked automatically: the account is not verified yet, or the payer already belongs to another account and has to accept an invite. An unverified account's payer is linked once it is verified; until then they are only invited if `createContactInvite` was set."}},"required":["id","accountId","externalId","mainContactId","nationalId","firstName","lastName","email","phoneNumber","address","createdAt","updatedAt","payerLinkPending"],"additionalProperties":false},"Customer":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"externalId":{"type":["string","null"]},"mainContactId":{"type":["string","null"]},"nationalId":{"type":["string","null"]},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"address":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"foundContact":{"type":"object","properties":{"gender":{"anyOf":[{"type":"string","enum":["MALE","FEMALE","OTHER"]},{"type":"null"}]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"externalId":{"type":["string","null"]},"email":{"type":["string","null"]},"phoneNumber":{"type":"string"},"emailVerified":{"type":["string","null"]},"phoneVerified":{"type":["string","null"]},"firstStepsStartedAt":{"type":["string","null"]},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"nationalId":{"type":["string","null"]},"dateOfBirth":{"type":["string","null"]},"nationality":{"type":["string","null"]},"address":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["gender","id","externalId","email","phoneNumber","emailVerified","phoneVerified","firstStepsStartedAt","firstName","lastName","nationalId","dateOfBirth","nationality","address","createdAt","updatedAt"],"additionalProperties":false}},"required":["id","accountId","externalId","mainContactId","nationalId","firstName","lastName","email","phoneNumber","address","createdAt","updatedAt"],"additionalProperties":false},"FiscalInvoice":{"type":"object","properties":{"source":{"type":"string","enum":["UNOPRINT","ABC_DIGITAL_PRINTING","EXTERNAL","ABC_TERCEROS"],"description":"Who issued it: `UNOPRINT`, `ABC_DIGITAL_PRINTING`, or `EXTERNAL` for an invoice issued outside UnoPago."},"invoiceNumber":{"type":"string","example":"00000123"},"controlNumber":{"description":"Only for a digitally printed invoice (ABC).","example":"00-000123","type":["string","null"]},"issuedAt":{"type":"string"}},"required":["source","invoiceNumber","controlNumber","issuedAt"],"additionalProperties":false},"StudentWithSyncSource":{"type":"object","properties":{"gender":{"type":"string","enum":["MALE","FEMALE","OTHER"]},"clothingSize":{"anyOf":[{"type":"string","enum":["XS","S","M","L","XL","XXL"]},{"type":"null"}]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"customerId":{"type":["string","null"]},"accountId":{"type":"string"},"externalId":{"type":["string","null"]},"reenrollmentSettingsId":{"type":["string","null"]},"firstName":{"type":"string"},"lastName":{"type":"string"},"nationalId":{"type":["string","null"]},"nationality":{"type":["string","null"]},"dateOfBirth":{"type":["string","null"]},"enrollmentYear":{"type":["string","null"]},"promoYear":{"type":["string","null"]},"sectionId":{"type":["string","null"]},"birthPlace":{"type":["string","null"]},"email":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"active":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"syncedFrom":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"detachedFrom":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]}},"required":["gender","clothingSize","id","customerId","accountId","externalId","reenrollmentSettingsId","firstName","lastName","nationalId","nationality","dateOfBirth","enrollmentYear","promoYear","sectionId","birthPlace","email","phoneNumber","active","createdAt","updatedAt","syncedFrom","detachedFrom"],"additionalProperties":false},"Invoice":{"type":"object","properties":{"lateFeeType":{"anyOf":[{"type":"string","enum":["PERCENTAGE","FIXED"]},{"type":"null"}]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"pricingMode":{"type":"string","enum":["CURRENCY","REFERENCE"],"description":"`CURRENCY` for a `VES` invoice; otherwise your account's pricing when the invoice was issued. `REFERENCE` (REF): dollars and euros count the same, so the amount can be paid as that figure in either. `CURRENCY`: other currencies convert at the day's rates."},"status":{"type":"string","enum":["DRAFT","UNPAID","OVERDUE","PENDING","PARTIAL","PAID","VOIDED"],"description":"`DRAFT` for a checkout order before its first confirmed payment (no customer yet, nobody owes it), `UNPAID` when issued, `OVERDUE` past its due date, `PENDING` while a payment is in flight (a reported transfer being reconciled or an online charge still settling), `PARTIAL` once part is paid, `PAID`, or `VOIDED` (final).","example":"UNPAID"},"source":{"type":"string","enum":["STANDARD","KIOSK","ONBOARDING","CHECKOUT"],"description":"`STANDARD` (console, API or a plan), `KIOSK` (a cantina sale) or `ONBOARDING` (the account's first-steps test charge)."},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"externalId":{"description":"Your id for this invoice, unique in your account.","example":"INV-2026-0042","type":["string","null"]},"accountId":{"type":"string"},"customerId":{"type":["string","null"]},"printJobId":{"type":["string","null"]},"fiscalRecordId":{"type":["string","null"]},"billingDetailsId":{"type":["string","null"]},"description":{"type":["string","null"]},"issueDate":{"example":"2026-10-01","type":"string"},"dueDate":{"description":"After this day the invoice is `OVERDUE` and its late fee, if any, applies.","example":"2026-10-15","type":["string","null"]},"expired":{"type":"boolean"},"paidAt":{"type":["string","null"]},"voidedAt":{"type":["string","null"]},"planDate":{"description":"For an invoice a plan issued: the cycle date it bills. `null` otherwise.","type":["string","null"]},"billingRunKey":{"type":["string","null"]},"lateFee":{"description":"Added once `dueDate` has passed: a fixed amount, or a percentage of the items' subtotal, per `lateFeeType`.","type":["number","null"]},"fiscalInvoicing":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"total":{"description":"What the invoice is worth as of today, or as of `paidAt` once paid: items, plus the late fee and fees, minus the discounts that still apply on that date. In `currency`.","example":114,"type":"number"},"balance":{"description":"What is still owed, in `currency`. Never negative.","example":64,"type":"number"},"feesTotals":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["IGTF","IVA","PROCESSING_FEE"]},"rateBase":{"type":"number"},"rate":{"type":"number"},"total":{"type":"number"}},"required":["type","rateBase","rate","total"],"additionalProperties":false}},"customer":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"externalId":{"type":["string","null"]},"mainContactId":{"type":["string","null"]},"nationalId":{"type":["string","null"]},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"address":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","accountId","externalId","mainContactId","nationalId","firstName","lastName","email","phoneNumber","address","createdAt","updatedAt"],"additionalProperties":false},{"type":"null"}],"description":"`null` only for a `DRAFT` order: it gets its customer at its first confirmed payment."},"discounts":{"type":"array","items":{"type":"object","properties":{"valueType":{"type":"string","enum":["PERCENTAGE","FIXED"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"invoiceId":{"type":"string"},"fromPaymentId":{"type":["string","null"]},"description":{"type":"string"},"value":{"type":"number"},"expiresAt":{"type":["string","null"]},"expired":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["valueType","id","accountId","invoiceId","fromPaymentId","description","value","expiresAt","expired","createdAt","updatedAt"],"additionalProperties":false}},"fees":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["IGTF","IVA","PROCESSING_FEE"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"invoiceId":{"type":"string"},"fromPaymentId":{"type":["string","null"]},"amount":{"type":"number"},"rate":{"type":"number"},"rateBase":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["type","id","accountId","invoiceId","fromPaymentId","amount","rate","rateBase","createdAt","updatedAt"],"additionalProperties":false}},"items":{"type":"array","items":{"type":"object","properties":{"discountValueType":{"anyOf":[{"type":"string","enum":["PERCENTAGE","FIXED"]},{"type":"null"}]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"invoiceId":{"type":"string"},"productId":{"type":["string","null"]},"studentId":{"type":["string","null"]},"description":{"type":"string"},"amount":{"type":"number"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"exento":{"type":"boolean"},"isService":{"type":"boolean"},"subscriptionId":{"type":["string","null"]},"ivaRatePercent":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"discountValue":{"type":["number","null"]},"discountExpiresAt":{"type":["string","null"]},"discountExpired":{"type":["boolean","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["discountValueType","id","accountId","invoiceId","productId","studentId","description","amount","quantity","exento","isService","subscriptionId","ivaRatePercent","discountValue","discountExpiresAt","discountExpired","createdAt","updatedAt"],"additionalProperties":false}},"transactions":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["ITEMS","DISCOUNT","LATE_FEE","IVA","IGTF","PROCESSING_FEE","PAYMENT","REFUND","RETENTION","EXCHANGE_DIFFERENCE","ADJUSTMENT"]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"customerId":{"type":"string"},"invoiceId":{"type":"string"},"statementId":{"type":["string","null"]},"description":{"type":"string"},"transactionDate":{"type":"string"},"exchangeRate":{"type":"number"},"rateDate":{"type":"string"},"credit":{"type":"number"},"debit":{"type":"number"},"paymentId":{"type":["string","null"]},"fromPaymentId":{"type":["string","null"]},"retentionId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["kind","currency","id","accountId","customerId","invoiceId","statementId","description","transactionDate","exchangeRate","rateDate","credit","debit","paymentId","fromPaymentId","retentionId","createdAt","updatedAt"],"additionalProperties":false},"description":"The invoice's ledger: its issuance, the payments applied to it and any adjustments."},"paymentMethods":{"description":"The payment methods this invoice is limited to; empty means all of your account's methods. Only returned by `GET` and `PUT /v1/invoices/{invoiceId}`.","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"invoiceId":{"type":"string"},"accountPaymentMethodId":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","invoiceId","accountPaymentMethodId","createdAt","updatedAt"],"additionalProperties":false}},"paymentLink":{"description":"A link where the customer can pay. Absent once the invoice is `PAID` or `VOIDED`, and for a `DRAFT` (it is paid through its checkout session).","type":"string"},"invoiceSequence":{"description":"Same as `fiscalInvoice.invoiceNumber`.","type":["string","null"]},"fiscalInvoice":{"anyOf":[{"$ref":"#/components/schemas/FiscalInvoice"},{"type":"null"}],"description":"The order's live fiscal invoice from any provider, or `null` when it has none."}},"required":["lateFeeType","currency","pricingMode","status","source","id","externalId","accountId","customerId","printJobId","fiscalRecordId","billingDetailsId","description","issueDate","dueDate","expired","paidAt","voidedAt","planDate","billingRunKey","lateFee","fiscalInvoicing","createdAt","updatedAt","total","balance","feesTotals","customer","discounts","fees","items","transactions","fiscalInvoice"],"additionalProperties":false},"Payment":{"type":"object","properties":{"currency":{"type":"string","enum":["VES","USD","EUR"]},"receiverBankName":{"anyOf":[{"type":"string","enum":["A100BANCO","BANCAMIGA","BANCARIBE","BANESCO","BDV","BFC","BNC","MERCANTIL","PROVINCIAL","BANCO_DEL_TESORO","BANCO_PLAZA","SOFITASA","BANCO_ACTIVO","BANCO_AGRICOLA","BANCO_BICENTENARIO","BANCO_CARONI","BANCO_EXTERIOR","BANCRECER","BANFANB","BANGENTE","BANPLUS","DELSUR","R4","VENEZOLANO_DE_CREDITO","BANK_OF_AMERICA","AMERANT_BANK","US_BANK","WELLS_FARGO","BINANCE"]},{"type":"null"}]},"method":{"type":"string","enum":["BANK_TRANSFER","ZELLE","C2P","IMMEDIATE_DEBIT","P2P","CASH","POS","CUSTOMER_CREDIT","STRIPE_ACH","STRIPE_CARD","DEBIT_CARD","PAYROLL","BINANCE_PAY","LEDGER_FEE"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"customerId":{"type":"string"},"amount":{"type":"number"},"transactionDate":{"type":"string"},"rateDate":{"type":["string","null"]},"referenceCode":{"type":["string","null"]},"externalId":{"type":["string","null"]},"receiverBankHolderName":{"type":["string","null"]},"receiverBankNationalId":{"type":["string","null"]},"customerFullName":{"type":["string","null"]},"customerNationalId":{"type":["string","null"]},"customerPhoneNumber":{"type":["string","null"]},"customerBankAccountNumber":{"type":["string","null"]},"customerEmail":{"type":["string","null"]},"customerNote":{"type":["string","null"]},"customerIpAddress":{"type":["string","null"]},"customerUserAgent":{"type":["string","null"]},"isAutoPay":{"type":"boolean"},"bankAccountId":{"type":["string","null"]},"paymentClaimId":{"type":["string","null"]},"bankTransactionId":{"type":["string","null"]},"createdById":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"splitAmount":{"type":["number","null"]},"customer":{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"externalId":{"type":["string","null"]},"mainContactId":{"type":["string","null"]},"nationalId":{"type":["string","null"]},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"address":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","accountId","externalId","mainContactId","nationalId","firstName","lastName","email","phoneNumber","address","createdAt","updatedAt"],"additionalProperties":false},"bankAccount":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["CHECKING","SAVINGS","ZELLE","BINANCE"]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"bankName":{"type":"string","enum":["A100BANCO","BANCAMIGA","BANCARIBE","BANESCO","BDV","BFC","BNC","MERCANTIL","PROVINCIAL","BANCO_DEL_TESORO","BANCO_PLAZA","SOFITASA","BANCO_ACTIVO","BANCO_AGRICOLA","BANCO_BICENTENARIO","BANCO_CARONI","BANCO_EXTERIOR","BANCRECER","BANFANB","BANGENTE","BANPLUS","DELSUR","R4","VENEZOLANO_DE_CREDITO","BANK_OF_AMERICA","AMERANT_BANK","US_BANK","WELLS_FARGO","BINANCE"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"name":{"type":"string"},"accountHolderName":{"type":"string"},"isActive":{"type":"boolean"},"nationalId":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"pagoMovilQrUrl":{"type":["string","null"]},"identifier":{"type":"string"},"last4":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["type","currency","bankName","id","accountId","name","accountHolderName","isActive","nationalId","phoneNumber","pagoMovilQrUrl","identifier","last4","createdAt","updatedAt"],"additionalProperties":false},{"type":"null"}]},"paymentTransactions":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["ITEMS","DISCOUNT","LATE_FEE","IVA","IGTF","PROCESSING_FEE","PAYMENT","REFUND","RETENTION","EXCHANGE_DIFFERENCE","ADJUSTMENT"]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"customerId":{"type":"string"},"invoiceId":{"type":"string"},"statementId":{"type":["string","null"]},"description":{"type":"string"},"transactionDate":{"type":"string"},"exchangeRate":{"type":"number"},"rateDate":{"type":"string"},"credit":{"type":"number"},"debit":{"type":"number"},"paymentId":{"type":["string","null"]},"fromPaymentId":{"type":["string","null"]},"retentionId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["kind","currency","id","accountId","customerId","invoiceId","statementId","description","transactionDate","exchangeRate","rateDate","credit","debit","paymentId","fromPaymentId","retentionId","createdAt","updatedAt"],"additionalProperties":false}}},"required":["currency","receiverBankName","method","id","accountId","customerId","amount","transactionDate","rateDate","referenceCode","externalId","receiverBankHolderName","receiverBankNationalId","customerFullName","customerNationalId","customerPhoneNumber","customerBankAccountNumber","customerEmail","customerNote","customerIpAddress","customerUserAgent","isAutoPay","bankAccountId","paymentClaimId","bankTransactionId","createdById","createdAt","updatedAt","splitAmount","customer","bankAccount","paymentTransactions"],"additionalProperties":false},"Student":{"type":"object","properties":{"gender":{"type":"string","enum":["MALE","FEMALE","OTHER"]},"clothingSize":{"anyOf":[{"type":"string","enum":["XS","S","M","L","XL","XXL"]},{"type":"null"}]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"customerId":{"type":["string","null"]},"accountId":{"type":"string"},"externalId":{"type":["string","null"]},"reenrollmentSettingsId":{"type":["string","null"]},"firstName":{"type":"string"},"lastName":{"type":"string"},"nationalId":{"type":["string","null"]},"nationality":{"type":["string","null"]},"dateOfBirth":{"type":["string","null"]},"enrollmentYear":{"type":["string","null"]},"promoYear":{"type":["string","null"]},"sectionId":{"type":["string","null"]},"birthPlace":{"type":["string","null"]},"email":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"active":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["gender","clothingSize","id","customerId","accountId","externalId","reenrollmentSettingsId","firstName","lastName","nationalId","nationality","dateOfBirth","enrollmentYear","promoYear","sectionId","birthPlace","email","phoneNumber","active","createdAt","updatedAt"],"additionalProperties":false},"JsonValue":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"$ref":"#/components/schemas/__schema2"},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/JsonValue"}}]},"__schema1":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null","const":null},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/__schema1"}},{"type":"array","items":{"$ref":"#/components/schemas/__schema1"}}]},"__schema2":{"type":"array","items":{"$ref":"#/components/schemas/JsonValue"}}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Your API key, created in Configuración → Claves API. The key alone, without the `Bearer` prefix, is accepted too."}}},"x-tagGroups":[{"name":"Billing","tags":["Checkout Sessions","Invoices","Payments","Settlements","Payment claims","Plans","Subscriptions"]},{"name":"Customer data","tags":["Customers","Tags","Imports"]},{"name":"Schools","tags":["Students","Grades","Sections"]},{"name":"Catalog","tags":["Products","Product Units"]},{"name":"Fiscal printing","tags":["Invoice print job"]},{"name":"Account","tags":["Account Settings","Account Payment Methods","Connected accounts","Vendors","Bank Transactions","Exchange rates"]},{"name":"Webhook integration","tags":["Webhooks","Webhook events"]}],"webhooks":{"invoice_created":{"post":{"tags":["Webhook events"],"summary":"Invoice Created","description":"Triggered when a new invoice is created, a checkout session's `DRAFT` order included: it is announced when the session is created, usually with `customer: null`, and its first payment sends `invoice_updated`.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"eventType":{"type":"string"},"account":{"description":"The connected account the event happened in, on events a platform receives on its **Cuentas conectadas** endpoints. Absent on your own account's events.","type":"string"},"createdAt":{"type":"string"},"data":{"type":"object","properties":{"invoice":{"type":"object","properties":{"lateFeeType":{"anyOf":[{"type":"string","enum":["PERCENTAGE","FIXED"]},{"type":"null"}]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"pricingMode":{"type":"string","enum":["CURRENCY","REFERENCE"]},"status":{"type":"string","enum":["DRAFT","UNPAID","OVERDUE","PENDING","PARTIAL","PAID","VOIDED"]},"source":{"type":"string","enum":["STANDARD","KIOSK","ONBOARDING","CHECKOUT"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"externalId":{"type":["string","null"]},"accountId":{"type":"string"},"customerId":{"type":["string","null"]},"printJobId":{"type":["string","null"]},"fiscalRecordId":{"type":["string","null"]},"billingDetailsId":{"type":["string","null"]},"description":{"type":["string","null"]},"issueDate":{"type":"string"},"dueDate":{"type":["string","null"]},"expired":{"type":"boolean"},"paidAt":{"type":["string","null"]},"voidedAt":{"type":["string","null"]},"planDate":{"type":["string","null"]},"billingRunKey":{"type":["string","null"]},"lateFee":{"type":["number","null"]},"fiscalInvoicing":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"account":{"type":"object","properties":{"type":{"type":"string","enum":["SCHOOL","COMMERCE"]},"status":{"type":"string","enum":["ACTIVE","MAINTENANCE","SUSPENDED","DEACTIVATED"]},"mainCurrency":{"type":"string","enum":["VES","USD","EUR"]},"defaultPricingMode":{"type":"string","enum":["CURRENCY","REFERENCE"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"name":{"type":"string"},"description":{"type":"string"},"isTest":{"type":"boolean"},"nationalId":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"address":{"type":["string","null"]},"image":{"type":["string","null"]},"accountNotificationSettingId":{"type":["string","null"]},"merchantId":{"type":["string","null"]},"platformAccountId":{"type":["string","null"]},"externalId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["type","status","mainCurrency","defaultPricingMode","id","name","description","isTest","nationalId","phoneNumber","address","image","accountNotificationSettingId","merchantId","platformAccountId","externalId","createdAt","updatedAt"]},"customer":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"externalId":{"type":["string","null"]},"mainContactId":{"type":["string","null"]},"nationalId":{"type":["string","null"]},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"address":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","accountId","externalId","mainContactId","nationalId","firstName","lastName","email","phoneNumber","address","createdAt","updatedAt"]},{"type":"null"}],"description":"`null` for a `DRAFT` order: a checkout session's, announced when the session is created (a store's, once per checkout attempt). Usually what you get for a checkout order; read `status`, since the event reads the order when it is sent. Its first confirmed payment gives it a customer and sends `invoice_updated`, which carries `customerId` only: read the customer with `GET /v1/customers/{id}`."},"items":{"type":"array","items":{"type":"object","properties":{"discountValueType":{"anyOf":[{"type":"string","enum":["PERCENTAGE","FIXED"]},{"type":"null"}]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"invoiceId":{"type":"string"},"productId":{"type":["string","null"]},"studentId":{"type":["string","null"]},"description":{"type":"string"},"amount":{"type":"number"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"exento":{"type":"boolean"},"isService":{"type":"boolean"},"subscriptionId":{"type":["string","null"]},"ivaRatePercent":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"discountValue":{"type":["number","null"]},"discountExpiresAt":{"type":["string","null"]},"discountExpired":{"type":["boolean","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["discountValueType","id","accountId","invoiceId","productId","studentId","description","amount","quantity","exento","isService","subscriptionId","ivaRatePercent","discountExpiresAt","discountExpired","createdAt","updatedAt"]}},"discounts":{"type":"array","items":{"type":"object","properties":{"valueType":{"type":"string","enum":["PERCENTAGE","FIXED"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"invoiceId":{"type":"string"},"fromPaymentId":{"type":["string","null"]},"description":{"type":"string"},"value":{"type":"number"},"expiresAt":{"type":["string","null"]},"expired":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["valueType","id","accountId","invoiceId","fromPaymentId","description","value","expiresAt","expired","createdAt","updatedAt"]}},"fees":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["IGTF","IVA","PROCESSING_FEE"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"invoiceId":{"type":"string"},"fromPaymentId":{"type":["string","null"]},"amount":{"type":"number"},"rate":{"type":"number"},"rateBase":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["type","id","accountId","invoiceId","fromPaymentId","amount","rate","rateBase","createdAt","updatedAt"]}}},"required":["lateFeeType","currency","pricingMode","status","source","id","externalId","accountId","customerId","printJobId","fiscalRecordId","billingDetailsId","description","issueDate","dueDate","expired","paidAt","voidedAt","planDate","billingRunKey","fiscalInvoicing","createdAt","updatedAt","account","customer","items","discounts","fees"]},"checkoutSessionId":{"description":"The hosted checkout session it came from, `null` when it came from anywhere else (a payment recorded from the panel included). A session paid in parts sends a `payment_received` per payment, all with the same id. Read the session with `GET /v1/checkout-sessions/{id}`.","type":["string","null"]}},"required":["invoice","checkoutSessionId"]}},"required":["id","eventType","createdAt","data"]}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"invoice_updated":{"post":{"tags":["Webhook events"],"summary":"Invoice Updated","description":"Triggered when an invoice is updated","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"eventType":{"type":"string"},"account":{"description":"The connected account the event happened in, on events a platform receives on its **Cuentas conectadas** endpoints. Absent on your own account's events.","type":"string"},"createdAt":{"type":"string"},"data":{"type":"object","properties":{"invoice":{"type":"object","properties":{"lateFeeType":{"anyOf":[{"type":"string","enum":["PERCENTAGE","FIXED"]},{"type":"null"}]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"pricingMode":{"type":"string","enum":["CURRENCY","REFERENCE"]},"status":{"type":"string","enum":["DRAFT","UNPAID","OVERDUE","PENDING","PARTIAL","PAID","VOIDED"]},"source":{"type":"string","enum":["STANDARD","KIOSK","ONBOARDING","CHECKOUT"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"externalId":{"type":["string","null"]},"accountId":{"type":"string"},"customerId":{"type":["string","null"]},"printJobId":{"type":["string","null"]},"fiscalRecordId":{"type":["string","null"]},"billingDetailsId":{"type":["string","null"]},"description":{"type":["string","null"]},"issueDate":{"type":"string"},"dueDate":{"type":["string","null"]},"expired":{"type":"boolean"},"paidAt":{"type":["string","null"]},"voidedAt":{"type":["string","null"]},"planDate":{"type":["string","null"]},"billingRunKey":{"type":["string","null"]},"lateFee":{"type":["number","null"]},"fiscalInvoicing":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"discountValueType":{"anyOf":[{"type":"string","enum":["PERCENTAGE","FIXED"]},{"type":"null"}]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"invoiceId":{"type":"string"},"productId":{"type":["string","null"]},"studentId":{"type":["string","null"]},"description":{"type":"string"},"amount":{"type":"number"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"exento":{"type":"boolean"},"isService":{"type":"boolean"},"subscriptionId":{"type":["string","null"]},"ivaRatePercent":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"discountValue":{"type":["number","null"]},"discountExpiresAt":{"type":["string","null"]},"discountExpired":{"type":["boolean","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["discountValueType","id","accountId","invoiceId","productId","studentId","description","amount","quantity","exento","isService","subscriptionId","ivaRatePercent","discountExpiresAt","discountExpired","createdAt","updatedAt"]}},"discounts":{"type":"array","items":{"type":"object","properties":{"valueType":{"type":"string","enum":["PERCENTAGE","FIXED"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"invoiceId":{"type":"string"},"fromPaymentId":{"type":["string","null"]},"description":{"type":"string"},"value":{"type":"number"},"expiresAt":{"type":["string","null"]},"expired":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["valueType","id","accountId","invoiceId","fromPaymentId","description","value","expiresAt","expired","createdAt","updatedAt"]}},"fees":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["IGTF","IVA","PROCESSING_FEE"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"invoiceId":{"type":"string"},"fromPaymentId":{"type":["string","null"]},"amount":{"type":"number"},"rate":{"type":"number"},"rateBase":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["type","id","accountId","invoiceId","fromPaymentId","amount","rate","rateBase","createdAt","updatedAt"]}},"transactions":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["ITEMS","DISCOUNT","LATE_FEE","IVA","IGTF","PROCESSING_FEE","PAYMENT","REFUND","RETENTION","EXCHANGE_DIFFERENCE","ADJUSTMENT"]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"customerId":{"type":"string"},"invoiceId":{"type":"string"},"statementId":{"type":["string","null"]},"description":{"type":"string"},"transactionDate":{"type":"string"},"exchangeRate":{"type":"number"},"rateDate":{"type":"string"},"credit":{"type":"number"},"debit":{"type":"number"},"paymentId":{"type":["string","null"]},"fromPaymentId":{"type":["string","null"]},"retentionId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"payment":{"anyOf":[{"type":"object","properties":{"currency":{"type":"string","enum":["VES","USD","EUR"]},"receiverBankName":{"anyOf":[{"type":"string","enum":["A100BANCO","BANCAMIGA","BANCARIBE","BANESCO","BDV","BFC","BNC","MERCANTIL","PROVINCIAL","BANCO_DEL_TESORO","BANCO_PLAZA","SOFITASA","BANCO_ACTIVO","BANCO_AGRICOLA","BANCO_BICENTENARIO","BANCO_CARONI","BANCO_EXTERIOR","BANCRECER","BANFANB","BANGENTE","BANPLUS","DELSUR","R4","VENEZOLANO_DE_CREDITO","BANK_OF_AMERICA","AMERANT_BANK","US_BANK","WELLS_FARGO","BINANCE"]},{"type":"null"}]},"method":{"type":"string","enum":["BANK_TRANSFER","ZELLE","C2P","IMMEDIATE_DEBIT","P2P","CASH","POS","CUSTOMER_CREDIT","STRIPE_ACH","STRIPE_CARD","DEBIT_CARD","PAYROLL","BINANCE_PAY","LEDGER_FEE"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"customerId":{"type":"string"},"amount":{"type":"number"},"transactionDate":{"type":"string"},"rateDate":{"type":["string","null"]},"referenceCode":{"type":["string","null"]},"externalId":{"type":["string","null"]},"receiverBankHolderName":{"type":["string","null"]},"receiverBankNationalId":{"type":["string","null"]},"customerFullName":{"type":["string","null"]},"customerNationalId":{"type":["string","null"]},"customerPhoneNumber":{"type":["string","null"]},"customerBankAccountNumber":{"type":["string","null"]},"customerEmail":{"type":["string","null"]},"customerNote":{"type":["string","null"]},"customerIpAddress":{"type":["string","null"]},"customerUserAgent":{"type":["string","null"]},"isAutoPay":{"type":"boolean"},"bankAccountId":{"type":["string","null"]},"paymentClaimId":{"type":["string","null"]},"bankTransactionId":{"type":["string","null"]},"createdById":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"splitAmount":{"type":["number","null"]}},"required":["currency","receiverBankName","method","id","accountId","customerId","amount","transactionDate","rateDate","referenceCode","externalId","receiverBankHolderName","receiverBankNationalId","customerFullName","customerNationalId","customerPhoneNumber","customerBankAccountNumber","customerEmail","customerNote","customerIpAddress","customerUserAgent","isAutoPay","bankAccountId","paymentClaimId","bankTransactionId","createdById","createdAt","updatedAt"]},{"type":"null"}]}},"required":["kind","currency","id","accountId","customerId","invoiceId","statementId","description","transactionDate","exchangeRate","rateDate","credit","debit","paymentId","fromPaymentId","retentionId","createdAt","updatedAt","payment"]}}},"required":["lateFeeType","currency","pricingMode","status","source","id","externalId","accountId","customerId","printJobId","fiscalRecordId","billingDetailsId","description","issueDate","dueDate","expired","paidAt","voidedAt","planDate","billingRunKey","fiscalInvoicing","createdAt","updatedAt","items","discounts","fees","transactions"]},"checkoutSessionId":{"description":"The hosted checkout session it came from, `null` when it came from anywhere else (a payment recorded from the panel included). A session paid in parts sends a `payment_received` per payment, all with the same id. Read the session with `GET /v1/checkout-sessions/{id}`.","type":["string","null"]}},"required":["invoice","checkoutSessionId"]}},"required":["id","eventType","createdAt","data"]}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"invoice_paid":{"post":{"tags":["Webhook events"],"summary":"Invoice Paid","description":"Triggered when an invoice is paid","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"eventType":{"type":"string"},"account":{"description":"The connected account the event happened in, on events a platform receives on its **Cuentas conectadas** endpoints. Absent on your own account's events.","type":"string"},"createdAt":{"type":"string"},"data":{"type":"object","properties":{"invoice":{"type":"object","properties":{"lateFeeType":{"anyOf":[{"type":"string","enum":["PERCENTAGE","FIXED"]},{"type":"null"}]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"pricingMode":{"type":"string","enum":["CURRENCY","REFERENCE"]},"status":{"type":"string","enum":["DRAFT","UNPAID","OVERDUE","PENDING","PARTIAL","PAID","VOIDED"]},"source":{"type":"string","enum":["STANDARD","KIOSK","ONBOARDING","CHECKOUT"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"externalId":{"type":["string","null"]},"accountId":{"type":"string"},"customerId":{"type":["string","null"]},"printJobId":{"type":["string","null"]},"fiscalRecordId":{"type":["string","null"]},"billingDetailsId":{"type":["string","null"]},"description":{"type":["string","null"]},"issueDate":{"type":"string"},"dueDate":{"type":["string","null"]},"expired":{"type":"boolean"},"paidAt":{"type":["string","null"]},"voidedAt":{"type":["string","null"]},"planDate":{"type":["string","null"]},"billingRunKey":{"type":["string","null"]},"lateFee":{"type":["number","null"]},"fiscalInvoicing":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"discountValueType":{"anyOf":[{"type":"string","enum":["PERCENTAGE","FIXED"]},{"type":"null"}]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"invoiceId":{"type":"string"},"productId":{"type":["string","null"]},"studentId":{"type":["string","null"]},"description":{"type":"string"},"amount":{"type":"number"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"exento":{"type":"boolean"},"isService":{"type":"boolean"},"subscriptionId":{"type":["string","null"]},"ivaRatePercent":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"discountValue":{"type":["number","null"]},"discountExpiresAt":{"type":["string","null"]},"discountExpired":{"type":["boolean","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["discountValueType","id","accountId","invoiceId","productId","studentId","description","amount","quantity","exento","isService","subscriptionId","ivaRatePercent","discountExpiresAt","discountExpired","createdAt","updatedAt"]}},"discounts":{"type":"array","items":{"type":"object","properties":{"valueType":{"type":"string","enum":["PERCENTAGE","FIXED"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"invoiceId":{"type":"string"},"fromPaymentId":{"type":["string","null"]},"description":{"type":"string"},"value":{"type":"number"},"expiresAt":{"type":["string","null"]},"expired":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["valueType","id","accountId","invoiceId","fromPaymentId","description","value","expiresAt","expired","createdAt","updatedAt"]}},"fees":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["IGTF","IVA","PROCESSING_FEE"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"invoiceId":{"type":"string"},"fromPaymentId":{"type":["string","null"]},"amount":{"type":"number"},"rate":{"type":"number"},"rateBase":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["type","id","accountId","invoiceId","fromPaymentId","amount","rate","rateBase","createdAt","updatedAt"]}},"transactions":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["ITEMS","DISCOUNT","LATE_FEE","IVA","IGTF","PROCESSING_FEE","PAYMENT","REFUND","RETENTION","EXCHANGE_DIFFERENCE","ADJUSTMENT"]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"customerId":{"type":"string"},"invoiceId":{"type":"string"},"statementId":{"type":["string","null"]},"description":{"type":"string"},"transactionDate":{"type":"string"},"exchangeRate":{"type":"number"},"rateDate":{"type":"string"},"credit":{"type":"number"},"debit":{"type":"number"},"paymentId":{"type":["string","null"]},"fromPaymentId":{"type":["string","null"]},"retentionId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"payment":{"anyOf":[{"type":"object","properties":{"currency":{"type":"string","enum":["VES","USD","EUR"]},"receiverBankName":{"anyOf":[{"type":"string","enum":["A100BANCO","BANCAMIGA","BANCARIBE","BANESCO","BDV","BFC","BNC","MERCANTIL","PROVINCIAL","BANCO_DEL_TESORO","BANCO_PLAZA","SOFITASA","BANCO_ACTIVO","BANCO_AGRICOLA","BANCO_BICENTENARIO","BANCO_CARONI","BANCO_EXTERIOR","BANCRECER","BANFANB","BANGENTE","BANPLUS","DELSUR","R4","VENEZOLANO_DE_CREDITO","BANK_OF_AMERICA","AMERANT_BANK","US_BANK","WELLS_FARGO","BINANCE"]},{"type":"null"}]},"method":{"type":"string","enum":["BANK_TRANSFER","ZELLE","C2P","IMMEDIATE_DEBIT","P2P","CASH","POS","CUSTOMER_CREDIT","STRIPE_ACH","STRIPE_CARD","DEBIT_CARD","PAYROLL","BINANCE_PAY","LEDGER_FEE"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"customerId":{"type":"string"},"amount":{"type":"number"},"transactionDate":{"type":"string"},"rateDate":{"type":["string","null"]},"referenceCode":{"type":["string","null"]},"externalId":{"type":["string","null"]},"receiverBankHolderName":{"type":["string","null"]},"receiverBankNationalId":{"type":["string","null"]},"customerFullName":{"type":["string","null"]},"customerNationalId":{"type":["string","null"]},"customerPhoneNumber":{"type":["string","null"]},"customerBankAccountNumber":{"type":["string","null"]},"customerEmail":{"type":["string","null"]},"customerNote":{"type":["string","null"]},"customerIpAddress":{"type":["string","null"]},"customerUserAgent":{"type":["string","null"]},"isAutoPay":{"type":"boolean"},"bankAccountId":{"type":["string","null"]},"paymentClaimId":{"type":["string","null"]},"bankTransactionId":{"type":["string","null"]},"createdById":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"splitAmount":{"type":["number","null"]}},"required":["currency","receiverBankName","method","id","accountId","customerId","amount","transactionDate","rateDate","referenceCode","externalId","receiverBankHolderName","receiverBankNationalId","customerFullName","customerNationalId","customerPhoneNumber","customerBankAccountNumber","customerEmail","customerNote","customerIpAddress","customerUserAgent","isAutoPay","bankAccountId","paymentClaimId","bankTransactionId","createdById","createdAt","updatedAt"]},{"type":"null"}]}},"required":["kind","currency","id","accountId","customerId","invoiceId","statementId","description","transactionDate","exchangeRate","rateDate","credit","debit","paymentId","fromPaymentId","retentionId","createdAt","updatedAt","payment"]}}},"required":["lateFeeType","currency","pricingMode","status","source","id","externalId","accountId","customerId","printJobId","fiscalRecordId","billingDetailsId","description","issueDate","dueDate","expired","paidAt","voidedAt","planDate","billingRunKey","fiscalInvoicing","createdAt","updatedAt","items","discounts","fees","transactions"]},"checkoutSessionId":{"description":"The hosted checkout session it came from, `null` when it came from anywhere else (a payment recorded from the panel included). A session paid in parts sends a `payment_received` per payment, all with the same id. Read the session with `GET /v1/checkout-sessions/{id}`.","type":["string","null"]}},"required":["invoice","checkoutSessionId"]}},"required":["id","eventType","createdAt","data"]}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"payment_received":{"post":{"tags":["Webhook events"],"summary":"Payment Received","description":"Triggered when a payment is created","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"eventType":{"type":"string"},"account":{"description":"The connected account the event happened in, on events a platform receives on its **Cuentas conectadas** endpoints. Absent on your own account's events.","type":"string"},"createdAt":{"type":"string"},"data":{"type":"object","properties":{"payment":{"type":"object","properties":{"currency":{"type":"string","enum":["VES","USD","EUR"]},"receiverBankName":{"anyOf":[{"type":"string","enum":["A100BANCO","BANCAMIGA","BANCARIBE","BANESCO","BDV","BFC","BNC","MERCANTIL","PROVINCIAL","BANCO_DEL_TESORO","BANCO_PLAZA","SOFITASA","BANCO_ACTIVO","BANCO_AGRICOLA","BANCO_BICENTENARIO","BANCO_CARONI","BANCO_EXTERIOR","BANCRECER","BANFANB","BANGENTE","BANPLUS","DELSUR","R4","VENEZOLANO_DE_CREDITO","BANK_OF_AMERICA","AMERANT_BANK","US_BANK","WELLS_FARGO","BINANCE"]},{"type":"null"}]},"method":{"type":"string","enum":["BANK_TRANSFER","ZELLE","C2P","IMMEDIATE_DEBIT","P2P","CASH","POS","CUSTOMER_CREDIT","STRIPE_ACH","STRIPE_CARD","DEBIT_CARD","PAYROLL","BINANCE_PAY","LEDGER_FEE"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"customerId":{"type":"string"},"amount":{"type":"number"},"transactionDate":{"type":"string"},"rateDate":{"type":["string","null"]},"referenceCode":{"type":["string","null"]},"externalId":{"type":["string","null"]},"receiverBankHolderName":{"type":["string","null"]},"receiverBankNationalId":{"type":["string","null"]},"customerFullName":{"type":["string","null"]},"customerNationalId":{"type":["string","null"]},"customerPhoneNumber":{"type":["string","null"]},"customerBankAccountNumber":{"type":["string","null"]},"customerEmail":{"type":["string","null"]},"customerNote":{"type":["string","null"]},"customerIpAddress":{"type":["string","null"]},"customerUserAgent":{"type":["string","null"]},"isAutoPay":{"type":"boolean"},"bankAccountId":{"type":["string","null"]},"paymentClaimId":{"type":["string","null"]},"bankTransactionId":{"type":["string","null"]},"createdById":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"splitAmount":{"type":["number","null"]},"paymentTransactions":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["ITEMS","DISCOUNT","LATE_FEE","IVA","IGTF","PROCESSING_FEE","PAYMENT","REFUND","RETENTION","EXCHANGE_DIFFERENCE","ADJUSTMENT"]},"currency":{"type":"string","enum":["VES","USD","EUR"]},"id":{"type":"string","format":"cuid","pattern":"^[cC][0-9a-z]{6,}$"},"accountId":{"type":"string"},"customerId":{"type":"string"},"invoiceId":{"type":"string"},"statementId":{"type":["string","null"]},"description":{"type":"string"},"transactionDate":{"type":"string"},"exchangeRate":{"type":"number"},"rateDate":{"type":"string"},"credit":{"type":"number"},"debit":{"type":"number"},"paymentId":{"type":["string","null"]},"fromPaymentId":{"type":["string","null"]},"retentionId":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["kind","currency","id","accountId","customerId","invoiceId","statementId","description","transactionDate","exchangeRate","rateDate","credit","debit","paymentId","fromPaymentId","retentionId","createdAt","updatedAt"]}}},"required":["currency","receiverBankName","method","id","accountId","customerId","amount","transactionDate","rateDate","referenceCode","externalId","receiverBankHolderName","receiverBankNationalId","customerFullName","customerNationalId","customerPhoneNumber","customerBankAccountNumber","customerEmail","customerNote","customerIpAddress","customerUserAgent","isAutoPay","bankAccountId","paymentClaimId","bankTransactionId","createdById","createdAt","updatedAt","paymentTransactions"]},"checkoutSessionId":{"description":"The hosted checkout session it came from, `null` when it came from anywhere else (a payment recorded from the panel included). A session paid in parts sends a `payment_received` per payment, all with the same id. Read the session with `GET /v1/checkout-sessions/{id}`.","type":["string","null"]}},"required":["payment","checkoutSessionId"]}},"required":["id","eventType","createdAt","data"]}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"checkout_session_paid":{"post":{"tags":["Webhook events"],"summary":"Checkout Session Paid","description":"Triggered once a checkout session is fully paid. Use it as the fulfilment signal: fulfil on the event type, not on which fields are set. It carries the session's `externalId`, `invoiceId`, `amountPaid` and `paymentIds`, every payment applied to it, oldest first.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"eventType":{"type":"string"},"account":{"description":"The connected account the event happened in, on events a platform receives on its **Cuentas conectadas** endpoints. Absent on your own account's events.","type":"string"},"createdAt":{"type":"string"},"data":{"type":"object","properties":{"checkoutSession":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":["string","null"]},"status":{"type":"string","enum":["OPEN","PROCESSING","PAID","FAILED","EXPIRED","CANCELED"]},"automaticTax":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]},"items":{"type":"array","items":{"type":"object","properties":{"productId":{"type":["string","null"]},"description":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount":{"type":"number"},"exento":{"type":"boolean"},"taxes":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"IVA"},"rate":{"type":"number"},"amount":{"type":"number"}},"required":["type","rate","amount"]}}},"required":["productId","description","quantity","amount","exento","taxes"]}},"subtotal":{"type":"number"},"ivaRate":{"type":["number","null"]},"ivaAmount":{"type":"number"},"ivaBreakdown":{"type":"array","items":{"type":"object","properties":{"rate":{"type":"number"},"rateBase":{"type":"number"},"amount":{"type":"number"}},"required":["rate","rateBase","amount"]}},"amount":{"type":"number"},"currency":{"type":"string","enum":["VES","USD","EUR"]},"amountVes":{"type":"number"},"exchangeRate":{"type":["number","null"]},"exchangeRateDate":{"type":["string","null"]},"amountPaid":{"type":"number","description":"What the session has been paid so far, in `currency`, on `amount` (fees not included), a payment recorded into its invoice outside the checkout included. A canceled session still counts what it was paid."},"amountRemaining":{"type":"number","description":"`amount` minus `amountPaid`, never below 0, whatever the `status`."},"splits":{"type":"array","items":{"type":"object","properties":{"vendor":{"type":"string"},"externalId":{"type":["string","null"]},"amount":{"type":"number"},"amountVes":{"type":["number","null"]}},"required":["vendor","externalId","amount","amountVes"]},"description":"The parts of the order owed to vendors, in `currency`. `amountVes` is each part in bolívares at the rate of the payment that paid the session, `null` until it is `PAID`. Empty for a session without them."},"reference":{"type":["string","null"]},"description":{"type":["string","null"]},"buyerName":{"type":["string","null"]},"buyerEmail":{"type":["string","null"]},"paidAt":{"type":["string","null"]},"expiresAt":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"provider":{"type":"string","enum":["API","SHOPIFY","STOREFRONT"]},"invoiceId":{"description":"The session's order, written as a `DRAFT` when the session is created and issued to the payer by its first payment. `null` only for a session created before drafts, until its first payment. Canceling a partly paid session voids it; a `DRAFT` is left as it is.","type":["string","null"]},"paymentIds":{"type":"array","items":{"type":"string"},"description":"The payments applied to its invoice, oldest first, the same ids `payment_received` carries. Empty until a first payment. Includes a payment recorded into its invoice from the panel, whose own `payment_received` has `checkoutSessionId: null`."},"paymentId":{"description":"Deprecated: will be removed. The payment that closed the session, `null` until it is `PAID`. Use `paymentIds`.","type":["string","null"]},"test":{"type":"boolean"}},"required":["id","externalId","status","automaticTax","items","subtotal","ivaRate","ivaAmount","ivaBreakdown","amount","currency","amountVes","exchangeRate","exchangeRateDate","amountPaid","amountRemaining","splits","reference","description","buyerName","buyerEmail","paidAt","expiresAt","createdAt","updatedAt","provider","invoiceId","paymentIds","paymentId","test"]}},"required":["checkoutSession"]}},"required":["id","eventType","createdAt","data"]}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"checkout_session_partially_paid":{"post":{"tags":["Webhook events"],"summary":"Checkout Session Partially Paid","description":"Triggered when a payment pays part of a checkout session and leaves the rest to pay: one per such payment, with the session still `OPEN` and its `amountPaid`, `amountRemaining` and `paymentIds`. The payment that closes the session sends `checkout_session_paid` instead. The session is read when the event is sent, so a late delivery can already show it `PAID`: trust the event type.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"eventType":{"type":"string"},"account":{"description":"The connected account the event happened in, on events a platform receives on its **Cuentas conectadas** endpoints. Absent on your own account's events.","type":"string"},"createdAt":{"type":"string"},"data":{"type":"object","properties":{"checkoutSession":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":["string","null"]},"status":{"type":"string","enum":["OPEN","PROCESSING","PAID","FAILED","EXPIRED","CANCELED"]},"automaticTax":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]},"items":{"type":"array","items":{"type":"object","properties":{"productId":{"type":["string","null"]},"description":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount":{"type":"number"},"exento":{"type":"boolean"},"taxes":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"IVA"},"rate":{"type":"number"},"amount":{"type":"number"}},"required":["type","rate","amount"]}}},"required":["productId","description","quantity","amount","exento","taxes"]}},"subtotal":{"type":"number"},"ivaRate":{"type":["number","null"]},"ivaAmount":{"type":"number"},"ivaBreakdown":{"type":"array","items":{"type":"object","properties":{"rate":{"type":"number"},"rateBase":{"type":"number"},"amount":{"type":"number"}},"required":["rate","rateBase","amount"]}},"amount":{"type":"number"},"currency":{"type":"string","enum":["VES","USD","EUR"]},"amountVes":{"type":"number"},"exchangeRate":{"type":["number","null"]},"exchangeRateDate":{"type":["string","null"]},"amountPaid":{"type":"number","description":"What the session has been paid so far, in `currency`, on `amount` (fees not included), a payment recorded into its invoice outside the checkout included. A canceled session still counts what it was paid."},"amountRemaining":{"type":"number","description":"`amount` minus `amountPaid`, never below 0, whatever the `status`."},"splits":{"type":"array","items":{"type":"object","properties":{"vendor":{"type":"string"},"externalId":{"type":["string","null"]},"amount":{"type":"number"},"amountVes":{"type":["number","null"]}},"required":["vendor","externalId","amount","amountVes"]},"description":"The parts of the order owed to vendors, in `currency`. `amountVes` is each part in bolívares at the rate of the payment that paid the session, `null` until it is `PAID`. Empty for a session without them."},"reference":{"type":["string","null"]},"description":{"type":["string","null"]},"buyerName":{"type":["string","null"]},"buyerEmail":{"type":["string","null"]},"paidAt":{"type":["string","null"]},"expiresAt":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"provider":{"type":"string","enum":["API","SHOPIFY","STOREFRONT"]},"invoiceId":{"description":"The session's order, written as a `DRAFT` when the session is created and issued to the payer by its first payment. `null` only for a session created before drafts, until its first payment. Canceling a partly paid session voids it; a `DRAFT` is left as it is.","type":["string","null"]},"paymentIds":{"type":"array","items":{"type":"string"},"description":"The payments applied to its invoice, oldest first, the same ids `payment_received` carries. Empty until a first payment. Includes a payment recorded into its invoice from the panel, whose own `payment_received` has `checkoutSessionId: null`."},"paymentId":{"description":"Deprecated: will be removed. The payment that closed the session, `null` until it is `PAID`. Use `paymentIds`.","type":["string","null"]},"test":{"type":"boolean"}},"required":["id","externalId","status","automaticTax","items","subtotal","ivaRate","ivaAmount","ivaBreakdown","amount","currency","amountVes","exchangeRate","exchangeRateDate","amountPaid","amountRemaining","splits","reference","description","buyerName","buyerEmail","paidAt","expiresAt","createdAt","updatedAt","provider","invoiceId","paymentIds","paymentId","test"]}},"required":["checkoutSession"]}},"required":["id","eventType","createdAt","data"]}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"checkout_session_expired":{"post":{"tags":["Webhook events"],"summary":"Checkout Session Expired","description":"Triggered when an open checkout session passes its `expiresAt` without being paid, including a bank rejection that arrives after it.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"eventType":{"type":"string"},"account":{"description":"The connected account the event happened in, on events a platform receives on its **Cuentas conectadas** endpoints. Absent on your own account's events.","type":"string"},"createdAt":{"type":"string"},"data":{"type":"object","properties":{"checkoutSession":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":["string","null"]},"status":{"type":"string","enum":["OPEN","PROCESSING","PAID","FAILED","EXPIRED","CANCELED"]},"automaticTax":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]},"items":{"type":"array","items":{"type":"object","properties":{"productId":{"type":["string","null"]},"description":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount":{"type":"number"},"exento":{"type":"boolean"},"taxes":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"IVA"},"rate":{"type":"number"},"amount":{"type":"number"}},"required":["type","rate","amount"]}}},"required":["productId","description","quantity","amount","exento","taxes"]}},"subtotal":{"type":"number"},"ivaRate":{"type":["number","null"]},"ivaAmount":{"type":"number"},"ivaBreakdown":{"type":"array","items":{"type":"object","properties":{"rate":{"type":"number"},"rateBase":{"type":"number"},"amount":{"type":"number"}},"required":["rate","rateBase","amount"]}},"amount":{"type":"number"},"currency":{"type":"string","enum":["VES","USD","EUR"]},"amountVes":{"type":"number"},"exchangeRate":{"type":["number","null"]},"exchangeRateDate":{"type":["string","null"]},"amountPaid":{"type":"number","description":"What the session has been paid so far, in `currency`, on `amount` (fees not included), a payment recorded into its invoice outside the checkout included. A canceled session still counts what it was paid."},"amountRemaining":{"type":"number","description":"`amount` minus `amountPaid`, never below 0, whatever the `status`."},"splits":{"type":"array","items":{"type":"object","properties":{"vendor":{"type":"string"},"externalId":{"type":["string","null"]},"amount":{"type":"number"},"amountVes":{"type":["number","null"]}},"required":["vendor","externalId","amount","amountVes"]},"description":"The parts of the order owed to vendors, in `currency`. `amountVes` is each part in bolívares at the rate of the payment that paid the session, `null` until it is `PAID`. Empty for a session without them."},"reference":{"type":["string","null"]},"description":{"type":["string","null"]},"buyerName":{"type":["string","null"]},"buyerEmail":{"type":["string","null"]},"paidAt":{"type":["string","null"]},"expiresAt":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"provider":{"type":"string","enum":["API","SHOPIFY","STOREFRONT"]},"invoiceId":{"description":"The session's order, written as a `DRAFT` when the session is created and issued to the payer by its first payment. `null` only for a session created before drafts, until its first payment. Canceling a partly paid session voids it; a `DRAFT` is left as it is.","type":["string","null"]},"paymentIds":{"type":"array","items":{"type":"string"},"description":"The payments applied to its invoice, oldest first, the same ids `payment_received` carries. Empty until a first payment. Includes a payment recorded into its invoice from the panel, whose own `payment_received` has `checkoutSessionId: null`."},"paymentId":{"description":"Deprecated: will be removed. The payment that closed the session, `null` until it is `PAID`. Use `paymentIds`.","type":["string","null"]},"test":{"type":"boolean"}},"required":["id","externalId","status","automaticTax","items","subtotal","ivaRate","ivaAmount","ivaBreakdown","amount","currency","amountVes","exchangeRate","exchangeRateDate","amountPaid","amountRemaining","splits","reference","description","buyerName","buyerEmail","paidAt","expiresAt","createdAt","updatedAt","provider","invoiceId","paymentIds","paymentId","test"]}},"required":["checkoutSession"]}},"required":["id","eventType","createdAt","data"]}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"checkout_session_canceled":{"post":{"tags":["Webhook events"],"summary":"Checkout Session Canceled","description":"Triggered when an open checkout session is canceled by the merchant API or replaced by a new storefront checkout.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"eventType":{"type":"string"},"account":{"description":"The connected account the event happened in, on events a platform receives on its **Cuentas conectadas** endpoints. Absent on your own account's events.","type":"string"},"createdAt":{"type":"string"},"data":{"type":"object","properties":{"checkoutSession":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":["string","null"]},"status":{"type":"string","enum":["OPEN","PROCESSING","PAID","FAILED","EXPIRED","CANCELED"]},"automaticTax":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]},"items":{"type":"array","items":{"type":"object","properties":{"productId":{"type":["string","null"]},"description":{"type":"string"},"quantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amount":{"type":"number"},"exento":{"type":"boolean"},"taxes":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"IVA"},"rate":{"type":"number"},"amount":{"type":"number"}},"required":["type","rate","amount"]}}},"required":["productId","description","quantity","amount","exento","taxes"]}},"subtotal":{"type":"number"},"ivaRate":{"type":["number","null"]},"ivaAmount":{"type":"number"},"ivaBreakdown":{"type":"array","items":{"type":"object","properties":{"rate":{"type":"number"},"rateBase":{"type":"number"},"amount":{"type":"number"}},"required":["rate","rateBase","amount"]}},"amount":{"type":"number"},"currency":{"type":"string","enum":["VES","USD","EUR"]},"amountVes":{"type":"number"},"exchangeRate":{"type":["number","null"]},"exchangeRateDate":{"type":["string","null"]},"amountPaid":{"type":"number","description":"What the session has been paid so far, in `currency`, on `amount` (fees not included), a payment recorded into its invoice outside the checkout included. A canceled session still counts what it was paid."},"amountRemaining":{"type":"number","description":"`amount` minus `amountPaid`, never below 0, whatever the `status`."},"splits":{"type":"array","items":{"type":"object","properties":{"vendor":{"type":"string"},"externalId":{"type":["string","null"]},"amount":{"type":"number"},"amountVes":{"type":["number","null"]}},"required":["vendor","externalId","amount","amountVes"]},"description":"The parts of the order owed to vendors, in `currency`. `amountVes` is each part in bolívares at the rate of the payment that paid the session, `null` until it is `PAID`. Empty for a session without them."},"reference":{"type":["string","null"]},"description":{"type":["string","null"]},"buyerName":{"type":["string","null"]},"buyerEmail":{"type":["string","null"]},"paidAt":{"type":["string","null"]},"expiresAt":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"provider":{"type":"string","enum":["API","SHOPIFY","STOREFRONT"]},"invoiceId":{"description":"The session's order, written as a `DRAFT` when the session is created and issued to the payer by its first payment. `null` only for a session created before drafts, until its first payment. Canceling a partly paid session voids it; a `DRAFT` is left as it is.","type":["string","null"]},"paymentIds":{"type":"array","items":{"type":"string"},"description":"The payments applied to its invoice, oldest first, the same ids `payment_received` carries. Empty until a first payment. Includes a payment recorded into its invoice from the panel, whose own `payment_received` has `checkoutSessionId: null`."},"paymentId":{"description":"Deprecated: will be removed. The payment that closed the session, `null` until it is `PAID`. Use `paymentIds`.","type":["string","null"]},"test":{"type":"boolean"}},"required":["id","externalId","status","automaticTax","items","subtotal","ivaRate","ivaAmount","ivaBreakdown","amount","currency","amountVes","exchangeRate","exchangeRateDate","amountPaid","amountRemaining","splits","reference","description","buyerName","buyerEmail","paidAt","expiresAt","createdAt","updatedAt","provider","invoiceId","paymentIds","paymentId","test"]}},"required":["checkoutSession"]}},"required":["id","eventType","createdAt","data"]}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"settlement_completed":{"post":{"tags":["Webhook events"],"summary":"Settlement Completed","description":"Triggered when UnoPago pays out what it collected to the account's bank account. `paymentIds` lists the payments it covers that UnoPago recorded, so it can be shorter than `paymentCount`. A payout to one of your vendors sends the same event with `vendor`: the three settlement events are how you learn what became of a vendor's payout, and UnoPago sends the vendor nothing. A vendor's events go to your account's own endpoints, never to the connected-accounts ones, also when its parts came from your connected accounts' orders: subscribe an endpoint of your own to the three. If you split orders, read `vendor` before counting a payout as yours: `netAmount` of a vendor's payout was deposited to the vendor.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"eventType":{"type":"string"},"account":{"description":"The connected account the event happened in, on events a platform receives on its **Cuentas conectadas** endpoints. Absent on your own account's events.","type":"string"},"createdAt":{"type":"string"},"data":{"type":"object","properties":{"settlement":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["COMPLETED","FAILED","CANCELED"]},"currency":{"type":"string","const":"VES"},"totalAmount":{"type":"string","description":"What the paid payments collected, in bolívares. On a vendor's payout, the vendor's parts of them."},"totalFees":{"type":"string","description":"UnoPago's fees on them. `0` on a vendor's payout: the account pays the fee on the whole charge."},"totalSplits":{"type":"string","description":"The parts of those payments owed to vendors (`splits` on their checkout sessions), paid to each vendor in a payout of its own. `0` on a vendor's payout and on a payout with no split payment."},"netAmount":{"type":"string","description":"What was sent to the bank account: `totalAmount − totalFees − totalSplits`."},"vendor":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":["string","null"]}},"required":["id","externalId"]},{"type":"null"}],"description":"The vendor this payout pays, with your own id for it. `null` on your own payout. A vendor is not notified by UnoPago: these events are how you learn its payout was paid, failed or was canceled. They are sent to your account's own endpoints, not to the connected-accounts ones."},"paymentCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paymentIds":{"type":"array","items":{"type":"string"},"description":"The payments this payout covers that UnoPago recorded, the same ids `payment_received` carries. Can be shorter than `paymentCount`. On a vendor's payout, the payments its parts came from. On `settlement_canceled`, the canceled payout's payments, paid in a later payout once UnoPago clears them."},"processingBank":{"type":"string"},"bankReference":{"type":["string","null"]},"bankAccount":{"anyOf":[{"type":"object","properties":{"bankCode":{"type":"string"},"accountNumberLast4":{"type":"string"}},"required":["bankCode","accountNumberLast4"]},{"type":"null"}]},"processedAt":{"type":["string","null"]}},"required":["id","status","currency","totalAmount","totalFees","totalSplits","netAmount","vendor","paymentCount","paymentIds","processingBank","bankReference","bankAccount","processedAt"]}},"required":["settlement"]}},"required":["id","eventType","createdAt","data"]}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"settlement_failed":{"post":{"tags":["Webhook events"],"summary":"Settlement Failed","description":"Triggered when a payout could not be completed: the bank refused it, or UnoPago could not confirm it (the check before sending it failed, or a review found it was not paid). A payout that fails twice sends it twice, with a different event `id`. The money stays owed to the account and UnoPago reviews it: it either sends this payout again (`settlement_completed` with the same `id`, or another `settlement_failed`) or releases it: then `settlement_canceled` arrives and its payments are paid in a later payout with a new `id`. A vendor's payout (`vendor` is set) fails the same ways. When it was the bank that refused it, usually a wrong account, you can release it yourself: update the vendor's bank account and have an owner confirm it; `settlement_canceled` arrives and the next run pays it to the new account. The event does not say which of the two it was: if no `settlement_canceled` follows the confirmation, UnoPago is reviewing the payout.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"eventType":{"type":"string"},"account":{"description":"The connected account the event happened in, on events a platform receives on its **Cuentas conectadas** endpoints. Absent on your own account's events.","type":"string"},"createdAt":{"type":"string"},"data":{"type":"object","properties":{"settlement":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["COMPLETED","FAILED","CANCELED"]},"currency":{"type":"string","const":"VES"},"totalAmount":{"type":"string","description":"What the paid payments collected, in bolívares. On a vendor's payout, the vendor's parts of them."},"totalFees":{"type":"string","description":"UnoPago's fees on them. `0` on a vendor's payout: the account pays the fee on the whole charge."},"totalSplits":{"type":"string","description":"The parts of those payments owed to vendors (`splits` on their checkout sessions), paid to each vendor in a payout of its own. `0` on a vendor's payout and on a payout with no split payment."},"netAmount":{"type":"string","description":"What was sent to the bank account: `totalAmount − totalFees − totalSplits`."},"vendor":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":["string","null"]}},"required":["id","externalId"]},{"type":"null"}],"description":"The vendor this payout pays, with your own id for it. `null` on your own payout. A vendor is not notified by UnoPago: these events are how you learn its payout was paid, failed or was canceled. They are sent to your account's own endpoints, not to the connected-accounts ones."},"paymentCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paymentIds":{"type":"array","items":{"type":"string"},"description":"The payments this payout covers that UnoPago recorded, the same ids `payment_received` carries. Can be shorter than `paymentCount`. On a vendor's payout, the payments its parts came from. On `settlement_canceled`, the canceled payout's payments, paid in a later payout once UnoPago clears them."},"processingBank":{"type":"string"},"bankReference":{"type":["string","null"]},"bankAccount":{"anyOf":[{"type":"object","properties":{"bankCode":{"type":"string"},"accountNumberLast4":{"type":"string"}},"required":["bankCode","accountNumberLast4"]},{"type":"null"}]},"processedAt":{"type":["string","null"]}},"required":["id","status","currency","totalAmount","totalFees","totalSplits","netAmount","vendor","paymentCount","paymentIds","processingBank","bankReference","bankAccount","processedAt"]}},"required":["settlement"]}},"required":["id","eventType","createdAt","data"]}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"settlement_canceled":{"post":{"tags":["Webhook events"],"summary":"Settlement Canceled","description":"Triggered when UnoPago cancels a payout that was never sent — the bank refused it, or UnoPago held it to review its payments — instead of sending it again: it will never be paid. `paymentIds` are its payments: they are paid in a later payout, with a new `id`, once UnoPago clears them.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"eventType":{"type":"string"},"account":{"description":"The connected account the event happened in, on events a platform receives on its **Cuentas conectadas** endpoints. Absent on your own account's events.","type":"string"},"createdAt":{"type":"string"},"data":{"type":"object","properties":{"settlement":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["COMPLETED","FAILED","CANCELED"]},"currency":{"type":"string","const":"VES"},"totalAmount":{"type":"string","description":"What the paid payments collected, in bolívares. On a vendor's payout, the vendor's parts of them."},"totalFees":{"type":"string","description":"UnoPago's fees on them. `0` on a vendor's payout: the account pays the fee on the whole charge."},"totalSplits":{"type":"string","description":"The parts of those payments owed to vendors (`splits` on their checkout sessions), paid to each vendor in a payout of its own. `0` on a vendor's payout and on a payout with no split payment."},"netAmount":{"type":"string","description":"What was sent to the bank account: `totalAmount − totalFees − totalSplits`."},"vendor":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":["string","null"]}},"required":["id","externalId"]},{"type":"null"}],"description":"The vendor this payout pays, with your own id for it. `null` on your own payout. A vendor is not notified by UnoPago: these events are how you learn its payout was paid, failed or was canceled. They are sent to your account's own endpoints, not to the connected-accounts ones."},"paymentCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paymentIds":{"type":"array","items":{"type":"string"},"description":"The payments this payout covers that UnoPago recorded, the same ids `payment_received` carries. Can be shorter than `paymentCount`. On a vendor's payout, the payments its parts came from. On `settlement_canceled`, the canceled payout's payments, paid in a later payout once UnoPago clears them."},"processingBank":{"type":"string"},"bankReference":{"type":["string","null"]},"bankAccount":{"anyOf":[{"type":"object","properties":{"bankCode":{"type":"string"},"accountNumberLast4":{"type":"string"}},"required":["bankCode","accountNumberLast4"]},{"type":"null"}]},"processedAt":{"type":["string","null"]}},"required":["id","status","currency","totalAmount","totalFees","totalSplits","netAmount","vendor","paymentCount","paymentIds","processingBank","bankReference","bankAccount","processedAt"]}},"required":["settlement"]}},"required":["id","eventType","createdAt","data"]}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"account_verified":{"post":{"tags":["Webhook events"],"summary":"Account Verified","description":"Triggered when UnoPago approves the account's verification. A platform receives it on its **Cuentas conectadas** endpoints for each connected account, with `account` set, so it does not need to poll `GET /v1/accounts/{accountId}/verification`.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"eventType":{"type":"string"},"account":{"description":"The connected account the event happened in, on events a platform receives on its **Cuentas conectadas** endpoints. Absent on your own account's events.","type":"string"},"createdAt":{"type":"string"},"data":{"type":"object","properties":{"verification":{"type":"object","properties":{"accountId":{"type":"string","description":"The account that was reviewed: on a platform's **Cuentas conectadas** endpoints, the same connected account as `account`."},"status":{"type":"string","enum":["VERIFIED","REJECTED"]},"rejectionReason":{"description":"Why UnoPago rejected it, in Spanish, ready to show the account. `null` when it was verified.","type":["string","null"]},"reviewedAt":{"type":"string"}},"required":["accountId","status","rejectionReason","reviewedAt"]}},"required":["verification"]}},"required":["id","eventType","createdAt","data"]}}}},"responses":{"200":{"description":"Webhook received successfully"}}}},"account_verification_rejected":{"post":{"tags":["Webhook events"],"summary":"Account Verification Rejected","description":"Triggered when UnoPago rejects the account's verification, with `rejectionReason`. The account can submit a new document right away; each rejection sends its own event, with a different `id`. A platform receives it on its **Cuentas conectadas** endpoints for each connected account, with `account` set.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"eventType":{"type":"string"},"account":{"description":"The connected account the event happened in, on events a platform receives on its **Cuentas conectadas** endpoints. Absent on your own account's events.","type":"string"},"createdAt":{"type":"string"},"data":{"type":"object","properties":{"verification":{"type":"object","properties":{"accountId":{"type":"string","description":"The account that was reviewed: on a platform's **Cuentas conectadas** endpoints, the same connected account as `account`."},"status":{"type":"string","enum":["VERIFIED","REJECTED"]},"rejectionReason":{"description":"Why UnoPago rejected it, in Spanish, ready to show the account. `null` when it was verified.","type":["string","null"]},"reviewedAt":{"type":"string"}},"required":["accountId","status","rejectionReason","reviewedAt"]}},"required":["verification"]}},"required":["id","eventType","createdAt","data"]}}}},"responses":{"200":{"description":"Webhook received successfully"}}}}}}