{
  "info": {
    "_postman_id": "5f0c8a52-3d47-4e0b-9a6c-1b2e7d9f4a10",
    "name": "Vestiarion: Getting Started",
    "description": "From a workspace API key to a first `200`, then a first write.\n\n1. **Set the key.** Import the Vestiarion environment, https://www.vestiarion.xyz/postman/vestiarion.postman_environment.json, choose it at the top right, and paste a workspace API key as the value of `apiKey`, which stays on your machine. Never share it. Start with a read-only key.\n\n2. **Send steps 1 to 3.** They read the workspace's status, its invoices and the agent's decisions with its reasoning.\n\n3. **Steps 4 and 5 add a counterparty and an invoice**, with a read-and-write key. Set `vendorName` and `vendorAddress` in this collection's **Variables** first, to a wallet you control, and never confirm an address you do not own.\n\nEach request has saved examples: its success, and each error it can answer, with the API's own message. No request can approve, reject or pay: no API call can.\n\nEvery other operation is in the \"Vestiarion API reference\" collection. Guide: https://www.vestiarion.xyz/docs/get-started/postman",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{apiKey}}",
        "type": "string"
      }
    ]
  },
  "event": [
    {
      "listen": "prerequest",
      "script": {
        "type": "text/javascript",
        "exec": [
          "if (!pm.variables.get(\"apiKey\")) {",
          "  throw new Error(\"apiKey is empty. Choose the Vestiarion environment, top right, and paste a workspace API key as the value of apiKey. That value stays on this machine: never share it.\");",
          "}"
        ]
      }
    }
  ],
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://www.vestiarion.xyz",
      "type": "string",
      "description": "Where the API is. The Vestiarion environment sets the same value."
    },
    {
      "key": "vendorName",
      "value": "",
      "description": "Set it before step 4: the name of the vendor step 4 adds, whose wallet is vendorAddress.",
      "type": "string"
    },
    {
      "key": "vendorAddress",
      "value": "",
      "description": "Set it before step 4: a wallet you control, which step 4 adds as the vendor's address. Never confirm an address you do not own.",
      "type": "string"
    },
    {
      "key": "counterpartyId",
      "value": "",
      "description": "Set by step 4's post-response script: the counterparty step 5 adds an invoice for.",
      "type": "string"
    },
    {
      "key": "dueDate",
      "value": "",
      "description": "Set by step 5's pre-request script each time it is sent: 14 days from that day, as YYYY-MM-DD.",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "1. Read, with a read-only key",
      "description": "Steps 1 to 3 read. A read-only key is enough, and the safest key to start with.",
      "item": [
        {
          "name": "1. Get the workspace status",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"answers 200 OK\", function () {",
                  "  pm.response.to.have.status(200);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/status",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "status"
              ]
            },
            "description": "The first call to make. A `200` proves the key works, and `provenance.payments` says whether payments on this workspace are live, simulated or unavailable.\n\nWhat this workspace is, and what it can actually do. The first call a client should make: whether payments and yield are live, simulated or unavailable, the workspace clock, running totals, and a description of its configuration. Secrets are never included.\n\n`unavailable` means nothing can pay in this workspace now: its Circle credentials are stored but cannot be read; or it is on Arc mainnet with no Circle account connected yet, or not live yet; or this deployment has Arc mainnet switched off. A cycle refuses to pay then rather than fall back to simulation, so status does not report it as `simulate`. Yield is also `unavailable` on a network with no yield reserve, such as Arc mainnet.\n\n**Key:** any workspace API key; a read-only one is enough.\n\nReference: https://www.vestiarion.xyz/docs/api/get-status"
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/api/v1/status",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "status"
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"data\": {\n    \"businessName\": \"Vestiarion workspace\",\n    \"provenance\": {\n      \"payments\": \"live\",\n      \"yield\": \"simulate\",\n      \"screening\": \"simulate\"\n    },\n    \"clock\": {\n      \"mode\": \"simulate\",\n      \"day\": 25,\n      \"lastCycleAt\": \"2026-09-24T18:33:04.546517+00:00\"\n    },\n    \"totals\": {\n      \"decisionsLogged\": 77,\n      \"totalPaidOut\": 4.815,\n      \"flagged\": 1\n    },\n    \"configuration\": {\n      \"businessName\": \"Vestiarion workspace\",\n      \"chain\": {\n        \"circleConfigured\": true,\n        \"arcRpcConfigured\": false\n      },\n      \"llm\": {\n        \"pinned\": null,\n        \"available\": [\n          \"deepseek\"\n        ]\n      },\n      \"compliance\": {\n        \"mode\": \"bundled\",\n        \"rescreenIntervalHours\": 0\n      },\n      \"followUp\": {\n        \"staleAfterDays\": 3,\n        \"reEscalateAfterDays\": 7\n      },\n      \"ledgerSigningKeyProvided\": false,\n      \"githubTokenProvided\": false,\n      \"clockMode\": \"simulate\"\n    },\n    \"apiVersion\": \"v1\"\n  }\n}"
            },
            {
              "name": "401 unauthorized",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/api/v1/status",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "status"
                  ]
                }
              },
              "status": "Unauthorized",
              "code": 401,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"unauthorized\",\n    \"message\": \"A valid API key is required.\"\n  }\n}"
            },
            {
              "name": "403 forbidden",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/api/v1/status",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "status"
                  ]
                }
              },
              "status": "Forbidden",
              "code": 403,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"forbidden\",\n    \"message\": \"This key cannot do that.\"\n  }\n}"
            },
            {
              "name": "500 internal",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/api/v1/status",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "status"
                  ]
                }
              },
              "status": "Internal Server Error",
              "code": 500,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"internal\",\n    \"message\": \"The request could not be completed.\"\n  }\n}"
            }
          ]
        },
        {
          "name": "2. List invoices",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"answers 200 OK\", function () {",
                  "  pm.response.to.have.status(200);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/invoices?limit=10",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "invoices"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "10",
                  "description": "How many items to return. Defaults to 50; a larger value is capped at 200."
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "The previous response's `page.nextCursor`, passed back unchanged to continue. Opaque: never decode or construct one. A cursor this endpoint could not have issued is refused with `400`.",
                  "disabled": true
                },
                {
                  "key": "direction",
                  "value": "payable",
                  "description": "Only payables, or only receivables. One of: `payable`, `receivable`.",
                  "disabled": true
                },
                {
                  "key": "status",
                  "value": "pending",
                  "description": "Only invoices in this status. One of: `pending`, `matched`, `scheduled`, `paid`, `held`, `flagged`, `awaiting_info`, `received`, `rejected`.",
                  "disabled": true
                },
                {
                  "key": "counterpartyId",
                  "value": "4e363b59-d1ca-4425-924c-5c894bc3373f",
                  "description": "Only invoices from or to this counterparty.",
                  "disabled": true
                }
              ]
            },
            "description": "The ten newest invoices. Each carries the agent's verdict and why, in `agentReasoning`. Send `page.nextCursor` back as `cursor` for the next ten.\n\nThe payable and receivable book, newest first, with the row id breaking equal timestamps. Each invoice carries the agent's reasoning, not only its verdict. Only a transaction reference beginning with `0x` is exposed as `txHash`; a simulated receipt gives `null`.\n\nAn unknown `direction` or `status` is refused with `400` rather than ignored.\n\n**Key:** any workspace API key; a read-only one is enough.\n\nReference: https://www.vestiarion.xyz/docs/api/list-invoices"
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/api/v1/invoices",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "invoices"
                  ],
                  "query": [
                    {
                      "key": "limit",
                      "value": "50",
                      "description": "How many items to return. Defaults to 50; a larger value is capped at 200.",
                      "disabled": true
                    },
                    {
                      "key": "cursor",
                      "value": "",
                      "description": "The previous response's `page.nextCursor`, passed back unchanged to continue. Opaque: never decode or construct one. A cursor this endpoint could not have issued is refused with `400`.",
                      "disabled": true
                    },
                    {
                      "key": "direction",
                      "value": "payable",
                      "description": "Only payables, or only receivables. One of: `payable`, `receivable`.",
                      "disabled": true
                    },
                    {
                      "key": "status",
                      "value": "pending",
                      "description": "Only invoices in this status. One of: `pending`, `matched`, `scheduled`, `paid`, `held`, `flagged`, `awaiting_info`, `received`, `rejected`.",
                      "disabled": true
                    },
                    {
                      "key": "counterpartyId",
                      "value": "4e363b59-d1ca-4425-924c-5c894bc3373f",
                      "description": "Only invoices from or to this counterparty.",
                      "disabled": true
                    }
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"data\": [\n    {\n      \"id\": \"9440f32c-000d-4a63-97f1-4eb6bf78439f\",\n      \"direction\": \"payable\",\n      \"status\": \"paid\",\n      \"amount\": 0.11,\n      \"currency\": \"USDC\",\n      \"memo\": \"Stage-isolation verification\",\n      \"poReference\": \"PO-4001\",\n      \"goodsReceived\": true,\n      \"dueDate\": \"2026-09-28T15:22:48.928+00:00\",\n      \"scheduledFor\": null,\n      \"earlyPayDiscount\": null,\n      \"decidedAt\": \"2026-09-24T15:24:22.75+00:00\",\n      \"settledAt\": \"2026-09-24T15:24:22.75+00:00\",\n      \"escalatedAt\": null,\n      \"agentReasoning\": \"Three-way match is complete: PO-4001 is on file and goodsReceived is true. Counterparty Vercel Inc has riskLevel 'clear' (not high) and the invoice amount 0.11 USDC is below the counterparty payment limit of 2 USDC. Treasury operatingBalance is 22.875 USDC, leaving 22.765 USDC after payment, and no duplicate matches were found (duplicateNote confirms no earlier payable from this counterparty resembles this invoice), so there is no fraud indicator.\",\n      \"txHash\": \"0xda97ba74aca6a45e4759858230e743aac0735252b874fb07c20ec8026d80a7bf\",\n      \"paidAmount\": 0.11,\n      \"counterparty\": {\n        \"id\": \"4e363b59-d1ca-4425-924c-5c894bc3373f\",\n        \"name\": \"Vercel Inc\",\n        \"riskLevel\": \"clear\"\n      },\n      \"createdAt\": \"2026-09-24T15:22:50.176754+00:00\"\n    }\n  ],\n  \"page\": {\n    \"nextCursor\": \"eyJrIjoiMjAyNi0wOS0yNFQxNToyMjo1MC4xNzY3NTQrMDA6MDAiLCJpZCI6Ijk0NDBmMzJjLTAwMGQtNGE2My05N2YxLTRlYjZiZjc4NDM5ZiJ9\",\n    \"hasMore\": true,\n    \"count\": 1\n  }\n}"
            },
            {
              "name": "400 invalid_request",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/api/v1/invoices",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "invoices"
                  ],
                  "query": [
                    {
                      "key": "limit",
                      "value": "50",
                      "description": "How many items to return. Defaults to 50; a larger value is capped at 200.",
                      "disabled": true
                    },
                    {
                      "key": "cursor",
                      "value": "",
                      "description": "The previous response's `page.nextCursor`, passed back unchanged to continue. Opaque: never decode or construct one. A cursor this endpoint could not have issued is refused with `400`.",
                      "disabled": true
                    },
                    {
                      "key": "direction",
                      "value": "payable",
                      "description": "Only payables, or only receivables. One of: `payable`, `receivable`.",
                      "disabled": true
                    },
                    {
                      "key": "status",
                      "value": "pending",
                      "description": "Only invoices in this status. One of: `pending`, `matched`, `scheduled`, `paid`, `held`, `flagged`, `awaiting_info`, `received`, `rejected`.",
                      "disabled": true
                    },
                    {
                      "key": "counterpartyId",
                      "value": "4e363b59-d1ca-4425-924c-5c894bc3373f",
                      "description": "Only invoices from or to this counterparty.",
                      "disabled": true
                    }
                  ]
                }
              },
              "status": "Bad Request",
              "code": 400,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"invalid_request\",\n    \"message\": \"cursor is not a cursor this API issued.\"\n  }\n}"
            },
            {
              "name": "401 unauthorized",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/api/v1/invoices",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "invoices"
                  ],
                  "query": [
                    {
                      "key": "limit",
                      "value": "50",
                      "description": "How many items to return. Defaults to 50; a larger value is capped at 200.",
                      "disabled": true
                    },
                    {
                      "key": "cursor",
                      "value": "",
                      "description": "The previous response's `page.nextCursor`, passed back unchanged to continue. Opaque: never decode or construct one. A cursor this endpoint could not have issued is refused with `400`.",
                      "disabled": true
                    },
                    {
                      "key": "direction",
                      "value": "payable",
                      "description": "Only payables, or only receivables. One of: `payable`, `receivable`.",
                      "disabled": true
                    },
                    {
                      "key": "status",
                      "value": "pending",
                      "description": "Only invoices in this status. One of: `pending`, `matched`, `scheduled`, `paid`, `held`, `flagged`, `awaiting_info`, `received`, `rejected`.",
                      "disabled": true
                    },
                    {
                      "key": "counterpartyId",
                      "value": "4e363b59-d1ca-4425-924c-5c894bc3373f",
                      "description": "Only invoices from or to this counterparty.",
                      "disabled": true
                    }
                  ]
                }
              },
              "status": "Unauthorized",
              "code": 401,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"unauthorized\",\n    \"message\": \"A valid API key is required.\"\n  }\n}"
            },
            {
              "name": "403 forbidden",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/api/v1/invoices",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "invoices"
                  ],
                  "query": [
                    {
                      "key": "limit",
                      "value": "50",
                      "description": "How many items to return. Defaults to 50; a larger value is capped at 200.",
                      "disabled": true
                    },
                    {
                      "key": "cursor",
                      "value": "",
                      "description": "The previous response's `page.nextCursor`, passed back unchanged to continue. Opaque: never decode or construct one. A cursor this endpoint could not have issued is refused with `400`.",
                      "disabled": true
                    },
                    {
                      "key": "direction",
                      "value": "payable",
                      "description": "Only payables, or only receivables. One of: `payable`, `receivable`.",
                      "disabled": true
                    },
                    {
                      "key": "status",
                      "value": "pending",
                      "description": "Only invoices in this status. One of: `pending`, `matched`, `scheduled`, `paid`, `held`, `flagged`, `awaiting_info`, `received`, `rejected`.",
                      "disabled": true
                    },
                    {
                      "key": "counterpartyId",
                      "value": "4e363b59-d1ca-4425-924c-5c894bc3373f",
                      "description": "Only invoices from or to this counterparty.",
                      "disabled": true
                    }
                  ]
                }
              },
              "status": "Forbidden",
              "code": 403,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"forbidden\",\n    \"message\": \"This key cannot do that.\"\n  }\n}"
            },
            {
              "name": "500 internal",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/api/v1/invoices",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "invoices"
                  ],
                  "query": [
                    {
                      "key": "limit",
                      "value": "50",
                      "description": "How many items to return. Defaults to 50; a larger value is capped at 200.",
                      "disabled": true
                    },
                    {
                      "key": "cursor",
                      "value": "",
                      "description": "The previous response's `page.nextCursor`, passed back unchanged to continue. Opaque: never decode or construct one. A cursor this endpoint could not have issued is refused with `400`.",
                      "disabled": true
                    },
                    {
                      "key": "direction",
                      "value": "payable",
                      "description": "Only payables, or only receivables. One of: `payable`, `receivable`.",
                      "disabled": true
                    },
                    {
                      "key": "status",
                      "value": "pending",
                      "description": "Only invoices in this status. One of: `pending`, `matched`, `scheduled`, `paid`, `held`, `flagged`, `awaiting_info`, `received`, `rejected`.",
                      "disabled": true
                    },
                    {
                      "key": "counterpartyId",
                      "value": "4e363b59-d1ca-4425-924c-5c894bc3373f",
                      "description": "Only invoices from or to this counterparty.",
                      "disabled": true
                    }
                  ]
                }
              },
              "status": "Internal Server Error",
              "code": 500,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"internal\",\n    \"message\": \"The request could not be completed.\"\n  }\n}"
            }
          ]
        },
        {
          "name": "3. List the agent's decisions, with its reasoning",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"answers 200 OK\", function () {",
                  "  pm.response.to.have.status(200);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/ledger?limit=200&actor=agent",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "ledger"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "200",
                  "description": "How many items to return. Defaults to 50; a larger value is capped at 200."
                },
                {
                  "key": "cursor",
                  "value": "",
                  "description": "The previous response's `page.nextCursor`, passed back unchanged to continue. Opaque: never decode or construct one. A cursor this endpoint could not have issued is refused with `400`.",
                  "disabled": true
                },
                {
                  "key": "domain",
                  "value": "ap",
                  "description": "Only entries in this domain.",
                  "disabled": true
                },
                {
                  "key": "actor",
                  "value": "agent",
                  "description": "Only entries written by this actor."
                }
              ]
            },
            "description": "The entries the agent signed into the ledger, with what it decided and, where the decision records one, its reasoning, in `detail`. The ledger answers oldest first, and has no newest-first order: it is a stream to resume from. To reach the latest decisions, send `page.nextCursor` back as `cursor`, ticked under **Params**, until `hasMore` is `false`; keep the last cursor, and the next read starts there. Tick `domain` for payables only. For the latest decisions on bills at once, step 2 is newest first, and each invoice carries the agent's reasoning. The saved example is the reference page's: one entry, of any actor.\n\nThe audit chain, oldest first, as a resumable stream. Because the ledger is append-only and ascending by `seq`, a stored `page.nextCursor` is a watermark: a request from it never returns an entry before it. Persist the last non-null `nextCursor` only after processing every entry in the responses read, and resume from it; the last page, which had no cursor of its own, is returned again, so de-duplicate on `seq`.\n\n`seq` is monotonic within a workspace but not gap-free; continuity is proven by the hash chain, not by `seq`.\n\n**Key:** any workspace API key; a read-only one is enough.\n\nReference: https://www.vestiarion.xyz/docs/api/list-ledger-entries"
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/api/v1/ledger",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "ledger"
                  ],
                  "query": [
                    {
                      "key": "limit",
                      "value": "50",
                      "description": "How many items to return. Defaults to 50; a larger value is capped at 200.",
                      "disabled": true
                    },
                    {
                      "key": "cursor",
                      "value": "",
                      "description": "The previous response's `page.nextCursor`, passed back unchanged to continue. Opaque: never decode or construct one. A cursor this endpoint could not have issued is refused with `400`.",
                      "disabled": true
                    },
                    {
                      "key": "domain",
                      "value": "system",
                      "description": "Only entries in this domain.",
                      "disabled": true
                    },
                    {
                      "key": "actor",
                      "value": "system",
                      "description": "Only entries written by this actor.",
                      "disabled": true
                    }
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"data\": [\n    {\n      \"seq\": 82,\n      \"id\": \"4566714f-a9f0-42c8-bcd4-d89adf830806\",\n      \"ts\": \"2026-09-24T11:55:00.370366+00:00\",\n      \"actor\": \"system\",\n      \"domain\": \"system\",\n      \"action\": \"seed\",\n      \"summary\": \"Seeded demo business: Northstar Studio\",\n      \"detail\": {\n        \"accounts\": 3,\n        \"invoices\": 6,\n        \"milestones\": 3,\n        \"amountScale\": 0.001,\n        \"counterparties\": 7\n      },\n      \"bodyHash\": \"8780d07cb3d083d359119e58fd4783f5e4b32aac14e0a8d9f7a5bb13365a4537\",\n      \"signature\": \"c14f06b751d31be6566ed11676d60d2db731ab8bbc5972f79d0a0c131e9e37200303d5b3ad04993b7973b1ce7200e7214e5a9b511306fa30538f072eb0d34705\",\n      \"prevHash\": \"0000000000000000000000000000000000000000000000000000000000000000\",\n      \"hash\": \"b0ac72908868ddd5ed4722fd8a14ff4a844eee4dad382c5c85288bca73737669\",\n      \"signingKeyId\": null\n    }\n  ],\n  \"page\": {\n    \"nextCursor\": \"eyJrIjo4Mn0\",\n    \"hasMore\": true,\n    \"count\": 1\n  }\n}"
            },
            {
              "name": "400 invalid_request",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/api/v1/ledger",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "ledger"
                  ],
                  "query": [
                    {
                      "key": "limit",
                      "value": "50",
                      "description": "How many items to return. Defaults to 50; a larger value is capped at 200.",
                      "disabled": true
                    },
                    {
                      "key": "cursor",
                      "value": "",
                      "description": "The previous response's `page.nextCursor`, passed back unchanged to continue. Opaque: never decode or construct one. A cursor this endpoint could not have issued is refused with `400`.",
                      "disabled": true
                    },
                    {
                      "key": "domain",
                      "value": "system",
                      "description": "Only entries in this domain.",
                      "disabled": true
                    },
                    {
                      "key": "actor",
                      "value": "system",
                      "description": "Only entries written by this actor.",
                      "disabled": true
                    }
                  ]
                }
              },
              "status": "Bad Request",
              "code": 400,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"invalid_request\",\n    \"message\": \"cursor is not a cursor this API issued.\"\n  }\n}"
            },
            {
              "name": "401 unauthorized",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/api/v1/ledger",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "ledger"
                  ],
                  "query": [
                    {
                      "key": "limit",
                      "value": "50",
                      "description": "How many items to return. Defaults to 50; a larger value is capped at 200.",
                      "disabled": true
                    },
                    {
                      "key": "cursor",
                      "value": "",
                      "description": "The previous response's `page.nextCursor`, passed back unchanged to continue. Opaque: never decode or construct one. A cursor this endpoint could not have issued is refused with `400`.",
                      "disabled": true
                    },
                    {
                      "key": "domain",
                      "value": "system",
                      "description": "Only entries in this domain.",
                      "disabled": true
                    },
                    {
                      "key": "actor",
                      "value": "system",
                      "description": "Only entries written by this actor.",
                      "disabled": true
                    }
                  ]
                }
              },
              "status": "Unauthorized",
              "code": 401,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"unauthorized\",\n    \"message\": \"A valid API key is required.\"\n  }\n}"
            },
            {
              "name": "403 forbidden",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/api/v1/ledger",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "ledger"
                  ],
                  "query": [
                    {
                      "key": "limit",
                      "value": "50",
                      "description": "How many items to return. Defaults to 50; a larger value is capped at 200.",
                      "disabled": true
                    },
                    {
                      "key": "cursor",
                      "value": "",
                      "description": "The previous response's `page.nextCursor`, passed back unchanged to continue. Opaque: never decode or construct one. A cursor this endpoint could not have issued is refused with `400`.",
                      "disabled": true
                    },
                    {
                      "key": "domain",
                      "value": "system",
                      "description": "Only entries in this domain.",
                      "disabled": true
                    },
                    {
                      "key": "actor",
                      "value": "system",
                      "description": "Only entries written by this actor.",
                      "disabled": true
                    }
                  ]
                }
              },
              "status": "Forbidden",
              "code": 403,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"forbidden\",\n    \"message\": \"This key cannot do that.\"\n  }\n}"
            },
            {
              "name": "500 internal",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/api/v1/ledger",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "ledger"
                  ],
                  "query": [
                    {
                      "key": "limit",
                      "value": "50",
                      "description": "How many items to return. Defaults to 50; a larger value is capped at 200.",
                      "disabled": true
                    },
                    {
                      "key": "cursor",
                      "value": "",
                      "description": "The previous response's `page.nextCursor`, passed back unchanged to continue. Opaque: never decode or construct one. A cursor this endpoint could not have issued is refused with `400`.",
                      "disabled": true
                    },
                    {
                      "key": "domain",
                      "value": "system",
                      "description": "Only entries in this domain.",
                      "disabled": true
                    },
                    {
                      "key": "actor",
                      "value": "system",
                      "description": "Only entries written by this actor.",
                      "disabled": true
                    }
                  ]
                }
              },
              "status": "Internal Server Error",
              "code": 500,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"internal\",\n    \"message\": \"The request could not be completed.\"\n  }\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "2. Add records, with a read-and-write key",
      "description": "Steps 4 and 5 add records, and need a key created with **Can also add records** ticked: switch `apiKey` to one. A read-only key gets `403 forbidden`, as the saved examples show.\n\n**First set `vendorName` and `vendorAddress`**, in this collection's **Variables**, to a wallet you control. Step 4 adds a counterparty at that address, and neither step sends until both are set. The address waits for a person in the workspace to confirm it, and the agent pays nothing to it until then. Never confirm an address you do not own: once confirmed, it may be paid, in real USDC on a workspace on Arc mainnet.\n\nAdding is all a key does. The agent decides the invoice as one typed into the console, under every guardrail. The `Idempotency-Key` header makes each step safe to send twice: a repeat within 24 hours gets the first answer back and adds nothing.",
      "item": [
        {
          "name": "4. Add a counterparty",
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get(\"vendorAddress\")) {",
                  "  throw new Error(\"Set vendorAddress to a wallet you control, in this collection's Variables. Never confirm an address you do not own.\");",
                  "}",
                  "if (!pm.variables.get(\"vendorName\")) {",
                  "  throw new Error(\"Set vendorName, in this collection's Variables, to the name of the vendor at vendorAddress.\");",
                  "}"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"answers 201 Created\", function () {",
                  "  pm.response.to.have.status(201);",
                  "});",
                  "if (pm.response.code === 201) {",
                  "  pm.collectionVariables.set(\"counterpartyId\", pm.response.json().data.id);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "postman-getting-started-counterparty-{{vendorAddress}}",
                "description": "Makes a retry safe: up to 255 printable ASCII characters, unique to the record being added, such as its id in your own system. A repeat with the same key and the same body within 24 hours gets the first answer back, with `Idempotent-Replayed: true`, and adds nothing. The same key with a different body answers `409`."
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"{{vendorName}}\",\n  \"role\": \"vendor\",\n  \"address\": \"{{vendorAddress}}\",\n  \"paymentLimit\": \"1\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/counterparties",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "counterparties"
              ]
            },
            "description": "Adds a vendor, screened as one added in the console, at `{{vendorAddress}}`. **Use a wallet you control:** set `vendorName` and `vendorAddress` in the collection's **Variables** before sending. The address waits for a person in the workspace to confirm it; do not confirm an address you do not own. The post-response script keeps the counterparty's `id` as `{{counterpartyId}}` for step 5.\n\nAdds a vendor, contractor or client, checked by the rules of the console's form and screened as one added there: the answer's `riskLevel` is the screening's verdict, or `unscreened` when screening could not finish. It is recorded in the ledger as `create_counterparty` with `via: \"api\"` and the key's id.\n\nAn address added through the API waits for a person. The agent pays nothing to it until an owner, admin or approver confirms it on Counterparties, so a key can add records but cannot point the agent's payments at a new address.\n\n**Key:** a read-and-write key. A read-only key gets `403 forbidden`.\n\nReference: https://www.vestiarion.xyz/docs/api/create-counterparty"
          },
          "response": [
            {
              "name": "201 Created",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "crm-vendor-1042",
                    "description": "Makes a retry safe: up to 255 printable ASCII characters, unique to the record being added, such as its id in your own system. A repeat with the same key and the same body within 24 hours gets the first answer back, with `Idempotent-Replayed: true`, and adds nothing. The same key with a different body answers `409`."
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"name\": \"API Test Vendor\",\n  \"role\": \"vendor\",\n  \"address\": \"0x6b3A4C65f362b818bb7FD6f999477A03CE07e51a\",\n  \"paymentLimit\": \"1\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{baseUrl}}/api/v1/counterparties",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "counterparties"
                  ]
                }
              },
              "status": "Created",
              "code": 201,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"data\": {\n    \"id\": \"6b361405-cfda-4400-a286-364b561911ce\",\n    \"name\": \"API Test Vendor\",\n    \"role\": \"vendor\",\n    \"address\": \"0x6b3A4C65f362b818bb7FD6f999477A03CE07e51a\",\n    \"chain\": \"ARC-TESTNET\",\n    \"jurisdiction\": null,\n    \"riskLevel\": \"clear\",\n    \"riskNotes\": \"OpenSanctions returned no matching entity\",\n    \"baselinePaymentLimit\": 1,\n    \"paymentLimit\": 1,\n    \"lastScreenedAt\": \"2026-10-03T10:15:29.759+00:00\",\n    \"performanceScore\": null,\n    \"performanceInputs\": null,\n    \"createdAt\": \"2026-10-03T10:15:26.865688+00:00\"\n  }\n}"
            },
            {
              "name": "400 invalid_request",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "crm-vendor-1042",
                    "description": "Makes a retry safe: up to 255 printable ASCII characters, unique to the record being added, such as its id in your own system. A repeat with the same key and the same body within 24 hours gets the first answer back, with `Idempotent-Replayed: true`, and adds nothing. The same key with a different body answers `409`."
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"name\": \"API Test Vendor\",\n  \"role\": \"vendor\",\n  \"address\": \"0x6b3A4C65f362b818bb7FD6f999477A03CE07e51a\",\n  \"paymentLimit\": \"1\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{baseUrl}}/api/v1/counterparties",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "counterparties"
                  ]
                }
              },
              "status": "Bad Request",
              "code": 400,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"invalid_request\",\n    \"message\": \"The body must be JSON.\"\n  }\n}"
            },
            {
              "name": "401 unauthorized",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "crm-vendor-1042",
                    "description": "Makes a retry safe: up to 255 printable ASCII characters, unique to the record being added, such as its id in your own system. A repeat with the same key and the same body within 24 hours gets the first answer back, with `Idempotent-Replayed: true`, and adds nothing. The same key with a different body answers `409`."
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"name\": \"API Test Vendor\",\n  \"role\": \"vendor\",\n  \"address\": \"0x6b3A4C65f362b818bb7FD6f999477A03CE07e51a\",\n  \"paymentLimit\": \"1\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{baseUrl}}/api/v1/counterparties",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "counterparties"
                  ]
                }
              },
              "status": "Unauthorized",
              "code": 401,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"unauthorized\",\n    \"message\": \"A valid API key is required.\"\n  }\n}"
            },
            {
              "name": "403 forbidden",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "crm-vendor-1042",
                    "description": "Makes a retry safe: up to 255 printable ASCII characters, unique to the record being added, such as its id in your own system. A repeat with the same key and the same body within 24 hours gets the first answer back, with `Idempotent-Replayed: true`, and adds nothing. The same key with a different body answers `409`."
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"name\": \"API Test Vendor\",\n  \"role\": \"vendor\",\n  \"address\": \"0x6b3A4C65f362b818bb7FD6f999477A03CE07e51a\",\n  \"paymentLimit\": \"1\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{baseUrl}}/api/v1/counterparties",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "counterparties"
                  ]
                }
              },
              "status": "Forbidden",
              "code": 403,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"forbidden\",\n    \"message\": \"This key cannot do that.\"\n  }\n}"
            },
            {
              "name": "409 conflict",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "crm-vendor-1042",
                    "description": "Makes a retry safe: up to 255 printable ASCII characters, unique to the record being added, such as its id in your own system. A repeat with the same key and the same body within 24 hours gets the first answer back, with `Idempotent-Replayed: true`, and adds nothing. The same key with a different body answers `409`."
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"name\": \"API Test Vendor\",\n  \"role\": \"vendor\",\n  \"address\": \"0x6b3A4C65f362b818bb7FD6f999477A03CE07e51a\",\n  \"paymentLimit\": \"1\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{baseUrl}}/api/v1/counterparties",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "counterparties"
                  ]
                }
              },
              "status": "Conflict",
              "code": 409,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"conflict\",\n    \"message\": \"This Idempotency-Key was already used for a different request. Use a new key for a new request.\"\n  }\n}"
            },
            {
              "name": "429 rate_limited",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "crm-vendor-1042",
                    "description": "Makes a retry safe: up to 255 printable ASCII characters, unique to the record being added, such as its id in your own system. A repeat with the same key and the same body within 24 hours gets the first answer back, with `Idempotent-Replayed: true`, and adds nothing. The same key with a different body answers `409`."
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"name\": \"API Test Vendor\",\n  \"role\": \"vendor\",\n  \"address\": \"0x6b3A4C65f362b818bb7FD6f999477A03CE07e51a\",\n  \"paymentLimit\": \"1\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{baseUrl}}/api/v1/counterparties",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "counterparties"
                  ]
                }
              },
              "status": "Too Many Requests",
              "code": 429,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                },
                {
                  "key": "Retry-After",
                  "value": "60"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"rate_limited\",\n    \"message\": \"Too many writes from this key. Try again in a minute.\"\n  }\n}"
            },
            {
              "name": "500 internal",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "crm-vendor-1042",
                    "description": "Makes a retry safe: up to 255 printable ASCII characters, unique to the record being added, such as its id in your own system. A repeat with the same key and the same body within 24 hours gets the first answer back, with `Idempotent-Replayed: true`, and adds nothing. The same key with a different body answers `409`."
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"name\": \"API Test Vendor\",\n  \"role\": \"vendor\",\n  \"address\": \"0x6b3A4C65f362b818bb7FD6f999477A03CE07e51a\",\n  \"paymentLimit\": \"1\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{baseUrl}}/api/v1/counterparties",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "counterparties"
                  ]
                }
              },
              "status": "Internal Server Error",
              "code": 500,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"internal\",\n    \"message\": \"The request could not be completed.\"\n  }\n}"
            }
          ]
        },
        {
          "name": "5. Add an invoice for it",
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get(\"vendorAddress\")) {",
                  "  throw new Error(\"Set vendorAddress to a wallet you control, in this collection's Variables. Never confirm an address you do not own.\");",
                  "}",
                  "if (!pm.variables.get(\"vendorName\")) {",
                  "  throw new Error(\"Set vendorName, in this collection's Variables, to the name of the vendor at vendorAddress.\");",
                  "}",
                  "if (!pm.collectionVariables.get(\"counterpartyId\")) {",
                  "  throw new Error(\"Send step 4 first: it keeps the new counterparty's id for this step.\");",
                  "}",
                  "// Due 14 days from the day this is sent, as YYYY-MM-DD.",
                  "pm.collectionVariables.set(\"dueDate\", new Date(Date.now() + 14 * 24 * 60 * 60 * 1000).toISOString().slice(0, 10));"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "pm.test(\"answers 201 Created\", function () {",
                  "  pm.response.to.have.status(201);",
                  "});"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "postman-getting-started-invoice-{{counterpartyId}}-{{dueDate}}",
                "description": "Makes a retry safe: up to 255 printable ASCII characters, unique to the record being added, such as its id in your own system. A repeat with the same key and the same body within 24 hours gets the first answer back, with `Idempotent-Replayed: true`, and adds nothing. The same key with a different body answers `409`."
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"counterpartyId\": \"{{counterpartyId}}\",\n  \"amount\": \"0.10\",\n  \"dueDate\": \"{{dueDate}}\",\n  \"poReference\": \"PO-API-1\",\n  \"goodsReceived\": true\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/invoices",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "invoices"
              ]
            },
            "description": "Adds a payable from the counterparty step 4 added, due 14 days from the day it is sent. Follow the agent's decision on it with step 2, or in the console.\n\nAdds a payable or a receivable, checked by the rules of the console's invoice form, and recorded in the ledger as `create_invoice` with `via: \"api\"` and the key's id. It is added as the key's issuer's: if the agent holds it, the issuer cannot approve it, unless they are the workspace's only approver.\n\nThe agent decides a payable as one typed in, with every guardrail and the workspace's limits, usually within a minute. The API never approves or pays. A `counterpartyId` the workspace does not hold, including another workspace's, answers `400`.\n\n**Key:** a read-and-write key. A read-only key gets `403 forbidden`.\n\nReference: https://www.vestiarion.xyz/docs/api/create-invoice"
          },
          "response": [
            {
              "name": "201 Created",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "billing-inv-2026-0042",
                    "description": "Makes a retry safe: up to 255 printable ASCII characters, unique to the record being added, such as its id in your own system. A repeat with the same key and the same body within 24 hours gets the first answer back, with `Idempotent-Replayed: true`, and adds nothing. The same key with a different body answers `409`."
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"counterpartyId\": \"6b361405-cfda-4400-a286-364b561911ce\",\n  \"amount\": \"0.10\",\n  \"dueDate\": \"2026-10-03\",\n  \"poReference\": \"PO-API-1\",\n  \"goodsReceived\": true\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{baseUrl}}/api/v1/invoices",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "invoices"
                  ]
                }
              },
              "status": "Created",
              "code": 201,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"data\": {\n    \"id\": \"1f96fd0b-71de-41bf-b088-779655ea6df4\",\n    \"direction\": \"payable\",\n    \"status\": \"pending\",\n    \"amount\": 0.1,\n    \"currency\": \"USDC\",\n    \"memo\": null,\n    \"poReference\": \"PO-API-1\",\n    \"goodsReceived\": true,\n    \"dueDate\": \"2026-10-03T12:00:00+00:00\",\n    \"scheduledFor\": null,\n    \"earlyPayDiscount\": null,\n    \"decidedAt\": null,\n    \"settledAt\": null,\n    \"escalatedAt\": null,\n    \"agentReasoning\": null,\n    \"txHash\": null,\n    \"paidAmount\": null,\n    \"counterparty\": {\n      \"id\": \"6b361405-cfda-4400-a286-364b561911ce\",\n      \"name\": \"API Test Vendor\",\n      \"riskLevel\": \"clear\"\n    },\n    \"createdAt\": \"2026-10-03T10:16:16.374931+00:00\"\n  }\n}"
            },
            {
              "name": "400 invalid_request",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "billing-inv-2026-0042",
                    "description": "Makes a retry safe: up to 255 printable ASCII characters, unique to the record being added, such as its id in your own system. A repeat with the same key and the same body within 24 hours gets the first answer back, with `Idempotent-Replayed: true`, and adds nothing. The same key with a different body answers `409`."
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"counterpartyId\": \"6b361405-cfda-4400-a286-364b561911ce\",\n  \"amount\": \"0.10\",\n  \"dueDate\": \"2026-10-03\",\n  \"poReference\": \"PO-API-1\",\n  \"goodsReceived\": true\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{baseUrl}}/api/v1/invoices",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "invoices"
                  ]
                }
              },
              "status": "Bad Request",
              "code": 400,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"invalid_request\",\n    \"message\": \"The body must be JSON.\"\n  }\n}"
            },
            {
              "name": "401 unauthorized",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "billing-inv-2026-0042",
                    "description": "Makes a retry safe: up to 255 printable ASCII characters, unique to the record being added, such as its id in your own system. A repeat with the same key and the same body within 24 hours gets the first answer back, with `Idempotent-Replayed: true`, and adds nothing. The same key with a different body answers `409`."
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"counterpartyId\": \"6b361405-cfda-4400-a286-364b561911ce\",\n  \"amount\": \"0.10\",\n  \"dueDate\": \"2026-10-03\",\n  \"poReference\": \"PO-API-1\",\n  \"goodsReceived\": true\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{baseUrl}}/api/v1/invoices",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "invoices"
                  ]
                }
              },
              "status": "Unauthorized",
              "code": 401,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"unauthorized\",\n    \"message\": \"A valid API key is required.\"\n  }\n}"
            },
            {
              "name": "403 forbidden",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "billing-inv-2026-0042",
                    "description": "Makes a retry safe: up to 255 printable ASCII characters, unique to the record being added, such as its id in your own system. A repeat with the same key and the same body within 24 hours gets the first answer back, with `Idempotent-Replayed: true`, and adds nothing. The same key with a different body answers `409`."
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"counterpartyId\": \"6b361405-cfda-4400-a286-364b561911ce\",\n  \"amount\": \"0.10\",\n  \"dueDate\": \"2026-10-03\",\n  \"poReference\": \"PO-API-1\",\n  \"goodsReceived\": true\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{baseUrl}}/api/v1/invoices",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "invoices"
                  ]
                }
              },
              "status": "Forbidden",
              "code": 403,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"forbidden\",\n    \"message\": \"This key cannot do that.\"\n  }\n}"
            },
            {
              "name": "409 conflict",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "billing-inv-2026-0042",
                    "description": "Makes a retry safe: up to 255 printable ASCII characters, unique to the record being added, such as its id in your own system. A repeat with the same key and the same body within 24 hours gets the first answer back, with `Idempotent-Replayed: true`, and adds nothing. The same key with a different body answers `409`."
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"counterpartyId\": \"6b361405-cfda-4400-a286-364b561911ce\",\n  \"amount\": \"0.10\",\n  \"dueDate\": \"2026-10-03\",\n  \"poReference\": \"PO-API-1\",\n  \"goodsReceived\": true\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{baseUrl}}/api/v1/invoices",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "invoices"
                  ]
                }
              },
              "status": "Conflict",
              "code": 409,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"conflict\",\n    \"message\": \"This Idempotency-Key was already used for a different request. Use a new key for a new request.\"\n  }\n}"
            },
            {
              "name": "429 rate_limited",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "billing-inv-2026-0042",
                    "description": "Makes a retry safe: up to 255 printable ASCII characters, unique to the record being added, such as its id in your own system. A repeat with the same key and the same body within 24 hours gets the first answer back, with `Idempotent-Replayed: true`, and adds nothing. The same key with a different body answers `409`."
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"counterpartyId\": \"6b361405-cfda-4400-a286-364b561911ce\",\n  \"amount\": \"0.10\",\n  \"dueDate\": \"2026-10-03\",\n  \"poReference\": \"PO-API-1\",\n  \"goodsReceived\": true\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{baseUrl}}/api/v1/invoices",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "invoices"
                  ]
                }
              },
              "status": "Too Many Requests",
              "code": 429,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                },
                {
                  "key": "Retry-After",
                  "value": "60"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"rate_limited\",\n    \"message\": \"Too many writes from this key. Try again in a minute.\"\n  }\n}"
            },
            {
              "name": "500 internal",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "billing-inv-2026-0042",
                    "description": "Makes a retry safe: up to 255 printable ASCII characters, unique to the record being added, such as its id in your own system. A repeat with the same key and the same body within 24 hours gets the first answer back, with `Idempotent-Replayed: true`, and adds nothing. The same key with a different body answers `409`."
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"counterpartyId\": \"6b361405-cfda-4400-a286-364b561911ce\",\n  \"amount\": \"0.10\",\n  \"dueDate\": \"2026-10-03\",\n  \"poReference\": \"PO-API-1\",\n  \"goodsReceived\": true\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{baseUrl}}/api/v1/invoices",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "api",
                    "v1",
                    "invoices"
                  ]
                }
              },
              "status": "Internal Server Error",
              "code": 500,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "cookie": [],
              "body": "{\n  \"error\": {\n    \"code\": \"internal\",\n    \"message\": \"The request could not be completed.\"\n  }\n}"
            }
          ]
        }
      ]
    }
  ]
}
