Payables and receivables

Add an invoice

Adds 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.

The 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.

post/api/v1/invoices

Request

  • Base URL: https://www.vestiarion.xyz
  • URL: https://www.vestiarion.xyz/api/v1/invoices
  • Auth: HTTP bearer

Headers

Idempotency-Keystring

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.

Request body

direction'payable' | 'receivable'

payable, a bill the business pays, which is the default, or receivable, one it is owed.

counterpartyIdstring required

The counterparty's id, from GET /api/v1/counterparties or from the answer that added it.

currency'USDC' | 'EURC'

USDC, the default, or EURC.

dueDatestring required

The day it is due, as YYYY-MM-DD.

memostring

What it is for, up to 280 characters.

poReferencestring

The purchase order it bills against, up to 100 characters.

goodsReceivedboolean

Whether what it bills for has arrived. Defaults to false. Without it, or without poReference, the agent asks for the missing detail instead of paying.

Response

Created

Changes

No recorded changes to this operation across all 1 revision of this API.