{
  "openapi": "3.0.4",
  "servers": [
    {
      "url": "https://app-sandbox.resolvepay.com/api",
      "description": "Sandbox server"
    }
  ],
  "info": {
    "title": "Resolve Partners API Reference",
    "version": "partners-v1",
    "x-logo": {
      "url": "https://assets.resolvepay.com/images/logos/resolve-direct-api.png",
      "altText": "Resolve API",
      "href": ""
    },
    "description": "API Support: [accounts@resolvepay.com](mailto:accounts@resolvepay.com?subject=API)\n"
  },
  "tags": [
    {
      "name": "Active Maintenance",
      "description": "**This API is currently under active maintenance.** New endpoints, fields, and features\nmay be introduced, and existing behavior may be updated over time. For questions or\nfeedback, contact [accounts@resolvepay.com](mailto:accounts@resolvepay.com?subject=Partners%20API%20Feedback).\n",
      "x-traitTag": true
    },
    {
      "name": "Introduction",
      "description": "The Resolve Partners API is organized around [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) principles.\nIt uses predictable resource-oriented URLs, standard HTTP verbs and response codes,\nand accepts and returns [JSON-encoded](https://www.json.org/json-en.html) request and response bodies.\n\nThe Partners API allows you to manage invoices, customers, payouts, and other resources on behalf of your sub-merchants. As a partner (platform or marketplace), you can access and manipulate your sub-merchants' data through this API.\n\nThere are two types of partners:\n- **Marketplace** — Invoices belong to sub-merchants, while customers belong to the partner (marketplace) itself.\n- **Single-merchant** — Both invoices and customers belong to the sub-merchant.\n\nYour partner type determines how certain endpoints behave, particularly regarding the `merchant_id` parameter. See individual endpoint documentation for details.\n\nThe current version is **partners-v1**. To upgrade your API version, please reach out to Resolve at [accounts@resolvepay.com](mailto:accounts@resolvepay.com?subject=API%20Version%20Upgrade).\n",
      "x-traitTag": true
    },
    {
      "name": "Access Keys",
      "x-displayName": "Access Keys",
      "description": "OAuth access keys are created in Merchant Dashboard and can be exchanged for bearer tokens.\n\nUse the `/access-keys/token` endpoint to mint a bearer token from a valid `client_id` and `client_secret`.\n"
    },
    {
      "name": "Webhooks",
      "x-displayName": "Webhooks",
      "description": "Webhooks allow you to receive real-time notifications about events occurring for your sub-merchants. When an event occurs for any of your sub-merchants, Resolve sends an HTTP POST request to your configured webhook endpoint with details about the event.\n\n## Webhook Event Structure\n\nAll webhook events follow a consistent structure:\n\n```json\n{\n  \"id\": \"4ecbe7f9e8c1c9092c000027\",\n  \"object\": \"invoice\",\n  \"type\": \"invoice.created\",\n  \"occurred_at\": \"2021-05-20T09:23:53+00:00\",\n  \"data\": {\n    \"id\": \"RH5fF9aeQ\",\n    \"merchant_id\": \"MER456789\"\n  }\n}\n```\n\nThe `data.id` field contains the ID of the object related to the event. You can use this ID to fetch the full object via the corresponding API endpoint.\n\nThe `data.merchant_id` field indicates the ID of the sub-merchant the event occurred for. This allows you to identify which sub-merchant's data triggered the webhook.\n\n## Supported Event Types\n\n### Invoice Events\n- **`invoice.created`** - Triggered when a new invoice record is created.\n- **`invoice.balance_updated`** - Triggered when the outstanding balance of an invoice changes (for example, when a payment or credit note is applied).\n\n### Customer Events\n- **`customer.created`** - Triggered when a new customer record is created.\n- **`customer.status_updated`** - Triggered when a customer's status changes (for example, when a customer is submitted for a credit check or enrolled).\n- **`customer.line_amount_updated`** - Triggered when a customer's credit limit amount is updated.\n- **`customer.advance_rate_updated`** - Triggered when a customer's advance rate percentage is updated.\n- **`customer.credit_decision_created`** - Triggered when a new credit decision is created for a customer.\n\n### Payout Events\n- **`payout.created`** - Triggered when a new payout record is created.\n- **`payout.status_changed`** - Triggered when the status of a payout changes (for example, pending, in transit, paid).\n\n### Merchant Events\n- **`merchant.created`** - Triggered when a new sub-merchant record is created by the partner integration.\n- **`merchant.underwriting_completed`** - Triggered when underwriting reaches a terminal decision for a sub-merchant.\n- **`merchant.more_info_needed`** - Triggered when a sub-merchant's underwriting workflow moves into a needs-info state.\n- **`merchant.mal_updated`** - Triggered when a sub-merchant's maximum approved limit (MAL) changes.\n\n## Verifying Webhook Signatures\n\nTo ensure webhook requests are genuine and coming from Resolve, you should verify the webhook signature. Resolve includes a signature in the `x-webhook-signature` header of each webhook request.\n\n### JavaScript Example\n\n```javascript\nconst crypto = require('crypto');\n\nfunction verifyWebhookSignature(payload, signature, secret) {\n  const computedSignature = crypto\n    .createHmac('sha256', secret)\n    .update(JSON.stringify(payload))\n    .digest('hex');\n\n  return crypto.timingSafeEqual(\n    Buffer.from(signature),\n    Buffer.from(computedSignature)\n  );\n}\n\n// Usage in Express.js\napp.post('/webhooks', express.json(), (req, res) => {\n  const signature = req.headers['x-webhook-signature'];\n  const isValid = verifyWebhookSignature(req.body, signature, process.env.WEBHOOK_SECRET);\n\n  if (!isValid) {\n    return res.status(401).send('Invalid signature');\n  }\n\n  // Process the webhook event\n  const event = req.body;\n  console.log('Received event:', event.type);\n\n  res.status(200).send('Webhook received');\n});\n```\n\n## Retry Policy\n\nIf your webhook endpoint doesn't respond successfully (non-2xx status code or connection error), Resolve will automatically retry sending the webhook notification. The retry schedule follows an exponential backoff pattern:\n\n- **1st retry**: 30 seconds after the initial attempt\n- **2nd retry**: 90 seconds after the 1st retry\n- **3rd retry**: 270 seconds (4.5 minutes) after the 2nd retry\n- **4th retry**: 810 seconds (13.5 minutes) after the 3rd retry\n- **5th retry**: 2430 seconds (40.5 minutes) after the 4th retry\n\nAfter the 5th unsuccessful attempt, Resolve will stop retrying and the webhook delivery will be marked as failed.\n\n## Best Practices\n\n- Always verify webhook signatures to ensure the request is from Resolve\n- Respond with a `200` status code as quickly as possible to acknowledge receipt\n- Process webhook events asynchronously if they require time-intensive operations\n- Implement idempotency on your endpoint to handle duplicate events from retries\n- Use the event `id` to track which events you've already processed\n"
    },
    {
      "name": "Invoices",
      "x-displayName": "Invoices",
      "description": "An invoice represents the business transaction between a sub-merchant and a customer. In Resolve, an invoice must be tied to both a customer and a sub-merchant. An advance can be taken on the invoice.\n\nWhen creating an invoice, the `merchant_id` field is required and must reference a valid sub-merchant under your partner account.\n\nFor an advance to be taken on the invoice, a PDF of the invoice must be uploaded and the associated customer must be approved and have available credit for the amount of the invoice.\n"
    },
    {
      "name": "Customers",
      "x-displayName": "Customers",
      "description": "A customer represents a company that does business with your sub-merchants. For larger companies, there may be several users with access to the customer account that can make purchases with their credit line. For smaller companies, a customer may represent a single individual. Retrieve a customer to get a summary of their total credit line and available credit balance.\n\n**Important:** The behavior of the `merchant_id` parameter depends on your partner type:\n\n- **Single-merchant partners**: The `merchant_id` field is **required** when creating a customer, and must reference a valid sub-merchant under your partner account. The `merchant_id` field will be included in responses and can be used as a filter when listing customers. Both invoices and customers belong to the sub-merchant.\n- **Marketplace partners**: The `merchant_id` field is **not accepted** when creating a customer — customers belong to the marketplace (partner) itself. The `merchant_id` field will not be present in responses or available as a filter. Invoices still belong to sub-merchants.\n"
    },
    {
      "name": "Payouts",
      "x-displayName": "Payouts",
      "description": "A Payout is a transfer of money between Resolve and either a sub-merchant or the partner directly, depending on who the payout receiver is. The `merchant_id` field on a payout can represent either the partner themselves or one of their sub-merchants.\n"
    },
    {
      "name": "Payout Transactions",
      "x-displayName": "Payout Transactions",
      "description": "Payout Transactions are the individual transactions like customer payments, Resolve advances, forwarded payments, etc. that are rolled into a Payout for a sub-merchant or the partner. Each Payout is the sum of one or more transactions. Note that certain fields are only relevant to certain transaction types - e.g.: a Payout Transaction of type `monthly_fee` will have both `customer_id` and `invoice_id` set to `null`.\n"
    },
    {
      "name": "Payments",
      "x-displayName": "Payments",
      "description": "A payment represents a transaction where a customer pays towards their invoices with a sub-merchant. When a payment is made to Resolve, the customer's available credit balance is increased by the amount of the payment. Payments can be made via various methods including ACH, credit card, check, or wire transfer. Each payment can be applied to one or more invoices.\n\nAs a partner, you can also create forwarded payments on behalf of your sub-merchants. The payment will be forwarded from the bank account of the entity that receives payouts — if the payout receiver is the partner, the partner's bank account will be used; otherwise, the sub-merchant's bank account will be used.\n"
    },
    {
      "name": "Credit Notes",
      "x-displayName": "Credit Notes",
      "description": "Credit Notes are issued to customers of your sub-merchants to reduce the amount they owe. As a partner, you can manage credit notes across all your sub-merchants.\n"
    },
    {
      "name": "Merchants",
      "x-displayName": "Merchants",
      "description": "Merchant-scoped operations for managing sub-merchant resources.\n\nThe merchant document upload endpoint creates a document record and starts transfer into Resolve-managed storage for validation.\n"
    },
    {
      "name": "Shipments",
      "x-displayName": "Shipments",
      "description": "A shipment represents the fulfillment of goods or services for an invoice of a sub-merchant. Track shipments to monitor delivery status and fulfillment progress. Shipments can be fulfilled through various methods including shipping providers, self-delivery, customer pickup, or for services-only transactions.\n\n## Supported Couriers\n\nWhile any courier value can be accepted for the `shipment_courier` field, instant verification through the sync endpoint is supported for the following couriers:\n\n### Major Carriers\n- `fedex` - FedEx®\n- `ups` - UPS\n- `usps` - USPS\n- `dhl` - DHL Express\n- `dhl-api` - DHL\n\n### Complete List of Supported Couriers\n\n`fedex`, `ups`, `usps`, `17postservice`, `2go`, `2ebox`, `360lion`, `3jmslogistics`, `4-72`, `4px`, `shipstoresoftware-webhook`, `99minutos`, `aduiepyle`, `a1post`, `a2b-ba`, `aaa-cooper`, `abf`, `acilogistix`, `acscourier`, `acsworldwide`, `ads`, `adsone`, `aex`, `afllog-ftp`, `arihantcourier`, `air21`, `aitworldwide-sftp`, `aitworldwide-api`, `alljoy`, `amsegroup`, `ancdelivers-sftp`, `anserx`, `ao-deutschland`, `ao-courier`, `ao-courier-webhook`, `apc-overnight`, `apc-overnight-connum`, `apc`, `apg`, `ark-logistics`, `ase`, `asigna`, `asm`, `ata`, `atshealthcare`, `atshealthcare-reference`, `activos24-api`, `aderonline`, `adicional`, `aeronet`, `test-courier`, `agediss-sftp`, `agility`, `airmee-webhook`, `airpak-express`, `airspeed`, `allegro`, `alliedexpress`, `allied-express-ftp`, `alphafreight-webhook`, `always-express`, `amazon`, `awest`, `an-post`, `andreani-api`, `anicamboxexpress`, `anjun`, `anteraja`, `aoyue`, `aquiline`, `aramex`, `aramex-api`, `fastway-au-api`, `fastway-au`, `araskargo`, `arco-spedizioni`, `argents-webhook`, `arrow-api`, `arrowxl`, `asendia-de`, `asendia-hk`, `asendia`, `asendia-uk`, `asendia-usa`, `agsystems`, `associated-couriers`, `asyadexpress`, `auexpress`, `australia-post`, `australia-post-api`, `austrian-post`, `austrian-post-registered`, `averitt`, `axlehire`, `axlehire-ftp`, `bh-worldwide`, `b2ceurope`, `bdmnet`, `bjshomedelivery`, `bjshomedelivery-ftp`, `brt-it`, `brt-it-api`, `brt-it-parcelid`, `brt-it-sender-ref`, `btxglobal-ftp`, `buffalo`, `barqexp`, `barsan`, `belpost`, `ibeone`, `bert-fr`, `800bestex`, `besttransport-sftp`, `bestwayparcel`, `bettertrucks`, `bigsmart`, `biocair-ftp`, `birdsystem`, `bleckmann-sftp`, `blinklastmile`, `bluex`, `bluestar`, `bluecare`, `bluedart-api`, `bluedart`, `bneed`, `bollore-logistics-sftp`, `bollore-logistics`, `bombinoexp`, `bomi-br-api`, `bomi`, `bond`, `bondscouriers`, `borderexpress`, `borderless360-webhook`, `boxc`, `box-berry`, `boxcheck-api`, `bpost`, `bpost-api`, `bpost-international`, `braspress-web`, `braunsexpress`, `brazil-correios`, `bring`, `bringer`, `brouwer-transport`, `budbee-webhook`, `bgpost`, `burd`, `cchezvous-sftp`, `cae-delivers`, `cbl-logistica`, `cbl-logistica-api`, `cdek`, `cdek-tr`, `cdldelivers`, `cdldelivers-api`, `ceva`, `ceva-webhook`, `ceva-tracking`, `cfl-logistics`, `cgs-express`, `parcll`, `cj-malaysia-international`, `cj-gls`, `cj-korea-thai`, `cjlogistics`, `cj-hk-international`, `cjpacket`, `cj-philippines`, `ckb-webhook`, `cle-logistics`, `cn-logistics`, `cnexps`, `crlexpress`, `cse`, `ctc-express`, `tourline`, `cacesa`, `cago`, `cainiao`, `cambodia-post`, `canada-post`, `canpar`, `capital`, `cpex`, `cargopartner-api`, `carriers`, `carry-flap`, `castleparcels`, `celeritas-ftp`, `cello-square`, `champion-logistics`, `chazki`, `chienventure-webhook`, `chilexpress-webhook`, `china-ems`, `china-post`, `chitchats`, `choirexpress`, `chronopost-france-webhook`, `chronopost-france`, `chronopost-portugal`, `ec-firstclass`, `city56-webhook`, `citylinkexpress`, `clevy-links`, `clicklink-sftp`, `cloudwish-asia`, `colis-prive`, `colissimo`, `collectplus`, `collectco`, `com1express`, `comet-tech`, `con-way`, `concise-api`, `concise-webhook`, `continental`, `coordinadora`, `coordinadora-api`, `copa-courier`, `cope`, `corporatecouriers-webhook`, `correo-uy`, `correosexpress`, `correosexpress-api`, `spain-correos-es`, `correos-de-mexico`, `costmeticsnow`, `courant-plus`, `courant-plus-api`, `courierit`, `cnwglobal-api`, `courier-plus`, `courierpost`, `couriers-please`, `croshot`, `crossflight`, `cryopdp-ftp`, `cubyn`, `cuckooexpress`, `cyprus-post`, `ceskaposta`, `ceskaposta-api`, `dexpress-webhook`, `dachser-web`, `dachser`, `daiglobaltrack`, `dao365`, `dbschenker-se`, `dbschenker-api`, `dbschenker-b2b`, `dbschenker-iceland-ftp`, `dbschenker-sv`, `ddexpress`, `deliveryontime`, `dex-i`, `dhl-api`, `dhl-reference-api`, `dhl-active-tracing`, `dhl-benelux`, `dhl-sftp`, `dhl`, `dhl-pieceid`, `dhl-freight`, `dhl-pa-api`, `dhl-global-forwarding-api`, `dhl-gt-api`, `dhl-ecommerce-gc`, `dhl-ecommerce-gc-api`, `dhl-hk`, `dhl-ie-sftp`, `dhl-nl`, `dhlparcel-nl`, `dhlparcel-ru`, `dhlparcel-es`, `dhlparcel-uk`, `dhl-poland`, `dhl-es-sftp`, `dhl-es`, `dhl-supplychain-apac`, `dhl-supply-chain-au-sftp`, `dhl-supply-chain-au`, `dhl-supplychain-id`, `dhl-global-mail-asia`, `dhl-global-mail-asia-api`, `dhl-global-mail`, `dhl-global-mail-api`, `dhl-supplychain-in`, `didadi`, `dirmensajeria`, `dksh`, `dmfgroup`, `dms-matrix`, `dnj-express`, `domino`, `dpd`, `dpd-api`, `dpd-at`, `dpd-at-sftp`, `exapaq`, `dpd-de`, `dpd-hk`, `dpd-hungary-web`, `dpd-hungary-ftp`, `dpd-hungary`, `dpd-ireland`, `interlink-express`, `interlink-express-reference`, `dpd-nl-api`, `packs-api`, `dpd-nl`, `dpd-poland`, `dpd-prt`, `dpd-ro`, `dpd-ru-api`, `dpd-ru`, `dpd-sk-sftp`, `dpd-ch-sftp`, `dpd-uk`, `dpd-uk-sftp`, `dpe-express`, `dpe-za`, `dpex`, `szdpex`, `dsv-za-sftp`, `dsv`, `dsv-reference`, `dsv-are-webhook`, `dtd`, `dtdc-au`, `dtdc-express`, `dtdc`, `dx`, `dx-sftp`, `dx-b2b-connum`, `dx-freight`, `daeshin`, `daiichi`, `danniao`, `danske-fragt`, `dashlink-webhook`, `dawnwing`, `dayross`, `dylt`, `dayton-freight`, `dealer-send`, `delhivery-webhook`, `delhivery`, `deliveryourparcel-za`, `deliver-it`, `smartkargo`, `deliveright-webhook`, `deliverr-sftp`, `delnext`, `deltec-courier`, `godependable`, `designertransport-webhook`, `destiny-ftp`, `destiny`, `destiny-webhook`, `detrack`, `detrack-webhook`, `dhl-germany`, `deutsch-post`, `dialogo-logistica-api`, `dialogo-logistica`, `diamondcouriers`, `dimerco`, `directcouriers`, `directcouriers-ftp`, `directfreight-au-ref`, `directlog`, `direx`, `discountpost`, `emega`, `dobropost`, `doordash-webhook`, `doora`, `dynamic-logistics`, `ecms`, `ecoscooting`, `ecexpress`, `efs`, `elta-courier`, `empsexpress`, `ems`, `eu-fleet-solutions`, `myhermes-uk`, `myhermes-uk-api`, `ewe`, `expressone`, `expressone-sv`, `earlybird`, `eastwestcourier-ftp`, `easy-mail`, `easyroutes`, `easyparcel`, `ecargo-asia`, `echo`, `ecofreight`, `ecom-express`, `ekart`, `ekol-api`, `elite-co`, `emirates-post`, `endeavour-delivery`, `energologistic`, `envialia`, `envialia-reference`, `equick-cn`, `eshipping`, `zes-express`, `estafeta`, `estafeta-api`, `estes`, `efwnow-api`, `etomars`, `edf-ftp`, `eurodis`, `europaket-api`, `exelot-ftp`, `expeditors`, `expeditors-api-ref`, `expresssale`, `fan`, `far-international`, `fdsexpress`, `fercam`, `fmx`, `frontdoorcorp`, `fujexp`, `fargood`, `fnf-za`, `fastdespatch`, `fastbox`, `fastrak-th`, `fastship`, `fasttrack`, `aramex-au-api`, `fastway-ireland`, `fastway-nz`, `fastway-za`, `faxecargo`, `fetchr`, `fiege`, `fiege-nl`, `first-flight`, `first-logistics-api`, `firstmile`, `fitzmark-api`, `flashexpress`, `flashexpress-webhook`, `flashexpress-ph-api`, `fleetopticsinc`, `flightlg`, `flipxp`, `fliway-sftp`, `fliway-api`, `flytexpress`, `fonsen`, `forwardair`, `fragilepak-sftp`, `freightquote`, `freterapido`, `fukuyama-sftp`, `fulfilla`, `fulfillmen`, `furdeco`, `gwlogis-api`, `gac-webhook`, `gangbao`, `gba`, `gbs-broker`, `gcx`, `gdex`, `gdpharm-webhook`, `gdpharm`, `gemworldwide`, `geodis-api`, `geodis-sftp`, `geodis-calberson-fr`, `geswl`, `gio-ecourier-api`, `gio-ecourier`, `gls`, `gls-croatia`, `gls-cz`, `gls-slovakia`, `gls-hun-api`, `gls-hun`, `gls-italy-ftp`, `gls-italy`, `dicom`, `gls-netherlands`, `gls-netherlands-webhook`, `gls-netherlands-sftp`, `gls-romania`, `gls-slovenia`, `gls-spain`, `gls-spain-api`, `gls-us`, `gols`, `gps`, `gsi-express`, `gso`, `gtagsm`, `gati-kwe`, `gati-kwe-api`, `gw-world`, `geis`, `gel-express`, `taxydromiki`, `geodis-usa-api`, `gpost`, `ghn`, `goglobalpost`, `globaltranz`, `globavend`, `globegistics`, `glovo`, `general-overnight`, `general-overnight-ftp`, `gopeople`, `gorush`, `gobolt`, `gojavas`, `gojek-webhook`, `grab-webhook`, `grandslamexpress`, `greyhound`, `mazet`, `grupoampm`, `andreani`, `hct-logistics`, `hfd`, `hkd`, `hrparcel`, `hermes-it`, `hsdexpress`, `hsm-global`, `htdkgroup-webhook`, `yycom`, `hubbed`, `hx-express`, `hdb`, `hdb-box`, `hanjin`, `hellenic-post`, `hellmann`, `helthjem`, `helthjem-api`, `heppner-fr`, `heppner`, `hermes-2mann-handling`, `hermes-de`, `hermes-de-ftp`, `hermes-uk-sftp`, `hermes`, `heroexpress`, `hipshipper`, `holisol`, `home-delivery-solutions`, `homelogistics`, `hong-kong-post`, `houndexpress`, `hrvatska-posta`, `hh-exp`, `huantong`, `hunter-express-sftp`, `hunter-express`, `huodull`, `ibventure-webhook`, `icscourier`, `idexpress`, `iml`, `imxmail`, `indopaket`, `intersmarttrans`, `intex-de`, `iordirect`, `postur-is`, `ilyanglogis`, `inpost-uk`, `inpost-paczkomaty`, `intime-ftp`, `india-post`, `india-post-int`, `inexpost`, `nox-nachtexpress`, `nox-nachtexpress-ftp`, `descartes`, `inntralog-sftp`, `instabox-webhook`, `integra2-ftp`, `intel-valley`, `intelcom-ca`, `intelipost`, `international-seur`, `international-seur-api`, `intexpress`, `interparcel-au`, `interparcel-nz`, `interparcel-uk`, `israel-post`, `israel-post-domestic`, `italy-sda`, `ivoy-webhook`, `jtcargo`, `jtexpress`, `jtexpress-ph`, `jtexpress-sg-api`, `simplypost`, `jtexpress-vn`, `j-net`, `jamef-web`, `jcex`, `jd-worldwide`, `jinsung`, `jne`, `jne-api`, `bh-posta`, `js-express`, `jx`, `jam-express`, `janco`, `janio`, `japan-post`, `javit`, `jawar`, `jayonexpress`, `jersey-post`, `jet-ship`, `ltianexp`, `jocom`, `joom-logistics`, `joyingbox`, `jumppoint-api`, `jumppoint`, `k1-express`, `kec`, `abxexpress-my`, `kgmhub`, `kurasi`, `kwe-global`, `kangaroo-my`, `kargomkolay`, `kedaex`, `kerryttc-vn`, `tgx`, `kerry-express-tw-api`, `kerry-logistics`, `kerry-express-th-webhook`, `kerrytj`, `kerry-ecommerce`, `kng`, `logisystems-sftp`, `kinisi`, `kiwi-express-webhook`, `kolay-gelsin`, `komon-express`, `kpost`, `korea-post`, `kronos-webhook`, `kronos`, `ky-express`, `kn`, `kdexp`, `lbcexpress-ftp`, `lbcexpress-api`, `lctbr-api`, `lht-express`, `liccardi-express`, `liefergrun`, `lmparcel`, `ltl`, `la-poste-colissimo`, `lalamove-api`, `lalamove`, `lalamove-plus-api`, `landmark-global-ftp`, `landmark-global`, `lao-post`, `lasership-api`, `lasership`, `latvijas-pasts`, `leader`, `legion-express`, `leman`, `lexship`, `lietuvos-pastas`, `line`, `linkbridge`, `lion-parcel`, `livrapide`, `locus-webhook`, `loggi`, `logisters`, `lwe-hk`, `logoix`, `logwin-logistics`, `logysto`, `lonestar`, `loomis-express`, `lotte`, `luwjistik`, `m-xpress`, `mx-cargo`, `m24logistics-webhook`, `m3logistics`, `mbw`, `collivery`, `metabrasil-webhook`, `misumi-cn`, `mng-kargo`, `mnx`, `mrw-spain`, `mrw`, `mrw-ftp`, `mudita`, `madrooex`, `maergo`, `magyar-posta-api`, `mail-box-etc`, `mailamericas`, `mailplus`, `mailplus-jp`, `mainfreight`, `mainway`, `malaysia-post-posdaftar`, `malaysia-post`, `malca-amit-api`, `malca-amit`, `marken`, `matdespatch`, `matkahuolto`, `medafrica`, `meest`, `fetchr-webhook`, `mensajerosurbanos-api`, `mwd-api`, `mwd`, `aeroflash`, `mexico-redpack`, `mexico-senda-express`, `mhi`, `mikropakket`, `mikropakket-be`, `milkman`, `mobi-br`, `mobiletyreshop-webhook`, `mondialrelay`, `mondialrelay-fr`, `mondialrelay-es`, `moova-webhook`, `moovin`, `morelink`, `morning-express`, `morninglobal`, `mothership-api`, `movianto`, `multientregapanama`, `mydynalogic`, `nmtransfer`, `nacex`, `nacex-spain-reference`, `nacex-spain`, `nox-night-time-express`, `ntilogistics-ftp`, `ntl`, `nytlogistics`, `new-zealand-post`, `naeko-ftp`, `nanjingwoyuan`, `naqel-express`, `national-sameday`, `nationex`, `nationex-ftp`, `nationwide-my`, `navlungo`, `netlogixgroup`, `newzealand-couriers`, `neweggexpress`, `newgistics`, `newgisticsapi`, `nhans-solutions`, `ntlogistics-vn`, `nipost`, `nightline`, `nim-express`, `nimbuspost`, `ninjavan`, `ninjavan-id`, `ninjavan-my`, `ninjavan-thai`, `ninjavan-vn`, `ninjavan-webhook`, `nippon-express-ftp`, `nippon-express`, `norsk-global`, `northline`, `nova-poshta`, `nova-poshtaint`, `nova-poshta-api`, `novofarma-webhook`, `oca-ar`, `ocs`, `ocs-worldwide`, `omlogistics-api`, `osm-worldwide-sftp`, `osm-worldwide`, `otschile`, `oakh`, `obibox`, `okayparcel`, `old-dominion`, `shopolive`, `omniparcel`, `omnirps-webhook`, `omniva-api`, `omniva`, `onway-webhook`, `ontrac`, `ontrac-api`, `oneworldexpress`, `oneclick`, `optimacourier`, `orangeconnex`, `orangeconnex-ftp`, `orangedsinc`, `orangedsinc-ftp`, `overseas-hr`, `ozeparts-shipping`, `p2p-delivery-api`, `trakpak`, `packfleet`, `palexpress`, `parcelone`, `pfcexpress`, `pflogistics`, `pflogistics-ftp`, `phse-api`, `pickupp-mys`, `pickupp-sgp`, `piggyship`, `pil-logistics`, `pittohio`, `taqbin-taiwan`, `mglobal`, `pts`, `ptt-kargo`, `ptt-posta`, `paack-webhook`, `pack-up`, `packaly`, `packeta`, `packlink`, `packs`, `paikeda`, `pakajo`, `palletways`, `pan-asia`, `pandago-api`, `pandago-ph-api`, `pandion`, `pandulogistics`, `panther`, `panther-order-number`, `panther-reference`, `panther-reference-api`, `papa-webhook`, `paper-express`, `paquetexpress`, `parcalogistics-webhook`, `parcalogistics-api`, `pdn-api`, `portless-api`, `parcel-force`, `parcelpost-sg`, `parcelright`, `parceltopost`, `parcel2go`, `parcelpal-webhook`, `parcelpoint`, `parcelinklogistics`, `parcelled-in`, `parcelstars-webhook`, `parcelstars`, `parknparcel`, `passportshipping`, `patheon`, `ppbyb`, `payo`, `payo-webhook`, `pgeon-api`, `pickrr`, `pickup`, `pidge`, `pilot-freight`, `pitney-bowes`, `planzer`, `plycongroup`, `poczta-polska`, `polarspeed`, `pony-express`, `porterex-webhook`, `portugal-ctt`, `portugal-seur`, `pos-indonesia`, `postone`, `post-serbia`, `post-slovenia`, `post56`, `postnl`, `postnl-international`, `postnl-3s`, `danmark-post`, `postnord`, `sweden-posten`, `postplus`, `postaplus`, `poste-italiane`, `poste-italiane-paccocelere`, `posten-norge`, `posti`, `posti-api`, `posta-romana`, `pressiode`, `procarrier`, `promeddelivery`, `productcaregroup-sftp`, `professional-couriers`, `ppl-api`, `ppl`, `purolator`, `purolator-api`, `purolator-international`, `qtrack`, `quantium`, `qintl-api`, `airterra`, `quiqup`, `quiqup-webhook`, `qwintry`, `qxpress`, `raf`, `ramgroup-za`, `ets-express`, `rl-carriers`, `rpd2man`, `rpm`, `rpxlogistics`, `rpxonline`, `rxo-api`, `rzyexpress`, `raben-group`, `raiderex`, `ransa-webhook`, `rcl`, `redjepakketje`, `redur-es`, `relaiscolis`, `rendr-webhook`, `returnmates-webhook`, `rhenus-group`, `rhenus-uk-api`, `rhenus-uk`, `rincos`, `air-canada-global`, `air-canada`, `rixonhk-api`, `roadbull`, `roadrunner-freight`, `roche-internal-sftp`, `rocketparcel`, `routific-webhook`, `royal-mail`, `royal-mail-ftp`, `royal-mail-webhook`, `royalshipments`, `russian-post`, `ruston`, `sailpost`, `sap-express`, `sekologistics`, `seko-sftp`, `showl`, `sf-express-api`, `sf-express`, `sf-express-cn`, `sfb2c`, `sfc`, `sfcservice`, `sglink`, `hotsin-cargo`, `shipa`, `shipter`, `shipxpres`, `shreenandancourier`, `shreetirupati`, `signia-ftp`, `signialogistics-sftp`, `skybox`, `smartcat`, `smsa-express`, `smsa-express-webhook`, `speedex`, `spflylogistica-webhook`, `spoton`, `sprint-pack`, `srekorea`, `srt-transport`, `starken`, `stepforwardfs`, `sto`, `stone3pl`, `szendex`, `safexpress`, `sagawa-api`, `sagawa`, `saia-freight`, `sassy-api`, `saudi-post`, `sberlogistics-ru`, `scotty`, `scudex-express`, `secretlab-webhook`, `seino`, `seino-api`, `sendeo-kargo`, `sending`, `sendit`, `sendle`, `sendy`, `nowlog-api`, `servip-webhook`, `servientrega`, `setel`, `shadowfax`, `dajin`, `ydex`, `kwt`, `sherpa`, `sherpa-webhook`, `ship-it-asia`, `shipentegra`, `shipgate`, `shipglobal-us`, `shipx`, `shipx-api`, `shippie`, `shippify`, `shippit`, `shiprocket`, `spx`, `spx-th`, `shopfans`, `shreeanjanicourier`, `shree-maruti`, `shunbang-express`, `shyplite`, `simpletire-webhook`, `simsglobal`, `singlobal-express`, `singapore-post`, `singapore-speedpost`, `sinotrans`, `siodemka`, `skelton-sftp`, `skyking`, `skyexpress-international`, `skyexpressinternational`, `skynet`, `skynetworldwide`, `skynetworldwide-uae`, `sky-postal`, `skynet-za`, `skynetworldwide-uk`, `sk-posta`, `smooth`, `sntglobal-api`, `sonictl`, `thenile-webhook`, `sapo`, `sefl`, `smtl`, `spanish-seur`, `spanish-seur-ftp`, `spanish-seur-api`, `specialisedfreight-za`, `spectran`, `spedisci`, `speedee`, `speedcouriers-gr`, `speedx`, `speedy`, `speedaf`, `spreetail-api`, `spring-gds`, `stallionexpress`, `star-track-courier`, `star-track-express`, `star-track`, `star-track-webhook`, `starlinks-api`, `statovernight`, `stop-start-api`, `streck-transport`, `sypost`, `superpackline`, `surat-kargo`, `sutton`, `swiship`, `swiship-jp`, `swiss-post`, `swiss-post-ftp`, `swiss-universal-express`, `loginext-webhook`, `t-cat`, `t-cat-api`, `taqbin-hk`, `tasco-my-webhook`, `tck-express`, `tcs-api`, `tcs`, `thedeliverygroup`, `tdn`, `tfm`, `tforce-finalmile`, `tigfreight`, `tipsa`, `tnt`, `tnt-au`, `tntbrasil-web`, `tnt-fr`, `tnt-fr-reference`, `tnt-it`, `tnt-reference`, `tnt-uk`, `tnt-uk-reference`, `tnt-click`, `tarrive`, `thaiparcels`, `trumpcard`, `tvsscs-webhook`, `typ`, `global-express`, `taiwan-post`, `tamergroup-webhook`, `tazmanian-freight`, `teamexpressllc`, `toll-priority`, `team-global-express-webhook`, `teleport-webhook`, `sic-teliway`, `testing-courier`, `thabit-logistics`, `thailand-post`, `thecourierguy`, `customco-api`, `pallet-network`, `thijs-nl`, `thunderexpress`, `tiki`, `tipsa-api`, `tipsa-ref`, `toll-ipec`, `toll-nz`, `tolos`, `tomydoor`, `tonami-ftp`, `esdex`, `topyou`, `tophatterexpress`, `toshi-webhook`, `total-express-api`, `total-express`, `tourline-reference`, `trackon`, `trans-kargo`, `trans2u`, `transmission-nl`, `transvirtual`, `transpak`, `tanet`, `trunkrs-webhook`, `trunkrs`, `trusk`, `tuffnells`, `tuffnells-reference`, `tusklogistics`, `u-envios`, `ubi-logistics`, `ucs`, `uk-mail`, `ucfs-api`, `usf-reddaway`, `uber-webhook`, `ukrposhta`, `uds`, `urb-it`, `courex`, `urbify`, `urgent-cargus`, `virtransport`, `viwo`, `vox`, `value-webhook`, `veho-webhook`, `venipak`, `vesyl`, `vesyl-api`, `viaeurope`, `viaxpress`, `vtfe`, `vnpost`, `vnpost-api`, `viettelpost`, `virtransport-sftp`, `wooyoung-logistics-sftp`, `wspexpress`, `wahana`, `wanbexpress`, `weworldexpress`, `wedo`, `wepost`, `weship-api`, `weship`, `weaship`, `welivery`, `shipwestgate`, `whistl`, `wineshipping`, `wineshipping-webhook`, `wise-express`, `wiseloads`, `wishpost`, `wizmo`, `worldcourier`, `worldnet`, `xdp-uk`, `xdp-uk-reference`, `xgs`, `xl-express`, `xpo-logistics`, `xpo-fr-api`, `xq-express`, `xde-webhook`, `xindus`, `xyy`, `xpedigo`, `xpert-delivery`, `xpost`, `xpressbees`, `xpressen-dk`, `yamato-tw-api`, `ydh-express`, `yrc`, `yto`, `yyexpress`, `yakit`, `taqbin-jp`, `taqbin-sg-api`, `taqbin-sg`, `yanwen`, `yifan`, `elian-post`, `yodel-api`, `yodeldirect`, `yodel`, `yodel-international`, `youparcel`, `yunexpress`, `yunant`, `yundaex`, `yunhuipost`, `yurtici-kargo`, `yusen-sftp`, `yusen`, `zjs-express`, `zto-domestic`, `zto-express`, `zyou`, `cndexpress`, `zajil-express`, `sfplus-webhook`, `zeek`, `zeleris`, `ziingfinalmile`, `zinc`, `zoom-red`, `zoom2u-webhook`, `zuelligpharma-sftp`, `acommerce`, `alphafast`, `cpacket`, `chronodiali-webhook`, `cnwangtong`, `delivere`, `e-courier-webhook`, `ecoutier`, `eparcel-kr`, `epostglobal`, `eshipper`, `etotal`, `etower`, `fairsenden-api`, `forrun`, `gojek`, `hepsijet`, `i-dika`, `i-parcel`, `icumulus-webhook`, `icumulus`, `idexpress-id`, `imile-api`, `ithinklogistics`, `liefery`, `mysendle-api`, `pack-man`, `shopline`, `solistica-api`, `swe`, `trans-o-flex-sftp`, `transligue-web`, `uparcel`, `uship`, `uc56`, `wndirect`, `xmszm`, `ceska-posta`, `winit`, `jd-express`, `jusdasr`, `be`, `padtf`, `pchome-api`, `6ls`, `yingnuo-logistics`, `jindouyun`, `sdh-scm`\n\n**Note:** Using unsupported courier values will still work but verification may be delayed or require manual processing.\n"
    }
  ],
  "components": {
    "securitySchemes": {
      "basicAuth": {
        "description": "HTTP Basic Auth using `merchant_id` as username and the merchant secret key as password.",
        "type": "http",
        "scheme": "basic"
      },
      "bearerAuth": {
        "description": "Bearer token authentication using an OAuth access token minted for an API access key created in Merchant Dashboard.",
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {
      "Customer": {
        "type": "object",
        "description": "The customer object represents a company that does business with your sub-merchants. Retrieve a customer to get a summary of their total credit line and available credit balance. For single-merchant partners, the response includes a `merchant_id` field. For marketplace partners, the `merchant_id` field is not present — customers belong to the marketplace itself.\n",
        "properties": {
          "id": {
            "type": "string",
            "example": "PMMlaE5wbg0"
          },
          "merchant_id": {
            "type": "string",
            "example": "MER456789",
            "description": "ID of the sub-merchant this customer belongs to. Only present for single-merchant partners."
          },
          "external_id": {
            "type": "string",
            "nullable": true,
            "example": "CUS-123456",
            "description": "Optional customer identifier from your system. This value is not required to be unique and can be used with the `external_id` list filter."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2020-01-01T00:00:00.750Z",
            "description": "Date the customer was created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "example": "2020-01-01T00:00:00.750Z",
            "description": "Date the customer was last updated."
          },
          "source": {
            "type": "string",
            "enum": [
              "QUICKBOOKS",
              "MERCHANT_USER",
              "ADMIN_USER",
              "APPLICATION",
              "CUSTOMER_USER",
              "API"
            ],
            "example": "MERCHANT_USER"
          },
          "business_address": {
            "type": "string",
            "example": "111 Main Street",
            "description": "Street address of the business' primary location."
          },
          "business_city": {
            "type": "string",
            "example": "San Francisco",
            "description": "City of the business' primary location."
          },
          "business_state": {
            "type": "string",
            "example": "CA",
            "description": "State or province of the business' primary location."
          },
          "business_zip": {
            "type": "string",
            "example": "94104",
            "description": "US zip code of the business' primary location."
          },
          "business_country": {
            "type": "string",
            "example": "US",
            "description": "Country of the business' primary location according to the **ISO 3166-1 alpha 2** standard."
          },
          "business_age_range": {
            "type": "string",
            "example": "5-10",
            "description": "String indicating age of the business in years.",
            "enum": [
              "0-2",
              "2-5",
              "5-10",
              "10+"
            ]
          },
          "business_ap_email": {
            "type": "string",
            "example": "ap@example.com",
            "description": "Email address of the business' accounts payable person or department."
          },
          "business_ap_phone": {
            "type": "string",
            "example": "(202) 456-1414",
            "description": "Phone number of the business' accounts payable person or department."
          },
          "business_ap_phone_extension": {
            "type": "string",
            "example": "123",
            "description": "Phone number extension of the business' accounts payable person or department."
          },
          "business_name": {
            "type": "string",
            "example": "Example, Inc.",
            "description": "Full legal name of the business being applied for."
          },
          "business_trade_name": {
            "type": "string",
            "example": "Example Trading Company",
            "description": "Trade name of the business, if different than `business_name.`"
          },
          "business_phone": {
            "type": "string",
            "example": "(202) 456-1414",
            "description": "Phone number of the business' primary location."
          },
          "business_type": {
            "type": "string",
            "example": "corporation",
            "description": "String indicating the business' type of legal entity.",
            "enum": [
              "sole_prop_or_partnership",
              "llc",
              "corporation",
              "nonprofit",
              "government"
            ]
          },
          "email": {
            "type": "string",
            "format": "email",
            "example": "user@example.com",
            "description": "Email of the customer applying for terms."
          },
          "personal_name_first": {
            "type": "string",
            "example": "James",
            "description": "First name of the person applying on behalf of the business."
          },
          "personal_name_last": {
            "type": "string",
            "example": "Bond",
            "description": "Last name of the person applying on behalf of the business."
          },
          "personal_phone": {
            "type": "string",
            "example": "(202) 456-1414",
            "description": "Personal phone number of the customer representative applying for terms."
          },
          "amount_approved": {
            "type": "integer",
            "format": "int64",
            "example": 10000,
            "description": "Total amount of the credit approved."
          },
          "amount_authorized": {
            "type": "integer",
            "format": "int64",
            "example": 10000,
            "description": "Amount of the credit line reserved for authorized charges."
          },
          "amount_available": {
            "type": "integer",
            "format": "int64",
            "example": 10000,
            "description": "Current amount of the credit line available for purchases."
          },
          "amount_balance": {
            "type": "integer",
            "format": "int64",
            "example": 2000,
            "description": "Current balance on the customer's credit line."
          },
          "amount_unapplied_payments": {
            "type": "integer",
            "format": "int64",
            "example": 1000,
            "description": "Current amount of a customer's unapplied payments."
          },
          "default_terms": {
            "type": "string",
            "nullable": true,
            "description": "Set default terms that will apply to this customer's invoices. Can be overridden when requesting an advance.",
            "enum": [
              "net7",
              "net10",
              "net10th",
              "net15",
              "net20",
              "net30",
              "net45",
              "net60",
              "net75",
              "net90",
              "net120",
              "net180",
              null
            ]
          },
          "advance_rate": {
            "type": "number",
            "format": "double",
            "nullable": true,
            "example": 0.75,
            "minimum": 0,
            "maximum": 1,
            "description": "The advance rate that will be used to determine the amount advanced for this customer's invoices."
          },
          "credit_status": {
            "type": "string",
            "nullable": true,
            "description": "Current credit status of this customer. See <a href=\"#operation/requestCustomerCreditCheck\">#request-a-credit-check</a> for more details.",
            "enum": [
              "approved",
              "hold",
              "declined",
              "pending",
              "deactivated",
              null
            ]
          },
          "net_terms_status": {
            "type": "string",
            "nullable": true,
            "description": "Current net terms enrollment status of this customer. See <a href=\"#operation/fetchCustomer\">#fetchCustomer</a> for more details.",
            "enum": [
              "enrolled",
              "pending_enrollment",
              "enrollment_expired",
              null
            ]
          },
          "net_terms_enrollment_url": {
            "type": "string",
            "nullable": true,
            "example": "www.app.resolvepay.com/merchant-id/activate/123456",
            "description": "The URL for a customer to complete enrollment requirements when net_terms_status is pending_enrollment. See <a href=\"#operation/fetchCustomer\">#fetchCustomer</a> for more details."
          },
          "net_terms_enrollment_expires_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "example": "2020-01-01T00:00:00.750Z",
            "description": "The date by which the customer must be enrolled in this net terms offer, not null when net_terms_status is pending_enrollment."
          },
          "credit_check_requested_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "example": "2020-01-01T00:00:00.750Z",
            "description": "The date a credit check was requested."
          },
          "archived": {
            "type": "boolean",
            "example": false,
            "description": "Boolean indicating if customer is archived."
          },
          "duns_number": {
            "type": "string",
            "nullable": true,
            "example": "00-123-4567",
            "description": "Dun & Bradstreet unique nine-digit identifier for businesses that is associated with a business's Live Business Identity"
          },
          "credit_decisions": {
            "type": "array",
            "description": "Array of credit decisions made for this customer.",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "example": "abc123",
                  "description": "Unique identifier for the credit decision."
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time",
                  "example": "2020-01-01T00:00:00.750Z",
                  "description": "Date the credit decision was created."
                },
                "decision": {
                  "type": "string",
                  "enum": [
                    "approved",
                    "declined",
                    "hold",
                    "line_adjustment",
                    "deactivate"
                  ],
                  "example": "approved",
                  "description": "The credit decision outcome."
                },
                "amount": {
                  "type": "integer",
                  "format": "int64",
                  "example": 10000,
                  "description": "The credit amount approved."
                },
                "advance_rate": {
                  "type": "number",
                  "format": "double",
                  "example": 0.75,
                  "minimum": 0,
                  "maximum": 1,
                  "description": "The advance rate for this credit decision."
                },
                "decline_code": {
                  "type": "string",
                  "enum": [
                    "no_business_found",
                    "thin_file",
                    "failing_credit",
                    "not_approved_need_more_info",
                    "sole_prop",
                    "applicant_business_association",
                    "merchant_risk",
                    "fraud",
                    "no_us_address",
                    "duplicate",
                    "test_account",
                    "email_verification_freemail",
                    "email_verification_domain",
                    "address_verification",
                    "poor_cash_flow",
                    "additional_info_not_provided",
                    "other"
                  ],
                  "nullable": true,
                  "example": "no_business_found",
                  "description": "Code indicating reason for decline, if applicable."
                },
                "hold_code": {
                  "type": "string",
                  "enum": [
                    "past_due",
                    "failed_payment",
                    "requested_by_customer",
                    "requested_by_merchant",
                    "dispute",
                    "fraud",
                    "churned",
                    "payment_plan",
                    "inactive",
                    "other"
                  ],
                  "nullable": true,
                  "example": "past_due",
                  "description": "Code indicating reason for hold, if applicable."
                }
              }
            }
          }
        }
      },
      "Invoice": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "PMMlaE5wbg0",
            "description": "Unique identifier for the invoice."
          },
          "merchant_id": {
            "type": "string",
            "example": "MER456789",
            "description": "ID of the sub-merchant this invoice belongs to."
          },
          "source": {
            "type": "string",
            "enum": [
              "QUICKBOOKS",
              "MERCHANT_USER",
              "ADMIN_USER",
              "CUSTOMER_USER",
              "API"
            ],
            "example": "MERCHANT_USER"
          },
          "customer_id": {
            "type": "string",
            "description": "ID of the customer being charged. For marketplace partners, the customer belongs to the partner. For single-merchant partners, the customer belongs to the sub-merchant."
          },
          "order_number": {
            "type": "string",
            "example": "5055",
            "description": "Order number identifier."
          },
          "number": {
            "type": "string",
            "example": "Inv # 123",
            "description": "Invoice number identifier."
          },
          "po_number": {
            "type": "string",
            "example": "PO-555",
            "description": "PO number identifier."
          },
          "notes": {
            "type": "string",
            "example": "Example of additional notes for Customer.",
            "description": "Additional notes for the Customer"
          },
          "line_items": {
            "type": "array",
            "example": [],
            "description": "Line item data"
          },
          "merchant_invoice_url": {
            "type": "string",
            "example": "https://www.example.com/invoice.pdf",
            "description": "The invoice PDF that you've uploaded to Resolve."
          },
          "resolve_invoice_url": {
            "type": "string",
            "example": "https://www.example.com/resolve-invoice.pdf",
            "description": "Resolve-issued invoice PDF with your invoice attached."
          },
          "resolve_invoice_status": {
            "type": "string",
            "example": "completed",
            "description": "Shows current status of the Resolve-issued invoice PDF.\n\n- `not_generated` - PDF wasn't created or queued for creation. Resolve PDFs\nare generated when an invoice is sent.\n- `processing` - PDF is in the process of being generated. Try to refetch the invoice\nin a minute to get a `resolve_invoice_url` link.\n- `completed` - PDF is generated, `resolve_invoice_url` points to the generated file.\n",
            "enum": [
              "not_generated",
              "processing",
              "completed"
            ]
          },
          "fully_paid": {
            "type": "boolean",
            "example": true,
            "description": "Indicates whether the invoice is fully paid."
          },
          "fully_paid_at": {
            "type": "string",
            "format": "date-time",
            "example": "2020-01-01T00:00:00.730Z",
            "description": "The date the invoice has been fully paid."
          },
          "advanced": {
            "type": "boolean",
            "example": false,
            "description": "Indicates whether the invoice has been advanced."
          },
          "due_at": {
            "type": "string",
            "format": "date-time",
            "example": "2020-02-01T00:00:00.750Z",
            "description": "The current due date for this invoice's payment."
          },
          "original_due_at": {
            "type": "string",
            "format": "date-time",
            "example": "2020-02-01T00:00:00.750Z",
            "description": "The due date for this invoice at the time an advance was issued."
          },
          "invoiced_at": {
            "type": "string",
            "format": "date-time",
            "example": "2020-01-01T00:00:00.750Z",
            "description": "The date this invoice was created in your system of record (Resolve or Quickbooks)."
          },
          "advance_requested": {
            "type": "boolean",
            "example": "false",
            "description": "Indicated if advance was requested."
          },
          "terms": {
            "type": "string",
            "enum": [
              "due_upon_receipt",
              "net7",
              "net10",
              "net10th",
              "net15",
              "net20",
              "net30",
              "net45",
              "net60",
              "net75",
              "net90",
              "net120",
              "net180"
            ],
            "description": "The terms selected for this invoice."
          },
          "amount_payout_due": {
            "type": "number",
            "format": "double",
            "example": 4000,
            "description": "The original amount that Resolve owed on this invoice on the advance date."
          },
          "amount_payout_paid": {
            "type": "number",
            "format": "double",
            "example": 2000,
            "description": "The amount that Resolve has paid out."
          },
          "amount_payout_pending": {
            "type": "number",
            "format": "double",
            "example": 1000,
            "description": "The amount that Resolve has currently pending to be paid out."
          },
          "amount_payout_refunded": {
            "type": "number",
            "format": "double",
            "example": 500,
            "description": "The amount that Resolve has debited from due to refunds."
          },
          "amount_payout_balance": {
            "type": "number",
            "format": "double",
            "example": 500,
            "description": "The amount remaining to be paid out."
          },
          "payout_fully_paid": {
            "type": "boolean",
            "example": false,
            "description": "The status of whether or not this invoice has been fully paid out."
          },
          "payout_fully_paid_at": {
            "type": "string",
            "format": "date-time",
            "example": "2020-01-02T00:00:00.730Z",
            "description": "The date of when this invoice has been fully paid out."
          },
          "amount_balance": {
            "type": "number",
            "format": "double",
            "example": 2000,
            "description": "Current balance due."
          },
          "amount_due": {
            "type": "number",
            "format": "double",
            "example": 4000,
            "description": "Original amount due."
          },
          "amount_refunded": {
            "type": "number",
            "format": "double",
            "example": 0,
            "description": "Amount that has been refunded."
          },
          "amount_pending": {
            "type": "number",
            "format": "double",
            "example": 1000,
            "description": "Amount of total payments pending."
          },
          "amount_paid": {
            "type": "number",
            "format": "double",
            "example": 1000,
            "description": "Amount of total payments applied to this invoice."
          },
          "amount_advance": {
            "type": "number",
            "format": "double",
            "example": 4000,
            "description": "Amount of advance received."
          },
          "amount_additional_advance": {
            "type": "number",
            "format": "double",
            "example": 1000,
            "description": "Amount of additional advance received."
          },
          "amount_advance_fee": {
            "type": "number",
            "format": "double",
            "example": 10.75,
            "description": "Fee for the amount of advance."
          },
          "amount_advance_fee_refund": {
            "type": "number",
            "format": "double",
            "example": 10.75,
            "description": "Refunded fees for the amount of advance."
          },
          "advance_rate": {
            "type": "number",
            "format": "double",
            "example": 0.75,
            "minimum": 0,
            "maximum": 1,
            "description": "The advance rate that was used to determine amount of advance."
          },
          "advanced_at": {
            "type": "string",
            "format": "date-time",
            "example": "2020-01-02T00:00:00.730Z",
            "description": "The date this invoice was advanced."
          },
          "amount_customer_fee_total": {
            "type": "number",
            "format": "double",
            "example": 500,
            "description": "The total amount of customer fees accrued."
          },
          "amount_customer_fee_waived": {
            "type": "number",
            "format": "double",
            "example": 120,
            "description": "The total amount of customer fees waived."
          },
          "amount_customer_fee_paid": {
            "type": "number",
            "format": "double",
            "example": 300,
            "description": "The total amount of customer fees paid."
          },
          "amount_customer_fee_balance": {
            "type": "number",
            "format": "double",
            "example": 80,
            "description": "The current amount of customer fees owed."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2020-01-02T00:00:00.730Z",
            "description": "Date the invoice was created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "example": "2020-01-02T00:00:00.730Z",
            "description": "Date the invoice was last updated."
          },
          "archived": {
            "type": "boolean",
            "example": false,
            "description": "Boolean indicating if invoice is archived."
          },
          "invoice_payment_url": {
            "type": "string",
            "example": "https://app.resolvepay.com/merchant/invoices/PMMlaE5wbg0",
            "description": "Link to make invoice payments."
          },
          "canceled": {
            "type": "boolean",
            "example": false,
            "description": "Indicates whether the invoice is canceled."
          },
          "canceled_at": {
            "type": "string",
            "format": "date-time",
            "example": null,
            "description": "Date the invoice was canceled."
          },
          "voided": {
            "type": "boolean",
            "example": false,
            "description": "Indicates whether the invoice is voided."
          },
          "voided_at": {
            "type": "string",
            "format": "date-time",
            "example": null,
            "description": "Date the invoice was voided."
          },
          "amount_canceled": {
            "type": "number",
            "format": "double",
            "example": 0,
            "description": "Amount that has been canceled."
          },
          "amount_voided": {
            "type": "number",
            "format": "double",
            "example": 0,
            "description": "Amount that has been voided."
          },
          "amount_scheduled": {
            "type": "number",
            "format": "double",
            "example": 0,
            "description": "Amount of scheduled payments."
          },
          "status": {
            "type": "string",
            "description": "Current payment status of the invoice."
          },
          "sent_at": {
            "type": "string",
            "format": "date-time",
            "example": "2020-01-01T00:00:00.730Z",
            "description": "Date the invoice was sent."
          }
        }
      },
      "Payment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "PMMlaE5wbg0",
            "description": "Unique identifier for the payment."
          },
          "customer_id": {
            "type": "string",
            "example": "X50sgfRd",
            "description": "Unique identifier of the customer that made the payment."
          },
          "source": {
            "type": "string",
            "enum": [
              "api",
              "merchant_user",
              "admin_user",
              "customer_user",
              "payment_gateway",
              "check",
              "guest_checkout"
            ],
            "example": "customer_user",
            "description": "Source of the payment."
          },
          "amount": {
            "type": "number",
            "format": "double",
            "example": 1000,
            "description": "Amount of the payment in USD."
          },
          "method": {
            "type": "string",
            "enum": [
              "check",
              "ach_debit",
              "direct_deposit",
              "card",
              "merchant",
              "unapplied_payment_adjustment",
              "credit_note",
              "adjustment",
              "wire"
            ],
            "example": "ach_debit",
            "description": "Method of payment made by the customer."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "in_transit",
              "in_review",
              "paid",
              "failed",
              "canceled"
            ],
            "example": "paid",
            "description": "Status of the payment.\n\n- `pending` - Payment is pending processing.\n- `in_transit` - Payment has been processed and is in transit.\n- `in_review` - Payment is being reviewed.\n- `paid` - Payment has been confirmed and applied to the customer's account.\n- `failed` - Payment failed confirmation (e.g., bank transfer or credit card payment rejected).\n- `canceled` - Payment was canceled by request.\n"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2020-01-01T00:00:00.730Z",
            "description": "Date the payment was created."
          },
          "paid_at": {
            "type": "string",
            "format": "date-time",
            "example": "2020-01-02T00:00:00.730Z",
            "description": "Date the payment was confirmed by Resolve and applied to the customer's account."
          },
          "canceled_at": {
            "type": "string",
            "format": "date-time",
            "example": null,
            "description": "Date the payment was canceled by request."
          },
          "failed_at": {
            "type": "string",
            "format": "date-time",
            "example": null,
            "description": "Date the payment failed processing."
          },
          "processed_at": {
            "type": "string",
            "format": "date-time",
            "example": "2020-01-01T12:00:00.730Z",
            "description": "Date the payment was processed by Resolve."
          },
          "scheduled_at": {
            "type": "string",
            "format": "date-time",
            "example": null,
            "description": "Date the payment was scheduled for processing, if applicable."
          },
          "processing_fee": {
            "type": "number",
            "format": "double",
            "example": 25.5,
            "description": "Processing fee for the payment."
          },
          "canceled_code": {
            "type": "string",
            "example": null,
            "description": "Code indicating the reason the payment was canceled."
          },
          "failed_code": {
            "type": "string",
            "example": null,
            "description": "Code indicating the reason the payment failed processing."
          },
          "dispute_code": {
            "type": "string",
            "example": null,
            "description": "Code indicating the reason for a payment dispute."
          },
          "payment_links": {
            "type": "array",
            "description": "List of records the payment is applied to.",
            "items": {
              "type": "object",
              "properties": {
                "record_id": {
                  "type": "string",
                  "example": "PMMlaE5wbg0",
                  "description": "ID of the record."
                },
                "record_type": {
                  "type": "string",
                  "enum": [
                    "invoice"
                  ],
                  "example": "invoice",
                  "description": "Type of record the payment is applied to."
                },
                "amount": {
                  "type": "number",
                  "format": "double",
                  "example": 500,
                  "description": "Amount applied to this record."
                }
              }
            }
          },
          "created_by_user_id": {
            "type": "string",
            "example": null,
            "description": "ID of the user who created the payment, if applicable."
          }
        }
      },
      "CreditNote": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "CNMlaE5wbg0",
            "description": "Unique identifier for the credit note."
          },
          "source": {
            "type": "string",
            "enum": [
              "MERCHANT_USER",
              "ADMIN_USER",
              "API"
            ],
            "example": "MERCHANT_USER",
            "description": "Source of the credit note creation."
          },
          "customer_id": {
            "type": "string",
            "example": "X50sgfRd",
            "description": "ID of the customer associated with the credit note."
          },
          "merchant_id": {
            "type": "string",
            "example": "MER456789",
            "description": "ID of the sub-merchant this credit note belongs to."
          },
          "invoice_id": {
            "type": "string",
            "example": "PMMlaE5wbg0",
            "description": "ID of the invoice this credit note is associated with."
          },
          "created_by_user_id": {
            "type": "string",
            "example": "USR123456",
            "description": "ID of the user who created the credit note."
          },
          "number": {
            "type": "string",
            "example": "CN-001",
            "description": "Credit note number identifier."
          },
          "amount": {
            "type": "number",
            "format": "double",
            "example": 1000,
            "description": "Total amount of the credit note."
          },
          "amount_balance": {
            "type": "number",
            "format": "double",
            "example": 500,
            "description": "Remaining balance to be applied."
          },
          "amount_paid": {
            "type": "number",
            "format": "double",
            "example": 500,
            "description": "Amount that has been applied/paid out."
          },
          "amount_voided": {
            "type": "number",
            "format": "double",
            "example": 0,
            "description": "Amount that has been voided."
          },
          "amount_payout": {
            "type": "number",
            "format": "double",
            "example": 1000,
            "description": "Total payout amount for the credit note."
          },
          "amount_payout_balance": {
            "type": "number",
            "format": "double",
            "example": 500,
            "description": "Remaining payout balance."
          },
          "amount_payout_paid": {
            "type": "number",
            "format": "double",
            "example": 500,
            "description": "Amount that has been paid out."
          },
          "credit_note_url": {
            "type": "string",
            "example": "https://www.example.com/credit-note.pdf",
            "description": "The credit note PDF that you've uploaded to Resolve."
          },
          "resolve_credit_note_url": {
            "type": "string",
            "example": "https://www.example.com/resolve-credit-note.pdf",
            "description": "Resolve-issued credit note PDF."
          },
          "reason_code": {
            "type": "string",
            "enum": [
              "chargeback",
              "duplicate",
              "fraudulent",
              "requested_by_customer",
              "missing_remittance",
              "overpayment_on_invoice",
              "invoice_was_refunded",
              "double_payment_on_invoice",
              "missing_invoice_in_resolve",
              "credit_transfer",
              "other"
            ],
            "example": "requested_by_customer",
            "description": "The reason code for issuing this credit note."
          },
          "reason_message": {
            "type": "string",
            "example": "Customer returned damaged goods",
            "description": "Additional details explaining the reason for the credit note."
          },
          "voided": {
            "type": "boolean",
            "example": false,
            "description": "Indicates whether the credit note is voided."
          },
          "voided_at": {
            "type": "string",
            "format": "date-time",
            "example": null,
            "description": "Date the credit note was voided."
          }
        }
      },
      "Merchant": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Resolve merchant identifier (lowercase alphanumeric).\n\nFor partner API create flows, ID assignment behavior is:\n- Resolve may derive a human-friendly alphanumeric candidate from merchant naming fields.\n- If the candidate collides with an existing merchant ID, Resolve generates a random lowercase alphanumeric ID.\n",
            "example": "mrc_1234567890abcdef"
          },
          "legal_business_name": {
            "type": "string",
            "example": "Acme Supply LLC"
          },
          "dba_name": {
            "type": "string",
            "nullable": true,
            "example": "Acme Industrial"
          },
          "business_address": {
            "$ref": "#/components/schemas/Address"
          },
          "business_email": {
            "type": "string",
            "format": "email",
            "example": "ops@acmesupply.com"
          },
          "business_phone": {
            "type": "string",
            "example": "+15125550123"
          },
          "entity_type": {
            "type": "string",
            "enum": [
              "corporation",
              "llc",
              "sole_proprietorship",
              "partnership",
              "non_profit"
            ],
            "example": "llc"
          },
          "formation_state": {
            "type": "string",
            "example": "TX"
          },
          "industry": {
            "type": "string",
            "nullable": true,
            "example": "Manufacturing"
          },
          "website": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "https://acmesupply.com"
          },
          "underwriting_status": {
            "type": "string",
            "description": "Current underwriting lifecycle status for the merchant.",
            "example": "pending"
          },
          "seller_amount_approved": {
            "type": "integer",
            "nullable": true,
            "description": "Merchant approved limit (MAL), when available.",
            "example": 50000
          },
          "active_subscription": {
            "type": "object",
            "nullable": true,
            "properties": {
              "id": {
                "type": "string",
                "example": "sub_1234567890abcdef"
              },
              "tier": {
                "type": "string",
                "example": "trial"
              }
            }
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "document_ingestion": {
            "$ref": "#/components/schemas/DocumentIngestionSummary"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-02-26T10:00:00.000Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-02-26T10:05:00.000Z"
          }
        }
      },
      "MerchantDocumentUploadRequest": {
        "$ref": "#/components/schemas/MerchantDocumentUploadRequestObject"
      },
      "Shipment": {
        "$ref": "#/components/schemas/ShipmentObject"
      },
      "WebhookEndpoint": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the webhook endpoint",
            "example": "whe_abc123def456"
          },
          "merchant_id": {
            "type": "string",
            "description": "The partner ID associated with this webhook endpoint",
            "example": "mer_xyz789"
          },
          "endpoint_url": {
            "type": "string",
            "format": "uri",
            "description": "The HTTPS URL where webhook events will be sent",
            "example": "https://example.com/webhooks/resolve"
          },
          "topic": {
            "type": "object",
            "description": "The event topic this endpoint is subscribed to",
            "properties": {
              "name": {
                "type": "string",
                "description": "The event topic name",
                "example": "invoice.created"
              },
              "description": {
                "type": "string",
                "description": "Human-readable description of the event topic",
                "example": "Triggered when a new invoice record is created"
              }
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When this webhook endpoint subscription was created",
            "example": "2021-05-20T09:23:53+00:00"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When this webhook endpoint subscription was last updated",
            "example": "2021-05-20T09:23:53+00:00"
          }
        }
      },
      "WebhookEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the webhook event",
            "example": "4ecbe7f9e8c1c9092c000027"
          },
          "object": {
            "type": "string",
            "description": "The type of object this event relates to (e.g., invoice, customer, payment, payout)",
            "example": "invoice"
          },
          "type": {
            "type": "string",
            "description": "The event type that triggered this webhook",
            "enum": [
              "invoice.created",
              "invoice.balance_updated",
              "customer.created",
              "customer.status_updated",
              "customer.line_amount_updated",
              "customer.advance_rate_updated",
              "customer.credit_decision_created",
              "payment.created",
              "payment.status_changed",
              "payout.created",
              "payout.status_changed",
              "merchant.created",
              "merchant.underwriting_completed",
              "merchant.more_info_needed",
              "merchant.mal_updated"
            ],
            "example": "invoice.created"
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 timestamp of when the event was created",
            "example": "2021-05-20T09:23:53+00:00"
          },
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The ID of the object related to the event. You can fetch the full object using this ID via the corresponding API endpoint.",
                "example": "RH5fF9aeQ"
              },
              "merchant_id": {
                "type": "string",
                "description": "The ID of the sub-merchant the event occurred for. Use this to identify which sub-merchant's data triggered the webhook.",
                "example": "MER456789"
              }
            },
            "required": [
              "id",
              "merchant_id"
            ]
          }
        },
        "required": [
          "id",
          "object",
          "type",
          "occurred_at",
          "data"
        ]
      },
      "WebhookEventSubscriptions": {
        "type": "object",
        "description": "Object containing boolean flags for each available webhook event topic. Set to true to subscribe to that event, or false to unsubscribe.",
        "properties": {
          "invoice.created": {
            "type": "boolean",
            "description": "Subscribe to invoice creation events",
            "example": true
          },
          "invoice.balance_updated": {
            "type": "boolean",
            "description": "Subscribe to invoice balance update events",
            "example": false
          },
          "customer.created": {
            "type": "boolean",
            "description": "Subscribe to customer creation events",
            "example": true
          },
          "customer.status_updated": {
            "type": "boolean",
            "description": "Subscribe to customer status update events",
            "example": false
          },
          "customer.line_amount_updated": {
            "type": "boolean",
            "description": "Subscribe to customer credit line amount update events",
            "example": false
          },
          "customer.advance_rate_updated": {
            "type": "boolean",
            "description": "Subscribe to customer advance rate update events",
            "example": false
          },
          "customer.credit_decision_created": {
            "type": "boolean",
            "description": "Subscribe to customer credit decision creation events",
            "example": true
          },
          "payment.created": {
            "type": "boolean",
            "description": "Subscribe to payment creation events",
            "example": true
          },
          "payment.status_changed": {
            "type": "boolean",
            "description": "Subscribe to payment status change events",
            "example": true
          },
          "payout.created": {
            "type": "boolean",
            "description": "Subscribe to payout creation events",
            "example": false
          },
          "payout.status_changed": {
            "type": "boolean",
            "description": "Subscribe to payout status change events",
            "example": false
          },
          "merchant.created": {
            "type": "boolean",
            "description": "Subscribe to partner-facing sub-merchant creation events",
            "example": true
          },
          "merchant.underwriting_completed": {
            "type": "boolean",
            "description": "Subscribe to sub-merchant underwriting completion events",
            "example": true
          },
          "merchant.more_info_needed": {
            "type": "boolean",
            "description": "Subscribe to sub-merchant underwriting needs-info events",
            "example": false
          },
          "merchant.mal_updated": {
            "type": "boolean",
            "description": "Subscribe to sub-merchant MAL update events",
            "example": false
          }
        },
        "additionalProperties": false
      },
      "InvoiceListResponse": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "example": 1
          },
          "limit": {
            "type": "integer",
            "example": 25
          },
          "page": {
            "type": "integer",
            "example": 1
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Invoice"
            }
          }
        }
      },
      "ValidationError": {
        "type": "object",
        "title": "Validation error",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string",
                "description": "A short string, describing error details",
                "example": "Validation error"
              },
              "type": {
                "type": "string",
                "description": "A short string, describing error type",
                "enum": [
                  "validation_error"
                ],
                "example": "validation_error"
              },
              "details": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "path": {
                      "type": "string",
                      "example": "path.to.field",
                      "description": "Path to the field failed validation"
                    },
                    "message": {
                      "type": "string",
                      "example": "`[field]` is required",
                      "description": "Detailed description of the error"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "InvalidRequestError": {
        "type": "object",
        "title": "Invalid request error",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string",
                "description": "A short string, describing error details",
                "example": "[Invalid request message]"
              },
              "type": {
                "type": "string",
                "description": "A short string, describing error type",
                "enum": [
                  "invalid_request"
                ],
                "example": "invalid_request"
              }
            }
          }
        }
      },
      "UnauthorizedError": {
        "type": "object",
        "title": "Unauthorized error",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string",
                "description": "A short string, describing error details",
                "example": "Invalid merchant credentials"
              },
              "type": {
                "type": "string",
                "description": "A short string, describing error type",
                "enum": [
                  "authentication_error"
                ],
                "example": "authentication_error"
              }
            }
          }
        }
      },
      "RateLimitError": {
        "type": "object",
        "title": "Rate limit error",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string",
                "description": "A short string, describing error details",
                "example": "Too many requests"
              },
              "type": {
                "type": "string",
                "description": "A short string, describing error type",
                "enum": [
                  "rate_limit_error"
                ],
                "example": "rate_limit_error"
              }
            }
          }
        }
      },
      "InvoiceRequestAfterSentBase": {
        "type": "object",
        "properties": {
          "terms": {
            "type": "string",
            "description": "The terms selected for this invoice. Terms selected must be available on your account and different terms will be available based on advance_requested.",
            "example": "due_upon_receipt",
            "enum": [
              "due_upon_receipt",
              "net7",
              "net10",
              "net10th",
              "net15",
              "net20",
              "net30",
              "net45",
              "net60",
              "net75",
              "net90",
              "net120",
              "net180"
            ]
          },
          "merchant_invoice_url": {
            "type": "string",
            "format": "url",
            "example": "https://example.com/invoice.pdf",
            "description": "URL for the publicly-accessible invoice PDF."
          },
          "number": {
            "type": "string",
            "example": "R334-097",
            "description": "Invoice number identifier."
          },
          "order_number": {
            "type": "string",
            "example": "09785",
            "description": "Order number identifier."
          },
          "po_number": {
            "type": "string",
            "example": "PO-09785",
            "description": "PO number identifier."
          },
          "notes": {
            "type": "string",
            "example": "Example of additional notes for Customer.",
            "description": "Additional notes for the Customer"
          }
        }
      },
      "InvoiceRequestBeforeSentBase": {
        "type": "object",
        "properties": {
          "customer_id": {
            "type": "string",
            "example": "X50sgfRd",
            "description": "ID of the customer being charged"
          },
          "advance_requested": {
            "type": "boolean",
            "example": "false",
            "description": "The type of invoice. This will determine if this is an advanced or non-advanced invoice."
          }
        }
      },
      "InvoiceRequestAmountBase": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "format": "double",
            "example": 2000,
            "description": "Amount being charged from the customer"
          }
        }
      },
      "InvoiceRequest": {
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/InvoiceRequestAfterSentBase"
          },
          {
            "$ref": "#/components/schemas/InvoiceRequestBeforeSentBase"
          },
          {
            "$ref": "#/components/schemas/InvoiceRequestAmountBase"
          }
        ]
      },
      "InvoiceCreateRequest": {
        "allOf": [
          {
            "type": "object",
            "required": [
              "merchant_id",
              "amount",
              "customer_id",
              "number",
              "merchant_invoice_url"
            ],
            "properties": {
              "merchant_id": {
                "type": "string",
                "example": "MER456789",
                "description": "ID of the sub-merchant this invoice belongs to. Must be a valid sub-merchant under your partner account."
              }
            }
          },
          {
            "$ref": "#/components/schemas/InvoiceRequest"
          }
        ]
      },
      "NotFoundError": {
        "type": "object",
        "title": "Not found error",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string",
                "description": "A short string, describing error details",
                "example": "[entity] not found"
              },
              "type": {
                "type": "string",
                "description": "A short string, describing error type",
                "enum": [
                  "not_found_error"
                ],
                "example": "not_found_error"
              }
            }
          }
        }
      },
      "InvoiceUpdateBeforeSent": {
        "title": "Not sent",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/InvoiceRequestAfterSentBase"
          },
          {
            "$ref": "#/components/schemas/InvoiceRequestBeforeSentBase"
          },
          {
            "$ref": "#/components/schemas/InvoiceRequestAmountBase"
          }
        ]
      },
      "InvoiceUpdateAfterSentAdvanced": {
        "title": "Sent with advance",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/InvoiceRequestAfterSentBase"
          }
        ]
      },
      "InvoiceUpdateAfterSentNonAdvanced": {
        "title": "Sent without advance",
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/InvoiceRequestAfterSentBase"
          },
          {
            "$ref": "#/components/schemas/InvoiceRequestAmountBase"
          }
        ]
      },
      "CreditNoteListResponse": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "example": 1
          },
          "limit": {
            "type": "integer",
            "example": 25
          },
          "page": {
            "type": "integer",
            "example": 1
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreditNote"
            }
          }
        }
      },
      "CreditNoteCreateRequest": {
        "type": "object",
        "required": [
          "invoice_id",
          "amount",
          "reason_code"
        ],
        "properties": {
          "invoice_id": {
            "type": "string",
            "example": "PMMlaE5wbg0",
            "description": "ID of the invoice"
          },
          "amount": {
            "type": "number",
            "format": "double",
            "example": 2000,
            "description": "Amount of the credit note"
          },
          "number": {
            "type": "string",
            "example": "CN-001",
            "description": "Number of the credit note"
          },
          "reason_code": {
            "type": "string",
            "example": "reason_code",
            "enum": [
              "chargeback",
              "duplicate",
              "fraudulent",
              "requested_by_customer",
              "missing_remittance",
              "overpayment_on_invoice",
              "invoice_was_refunded",
              "double_payment_on_invoice",
              "missing_invoice_in_resolve",
              "credit_transfer",
              "other"
            ],
            "description": "Reason code for the credit note"
          },
          "reason_message": {
            "type": "string",
            "example": "reason_message",
            "description": "Reason message for the credit note"
          },
          "credit_note_url": {
            "type": "string",
            "example": "https://example.com/credit_note_url.pdf",
            "description": "URL for the publicly-accessible credit note PDF."
          }
        }
      },
      "CreditNoteAction": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "processing",
              "failed",
              "completed"
            ],
            "example": "pending",
            "description": "Status of the credit note action"
          }
        }
      },
      "CustomerList": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "example": 1
          },
          "limit": {
            "type": "integer",
            "example": 25
          },
          "page": {
            "type": "integer",
            "example": 1
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/Customer"
            }
          }
        }
      },
      "CustomerPostRequest": {
        "type": "object",
        "required": [
          "business_address",
          "business_city",
          "business_state",
          "business_zip",
          "business_country",
          "business_name",
          "email",
          "business_ap_email"
        ],
        "properties": {
          "merchant_id": {
            "type": "string",
            "example": "MER456789",
            "description": "ID of the sub-merchant this customer belongs to. **Required for single-merchant partners.** Must be a valid sub-merchant under your partner account. **Not accepted for marketplace partners** — customers belong to the marketplace itself."
          },
          "external_id": {
            "type": "string",
            "nullable": true,
            "example": "CUS-123456",
            "description": "Optional customer identifier from your system. This value is not required to be unique."
          },
          "business_address": {
            "type": "string",
            "example": "111 Main Street",
            "description": "Street address of the business' primary location."
          },
          "business_city": {
            "type": "string",
            "example": "San Francisco",
            "description": "City of the business' primary location."
          },
          "business_state": {
            "type": "string",
            "example": "CA",
            "description": "State or province of the business' primary location."
          },
          "business_zip": {
            "type": "string",
            "example": "94104",
            "description": "US zip code of the business' primary location."
          },
          "business_country": {
            "type": "string",
            "format": "ISO 3166-1 alpha 2",
            "example": "US",
            "description": "2-letter country code of the business' primary location, according to the **ISO 3166-1 alpha 2** standard."
          },
          "business_ap_email": {
            "type": "string",
            "format": "email",
            "example": "ap@example.com",
            "description": "Email address of the business' accounts payable person or department."
          },
          "business_ap_phone": {
            "type": "string",
            "example": "(202) 456-1414",
            "description": "Phone number of the business' accounts payable person or department."
          },
          "business_ap_phone_extension": {
            "type": "string",
            "example": "123",
            "description": "Phone number extension of the business' accounts payable person or department."
          },
          "business_name": {
            "type": "string",
            "example": "Example, Inc.",
            "description": "Full legal name of the business being applied for."
          },
          "email": {
            "type": "string",
            "format": "email",
            "example": "user@example.com",
            "description": "Email of the customer applying for terms."
          },
          "default_terms": {
            "type": "string",
            "nullable": true,
            "description": "Default terms invoices will be advanced with.",
            "enum": [
              "net7",
              "net10",
              "net10th",
              "net15",
              "net20",
              "net30",
              "net45",
              "net60",
              "net75",
              "net90",
              "net120",
              "net180",
              null
            ]
          }
        }
      },
      "CustomerPutRequest": {
        "type": "object",
        "properties": {
          "external_id": {
            "type": "string",
            "nullable": true,
            "example": "CUS-123456",
            "description": "Optional customer identifier from your system."
          },
          "business_address": {
            "type": "string",
            "example": "111 Main Street",
            "description": "Street address of the business' primary location."
          },
          "business_city": {
            "type": "string",
            "example": "San Francisco",
            "description": "City of the business' primary location."
          },
          "business_state": {
            "type": "string",
            "example": "CA",
            "description": "State or province of the business' primary location."
          },
          "business_zip": {
            "type": "string",
            "example": "94104",
            "description": "US zip code of the business' primary location."
          },
          "business_country": {
            "type": "string",
            "example": "US",
            "description": "Country of the business' primary location."
          },
          "business_ap_email": {
            "type": "string",
            "example": "ap@example.com",
            "description": "Email address of the business' accounts payable person or department."
          },
          "business_ap_phone": {
            "type": "string",
            "example": "(202) 456-1414",
            "description": "Phone number of the business' accounts payable person or department."
          },
          "business_ap_phone_extension": {
            "type": "string",
            "example": "123",
            "description": "Phone number extension of the business' accounts payable person or department."
          },
          "business_name": {
            "type": "string",
            "example": "Example, Inc.",
            "description": "Full legal name of the business being applied for."
          },
          "email": {
            "type": "string",
            "format": "email",
            "example": "user@example.com",
            "description": "Email of the customer applying for terms."
          },
          "default_terms": {
            "type": "string",
            "nullable": true,
            "description": "Set default terms that will apply to this customer's invoices. Can be overridden when requesting an advance.",
            "enum": [
              "net7",
              "net10",
              "net10th",
              "net15",
              "net20",
              "net30",
              "net45",
              "net60",
              "net75",
              "net90",
              "net120",
              "net180",
              null
            ]
          }
        }
      },
      "CustomerCreditCheckRequest": {
        "type": "object",
        "required": [
          "amount_requested",
          "has_purchase_history"
        ],
        "properties": {
          "amount_requested": {
            "type": "number",
            "example": 50000,
            "minimum": 1,
            "description": "Request an amount (plus buffer) to cover your customer's purchases over their payment term. This can be increased later."
          },
          "business_description": {
            "type": "string",
            "maxLength": 500,
            "example": "Put a description your customer's business here.",
            "description": "A description of your customer's business.",
            "nullable": true
          },
          "has_purchase_history": {
            "type": "boolean",
            "example": true,
            "description": "Indicates whether this customer has prior purchase history with the sub-merchant. When `true`, the sub-merchant has prior purchase history with this customer."
          },
          "has_purchase_terms_history": {
            "type": "boolean",
            "example": false,
            "description": "Required if `has_purchase_history = true`. Indicates whether this customer has prior purchase history on net terms with the sub-merchant. When `true`, the sub-merchant has prior net terms purchase history with this customer."
          }
        }
      },
      "CreditCheckExistsError": {
        "type": "object",
        "title": "Credit check exists error",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string",
                "description": "A short string, describing error details",
                "example": "Credit check already created for this customer."
              },
              "type": {
                "type": "string",
                "description": "A short string, describing error type",
                "enum": [
                  "invalid_request"
                ],
                "example": "invalid_request"
              }
            }
          }
        }
      },
      "IssueAccessKeyTokenRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "client_id",
          "client_secret"
        ],
        "properties": {
          "client_id": {
            "type": "string",
            "description": "OAuth access key client ID returned when the access key was created."
          },
          "client_secret": {
            "type": "string",
            "description": "OAuth access key client secret returned when the access key was created or rotated."
          }
        }
      },
      "AccessKeyTokenResponse": {
        "type": "object",
        "required": [
          "access_token",
          "token_type",
          "expires_in"
        ],
        "properties": {
          "access_token": {
            "type": "string",
            "description": "Bearer token to include in the `Authorization` header."
          },
          "token_type": {
            "type": "string",
            "example": "Bearer"
          },
          "expires_in": {
            "type": "integer",
            "description": "Token lifetime in seconds.",
            "example": 86400
          },
          "scope": {
            "type": "string",
            "description": "Space-delimited scopes granted to the token.",
            "example": "merchant:read merchant:write"
          }
        }
      },
      "ForbiddenError": {
        "type": "object",
        "title": "Forbidden error",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string",
                "description": "A short string, describing error details",
                "example": "API access key expired"
              },
              "type": {
                "type": "string",
                "description": "A short string, describing error type",
                "example": "forbidden_error"
              }
            }
          }
        }
      },
      "Address": {
        "type": "object",
        "required": [
          "line1",
          "city",
          "state",
          "postal_code",
          "country"
        ],
        "properties": {
          "line1": {
            "type": "string",
            "example": "100 Main St"
          },
          "line2": {
            "type": "string",
            "nullable": true,
            "example": "Suite 200"
          },
          "city": {
            "type": "string",
            "example": "Austin"
          },
          "state": {
            "type": "string",
            "example": "TX"
          },
          "postal_code": {
            "type": "string",
            "example": "78701"
          },
          "country": {
            "type": "string",
            "example": "US"
          }
        }
      },
      "DocumentIngestionResult": {
        "type": "object",
        "description": "Inline document dispatch result for merchant create/update responses.\nPost-commit queue dispatch failures are surfaced here as `failed` items without rolling back the merchant write.\n",
        "properties": {
          "document_id": {
            "type": "string",
            "nullable": true,
            "example": "md_1234567890abcdef"
          },
          "document_type": {
            "type": "string",
            "enum": [
              "bank_statements",
              "financial_statements",
              "credit_references",
              "personal_guarantee",
              "other"
            ]
          },
          "filename": {
            "type": "string"
          },
          "download_url": {
            "type": "string",
            "format": "uri"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "failed"
            ]
          },
          "error_code": {
            "type": "string",
            "nullable": true
          },
          "error_message": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "DocumentIngestionSummary": {
        "type": "object",
        "properties": {
          "requested_count": {
            "type": "integer",
            "example": 2
          },
          "queued_count": {
            "type": "integer",
            "example": 1
          },
          "failed_count": {
            "type": "integer",
            "example": 1
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentIngestionResult"
            }
          }
        }
      },
      "MerchantList": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "example": 2
          },
          "page": {
            "type": "integer",
            "example": 1
          },
          "limit": {
            "type": "integer",
            "example": 25
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Merchant"
            }
          }
        }
      },
      "BeneficialOwner": {
        "type": "object",
        "required": [
          "first_name",
          "last_name",
          "date_of_birth",
          "address",
          "ssn_last_4"
        ],
        "properties": {
          "first_name": {
            "type": "string",
            "example": "John"
          },
          "last_name": {
            "type": "string",
            "example": "Owner"
          },
          "date_of_birth": {
            "type": "string",
            "format": "date",
            "example": "1987-04-14"
          },
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "ssn_last_4": {
            "type": "string",
            "minLength": 4,
            "maxLength": 4,
            "example": "1234"
          },
          "ownership_percentage": {
            "type": "number",
            "format": "double",
            "minimum": 0,
            "maximum": 100,
            "example": 35
          }
        }
      },
      "AuthorizedSigner": {
        "type": "object",
        "properties": {
          "first_name": {
            "type": "string",
            "example": "Jane"
          },
          "last_name": {
            "type": "string",
            "example": "Doe"
          },
          "email": {
            "type": "string",
            "format": "email",
            "example": "jane.doe@acmesupply.com"
          },
          "title": {
            "type": "string",
            "example": "Controller"
          },
          "phone": {
            "type": "string",
            "example": "+15125550123"
          }
        }
      },
      "InlineDocumentDownloadRequest": {
        "type": "object",
        "required": [
          "filename",
          "filetype",
          "download_url"
        ],
        "properties": {
          "filename": {
            "type": "string",
            "description": "Original filename for the remote file.\nThe filename must include an extension, and that extension must match `filetype`.\n",
            "example": "bank_statement_2026_01.pdf"
          },
          "filetype": {
            "type": "string",
            "description": "MIME type for the remote file.\nMust be a supported MIME type for the merchant underwriting document validation profile.\n",
            "example": "application/pdf"
          },
          "download_url": {
            "type": "string",
            "format": "uri",
            "description": "Remote file URL. Only `http` and `https` URLs are accepted.",
            "example": "https://partner-files.example.com/bank_statement_2026_01.pdf"
          }
        }
      },
      "CreateMerchantRequest": {
        "type": "object",
        "required": [
          "legal_business_name",
          "business_address",
          "business_email",
          "business_phone",
          "entity_type",
          "formation_state",
          "ein"
        ],
        "properties": {
          "legal_business_name": {
            "type": "string",
            "example": "Acme Supply LLC"
          },
          "business_address": {
            "$ref": "#/components/schemas/Address"
          },
          "business_email": {
            "type": "string",
            "format": "email",
            "example": "ops@acmesupply.com"
          },
          "business_phone": {
            "type": "string",
            "description": "Business phone number. Must be a valid US phone number and is normalized to E.164.",
            "example": "+15125550123"
          },
          "entity_type": {
            "type": "string",
            "enum": [
              "corporation",
              "llc",
              "sole_proprietorship",
              "partnership",
              "non_profit"
            ],
            "example": "llc"
          },
          "formation_state": {
            "type": "string",
            "description": "Business formation state. Must map to a valid US state and is normalized to the state code.",
            "example": "TX"
          },
          "ein": {
            "type": "string",
            "description": "Employer Identification Number. Must be a valid EIN format.",
            "example": "12-3456789"
          },
          "dba_name": {
            "type": "string",
            "example": "Acme Industrial"
          },
          "annual_revenue": {
            "type": "integer",
            "example": 4500000
          },
          "years_in_business": {
            "type": "integer",
            "minimum": 0,
            "example": 6
          },
          "industry": {
            "type": "string",
            "example": "Manufacturing"
          },
          "business_description": {
            "type": "string",
            "example": "Industrial hardware distributor"
          },
          "website": {
            "type": "string",
            "format": "uri",
            "example": "https://acmesupply.com"
          },
          "estimated_monthly_net_terms_volume": {
            "type": "integer",
            "example": 350000
          },
          "existing_net_terms_info": {
            "type": "object",
            "additionalProperties": true,
            "example": {
              "provider": "Internal",
              "average_days_past_due": 12
            }
          },
          "beneficial_owners": {
            "type": "array",
            "description": "Initial beneficial owner list.",
            "items": {
              "$ref": "#/components/schemas/BeneficialOwner"
            }
          },
          "authorized_signer": {
            "$ref": "#/components/schemas/AuthorizedSigner"
          },
          "plaid_access_token": {
            "type": "string",
            "description": "Plaid access token when a bank connection has already been established.",
            "example": "access-sandbox-1234567890"
          },
          "bank_account_number": {
            "type": "string",
            "description": "Bank account number. Must satisfy Resolve account-number validation and must be different from\n`bank_routing_number`.\n",
            "example": "****6789"
          },
          "bank_routing_number": {
            "type": "string",
            "description": "ABA routing number. Must be a valid routing number.",
            "example": "*****021"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true,
            "example": {
              "partner_reference": "mt-merchant-1029"
            }
          },
          "bank_statements": {
            "type": "array",
            "description": "Optional document ingestion on merchant create.\nEach item queues a background download job (equivalent to calling the document endpoint with `download_url`).\n",
            "items": {
              "$ref": "#/components/schemas/InlineDocumentDownloadRequest"
            }
          },
          "financial_statements": {
            "type": "array",
            "description": "Optional inline `financial_statements` document ingestion requests.",
            "items": {
              "$ref": "#/components/schemas/InlineDocumentDownloadRequest"
            }
          },
          "credit_references": {
            "type": "array",
            "description": "Optional inline `credit_references` document ingestion requests.",
            "items": {
              "$ref": "#/components/schemas/InlineDocumentDownloadRequest"
            }
          },
          "personal_guarantee": {
            "type": "array",
            "description": "Optional inline `personal_guarantee` document ingestion requests.",
            "items": {
              "$ref": "#/components/schemas/InlineDocumentDownloadRequest"
            }
          },
          "other_documents": {
            "type": "array",
            "description": "Optional inline `other` document ingestion requests.",
            "items": {
              "$ref": "#/components/schemas/InlineDocumentDownloadRequest"
            }
          }
        }
      },
      "UpdateMerchantRequest": {
        "type": "object",
        "description": "All fields are optional for update requests.\n\nFor merchants whose latest underwriting decision has been finalized, updates to core legal/identity/banking\nfields may be blocked.\n",
        "properties": {
          "legal_business_name": {
            "type": "string"
          },
          "business_address": {
            "$ref": "#/components/schemas/Address"
          },
          "business_email": {
            "type": "string",
            "format": "email"
          },
          "business_phone": {
            "type": "string",
            "description": "Business phone number. Must be a valid US phone number and is normalized to E.164."
          },
          "entity_type": {
            "type": "string",
            "enum": [
              "corporation",
              "llc",
              "sole_proprietorship",
              "partnership",
              "non_profit"
            ]
          },
          "formation_state": {
            "type": "string",
            "description": "Business formation state. Must map to a valid US state and is normalized to the state code."
          },
          "ein": {
            "type": "string",
            "description": "Employer Identification Number. Must be a valid EIN format."
          },
          "dba_name": {
            "type": "string"
          },
          "annual_revenue": {
            "type": "integer"
          },
          "years_in_business": {
            "type": "integer",
            "minimum": 0
          },
          "industry": {
            "type": "string"
          },
          "business_description": {
            "type": "string"
          },
          "website": {
            "type": "string",
            "format": "uri"
          },
          "estimated_monthly_net_terms_volume": {
            "type": "integer"
          },
          "existing_net_terms_info": {
            "type": "object",
            "additionalProperties": true
          },
          "beneficial_owners": {
            "type": "array",
            "description": "Beneficial owner records. Existing owner records are not editable after underwriting is complete.",
            "items": {
              "$ref": "#/components/schemas/BeneficialOwner"
            }
          },
          "additional_beneficial_owners": {
            "type": "array",
            "description": "Add-only beneficial owner records for post-underwriting updates.",
            "items": {
              "$ref": "#/components/schemas/BeneficialOwner"
            }
          },
          "authorized_signer": {
            "$ref": "#/components/schemas/AuthorizedSigner"
          },
          "plaid_access_token": {
            "type": "string",
            "description": "Plaid access token for connected banking data."
          },
          "bank_account_number": {
            "type": "string",
            "description": "Bank account number. Must satisfy Resolve account-number validation."
          },
          "bank_routing_number": {
            "type": "string",
            "description": "ABA routing number. Must be a valid routing number."
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "bank_statements": {
            "type": "array",
            "description": "Optional document ingestion on merchant update.\nEach item queues a background download job (equivalent to calling the document endpoint with `download_url`).\n",
            "items": {
              "$ref": "#/components/schemas/InlineDocumentDownloadRequest"
            }
          },
          "financial_statements": {
            "type": "array",
            "description": "Optional inline `financial_statements` document ingestion requests.",
            "items": {
              "$ref": "#/components/schemas/InlineDocumentDownloadRequest"
            }
          },
          "credit_references": {
            "type": "array",
            "description": "Optional inline `credit_references` document ingestion requests.",
            "items": {
              "$ref": "#/components/schemas/InlineDocumentDownloadRequest"
            }
          },
          "personal_guarantee": {
            "type": "array",
            "description": "Optional inline `personal_guarantee` document ingestion requests.",
            "items": {
              "$ref": "#/components/schemas/InlineDocumentDownloadRequest"
            }
          },
          "other_documents": {
            "type": "array",
            "description": "Optional inline `other` document ingestion requests.",
            "items": {
              "$ref": "#/components/schemas/InlineDocumentDownloadRequest"
            }
          }
        }
      },
      "MerchantDocument": {
        "type": "object",
        "description": "Merchant document metadata and validation lifecycle status.",
        "properties": {
          "id": {
            "type": "string",
            "example": "md_1234567890abcdef"
          },
          "merchant_id": {
            "type": "string",
            "example": "mrc_1234567890abcdef"
          },
          "document_type": {
            "type": "string",
            "enum": [
              "bank_statements",
              "financial_statements",
              "credit_references",
              "personal_guarantee",
              "other"
            ],
            "example": "bank_statements"
          },
          "status": {
            "type": "string",
            "description": "Current validation lifecycle status.",
            "enum": [
              "pending_upload",
              "uploaded_pending_validation",
              "accepted",
              "rejected",
              "failed"
            ],
            "example": "accepted"
          },
          "validation_reasons": {
            "type": "array",
            "description": "Validation reason codes/messages associated with the current status.",
            "items": {
              "type": "string"
            },
            "example": []
          },
          "uploaded_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "example": "2026-02-26T10:05:00.000Z"
          },
          "validated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "example": "2026-02-26T10:06:40.000Z"
          },
          "object_key": {
            "type": "string",
            "nullable": true,
            "description": "S3 object key reference used by validation/reconciliation flows.",
            "example": "merchant/mrc_123/document/md_1234567890abcdef/bank_statement_2026_01.pdf"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-02-26T10:00:00.000Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-02-26T10:06:40.000Z"
          }
        }
      },
      "MerchantDocumentList": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "example": 2
          },
          "page": {
            "type": "integer",
            "example": 1
          },
          "limit": {
            "type": "integer",
            "example": 25
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MerchantDocument"
            }
          }
        }
      },
      "CreateMerchantDocumentRequest": {
        "type": "object",
        "required": [
          "document_type",
          "filename",
          "filetype"
        ],
        "properties": {
          "document_type": {
            "type": "string",
            "description": "Merchant document type.",
            "enum": [
              "bank_statements",
              "financial_statements",
              "credit_references",
              "personal_guarantee",
              "other"
            ],
            "example": "bank_statements"
          },
          "filename": {
            "type": "string",
            "description": "Original filename for the document.\nThe filename must include an extension. For known MIME types, the extension must match `filetype`.\n",
            "example": "bank_statement_2026_01.pdf"
          },
          "filetype": {
            "type": "string",
            "description": "MIME type for the document.\nKnown MIME types are validated against the filename extension.\n",
            "example": "application/pdf"
          },
          "download_url": {
            "type": "string",
            "format": "uri",
            "description": "Optional remote URL for Resolve to fetch directly. When provided, Resolve queues a background download job\nand does not return a presigned upload URL. Only `http` and `https` URLs are accepted.\n",
            "example": "https://partner-files.example.com/bank_statement_2026_01.pdf"
          }
        }
      },
      "MerchantDocumentUploadRequestObject": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the merchant document.",
            "example": "md_1234567890abcdef"
          },
          "document_id": {
            "type": "string",
            "description": "Alias of the merchant document identifier.",
            "example": "md_1234567890abcdef"
          },
          "document_type": {
            "type": "string",
            "enum": [
              "bank_statements",
              "financial_statements",
              "credit_references",
              "personal_guarantee",
              "other"
            ],
            "example": "bank_statements"
          },
          "status": {
            "type": "string",
            "description": "Initial validation lifecycle status for the document.",
            "enum": [
              "pending_upload",
              "failed"
            ],
            "example": "pending_upload"
          },
          "upload_url": {
            "type": "string",
            "format": "uri",
            "nullable": true,
            "description": "Presigned S3 URL to upload file content when `transfer_method` is `presigned_upload`.",
            "example": "https://resolve-document-validation-uploads-dev.s3.amazonaws.com/merchant/mrc_123/document/md_123/bank_statement_2026_01.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&..."
          },
          "upload_expires_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Expiration timestamp for `upload_url` when `transfer_method` is `presigned_upload`.",
            "example": "2026-02-26T18:35:00.000Z"
          },
          "object_key": {
            "type": "string",
            "description": "S3 object key where the document is expected to be stored.",
            "example": "merchant/mrc_123/document/md_1234567890abcdef/bank_statement_2026_01.pdf"
          },
          "transfer_method": {
            "type": "string",
            "description": "How the document is moved into Resolve-managed storage.",
            "enum": [
              "presigned_upload",
              "download_url"
            ],
            "example": "presigned_upload"
          },
          "queue_dispatch_status": {
            "type": "string",
            "nullable": true,
            "description": "Queue dispatch result when `transfer_method` is `download_url`.\n",
            "enum": [
              "queued",
              "failed"
            ],
            "example": "queued"
          },
          "upload_headers": {
            "type": "object",
            "nullable": true,
            "description": "Required headers to include on the presigned upload PUT request.\n\nAlways includes:\n- `x-amz-meta-validation_profile`\n\nMay include callback routing headers when configured by Resolve:\n- `x-amz-meta-callback_domain`\n- `x-amz-meta-callback_url`\n",
            "additionalProperties": {
              "type": "string"
            },
            "example": {
              "x-amz-meta-validation_profile": "merchant_underwriting_document_default",
              "x-amz-meta-callback_domain": "overcommunicative-unriotously-alaina.ngrok-free.dev",
              "x-amz-meta-callback_url": "https://overcommunicative-unriotously-alaina.ngrok-free.dev/api/internal/document-validation/completed"
            }
          },
          "validation_profile": {
            "type": "string",
            "description": "Resolve-managed document validation profile applied to this request.",
            "enum": [
              "merchant_underwriting_document_default"
            ],
            "example": "merchant_underwriting_document_default"
          }
        }
      },
      "PayoutObject": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the Payout.",
            "example": "PMMlaE5wbg0"
          },
          "merchant_id": {
            "type": "string",
            "description": "ID of the sub-merchant or partner this payout belongs to.",
            "example": "MER456789"
          },
          "amount_gross": {
            "type": "integer",
            "description": "Total gross amount of all payout transactions",
            "example": 120
          },
          "amount_fee": {
            "type": "integer",
            "description": "Total fee amount of all payout transactions",
            "example": 20
          },
          "amount_net": {
            "type": "integer",
            "description": "Total net amount of all payout transactions.",
            "example": 100
          },
          "status": {
            "type": "string",
            "description": "Current status of the Payout. <br><br> `pending` = the payout is created by Resolve, pending to be sent to our bank. <br> `in_transit` = the payment or payout has been sent to our bank and is pending their execution. <br> `paid` = the payment or payout amount was successfully deposited. <br> `failed` = the payment or payout amount did not successfully deposit. <br> `canceled` = the payment or payout in Resolve's system was not sent to or executed by the bank. <br>",
            "enum": [
              "pending",
              "in_transit",
              "paid",
              "failed",
              "canceled"
            ],
            "example": "pending"
          },
          "retry_payout_id": {
            "type": "string",
            "description": "Payout id being retried.",
            "example": "PMMlaE5wbg0"
          },
          "failed_at": {
            "type": "string",
            "description": "Date time of when the Payout failed.",
            "example": "2022-09-06T03:08:37.508Z"
          },
          "expected_by": {
            "type": "string",
            "description": "Date time of when we expect the Payout to reach the sub-merchant's bank.",
            "example": "2022-09-06T03:08:37.508Z"
          },
          "transactions_starting_at": {
            "type": "string",
            "description": "This value is the earliest value for payout_transaction.created_at AND payout_transaction.payout_id = payout.id."
          },
          "transactions_ending_at": {
            "type": "string",
            "description": "This value is the latest value for payout_transaction.created_at AND payout_transaction.payout_id = payout.id."
          },
          "canceled_at": {
            "type": "string",
            "description": "Date time of when the Payout was canceled.",
            "example": "2022-09-06T03:08:37.508Z"
          },
          "created_at": {
            "type": "string",
            "description": "Date time of when the Payout was created.",
            "example": "2022-09-06T03:08:37.508Z"
          },
          "updated_at": {
            "type": "string",
            "description": "Date time of when the Payout was last updated.",
            "example": "2022-09-06T03:08:37.508Z"
          }
        }
      },
      "PayoutsLists": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer",
            "example": 25
          },
          "page": {
            "type": "integer",
            "example": 1
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/PayoutObject"
            }
          }
        }
      },
      "PayoutTransactionObject": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the payout transaction.",
            "example": "AOncfxMnm"
          },
          "merchant_id": {
            "type": "string",
            "description": "ID of the sub-merchant or partner this payout transaction belongs to.",
            "example": "MER456789"
          },
          "payout_id": {
            "type": "string",
            "description": "Resolve payout ID.",
            "example": "gQxGLAowY"
          },
          "type": {
            "type": "string",
            "description": "Type of the payout transaction.",
            "enum": [
              "advance",
              "payment",
              "refund",
              "monthly_fee",
              "annual_fee",
              "non_advanced_invoice_fee",
              "merchant_payment",
              "mdr_extension",
              "credit_note",
              "express_ach_payout_fee",
              "express_ach_payment_fee",
              "mdr_passthrough"
            ],
            "example": "advance"
          },
          "customer_id": {
            "type": "string",
            "description": "Resolve customer ID.",
            "example": "voArW2nSs"
          },
          "customer_name": {
            "type": "string",
            "description": "Name of the customer.",
            "example": "Test name"
          },
          "invoice_id": {
            "type": "string",
            "description": "Resolve invoice ID.",
            "example": "C2vBqxfZ4"
          },
          "invoice_number": {
            "type": "string",
            "example": "R334-097R",
            "description": "Invoice number identifier."
          },
          "order_id": {
            "type": "string",
            "description": "Resolve order ID.",
            "example": "u5WRraCYY"
          },
          "po_number": {
            "type": "string",
            "example": "PO-09785",
            "description": "PO number identifier."
          },
          "amount_gross": {
            "type": "integer",
            "description": "Payout transaction gross amount.",
            "example": 100
          },
          "amount_fee": {
            "type": "integer",
            "description": "Payout transaction fee amount.",
            "example": 3
          },
          "amount_net": {
            "type": "integer",
            "description": "Payout transaction net amount.",
            "example": 97
          },
          "created_at": {
            "type": "string",
            "description": "Date time of when the payout transaction was created.",
            "example": "2022-09-06T03:08:37.508Z"
          },
          "updated_at": {
            "type": "string",
            "description": "Date time of when the payout transaction was last updated.",
            "example": "2022-09-06T03:08:37.508Z"
          }
        }
      },
      "PayoutTransactionsLists": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer",
            "example": 25
          },
          "page": {
            "type": "integer",
            "example": 1
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/PayoutTransactionObject"
            }
          }
        }
      },
      "PaymentListResponse": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "example": 1
          },
          "limit": {
            "type": "integer",
            "example": 25
          },
          "page": {
            "type": "integer",
            "example": 1
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Payment"
            }
          }
        }
      },
      "PaymentCreateRequest": {
        "type": "object",
        "required": [
          "invoice_id",
          "amount"
        ],
        "properties": {
          "invoice_id": {
            "type": "string",
            "example": "PMMlaE5wbg0",
            "description": "ID of the invoice to create a payment for. The invoice must belong to one of your sub-merchants and must be sent."
          },
          "amount": {
            "type": "number",
            "format": "double",
            "example": 1000.5,
            "exclusiveMinimum": true,
            "minimum": 0,
            "description": "Payment amount in dollars. Must be greater than zero and must not exceed the invoice's outstanding balance."
          }
        }
      },
      "ShipmentObject": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the Shipment.",
            "example": "ship_1234567890abcdef"
          },
          "merchant_invoice_id": {
            "type": "string",
            "description": "ID of the associated merchant invoice.",
            "example": "inv_1234567890abcdef"
          },
          "fulfillment_method": {
            "type": "string",
            "description": "Method of fulfillment for the shipment.",
            "enum": [
              "shipping_provider",
              "self_delivery",
              "customer_pickup",
              "services_only"
            ],
            "example": "shipping_provider"
          },
          "shipment_tracking_number": {
            "type": "string",
            "description": "Tracking number provided by the shipping courier.",
            "example": "1Z123E45678901234"
          },
          "shipment_courier": {
            "type": "string",
            "description": "Shipping courier or provider name. While any value can be accepted, instant verification is supported for specific couriers.\n\nSee the [Shipments API documentation](#tag/Shipments) for the complete list of supported couriers.\n",
            "example": "ups"
          },
          "verification_status": {
            "type": "string",
            "description": "Manual or automatic verification status of the shipment.",
            "enum": [
              "verified",
              "pending"
            ],
            "example": "verified"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Date time when the shipment was created.",
            "example": "2024-01-15T10:30:00Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Date time when the shipment was last updated.",
            "example": "2024-01-15T14:45:00Z"
          },
          "tracking_status": {
            "type": "string",
            "description": "Current tracking status of the shipment from the courier.",
            "nullable": true,
            "example": "delivered"
          },
          "tracking_substatus": {
            "type": "string",
            "description": "Detailed tracking substatus providing additional context about the shipment's current state.",
            "nullable": true,
            "example": "delivered_001"
          },
          "expected_delivery": {
            "type": "string",
            "format": "date-time",
            "description": "Expected delivery date and time provided by the shipping courier.",
            "nullable": true,
            "example": "2024-01-20T18:00:00Z"
          }
        }
      },
      "ShipmentsList": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer",
            "description": "Number of results returned per page.",
            "example": 10
          },
          "page": {
            "type": "integer",
            "description": "Current page number.",
            "example": 1
          },
          "count": {
            "type": "integer",
            "description": "Total number of shipments matching the query.",
            "example": 25
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ShipmentObject"
            }
          }
        }
      },
      "ShipmentFile": {
        "type": "object",
        "required": [
          "url",
          "size"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "S3 URL of the uploaded file obtained after uploading to the signed URL from `/shipments/sign-upload`.",
            "example": "https://bucket.s3.amazonaws.com/1234567890-document.pdf"
          },
          "size": {
            "type": "integer",
            "description": "File size in bytes.",
            "example": 204800
          },
          "metadata": {
            "type": "object",
            "description": "Optional metadata about the file.",
            "properties": {
              "original_filename": {
                "type": "string",
                "description": "Original filename before upload.",
                "example": "proof_of_delivery.pdf"
              }
            },
            "example": {
              "original_filename": "proof_of_delivery.pdf"
            }
          }
        }
      },
      "ShipmentCreateRequest": {
        "type": "object",
        "required": [
          "merchant_invoice_id"
        ],
        "properties": {
          "merchant_invoice_id": {
            "type": "string",
            "description": "ID of the invoice this shipment belongs to. The invoice must belong to one of your sub-merchants.",
            "example": "inv_1234567890abcdef"
          },
          "fulfillment_method": {
            "type": "string",
            "description": "Method of fulfillment for the shipment. Determines what additional fields are required:\n- `shipping_provider`: Requires `shipment_tracking_number` and `shipment_courier`. File is not allowed.\n- `self_delivery`, `customer_pickup`, `services_only`: Require a `file`. Tracking number and courier are optional.\n",
            "enum": [
              "shipping_provider",
              "self_delivery",
              "customer_pickup",
              "services_only"
            ],
            "default": "shipping_provider",
            "example": "shipping_provider"
          },
          "shipment_tracking_number": {
            "type": "string",
            "description": "Tracking number (required when fulfillment_method is shipping_provider, optional otherwise).",
            "example": "1Z123E45678901234"
          },
          "shipment_courier": {
            "type": "string",
            "description": "Shipping courier (required when fulfillment_method is shipping_provider, optional otherwise). While any value can be accepted, instant verification is supported for specific couriers.\n\nSee the [Shipments API documentation](#tag/Shipments) for the complete list of supported couriers.\n",
            "example": "ups"
          },
          "file": {
            "$ref": "#/components/schemas/ShipmentFile",
            "description": "Proof of delivery file. Required for `self_delivery`, `customer_pickup`, and `services_only` fulfillment methods.\nForbidden for `shipping_provider` fulfillment method.\n\nUse the `/shipments/sign-upload` endpoint to obtain a signed URL for uploading the file to S3, then include the uploaded file details here.\n",
            "example": {
              "url": "https://bucket.s3.amazonaws.com/1234567890-document.pdf",
              "size": 204800,
              "metadata": {
                "original_filename": "proof_of_delivery.pdf"
              }
            }
          }
        }
      },
      "ShipmentUpdateRequest": {
        "type": "object",
        "properties": {
          "merchant_invoice_id": {
            "type": "string",
            "description": "ID of the invoice (must belong to one of your sub-merchants).",
            "example": "inv_9876543210fedcba"
          },
          "shipment_tracking_number": {
            "type": "string",
            "description": "Tracking number for the shipment.",
            "example": "1Z987F65432109876"
          },
          "shipment_courier": {
            "type": "string",
            "description": "Shipping courier or provider name. While any value can be accepted, instant verification is supported for specific couriers.\n\nSee the [Shipments API documentation](#tag/Shipments) for the complete list of supported couriers.\n",
            "example": "fedex"
          },
          "file": {
            "$ref": "#/components/schemas/ShipmentFile",
            "description": "Proof of delivery file. Cannot be added for shipments with `shipping_provider` fulfillment method.\n\nUse the `/shipments/sign-upload` endpoint to obtain a signed URL for uploading the file to S3, then include the uploaded file details here.\n",
            "example": {
              "url": "https://bucket.s3.amazonaws.com/1234567890-document.pdf",
              "size": 204800,
              "metadata": {
                "original_filename": "proof_of_delivery.pdf"
              }
            }
          }
        }
      }
    },
    "responses": {
      "InvoiceListResponse": {
        "description": "An object with an array of results containing up to the limit. If no invoices are found, the results array will be empty.\n",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/InvoiceListResponse"
            }
          }
        }
      },
      "InvalidRequestOrValidationResponse": {
        "description": "Bad request error",
        "content": {
          "application/json": {
            "schema": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/ValidationError"
                },
                {
                  "$ref": "#/components/schemas/InvalidRequestError"
                }
              ]
            }
          }
        }
      },
      "UnauthorizedResponse": {
        "description": "Unauthorized error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/UnauthorizedError"
            }
          }
        }
      },
      "RateLimitResponse": {
        "description": "Rate limit error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/RateLimitError"
            }
          }
        }
      },
      "InvoiceResponse": {
        "description": "An object representing an invoice.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Invoice"
            }
          }
        }
      },
      "NotFoundResponse": {
        "description": "Not found error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/NotFoundError"
            }
          }
        }
      },
      "CreditNoteListResponse": {
        "description": "A paginated list of credit notes.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CreditNoteListResponse"
            }
          }
        }
      },
      "CreditNoteActionResponse": {
        "description": "An object containing the status of the credit note creation request.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CreditNoteAction"
            }
          }
        }
      },
      "CreditNoteResponse": {
        "description": "The credit note object.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CreditNote"
            }
          }
        }
      },
      "CustomerListResponse": {
        "description": "An object with an array of results containing up to the limit. If no customers are found, the results array will be empty.\n",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CustomerList"
            }
          }
        }
      },
      "CustomerResponse": {
        "description": "An object representing the customer.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Customer"
            }
          }
        }
      },
      "CreditCheckAlreadyExistsResponse": {
        "description": "Credit check already created for this customer",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CreditCheckExistsError"
            }
          }
        }
      },
      "AccessKeyTokenResponse": {
        "description": "Successfully minted bearer token",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AccessKeyTokenResponse"
            },
            "examples": {
              "default": {
                "value": {
                  "access_token": "eyJ...",
                  "token_type": "Bearer",
                  "expires_in": 86400,
                  "scope": "merchant:read merchant:write"
                }
              }
            }
          }
        }
      },
      "ForbiddenResponse": {
        "description": "Forbidden error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ForbiddenError"
            }
          }
        }
      },
      "MerchantListResponse": {
        "description": "Paginated list of merchants.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/MerchantList"
            },
            "examples": {
              "merchantList": {
                "summary": "List merchant response with pagination metadata",
                "value": {
                  "count": 2,
                  "page": 1,
                  "limit": 25,
                  "results": [
                    {
                      "id": "mrc_alpha123456789",
                      "legal_business_name": "Alpha Supply LLC",
                      "dba_name": "Alpha DBA",
                      "business_address": {
                        "line1": "100 Main St",
                        "city": "Austin",
                        "state": "TX",
                        "postal_code": "78701",
                        "country": "US"
                      },
                      "business_email": "ops@alpha.example.com",
                      "business_phone": "+15125550100",
                      "entity_type": "llc",
                      "formation_state": "TX",
                      "industry": "Manufacturing",
                      "website": "https://alpha.example.com",
                      "underwriting_status": "completed",
                      "seller_amount_approved": 12500,
                      "active_subscription": {
                        "id": "sub_alpha123456789",
                        "tier": "free"
                      },
                      "metadata": {
                        "partner_ref": "alpha-001"
                      },
                      "created_at": "2026-03-11T10:00:00.000Z",
                      "updated_at": "2026-03-11T10:00:00.000Z"
                    },
                    {
                      "id": "mrc_beta1234567890",
                      "legal_business_name": "Beta Goods Inc",
                      "dba_name": null,
                      "business_address": {
                        "line1": "200 Beta Blvd",
                        "city": "Denver",
                        "state": "CO",
                        "postal_code": "80202",
                        "country": "US"
                      },
                      "business_email": "ops@beta.example.com",
                      "business_phone": "+13035550100",
                      "entity_type": "corporation",
                      "formation_state": "DE",
                      "industry": "Distribution",
                      "website": "https://beta.example.com",
                      "underwriting_status": "pending",
                      "seller_amount_approved": 0,
                      "active_subscription": {
                        "id": "sub_beta1234567890",
                        "tier": "free"
                      },
                      "metadata": {
                        "partner_ref": "beta-001"
                      },
                      "created_at": "2026-03-11T11:00:00.000Z",
                      "updated_at": "2026-03-11T11:00:00.000Z"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "MerchantResponse": {
        "description": "A merchant object.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Merchant"
            },
            "examples": {
              "merchantOnly": {
                "summary": "Merchant create/get response without inline document ingestion",
                "value": {
                  "id": "mrc_1234567890abcdef",
                  "legal_business_name": "Acme Supply LLC",
                  "dba_name": "Acme Industrial",
                  "business_address": {
                    "line1": "100 Main St",
                    "city": "Austin",
                    "state": "TX",
                    "postal_code": "78701",
                    "country": "US"
                  },
                  "business_email": "ops@acmesupply.com",
                  "business_phone": "+15125550123",
                  "entity_type": "llc",
                  "formation_state": "TX",
                  "underwriting_status": "pending",
                  "seller_amount_approved": 0,
                  "active_subscription": {
                    "id": "sub_1234567890abcdef",
                    "tier": "trial"
                  },
                  "metadata": {
                    "partner_reference": "mt-merchant-1029"
                  },
                  "created_at": "2026-02-26T10:00:00.000Z",
                  "updated_at": "2026-02-26T10:00:00.000Z"
                }
              },
              "merchantWithInlineDocuments": {
                "summary": "Merchant create response with partial inline document ingestion",
                "value": {
                  "id": "mrc_1234567890abcdef",
                  "legal_business_name": "Acme Supply LLC",
                  "business_address": {
                    "line1": "100 Main St",
                    "city": "Austin",
                    "state": "TX",
                    "postal_code": "78701",
                    "country": "US"
                  },
                  "business_email": "ops@acmesupply.com",
                  "business_phone": "+15125550123",
                  "entity_type": "llc",
                  "formation_state": "TX",
                  "underwriting_status": "pending",
                  "seller_amount_approved": 0,
                  "active_subscription": {
                    "id": "sub_1234567890abcdef",
                    "tier": "trial"
                  },
                  "document_ingestion": {
                    "requested_count": 2,
                    "queued_count": 1,
                    "failed_count": 1,
                    "results": [
                      {
                        "document_id": "md_1234567890abcdef",
                        "document_type": "bank_statements",
                        "filename": "bank_statement_2026_01.pdf",
                        "download_url": "https://partner-files.example.com/bank_statement_2026_01.pdf",
                        "status": "queued",
                        "error_code": null,
                        "error_message": null
                      },
                      {
                        "document_id": null,
                        "document_type": "financial_statements",
                        "filename": "financials_q4_2025.pdf",
                        "download_url": "https://partner-files.example.com/financials_q4_2025.pdf",
                        "status": "failed",
                        "error_code": "DOCUMENT_DISPATCH_FAILED",
                        "error_message": "queue unavailable"
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      },
      "MerchantDocumentListResponse": {
        "description": "Paginated list of merchant document metadata.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/MerchantDocumentList"
            },
            "examples": {
              "documentList": {
                "summary": "Merchant document metadata list",
                "value": {
                  "count": 2,
                  "page": 1,
                  "limit": 25,
                  "results": [
                    {
                      "id": "md_1234567890abcdef",
                      "merchant_id": "mrc_1234567890abcdef",
                      "document_type": "bank_statements",
                      "status": "accepted",
                      "validation_reasons": [],
                      "uploaded_at": "2026-02-26T10:05:00.000Z",
                      "validated_at": "2026-02-26T10:06:40.000Z",
                      "object_key": "merchant/mrc_123/document/md_1234567890abcdef/bank_statement_2026_01.pdf",
                      "created_at": "2026-02-26T10:00:00.000Z",
                      "updated_at": "2026-02-26T10:06:40.000Z"
                    },
                    {
                      "id": "md_abcdef1234567890",
                      "merchant_id": "mrc_1234567890abcdef",
                      "document_type": "financial_statements",
                      "status": "failed",
                      "validation_reasons": [
                        "DOWNLOAD_TIMEOUT"
                      ],
                      "uploaded_at": null,
                      "validated_at": "2026-02-26T10:06:40.000Z",
                      "object_key": "merchant/mrc_123/document/md_abcdef1234567890/financials_q4_2025.pdf",
                      "created_at": "2026-02-26T10:01:00.000Z",
                      "updated_at": "2026-02-26T10:06:40.000Z"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "CreateMerchantDocumentResponse": {
        "description": "Successful response with merchant document upload/download initiation details.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/MerchantDocumentUploadRequestObject"
            },
            "examples": {
              "presignedUpload": {
                "summary": "Presigned upload response",
                "value": {
                  "id": "md_1234567890abcdef",
                  "document_id": "md_1234567890abcdef",
                  "document_type": "bank_statements",
                  "status": "pending_upload",
                  "upload_url": "https://resolve-document-validation-uploads-dev.s3.amazonaws.com/merchant/mrc_123/document/md_123/bank_statement_2026_01.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&...",
                  "upload_expires_at": "2026-02-26T18:35:00.000Z",
                  "object_key": "merchant/mrc_123/document/md_1234567890abcdef/bank_statement_2026_01.pdf",
                  "transfer_method": "presigned_upload",
                  "queue_dispatch_status": null,
                  "upload_headers": {
                    "x-amz-meta-validation_profile": "merchant_underwriting_document_default",
                    "x-amz-meta-callback_domain": "overcommunicative-unriotously-alaina.ngrok-free.dev",
                    "x-amz-meta-callback_url": "https://overcommunicative-unriotously-alaina.ngrok-free.dev/api/internal/document-validation/completed"
                  },
                  "validation_profile": "merchant_underwriting_document_default"
                }
              },
              "downloadUrl": {
                "summary": "Queued download response",
                "value": {
                  "id": "md_1234567890abcdef",
                  "document_id": "md_1234567890abcdef",
                  "document_type": "financial_statements",
                  "status": "pending_upload",
                  "upload_url": null,
                  "upload_expires_at": null,
                  "object_key": "merchant/mrc_123/document/md_1234567890abcdef/financials_q4_2025.pdf",
                  "transfer_method": "download_url",
                  "queue_dispatch_status": "queued",
                  "validation_profile": "merchant_underwriting_document_default"
                }
              },
              "failedDownloadDispatch": {
                "summary": "Download URL dispatch failed after persistence",
                "value": {
                  "id": "md_1234567890abcdef",
                  "document_id": "md_1234567890abcdef",
                  "document_type": "financial_statements",
                  "status": "failed",
                  "upload_url": null,
                  "upload_expires_at": null,
                  "object_key": "merchant/mrc_123/document/md_1234567890abcdef/financials_q4_2025.pdf",
                  "transfer_method": "download_url",
                  "queue_dispatch_status": "failed",
                  "validation_profile": "merchant_underwriting_document_default"
                }
              }
            }
          }
        }
      },
      "PayoutListResponse": {
        "description": "An object with an array of Payouts up to the specified limit.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PayoutsLists"
            }
          }
        }
      },
      "PayoutResponse": {
        "description": "An object representing the created Payout.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PayoutObject"
            }
          }
        }
      },
      "ListPayoutTransactionsResponse": {
        "description": "An object with an array of results containing up to the limit. If no payout transactions are found, the results array will be empty.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PayoutTransactionsLists"
            }
          }
        }
      },
      "PayoutTransactionResponse": {
        "description": "An object representing the created Payout Transaction.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PayoutTransactionObject"
            }
          }
        }
      },
      "PaymentListResponse": {
        "description": "A paginated list of payments.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PaymentListResponse"
            }
          }
        }
      },
      "PaymentResponse": {
        "description": "An object representing a payment.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Payment"
            }
          }
        }
      },
      "ShipmentListResponse": {
        "description": "An object with an array of Shipments up to the specified limit.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ShipmentsList"
            }
          }
        }
      },
      "ShipmentResponse": {
        "description": "An object representing the Shipment.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ShipmentObject"
            }
          }
        }
      },
      "WebhookListResponse": {
        "description": "An object with an array of results containing up to the limit. If no subscriptions are found, the results array will be empty.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "count": {
                  "type": "integer",
                  "description": "Total number of webhook endpoint subscriptions",
                  "example": 3
                },
                "page": {
                  "type": "integer",
                  "description": "Current page number",
                  "example": 1
                },
                "limit": {
                  "type": "integer",
                  "description": "Number of results per page",
                  "example": 25
                },
                "results": {
                  "type": "array",
                  "description": "Array of webhook endpoint objects. Each object represents one endpoint-topic subscription. If an endpoint is subscribed to multiple topics, it will appear multiple times in the array.",
                  "items": {
                    "$ref": "#/components/schemas/WebhookEndpoint"
                  }
                }
              }
            },
            "examples": {
              "multiple_endpoints": {
                "summary": "Response with multiple webhook endpoint subscriptions",
                "value": {
                  "count": 3,
                  "page": 1,
                  "limit": 25,
                  "results": [
                    {
                      "id": "whe_abc123def456",
                      "merchant_id": "mer_xyz789",
                      "endpoint_url": "https://example.com/webhooks/resolve",
                      "topic": {
                        "name": "invoice.created",
                        "description": "Triggered when a new invoice record is created"
                      },
                      "created_at": "2021-05-20T09:23:53+00:00",
                      "updated_at": "2021-05-20T09:23:53+00:00"
                    },
                    {
                      "id": "whe_def456ghi789",
                      "merchant_id": "mer_xyz789",
                      "endpoint_url": "https://example.com/webhooks/resolve",
                      "topic": {
                        "name": "customer.created",
                        "description": "Triggered when a new customer record is created"
                      },
                      "created_at": "2021-05-20T09:23:53+00:00",
                      "updated_at": "2021-05-20T09:23:53+00:00"
                    },
                    {
                      "id": "whe_ghi789jkl012",
                      "merchant_id": "mer_xyz789",
                      "endpoint_url": "https://api.example.com/resolve-events",
                      "topic": {
                        "name": "payout.created",
                        "description": "Triggered when a new payout record is created"
                      },
                      "created_at": "2021-05-21T10:30:00+00:00",
                      "updated_at": "2021-05-21T10:30:00+00:00"
                    }
                  ]
                }
              },
              "partner_merchant_events": {
                "summary": "Response with partner merchant webhook subscriptions",
                "value": {
                  "count": 4,
                  "page": 1,
                  "limit": 25,
                  "results": [
                    {
                      "id": "whe_mer123abc456",
                      "merchant_id": "mer_xyz789",
                      "endpoint_url": "https://example.com/webhooks/resolve",
                      "topic": {
                        "name": "merchant.created",
                        "description": "Triggered when a partner creates a new merchant record."
                      },
                      "created_at": "2026-03-13T12:00:00+00:00",
                      "updated_at": "2026-03-13T12:00:00+00:00"
                    },
                    {
                      "id": "whe_mer123abc457",
                      "merchant_id": "mer_xyz789",
                      "endpoint_url": "https://example.com/webhooks/resolve",
                      "topic": {
                        "name": "merchant.underwriting_completed",
                        "description": "Triggered when a merchant underwriting decision is completed."
                      },
                      "created_at": "2026-03-13T12:00:00+00:00",
                      "updated_at": "2026-03-13T12:00:00+00:00"
                    },
                    {
                      "id": "whe_mer123abc458",
                      "merchant_id": "mer_xyz789",
                      "endpoint_url": "https://example.com/webhooks/resolve",
                      "topic": {
                        "name": "merchant.more_info_needed",
                        "description": "Triggered when merchant underwriting status changes to needs info."
                      },
                      "created_at": "2026-03-13T12:00:00+00:00",
                      "updated_at": "2026-03-13T12:00:00+00:00"
                    },
                    {
                      "id": "whe_mer123abc459",
                      "merchant_id": "mer_xyz789",
                      "endpoint_url": "https://example.com/webhooks/resolve",
                      "topic": {
                        "name": "merchant.mal_updated",
                        "description": "Triggered when a merchant approved limit (MAL) changes."
                      },
                      "created_at": "2026-03-13T12:00:00+00:00",
                      "updated_at": "2026-03-13T12:00:00+00:00"
                    }
                  ]
                }
              },
              "empty_list": {
                "summary": "Response with no webhook endpoints configured",
                "value": {
                  "count": 0,
                  "page": 1,
                  "limit": 25,
                  "results": []
                }
              }
            }
          }
        }
      },
      "WebhookResponse": {
        "description": "Successful response with webhook endpoint subscriptions",
        "content": {
          "application/json": {
            "schema": {
              "type": "array",
              "description": "Array of webhook endpoint objects. Each object represents one endpoint-topic subscription created or updated.",
              "items": {
                "$ref": "#/components/schemas/WebhookEndpoint"
              }
            },
            "examples": {
              "created": {
                "summary": "Newly created webhook endpoint subscriptions",
                "value": [
                  {
                    "id": "whe_abc123def456",
                    "merchant_id": "mer_xyz789",
                    "endpoint_url": "https://example.com/webhooks/resolve",
                    "topic": {
                      "name": "invoice.created",
                      "description": "Triggered when a new invoice record is created"
                    },
                    "created_at": "2021-05-20T09:23:53+00:00",
                    "updated_at": "2021-05-20T09:23:53+00:00"
                  },
                  {
                    "id": "whe_def456ghi789",
                    "merchant_id": "mer_xyz789",
                    "endpoint_url": "https://example.com/webhooks/resolve",
                    "topic": {
                      "name": "invoice.balance_updated",
                      "description": "Triggered when the outstanding balance of an invoice changes"
                    },
                    "created_at": "2021-05-20T09:23:53+00:00",
                    "updated_at": "2021-05-20T09:23:53+00:00"
                  },
                  {
                    "id": "whe_ghi789jkl012",
                    "merchant_id": "mer_xyz789",
                    "endpoint_url": "https://example.com/webhooks/resolve",
                    "topic": {
                      "name": "customer.created",
                      "description": "Triggered when a new customer record is created"
                    },
                    "created_at": "2021-05-20T09:23:53+00:00",
                    "updated_at": "2021-05-20T09:23:53+00:00"
                  }
                ]
              },
              "updated": {
                "summary": "Updated webhook endpoint with new event subscriptions",
                "value": [
                  {
                    "id": "whe_abc123def456",
                    "merchant_id": "mer_xyz789",
                    "endpoint_url": "https://example.com/webhooks/resolve",
                    "topic": {
                      "name": "invoice.created",
                      "description": "Triggered when a new invoice record is created"
                    },
                    "created_at": "2021-05-20T09:23:53+00:00",
                    "updated_at": "2021-05-25T14:30:00+00:00"
                  },
                  {
                    "id": "whe_mno123pqr456",
                    "merchant_id": "mer_xyz789",
                    "endpoint_url": "https://example.com/webhooks/resolve",
                    "topic": {
                      "name": "payment.created",
                      "description": "Triggered when a new payment is created"
                    },
                    "created_at": "2021-05-25T14:30:00+00:00",
                    "updated_at": "2021-05-25T14:30:00+00:00"
                  },
                  {
                    "id": "whe_stu789vwx012",
                    "merchant_id": "mer_xyz789",
                    "endpoint_url": "https://example.com/webhooks/resolve",
                    "topic": {
                      "name": "merchant.underwriting_completed",
                      "description": "Triggered when a merchant underwriting decision is completed."
                    },
                    "created_at": "2021-05-25T14:30:00+00:00",
                    "updated_at": "2021-05-25T14:30:00+00:00"
                  }
                ]
              }
            }
          }
        }
      }
    },
    "requestBodies": {
      "InvoiceCreateRequestBody": {
        "description": "Invoice to add to the system. Must include `merchant_id` referencing a valid sub-merchant.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/InvoiceCreateRequest"
            }
          }
        }
      },
      "InvoiceUpdateRequestBody": {
        "description": "Fields to update an invoice with. Please note, allowed fields depend on whether or not the invoice has been sent.\n",
        "content": {
          "application/json": {
            "schema": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/InvoiceUpdateBeforeSent"
                },
                {
                  "$ref": "#/components/schemas/InvoiceUpdateAfterSentAdvanced"
                },
                {
                  "$ref": "#/components/schemas/InvoiceUpdateAfterSentNonAdvanced"
                }
              ]
            }
          }
        }
      },
      "CreditNoteCreateRequestBody": {
        "description": "Issue a credit note for an invoice.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CreditNoteCreateRequest"
            }
          }
        }
      },
      "CustomerPostRequestBody": {
        "description": "Customer to add to the system.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CustomerPostRequest"
            }
          }
        }
      },
      "CustomerPutRequestBody": {
        "description": "Fields to update a customer with.\n",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CustomerPutRequest"
            }
          }
        }
      },
      "CustomerRequestCreditCheckBody": {
        "description": "Request a credit check for a customer",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CustomerCreditCheckRequest"
            }
          }
        }
      },
      "IssueAccessKeyTokenRequestBody": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/IssueAccessKeyTokenRequest"
            },
            "examples": {
              "default": {
                "value": {
                  "client_id": "abc123clientid",
                  "client_secret": "secret-value"
                }
              }
            }
          }
        }
      },
      "CreateMerchantRequest": {
        "description": "Request body for creating a partner sub-merchant.",
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CreateMerchantRequest"
            },
            "examples": {
              "basic": {
                "summary": "Create merchant",
                "value": {
                  "legal_business_name": "Acme Supply LLC",
                  "business_address": {
                    "line1": "100 Main St",
                    "city": "Austin",
                    "state": "TX",
                    "postal_code": "78701",
                    "country": "US"
                  },
                  "business_email": "ops@acmesupply.com",
                  "business_phone": "+15125550123",
                  "entity_type": "llc",
                  "formation_state": "TX",
                  "ein": "12-3456789",
                  "website": "https://acmesupply.com",
                  "metadata": {
                    "partner_reference": "mt-merchant-1029"
                  }
                }
              },
              "withInlineDocuments": {
                "summary": "Create merchant with inline document URL ingestion",
                "value": {
                  "legal_business_name": "Acme Supply LLC",
                  "business_address": {
                    "line1": "100 Main St",
                    "city": "Austin",
                    "state": "TX",
                    "postal_code": "78701",
                    "country": "US"
                  },
                  "business_email": "ops@acmesupply.com",
                  "business_phone": "+15125550123",
                  "entity_type": "llc",
                  "formation_state": "TX",
                  "ein": "12-3456789",
                  "bank_statements": [
                    {
                      "filename": "bank_statement_2026_01.pdf",
                      "filetype": "application/pdf",
                      "download_url": "https://partner-files.example.com/bank_statement_2026_01.pdf"
                    }
                  ],
                  "financial_statements": [
                    {
                      "filename": "financials_q4_2025.pdf",
                      "filetype": "application/pdf",
                      "download_url": "https://partner-files.example.com/financials_q4_2025.pdf"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "UpdateMerchantRequest": {
        "description": "Request body for updating a partner sub-merchant.",
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/UpdateMerchantRequest"
            },
            "examples": {
              "updateAllowedFields": {
                "summary": "Update merchant fields",
                "value": {
                  "dba_name": "Acme Industrial",
                  "business_description": "Industrial hardware distributor",
                  "estimated_monthly_net_terms_volume": 350000,
                  "metadata": {
                    "account_owner": "partnerships-team"
                  }
                }
              },
              "withInlineDocuments": {
                "summary": "Update merchant with inline document URL ingestion",
                "value": {
                  "dba_name": "Acme Industrial",
                  "bank_statements": [
                    {
                      "filename": "bank_statement_2026_02.pdf",
                      "filetype": "application/pdf",
                      "download_url": "https://partner-files.example.com/bank_statement_2026_02.pdf"
                    }
                  ],
                  "other_documents": [
                    {
                      "filename": "updated_customer_reference.pdf",
                      "filetype": "application/pdf",
                      "download_url": "https://partner-files.example.com/updated_customer_reference.pdf"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "CreateMerchantDocumentRequest": {
        "description": "Request body for creating a merchant document upload request.\n\nValidation notes:\n- `filename` must include an extension\n- `filetype` must be a supported MIME type for the merchant underwriting document profile\n- `download_url`, when provided, must use `http` or `https`\n- `filename` extension must match `filetype`\n",
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/CreateMerchantDocumentRequest"
            },
            "examples": {
              "presignedUpload": {
                "summary": "Presigned upload flow",
                "value": {
                  "document_type": "bank_statements",
                  "filename": "bank_statement_2026_01.pdf",
                  "filetype": "application/pdf"
                }
              },
              "downloadUrl": {
                "summary": "Download URL flow",
                "value": {
                  "document_type": "financial_statements",
                  "filename": "financials_q4_2025.pdf",
                  "filetype": "application/pdf",
                  "download_url": "https://partner-files.example.com/financials_q4_2025.pdf"
                }
              }
            }
          }
        }
      },
      "PaymentCreateRequestBody": {
        "description": "Create a forwarded payment for a sub-merchant's invoice.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PaymentCreateRequest"
            }
          }
        }
      },
      "CreateShipmentRequest": {
        "description": "Request body for creating a new shipment.",
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ShipmentCreateRequest"
            }
          }
        }
      },
      "UpdateShipmentRequest": {
        "description": "Request body for updating an existing shipment.",
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ShipmentUpdateRequest"
            }
          }
        }
      },
      "WebhookUpsertRequestBody": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "endpoint_url",
                "events"
              ],
              "properties": {
                "endpoint_url": {
                  "type": "string",
                  "format": "uri",
                  "pattern": "^https://",
                  "description": "The HTTPS URL where webhook events will be sent. Must use HTTPS protocol.",
                  "example": "https://example.com/webhooks/resolve"
                },
                "events": {
                  "$ref": "#/components/schemas/WebhookEventSubscriptions"
                }
              }
            },
            "examples": {
              "basic": {
                "summary": "Subscribe to specific events",
                "value": {
                  "endpoint_url": "https://example.com/webhooks/resolve",
                  "events": {
                    "invoice.created": true,
                    "invoice.balance_updated": true,
                    "customer.created": true,
                    "customer.credit_decision_created": true
                  }
                }
              },
              "partner_merchant_events": {
                "summary": "Subscribe to partner merchant lifecycle events",
                "value": {
                  "endpoint_url": "https://example.com/webhooks/resolve",
                  "events": {
                    "merchant.created": true,
                    "merchant.underwriting_completed": true,
                    "merchant.more_info_needed": true,
                    "merchant.mal_updated": true
                  }
                }
              },
              "unsubscribe": {
                "summary": "Unsubscribe from specific events",
                "description": "Update an existing endpoint to unsubscribe from certain event types by setting them to false. Only events set to true will remain active.",
                "value": {
                  "endpoint_url": "https://example.com/webhooks/resolve",
                  "events": {
                    "invoice.created": true,
                    "invoice.balance_updated": false,
                    "customer.created": true,
                    "customer.status_updated": false,
                    "customer.line_amount_updated": false,
                    "customer.advance_rate_updated": false,
                    "customer.credit_decision_created": false,
                    "payment.created": false,
                    "payment.status_changed": false,
                    "payout.created": false,
                    "payout.status_changed": false,
                    "merchant.created": false,
                    "merchant.underwriting_completed": false,
                    "merchant.more_info_needed": false,
                    "merchant.mal_updated": false
                  }
                }
              }
            }
          }
        }
      },
      "WebhookDeleteRequestBody": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "endpoint_url"
              ],
              "properties": {
                "endpoint_url": {
                  "type": "string",
                  "format": "uri",
                  "pattern": "^https://",
                  "description": "The HTTPS URL of the webhook endpoint to delete",
                  "example": "https://example.com/webhooks/resolve"
                }
              }
            },
            "examples": {
              "basic": {
                "summary": "Delete a webhook endpoint",
                "value": {
                  "endpoint_url": "https://example.com/webhooks/resolve"
                }
              }
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    },
    {
      "basicAuth": []
    }
  ],
  "paths": {
    "/invoices": {
      "get": {
        "summary": "List all invoices",
        "operationId": "listInvoices",
        "description": "Return a list of invoices across your sub-merchants.",
        "parameters": [
          {
            "name": "limit",
            "schema": {
              "type": "integer",
              "default": 25,
              "maximum": 100,
              "minimum": 25
            },
            "in": "query",
            "description": "Limit the number of invoices returned."
          },
          {
            "name": "page",
            "schema": {
              "type": "string",
              "default": "1"
            },
            "in": "query",
            "description": "Specify the page of invoices returned."
          },
          {
            "name": "filter",
            "explode": true,
            "style": "deepObject",
            "schema": {
              "type": "object",
              "properties": {
                "merchant_id": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "string"
                    }
                  },
                  "description": "Filter by sub-merchant ID."
                },
                "number": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "string"
                    }
                  }
                },
                "order_number": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "string"
                    }
                  }
                },
                "po_number": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "string"
                    }
                  }
                },
                "customer_id": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "string"
                    }
                  }
                },
                "created_at": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "gt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "lt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "gte": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "lte": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "fully_paid": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "boolean"
                    },
                    "ne": {
                      "type": "boolean"
                    }
                  }
                },
                "fully_paid_at": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "gt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "lt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "gte": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "lte": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "amount_due": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "number"
                    },
                    "gt": {
                      "type": "number"
                    },
                    "lt": {
                      "type": "number"
                    },
                    "gte": {
                      "type": "number"
                    },
                    "lte": {
                      "type": "number"
                    }
                  }
                },
                "amount_balance": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "number"
                    },
                    "gt": {
                      "type": "number"
                    },
                    "lt": {
                      "type": "number"
                    },
                    "gte": {
                      "type": "number"
                    },
                    "lte": {
                      "type": "number"
                    }
                  }
                },
                "amount_pending": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "number"
                    },
                    "gt": {
                      "type": "number"
                    },
                    "lt": {
                      "type": "number"
                    },
                    "gte": {
                      "type": "number"
                    },
                    "lte": {
                      "type": "number"
                    }
                  }
                },
                "amount_refunded": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "number"
                    },
                    "gt": {
                      "type": "number"
                    },
                    "lt": {
                      "type": "number"
                    },
                    "gte": {
                      "type": "number"
                    },
                    "lte": {
                      "type": "number"
                    }
                  }
                },
                "amount_scheduled": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "number"
                    },
                    "gt": {
                      "type": "number"
                    },
                    "lt": {
                      "type": "number"
                    },
                    "gte": {
                      "type": "number"
                    },
                    "lte": {
                      "type": "number"
                    }
                  }
                },
                "archived": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "boolean"
                    },
                    "ne": {
                      "type": "boolean"
                    }
                  }
                }
              }
            },
            "in": "query",
            "description": "Filter invoices by the specified fields.\n\nFilter semantics: `filter[field][operator]=value`.\n\nAvailable filter operators:\n- `eq` - equal (=)\n- `ne` - not equal (!=)\n- `gt` - greater than (>)\n- `gte` - greater than or equal (>=)\n- `lt` - less than (<)\n- `lte` - less than or equal  (<=)\n\nFiltering is allowed by the following fields:\n  - `merchant_id` (`eq`) - filter by sub-merchant ID\n  - `number` (`eq`)\n  - `order_number` (`eq`)\n  - `po_number` (`eq`)\n  - `customer_id` (`eq`)\n  - `advance_requested` (`eq`)\n  - `created_at` (`eq`, `gt`, `lt`, `gte`, `lte`)\n  - `fully_paid` (`eq`, `ne`)\n  - `fully_paid_at` (`eq`, `gt`, `lt`, `gte`, `lte`)\n  - `amount_due` (`eq`, `gt`, `lt`, `gte`, `lte`)\n  - `amount_balance` (`eq`, `gt`, `lt`, `gte`, `lte`)\n  - `amount_scheduled` (`eq`, `gt`, `lt`, `gte`, `lte`)\n  - `amount_pending` (`eq`, `gt`, `lt`, `gte`, `lte`)\n  - `amount_refunded` (`eq`, `gt`, `lt`, `gte`, `lte`)\n  - `archived` (`eq`, `ne`)\n\nExample: `filter[merchant_id][eq]=MER456789`\n\nNote: filter with the `eq` operator is equivalent to the following filter `filter[field]=value`\n"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/InvoiceListResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Invoices"
        ]
      },
      "post": {
        "summary": "Create an invoice",
        "operationId": "createInvoice",
        "description": "Create a new advanced or non-advanced invoice for a sub-merchant with the desired terms. The `merchant_id` field is required and must reference a valid sub-merchant under your partner account.",
        "requestBody": {
          "$ref": "#/components/requestBodies/InvoiceCreateRequestBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/InvoiceResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Invoices"
        ]
      }
    },
    "/invoices/{invoice_id}": {
      "get": {
        "summary": "Fetch an invoice",
        "operationId": "fetchInvoice",
        "description": "Retrieve an existing invoice by its ID.",
        "parameters": [
          {
            "name": "invoice_id",
            "schema": {
              "type": "string"
            },
            "in": "path",
            "required": true,
            "description": "ID of the invoice to retrieve"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/InvoiceResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Invoices"
        ]
      },
      "put": {
        "summary": "Update an invoice",
        "operationId": "updateInvoice",
        "description": "Update an invoice.",
        "parameters": [
          {
            "name": "invoice_id",
            "schema": {
              "type": "string"
            },
            "in": "path",
            "required": true,
            "description": "ID of the invoice to update"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/InvoiceUpdateRequestBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/InvoiceResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Invoices"
        ]
      },
      "delete": {
        "summary": "Delete an invoice",
        "operationId": "deleteInvoice",
        "description": "Delete an invoice.",
        "parameters": [
          {
            "name": "invoice_id",
            "schema": {
              "type": "string"
            },
            "in": "path",
            "required": true,
            "description": "ID of the invoice to delete"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/InvoiceResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Invoices"
        ]
      }
    },
    "/invoices/{invoice_id}/send": {
      "put": {
        "summary": "Send an invoice",
        "operationId": "sendInvoice",
        "description": "Send an invoice to the customer.",
        "parameters": [
          {
            "name": "invoice_id",
            "schema": {
              "type": "string"
            },
            "in": "path",
            "required": true,
            "description": "ID of the invoice to send"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/InvoiceResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Invoices"
        ]
      }
    },
    "/invoices/{invoice_id}/void": {
      "post": {
        "summary": "Void an invoice",
        "operationId": "voidInvoice",
        "description": "Void an invoice.",
        "parameters": [
          {
            "name": "invoice_id",
            "schema": {
              "type": "string"
            },
            "in": "path",
            "required": true,
            "description": "ID of the invoice to void"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/InvoiceResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Invoices"
        ]
      }
    },
    "/invoices/{invoice_id}/cancel": {
      "post": {
        "summary": "Cancel an invoice",
        "operationId": "cancelInvoice",
        "description": "Cancel an invoice.",
        "parameters": [
          {
            "name": "invoice_id",
            "schema": {
              "type": "string"
            },
            "in": "path",
            "required": true,
            "description": "ID of the invoice to cancel"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/InvoiceResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Invoices"
        ]
      }
    },
    "/credit-notes": {
      "get": {
        "summary": "List credit notes",
        "operationId": "listCreditNotes",
        "description": "Return a list of credit notes.",
        "parameters": [
          {
            "name": "limit",
            "schema": {
              "type": "integer",
              "default": 25,
              "maximum": 100,
              "minimum": 25
            },
            "in": "query",
            "description": "Limit the number of credit notes returned."
          },
          {
            "name": "page",
            "schema": {
              "type": "string",
              "default": "1"
            },
            "in": "query",
            "description": "Specify the page of credit notes returned."
          },
          {
            "name": "filter",
            "explode": true,
            "style": "deepObject",
            "schema": {
              "type": "object",
              "properties": {
                "merchant_id": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "string"
                    }
                  },
                  "description": "Filter by sub-merchant ID."
                },
                "number": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "string"
                    }
                  }
                },
                "customer_id": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "string"
                    }
                  }
                },
                "invoice_id": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "string"
                    }
                  }
                },
                "payment_id": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "string"
                    }
                  }
                },
                "amount": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "number"
                    },
                    "gt": {
                      "type": "number"
                    },
                    "lt": {
                      "type": "number"
                    },
                    "gte": {
                      "type": "number"
                    },
                    "lte": {
                      "type": "number"
                    }
                  }
                },
                "amount_balance": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "number"
                    },
                    "gt": {
                      "type": "number"
                    },
                    "lt": {
                      "type": "number"
                    },
                    "gte": {
                      "type": "number"
                    },
                    "lte": {
                      "type": "number"
                    }
                  }
                },
                "amount_paid": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "number"
                    },
                    "gt": {
                      "type": "number"
                    },
                    "lt": {
                      "type": "number"
                    },
                    "gte": {
                      "type": "number"
                    },
                    "lte": {
                      "type": "number"
                    }
                  }
                }
              }
            },
            "in": "query",
            "description": "Filter credit notes by the specified fields.\n\nFilter semantics: `filter[field][operator]=value`.\n\nAvailable filter operators:\n- `eq` - equal (=)\n- `gt` - greater than (>)\n- `gte` - greater than or equal (>=)\n- `lt` - less than (<)\n- `lte` - less than or equal  (<=)\n\nFiltering is allowed by the following fields:\n  - `merchant_id` (`eq`) - filter by sub-merchant ID\n  - `number` (`eq`)\n  - `customer_id` (`eq`)\n  - `invoice_id` (`eq`)\n  - `payment_id` (`eq`)\n  - `amount` (`eq`, `gt`, `lt`, `gte`, `lte`)\n  - `amount_balance` (`eq`, `gt`, `lt`, `gte`, `lte`)\n  - `amount_paid` (`eq`, `gt`, `lt`, `gte`, `lte`)\n\nExample: `filter[number][eq]=CN-001`\n\nNote: filter with the `eq` operator is equivalent to the following filter `filter[field]=value`\n"
          },
          {
            "name": "sort",
            "schema": {
              "type": "string",
              "enum": [
                "id",
                "-id",
                "created_at",
                "-created_at",
                "amount",
                "-amount",
                "amount_balance",
                "-amount_balance"
              ],
              "default": "-created_at"
            },
            "in": "query",
            "description": "Sort credit notes by the specified field. Use `-` prefix for descending order.\n\nAvailable sort fields:\n  - `id`\n  - `created_at`\n  - `amount`\n  - `amount_balance`\n\nExample: `sort=-created_at` (sort by created_at in descending order)\n"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/CreditNoteListResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Credit Notes"
        ]
      },
      "post": {
        "summary": "Create a credit note",
        "operationId": "createCreditNote",
        "description": "Create a new credit note.",
        "requestBody": {
          "$ref": "#/components/requestBodies/CreditNoteCreateRequestBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/CreditNoteActionResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Credit Notes"
        ]
      }
    },
    "/credit-notes/{credit_note_id}/void": {
      "post": {
        "summary": "Request to void a credit note",
        "operationId": "voidCreditNote",
        "description": "Request to void an existing credit note.",
        "responses": {
          "200": {
            "$ref": "#/components/responses/CreditNoteResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Credit Notes"
        ]
      }
    },
    "/credit-notes/{credit_note_id}": {
      "get": {
        "summary": "Fetch a credit note",
        "operationId": "fetchCreditNote",
        "description": "Retrieve an existing credit note by its ID.",
        "parameters": [
          {
            "name": "credit_note_id",
            "schema": {
              "type": "string"
            },
            "in": "path",
            "required": true,
            "description": "ID of the credit note to retrieve"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/CreditNoteResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Credit Notes"
        ]
      }
    },
    "/customers": {
      "get": {
        "summary": "List all customers",
        "operationId": "listCustomers",
        "description": "Return a list of customers. For single-merchant partners, this returns customers belonging to your sub-merchants. For marketplace partners, this returns customers belonging to your marketplace.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 25,
              "maximum": 100,
              "minimum": 25
            },
            "description": "Limit the number of customers returned."
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "1"
            },
            "description": "Specify the page of customers returned."
          },
          {
            "name": "filter",
            "explode": true,
            "style": "deepObject",
            "schema": {
              "type": "object",
              "properties": {
                "merchant_id": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "string"
                    }
                  },
                  "description": "Filter by sub-merchant ID. Only available for single-merchant partners."
                },
                "external_id": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "string"
                    }
                  },
                  "description": "Filter by customer external ID."
                },
                "email": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "string"
                    }
                  }
                },
                "business_name": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "string"
                    }
                  }
                },
                "created_at": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "gt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "lt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "gte": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "lte": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "amount_approved": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "number"
                    },
                    "gt": {
                      "type": "number"
                    },
                    "lt": {
                      "type": "number"
                    },
                    "gte": {
                      "type": "number"
                    },
                    "lte": {
                      "type": "number"
                    }
                  }
                },
                "amount_available": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "number"
                    },
                    "gt": {
                      "type": "number"
                    },
                    "lt": {
                      "type": "number"
                    },
                    "gte": {
                      "type": "number"
                    },
                    "lte": {
                      "type": "number"
                    }
                  }
                },
                "amount_authorized": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "number"
                    },
                    "gt": {
                      "type": "number"
                    },
                    "lt": {
                      "type": "number"
                    },
                    "gte": {
                      "type": "number"
                    },
                    "lte": {
                      "type": "number"
                    }
                  }
                },
                "amount_balance": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "number"
                    },
                    "gt": {
                      "type": "number"
                    },
                    "lt": {
                      "type": "number"
                    },
                    "gte": {
                      "type": "number"
                    },
                    "lte": {
                      "type": "number"
                    }
                  }
                },
                "amount_unapplied_payments": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "number"
                    },
                    "gt": {
                      "type": "number"
                    },
                    "lt": {
                      "type": "number"
                    },
                    "gte": {
                      "type": "number"
                    },
                    "lte": {
                      "type": "number"
                    }
                  }
                },
                "advance_rate": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "number",
                      "format": "double",
                      "minimum": 0,
                      "maximum": 1
                    },
                    "gt": {
                      "type": "number",
                      "format": "double",
                      "minimum": 0,
                      "maximum": 1
                    },
                    "lt": {
                      "type": "number",
                      "format": "double",
                      "minimum": 0,
                      "maximum": 1
                    },
                    "gte": {
                      "type": "number",
                      "format": "double",
                      "minimum": 0,
                      "maximum": 1
                    },
                    "lte": {
                      "type": "number",
                      "format": "double",
                      "minimum": 0,
                      "maximum": 1
                    }
                  }
                },
                "archived": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "boolean"
                    },
                    "ne": {
                      "type": "boolean"
                    }
                  }
                }
              }
            },
            "in": "query",
            "description": "Filter customers by the specified fields.\n\nFilter semantics: `filter[field][operator]=value`.\n\nAvailable filter operators:\n- `eq` - equal (=)\n- `ne` - not equal (!=)\n- `gt` - greater than (>)\n- `gte` - greater than or equal (>=)\n- `lt` - less than (<)\n- `lte` - less than or equal  (<=)\n\nFiltering is allowed by the following fields:\n  - `merchant_id` (`eq`) — only available for single-merchant partners\n  - `external_id` (`eq`)\n  - `email` (`eq`)\n  - `business_name` (`eq`)\n  - `created_at` (`eq`, `gt`, `lt`, `gte`, `lte`)\n  - `amount_approved` (`eq`, `gt`, `lt`, `gte`, `lte`)\n  - `amount_available` (`eq`, `gt`, `lt`, `gte`, `lte`)\n  - `amount_authorized` (`eq`, `gt`, `lt`, `gte`, `lte`)\n  - `amount_balance` (`eq`, `gt`, `lt`, `gte`, `lte`)\n  - `amount_unapplied_payments` (`eq`, `gt`, `lt`, `gte`, `lte`)\n  - `advance_rate` (`eq`, `gt`, `lt`, `gte`, `lte`)\n  - `archived` (`eq`, `ne`)\n\nExample: `filter[email][eq]=test@resolvepay.com`\nExample: `filter[external_id][eq]=CUS-123456`\n\nNote: filter with the `eq` operator is equivalent to the following filter `filter[field]=value`\n"
          },
          {
            "name": "sort",
            "schema": {
              "type": "string"
            },
            "in": "query",
            "description": "Sort customers by the specified fields.\n\nThe sort order for each sort field is ascending unless it is prefixed with a minus,\nin which case it is descending.\n\nMultiple sort fields supported by allowing comma-separated sort fields. Sort fields will be applied in the order specified.\n\nSorting is allowed by the following fields: `id`, `created_at`, `amount_approved`, `amount_available`, `business_name`.\n\nExample: `sort=business_name,-created_at`\n"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/CustomerListResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Customers"
        ]
      },
      "post": {
        "summary": "Create a customer",
        "operationId": "createCustomer",
        "description": "Create a customer",
        "requestBody": {
          "$ref": "#/components/requestBodies/CustomerPostRequestBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/CustomerResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Customers"
        ]
      }
    },
    "/customers/{customer_id}": {
      "get": {
        "summary": "Fetch a customer",
        "operationId": "fetchCustomer",
        "description": "Retrieve an existing customer by its ID.\n\nA successful response to this request will be the Customer entity.\nIf customer enrollment is required, we will return `net_terms_status='pending_enrollment'` and a not null `net_terms_enrollment_url`.\nIf customer enrollment is not required (customer applied through a direct application), we will return `net_terms_status='enrolled'`.\n",
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "ID of the customer to return"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/CustomerResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Customers"
        ]
      },
      "put": {
        "summary": "Update a customer",
        "operationId": "updateCustomer",
        "description": "Update a customer",
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "ID of the customer to update"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/CustomerPutRequestBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/CustomerResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Customers"
        ]
      }
    },
    "/customers/{customer_id}/credit-check": {
      "post": {
        "summary": "Request a credit check",
        "operationId": "requestCustomerCreditCheck",
        "description": "You may request a credit check on a customer who hasn't previously been credit checked.\nThis endpoint returns no content. You'll be able to see the date you requested the credit check\n(`credit_check_requested_at`) and `credit_status` updated to `pending` or, in the case of an instant decision,\n`approved` or `declined` by fetching the Customer entity.\n\nA `hold` credit status represents when a customer's credit account is overdue.\nA `deactivated` credit status represents when a customer's credit account has been deactivated.\n\nWhen a customer's `credit_status` is `approved` - the customer's `net_terms_status` represents the current state of a customer's enrollment in the approved net terms offer.\nSee <a href=\"#operation/fetchCustomer\">#fetchCustomer</a> for more details.\n\nNote: Except for instant decisions, a decision should be reflected on the Customer entity within 1 business day.\n",
        "parameters": [
          {
            "name": "customer_id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "ID of the customer being submitted for a credit check"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/CustomerRequestCreditCheckBody"
        },
        "responses": {
          "204": {
            "description": "Credit check request accepted."
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundResponse"
          },
          "422": {
            "$ref": "#/components/responses/CreditCheckAlreadyExistsResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Customers"
        ]
      }
    },
    "/access-keys/token": {
      "post": {
        "summary": "Mint an access token",
        "operationId": "issueAccessKeyToken",
        "description": "Exchange an OAuth access key for a bearer token by providing its `client_id` and `client_secret` in the request body.\n",
        "security": [],
        "requestBody": {
          "$ref": "#/components/requestBodies/IssueAccessKeyTokenRequestBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/AccessKeyTokenResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Access Keys"
        ]
      }
    },
    "/merchants": {
      "get": {
        "summary": "List Merchants",
        "operationId": "listMerchants",
        "description": "Returns sub-merchants under the authenticated partner account.\n\nSupported query options:\n- Pagination: `limit`, `page`\n- Text search: `search`\n- Sorting: `sort`\n- Field filters: `filter[field][eq]=value`\n\nSupported filter fields:\n- `id`\n- `external_id`\n- `name`\n- `legal_name`\n- `email`\n- `underwriting_status`\n- `created_at`\n\nSupported sort fields:\n- `created_at`\n- `id`\n- `name`\n- `legal_name`\n\nUse `-` prefix for descending sort, for example `sort=-name`.\n",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            },
            "description": "Maximum number of merchants to return.",
            "example": 25
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "description": "Page number for paginated merchant results.",
            "example": 1
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Case-insensitive text search across merchant `id`, `name`, `email`, and `legal_name`.",
            "example": "alpha"
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "created_at",
                "-created_at",
                "id",
                "-id",
                "name",
                "-name",
                "legal_name",
                "-legal_name"
              ]
            },
            "description": "Sort field for merchant results.\n\nPrefix with `-` for descending order.\n",
            "example": "-created_at"
          },
          {
            "name": "filter",
            "explode": true,
            "style": "deepObject",
            "schema": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "string"
                    }
                  }
                },
                "external_id": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "string"
                    }
                  }
                },
                "name": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "string"
                    }
                  }
                },
                "legal_name": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "string"
                    }
                  }
                },
                "email": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "string",
                      "format": "email"
                    }
                  }
                },
                "underwriting_status": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "string",
                      "description": "Current latest underwriting status for the merchant."
                    }
                  }
                },
                "created_at": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            },
            "in": "query",
            "description": "Filter merchants by allowlisted fields.\n\nFilter semantics: `filter[field][operator]=value`.\n\nSupported filters:\n- `filter[id][eq]=mrc_1234567890abcdef`\n- `filter[legal_name][eq]=Alpha Supply LLC`\n- `filter[underwriting_status][eq]=pending`\n- `filter[created_at][eq]=2026-03-11T00:00:00.000Z`\n"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/MerchantListResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Merchants"
        ]
      },
      "post": {
        "summary": "Create Merchant",
        "operationId": "createMerchant",
        "description": "Creates a sub-merchant under the authenticated partner and starts underwriting lifecycle tracking.\n\nFor the **partner API** contract, `id` is server-managed and is not accepted in the request payload.\nResolve derives/assigns the merchant identifier from merchant naming inputs (`dba_name` or `legal_business_name`) with random alphanumeric fallback for collisions.\n\nCore merchant validation includes:\n- `business_phone` must be a valid US phone number\n- `formation_state` must map to a valid US state\n- US business addresses validate `state` and `postal_code`\n- beneficial owner US addresses validate `state` and `postal_code`\n- `authorized_signer.phone`, when provided, must be a valid US phone number\n- `ein` must be a valid EIN format\n- banking fields validate account-number shape and ABA routing number format\n- `bank_account_number` must be different from `bank_routing_number`\n\nThis endpoint also supports optional inline document URL ingestion. If document arrays are provided\n(`bank_statements`, `financial_statements`, `credit_references`, `personal_guarantee`, `other_documents`),\nResolve queues `download_url` ingestion jobs equivalent to the document endpoint.\n\nInline document requests require:\n- `filename` with an extension\n- supported `filetype` for the merchant underwriting document profile\n- `download_url` using `http` or `https`\n- matching filename extension and `filetype`\n\nMerchant creation is not rolled back for inline document ingestion failures.\n\nInline download dispatch is performed after database commit. Dispatch failures are surfaced per-item in\n`document_ingestion.results`, and the affected merchant document/file metadata is marked failed even though\nthe merchant and some/all document rows were already persisted.\n",
        "requestBody": {
          "$ref": "#/components/requestBodies/CreateMerchantRequest"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/MerchantResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Merchants"
        ]
      }
    },
    "/merchants/{merchant_id}": {
      "get": {
        "summary": "Get Merchant",
        "operationId": "getMerchant",
        "description": "Retrieves a single sub-merchant belonging to the authenticated partner.\n\nOnly merchants scoped to the authenticated partner are returned. Requests for\nunknown merchants or merchants outside that scope return `404`.\n\nThis path currently overlaps with a legacy public merchant endpoint. To avoid\nambiguous response shapes or fallback behavior, send the `resolve-api-version`\nheader on every request. Use `resolve-api-version: partner-v1` when you need\nthe partner API response contract documented here.\n",
        "parameters": [
          {
            "name": "merchant_id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "ID of the sub-merchant under your partner account.",
            "example": "mrc_1234567890abcdef"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/MerchantResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Merchants"
        ]
      },
      "put": {
        "summary": "Update Merchant",
        "operationId": "updateMerchant",
        "description": "Updates a sub-merchant belonging to the authenticated partner.\n\nFor the **partner API** contract, `id` is immutable and cannot be updated via request payload.\n\nPost-underwriting restrictions apply once the latest underwriting decision has been finalized.\n\nFields that are **not updateable** after underwriting is complete:\n- `legal_business_name`\n- `business_address`\n- `business_email`\n- `business_phone`\n- `entity_type`\n- `formation_state`\n- `ein`\n- `annual_revenue`\n- `years_in_business`\n- `industry`\n- `authorized_signer`\n- `bank_account_number`\n- `bank_routing_number`\n- `beneficial_owners` (existing owners are not editable)\n\nFields that are **updateable** after underwriting is complete:\n- `dba_name`\n- `business_description`\n- `website`\n- `estimated_monthly_net_terms_volume`\n- `existing_net_terms_info`\n- `metadata`\n- `plaid_access_token`\n- `additional_beneficial_owners` (add-only)\n\nValidation for mutable request fields follows the same partner create rules for phone, EIN, US address fields,\nbeneficial owner address fields, authorized signer phone, and banking inputs.\n\nThis endpoint also supports optional inline document URL ingestion using the same `download_url` pattern as\nmerchant create. If document arrays are provided (`bank_statements`, `financial_statements`,\n`credit_references`, `personal_guarantee`, `other_documents`), Resolve queues `download_url` ingestion jobs\nequivalent to the document endpoint.\n\nMerchant updates are not rolled back for inline document ingestion failures. Dispatch failures are surfaced\nper-item in `document_ingestion.results`, and the affected merchant document/file metadata is marked failed.\n",
        "parameters": [
          {
            "name": "merchant_id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "ID of the sub-merchant under your partner account.",
            "example": "mrc_1234567890abcdef"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/UpdateMerchantRequest"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/MerchantResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Merchants"
        ]
      }
    },
    "/merchants/{merchant_id}/documents": {
      "get": {
        "summary": "List Merchant Documents",
        "operationId": "listMerchantDocuments",
        "description": "Returns document presence and validation lifecycle status for a specific sub-merchant.\n\nThis endpoint is metadata-only and does not return file bodies or signed retrieval URLs.\n\nSupported query options:\n- Pagination: `limit`, `page`\n- Sorting: `sort`\n- Field filters: `filter[field][eq]=value`\n\nSupported filter fields:\n- `document_type`\n- `status`\n\nSupported sort fields:\n- `created_at`\n\nUse `-` prefix for descending sort, for example `sort=-created_at`.\n",
        "parameters": [
          {
            "name": "merchant_id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "ID of the sub-merchant under your partner account.",
            "example": "mrc_1234567890abcdef"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            },
            "description": "Maximum number of document records to return.",
            "example": 25
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "description": "Page number for paginated document results.",
            "example": 1
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "created_at",
                "-created_at"
              ]
            },
            "description": "Sort field for merchant document results.\n\nPrefix with `-` for descending order.\n",
            "example": "-created_at"
          },
          {
            "name": "filter",
            "explode": true,
            "style": "deepObject",
            "schema": {
              "type": "object",
              "properties": {
                "document_type": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "string"
                    }
                  }
                },
                "status": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "string",
                      "enum": [
                        "pending_upload",
                        "uploaded_pending_validation",
                        "accepted",
                        "rejected",
                        "failed"
                      ]
                    }
                  }
                }
              }
            },
            "in": "query",
            "description": "Filter merchant documents by type or validation status.\n\nFilter semantics: `filter[field][operator]=value`.\n\nSupported filters:\n- `filter[document_type][eq]=bank_statements`\n- `filter[status][eq]=accepted`\n"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/MerchantDocumentListResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Merchants"
        ]
      },
      "post": {
        "summary": "Create a Merchant Document Upload Request",
        "operationId": "createMerchantDocumentUploadRequest",
        "description": "Creates a new merchant document record for a sub-merchant and initializes document transfer to the Resolve document validation service.\n\nThe transfer method is determined by request shape:\n- If `download_url` is provided, Resolve queues a background download job (`transfer_method=download_url`).\n- Otherwise, Resolve returns a presigned S3 upload URL (`transfer_method=presigned_upload`).\n\nThe validation profile is endpoint-managed by Resolve and cannot be overridden in the request.\n\nRequest validation includes:\n- `filename` must include an extension\n- `filetype` must be a supported MIME type for the merchant underwriting document profile\n- `download_url`, when provided, must use `http` or `https`\n- `filename` extension must match `filetype`\n\nFor `download_url`, queue dispatch is executed after database commit. A dispatch failure at that stage does not\nroll back the merchant document row; instead, the response remains successful and the document is marked failed.\n",
        "parameters": [
          {
            "name": "merchant_id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "ID of the sub-merchant under your partner account.",
            "example": "mrc_1234567890abcdef"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/CreateMerchantDocumentRequest"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/CreateMerchantDocumentResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Merchants"
        ]
      }
    },
    "/payouts": {
      "get": {
        "summary": "List Payouts",
        "operationId": "listPayouts",
        "parameters": [
          {
            "name": "filter",
            "schema": {
              "type": "string"
            },
            "in": "query",
            "description": "Filter records by the specified fields.\n  \nFilter semantics: `filter[field][operator]=value`.\n\nAvailable filter operators:\n  - `eq` - equal (=)\n  - `ne` - not equal (!=)\n  - `gt` - greater than (>)\n  - `gte` - greater than or equal (>=)\n  - `lt` - less than (<)\n  - `lte` - less than or equal  (<=)\n\nFiltering is allowed by the following fields:\n  - `merchant_id` (`eq`) - filter by sub-merchant ID\n  - `status` (`eq`)\n  - `expected_by` (`eq`, `gt`, `lt`, `gte`, `lte`)\n  - `created_at` (`eq`, `gt`, `lt`, `gte`, `lte`)\n\nExample: `filter[created_at][gt]=2022-10-30T14:00:00.000Z`\n\nNote: filter with the `eq` operator is equivalent to the following filter `filter[field]=value`\n"
          },
          {
            "name": "sort",
            "schema": {
              "type": "string"
            },
            "in": "query",
            "description": "Sort records by the specified fields.\n\nThe sort order for each sort field is ascending unless it is prefixed with a minus,\nin which case it is descending.\n\nMultiple sort fields supported by allowing comma-separated sort fields. Sort fields will be applied in the order specified.\n\nSorting is allowed by the following fields: `id`, `created_at`.\n\nExample: `sort=id,-created_at`\n"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/PayoutListResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Payouts"
        ]
      }
    },
    "/payouts/{payout_id}": {
      "get": {
        "summary": "Get a Payout",
        "operationId": "getPayout",
        "parameters": [
          {
            "name": "payout_id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "ID of the Payout"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/PayoutResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Payouts"
        ]
      }
    },
    "/payout-transactions": {
      "get": {
        "summary": "List Payout Transactions",
        "operationId": "listPayoutTransactions",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 25,
              "maximum": 100,
              "minimum": 25
            },
            "description": "Limit the number of payout transactions returned."
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "1"
            },
            "description": "Specify the page of payout transactions returned."
          },
          {
            "name": "filter",
            "schema": {
              "type": "string"
            },
            "in": "query",
            "description": "Filter Payout Transactions by the specified fields.\n\nFilter semantics: `filter[field][operator]=value`.\n\nAvailable filter operators:\n- `eq` - equal (=)\n- `ne` - not equal (!=)\n- `gt` - greater than (>)\n- `gte` - greater than or equal (>=)\n- `lt` - less than (<)\n- `lte` - less than or equal  (<=)\n\nFiltering is allowed by the following fields:\n  - `merchant_id` (`eq`) - filter by sub-merchant ID\n  - `customer_id` (`eq`, `ne`)\n  - `created_at` (`eq`, `gt`, `lt`, `gte`, `lte`)\n  - `payout_id` (`eq`, `ne`)\n  - `invoice_id` (`eq`, `ne`)\n\nExample: `filter[created_at][gte]=2021-01-01T00:00:00.000Z`\n\nNote: filter with the `eq` operator is equivalent to the following filter `filter[field]=value`\n"
          },
          {
            "name": "sort",
            "schema": {
              "type": "string"
            },
            "in": "query",
            "description": "Sort Payout Transactions by the specified fields.\n\nThe sort order for each sort field is ascending unless it is prefixed with a minus,\nin which case it is descending.\n\nMultiple sort fields supported by allowing comma-separated sort fields. Sort fields will be applied in the order specified.\n\nSorting is allowed by the following fields: `id`, `created_at`.\n\nExample: `sort=id,-created_at`\n"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ListPayoutTransactionsResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Payout Transactions"
        ]
      }
    },
    "/payout_transactions/{payout_transaction_id}": {
      "get": {
        "summary": "Get a Payout Transaction",
        "operationId": "getPayoutTransaction",
        "parameters": [
          {
            "name": "payout_transaction_id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "ID of the Payout Transaction"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/PayoutTransactionResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Payout Transactions"
        ]
      }
    },
    "/payments": {
      "get": {
        "summary": "List payments",
        "operationId": "listPayments",
        "description": "Return a list of payments across your sub-merchants.",
        "parameters": [
          {
            "name": "limit",
            "schema": {
              "type": "integer",
              "default": 25,
              "maximum": 100,
              "minimum": 25
            },
            "in": "query",
            "description": "Limit the number of payments returned."
          },
          {
            "name": "page",
            "schema": {
              "type": "string",
              "default": "1"
            },
            "in": "query",
            "description": "Specify the page of payments returned."
          },
          {
            "name": "filter",
            "explode": true,
            "style": "deepObject",
            "schema": {
              "type": "object",
              "properties": {
                "customer_id": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "string"
                    }
                  }
                },
                "status": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "in_transit",
                        "in_review",
                        "paid",
                        "failed",
                        "canceled"
                      ]
                    }
                  }
                },
                "amount": {
                  "type": "object",
                  "properties": {
                    "eq": {
                      "type": "number"
                    },
                    "gt": {
                      "type": "number"
                    },
                    "lt": {
                      "type": "number"
                    },
                    "gte": {
                      "type": "number"
                    },
                    "lte": {
                      "type": "number"
                    }
                  }
                }
              }
            },
            "in": "query",
            "description": "Filter payments by the specified fields.\n\nFilter semantics: `filter[field][operator]=value`.\n\nAvailable filter operators:\n- `eq` - equal (=)\n- `gt` - greater than (>)\n- `gte` - greater than or equal (>=)\n- `lt` - less than (<)\n- `lte` - less than or equal  (<=)\n- `after` - after date\n- `before` - before date\n- `start` - start date\n- `end` - end date\n\nFiltering is allowed by the following fields:\n  - `customer_id` (`eq`)\n  - `status` (`eq`)\n  - `amount` (`eq`, `gt`, `lt`, `gte`, `lte`)\n\nExample: `filter[customer_id][eq]=X50sgfRd`\n\nNote: filter with the `eq` operator is equivalent to the following filter `filter[field]=value`\n"
          },
          {
            "name": "sort",
            "schema": {
              "type": "string",
              "enum": [
                "id",
                "-id",
                "created_at",
                "-created_at",
                "amount",
                "-amount"
              ],
              "default": "-created_at"
            },
            "in": "query",
            "description": "Sort payments by the specified field. Use `-` prefix for descending order.\n\nAvailable sort fields:\n  - `id`\n  - `created_at`\n  - `amount`\n\nExample: `sort=-created_at` (sort by created_at in descending order)\n"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/PaymentListResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Payments"
        ]
      },
      "post": {
        "summary": "Create a payment",
        "operationId": "createPayment",
        "description": "Create a forwarded payment for an invoice belonging to one of your sub-merchants.\n\nThe payment will be forwarded from the bank account of the entity that receives payouts. If the payout receiver is the partner, the partner's bank account will be used. If the payout receiver is the sub-merchant, the sub-merchant's bank account will be used.\n\nThe invoice must be sent, and the payment amount must not exceed the invoice's outstanding balance.\n",
        "requestBody": {
          "$ref": "#/components/requestBodies/PaymentCreateRequestBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/PaymentResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundResponse"
          },
          "422": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Payments"
        ]
      }
    },
    "/payments/{payment_id}": {
      "get": {
        "summary": "Fetch a payment",
        "operationId": "fetchPayment",
        "description": "Retrieve an existing payment by its ID.",
        "parameters": [
          {
            "name": "payment_id",
            "schema": {
              "type": "string"
            },
            "in": "path",
            "required": true,
            "description": "ID of the payment to retrieve"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/PaymentResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Payments"
        ]
      }
    },
    "/shipments": {
      "get": {
        "summary": "List Shipments",
        "operationId": "listShipments",
        "description": "Return a list of shipments across your sub-merchants.",
        "parameters": [
          {
            "name": "merchant_invoice_id",
            "schema": {
              "type": "string"
            },
            "in": "query",
            "description": "Filter shipments by specific merchant invoice ID.",
            "example": "inv_1234567890abcdef"
          },
          {
            "name": "fulfillment_method",
            "schema": {
              "type": "string",
              "enum": [
                "shipping_provider",
                "self_delivery",
                "customer_pickup",
                "services_only"
              ]
            },
            "in": "query",
            "description": "Filter shipments by fulfillment method.",
            "example": "shipping_provider"
          },
          {
            "name": "verification_status",
            "schema": {
              "type": "string",
              "enum": [
                "verified",
                "pending"
              ]
            },
            "in": "query",
            "description": "Filter shipments by verification status.",
            "example": "verified"
          },
          {
            "name": "shipment_courier",
            "schema": {
              "type": "string"
            },
            "in": "query",
            "description": "Filter shipments by shipping courier.",
            "example": "ups"
          },
          {
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            },
            "in": "query",
            "description": "Number of results to return per page (1-100).",
            "example": 25
          },
          {
            "name": "starting_after",
            "schema": {
              "type": "string"
            },
            "in": "query",
            "description": "Pagination cursor for fetching results after a specific shipment ID.",
            "example": "ship_1234567890abcdef"
          },
          {
            "name": "ending_before",
            "schema": {
              "type": "string"
            },
            "in": "query",
            "description": "Pagination cursor for fetching results before a specific shipment ID.",
            "example": "ship_9876543210fedcba"
          },
          {
            "name": "search",
            "schema": {
              "type": "string"
            },
            "in": "query",
            "description": "Search term to filter shipments across multiple fields.",
            "example": "1Z123E45678901234"
          },
          {
            "name": "searchBy",
            "schema": {
              "type": "string",
              "enum": [
                "tracking_number",
                "courier",
                "id",
                "merchant_invoice_id"
              ]
            },
            "in": "query",
            "description": "Specific field to search within.",
            "example": "tracking_number"
          },
          {
            "name": "sort",
            "schema": {
              "type": "string"
            },
            "in": "query",
            "description": "Sort records by the specified fields.\n\nThe sort order for each sort field is ascending unless it is prefixed with a minus,\nin which case it is descending.\n\nMultiple sort fields supported by allowing comma-separated sort fields. Sort fields will be applied in the order specified.\n\nSorting is allowed by the following fields: `id`, `created_at`.\n\nExample: `sort=id,-created_at`\n"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ShipmentListResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Shipments"
        ]
      },
      "post": {
        "summary": "Create a Shipment",
        "operationId": "createShipment",
        "description": "Create a shipment for an invoice belonging to one of your sub-merchants.",
        "requestBody": {
          "$ref": "#/components/requestBodies/CreateShipmentRequest"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/ShipmentResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Shipments"
        ]
      }
    },
    "/shipments/{shipment_id}": {
      "get": {
        "summary": "Get a Shipment",
        "operationId": "getShipment",
        "description": "Retrieve an existing shipment by its ID.",
        "parameters": [
          {
            "name": "shipment_id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "ID of the Shipment",
            "example": "ship_1234567890abcdef"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ShipmentResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Shipments"
        ]
      },
      "put": {
        "summary": "Update a Shipment",
        "operationId": "updateShipment",
        "description": "Update an existing shipment belonging to one of your sub-merchants.",
        "parameters": [
          {
            "name": "shipment_id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "ID of the Shipment to update",
            "example": "ship_1234567890abcdef"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/UpdateShipmentRequest"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/ShipmentResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Shipments"
        ]
      },
      "delete": {
        "summary": "Delete a Shipment",
        "operationId": "deleteShipment",
        "description": "Delete a shipment belonging to one of your sub-merchants.",
        "parameters": [
          {
            "name": "shipment_id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "ID of the Shipment to delete",
            "example": "ship_1234567890abcdef"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ShipmentResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Shipments"
        ]
      }
    },
    "/shipments/{shipment_id}/sync": {
      "post": {
        "summary": "Sync Shipment Tracking",
        "description": "Synchronizes shipment tracking information by fetching real-time data from the courier using the existing tracking number. This endpoint retrieves the latest tracking updates directly from the shipping provider and performs instant verification of the shipment status, ensuring that the shipment data is current and accurate.",
        "operationId": "syncShipmentTracking",
        "parameters": [
          {
            "name": "shipment_id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "ID of the Shipment to sync tracking for",
            "example": "ship_1234567890abcdef"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ShipmentResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "404": {
            "$ref": "#/components/responses/NotFoundResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Shipments"
        ]
      }
    },
    "/webhooks": {
      "get": {
        "summary": "List webhook endpoints",
        "operationId": "listWebhookEndpoints",
        "description": "Returns a list of all configured webhook endpoints for your account.",
        "parameters": [
          {
            "name": "limit",
            "schema": {
              "type": "integer",
              "default": 25,
              "maximum": 100,
              "minimum": 25
            },
            "in": "query",
            "description": "Limit the number of webhook endpoints returned."
          },
          {
            "name": "page",
            "schema": {
              "type": "string",
              "default": "1"
            },
            "in": "query",
            "description": "Specify the page of webhook endpoints returned."
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/WebhookListResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Webhooks"
        ]
      },
      "post": {
        "summary": "Create or update webhook endpoints",
        "operationId": "upsertWebhookEndpoints",
        "description": "Create a new webhook endpoint or update an existing one. If an endpoint with the same URL already exists, it will be updated with the new event subscriptions.",
        "requestBody": {
          "$ref": "#/components/requestBodies/WebhookUpsertRequestBody"
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/WebhookResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Webhooks"
        ]
      },
      "delete": {
        "summary": "Delete webhook endpoints",
        "operationId": "deleteWebhookEndpoints",
        "description": "Delete a webhook endpoint and all its event subscriptions.",
        "requestBody": {
          "$ref": "#/components/requestBodies/WebhookDeleteRequestBody"
        },
        "responses": {
          "204": {
            "description": "Webhook endpoint successfully deleted."
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequestOrValidationResponse"
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitResponse"
          }
        },
        "tags": [
          "Webhooks"
        ]
      }
    }
  }
}