Whiteflow

v0.3.0
io.github.Vishal4742/whiteflow Checked 3 hours ago Published 24 days ago

USDT payment links, payments and collection summaries on Whitechain testnet.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_business_profile Get business profile

The signed-in business: name, environment (sandbox or testnet), time zone and today's date there, supported price currencies, invoice currency, payment methods and limits, and what this API key may do. Call it first, and resolve relative dates ("next Friday") against its `today`.

search_customers Search customers

Find existing customers by name or email (part of either). Returns stable customer ids with a masked email. Use it before create_customer, and to turn a name into the customer_id an invoice needs.

ParameterTypeDescription
query *stringPart of the customer's name or email, e.g. "Acme".
limitintegerAt most this many, 1 to 20.

create_customer Create customer

Create a customer with only what's needed: a name, and an email if the merchant gives one. Refuses a likely duplicate (same name or email) and lists it instead; pass confirm_new only after the merchant confirms it's a different customer.

ParameterTypeDescription
name *stringThe customer's or company's name, as the merchant said it.
confirm_newbooleantrue only after the merchant confirmed that a listed possible duplicate is a different customer.
create_anotherbooleantrue only when the merchant deliberately wants a second record identical to one just created (e.g. two identical sales). Never to retry an error.
emailstringOptional email, only if the merchant gave it.
idempotency_keystringOptional, advanced: your own key for this exact request. Leave it out normally: a retry of an unresolved request is resumed automatically.

create_invoice_draft Create invoice draft

Save a private invoice DRAFT (not sent, not payable) for an existing customer_id: line items with quantity × unit price, a due date, and only an explicit discount or tax the merchant stated. Invoices are in USDT, the settlement asset: if the merchant priced in another currency, ask for the USDT amounts or offer a payment link; never convert. Never invent a tax rate. Resolve a relative due date ("next Friday") with get_business_profile's today and confirm the resulting date.

ParameterTypeDescription
currency *stringMust be "USDT".
customer_id *stringFrom search_customers or create_customer. Never a name.
due_date *stringYYYY-MM-DD in the business time zone; today or later.
line_items *array
create_anotherbooleantrue only when the merchant deliberately wants a second record identical to one just created (e.g. two identical sales). Never to retry an error.
discountOnly if the merchant asked for one.
idempotency_keystringOptional, advanced: your own key for this exact request. Leave it out normally: a retry of an unresolved request is resumed automatically.
memostringOptional note shown on the invoice.
taxobjectOnly a tax the merchant explicitly named, with its rate. Never infer one.

update_invoice_draft Update invoice draft

Change a DRAFT before publication: customer, line items, due date, discount, tax or memo (give only what changes; `discount: null` / `tax: null` removes one). It creates a new revision, and any pending publication approval for the old one is cancelled. Published invoices can't be edited.

ParameterTypeDescription
invoice *stringThe invoice id (inv_…) or its number (WF-1042).
customer_idstring
discount
due_datestring
idempotency_keystringOptional, advanced: your own key for this exact request. Leave it out normally: a retry of an unresolved request is resumed automatically.
line_itemsarray
memo
tax

finalize_invoice Request invoice publication

Ask to publish a reviewed DRAFT. This doesn't publish by itself: Whiteflow creates an approval request for this exact version (total, currency, customer), and an Owner of the business approves it on the review page; then the invoice gets its number and payment URL. A conversation 'yes' is not that approval. The connector re-checks the totals first and refuses if they don't add up. Nothing is emailed or sent.

ParameterTypeDescription
invoice *stringThe invoice id (inv_…) or its number (WF-1042).
idempotency_keystringOptional, advanced: your own key for this exact request. Leave it out normally: a retry of an unresolved request is resumed automatically.

get_invoice Get invoice

An invoice's status (draft, awaiting approval, open, overdue, paid), totals, amount paid and still due, due date, payment URL, and its verified payments. Paid status comes only from Whiteflow's verified payment records.

ParameterTypeDescription
invoice *stringThe invoice id (inv_…) or its number (WF-1042).

list_invoices List invoices

Invoices newest first, filtered by customer, status (draft, open, paid, overdue) and due-date range, with a cursor for the next page. Amounts stay in each invoice's own currency.

ParameterTypeDescription
cursorstringThe `next_cursor` of the previous page.
customer_idstring
due_fromstringYYYY-MM-DD, inclusive.
due_tostringYYYY-MM-DD, inclusive.
limitinteger
statusstring

prepare_invoice_reminder Prepare invoice reminder

Draft a payment reminder for an open invoice: subject, body, the intended recipient and the payment URL. It does NOT send anything (sent: false); the merchant reviews and sends it.

ParameterTypeDescription
invoice *stringThe invoice id (inv_…) or its number (WF-1042).

list_payments List payments

Verified payments received, newest first: amount in USDT, refunded amount, time, the related invoice or link, and evidence (an explorer link on testnet). A cursor pages through older ones.

ParameterTypeDescription
cursorstringThe `next_cursor` of the previous page.
limitintegerHow many, 1 to 100.

get_collection_summary Collection summary

Money collected in a period (gross, fees, refunds, net and count, per currency) and, where the backend has invoices, what is outstanding and overdue now. Days are the business's own time zone. Give a period, or from and to.

ParameterTypeDescription
fromstringYYYY-MM-DD, inclusive (with to; instead of period).
periodstringthis_week starts on Monday. Default: this_week.
tostringYYYY-MM-DD, inclusive.

get_operation_status Operation status

Writes whose outcome is still unknown or needs reconciliation (after a timeout, a lost reply, or a reply that didn't match the request), or one write by its idempotency_key: what was attempted, when, and what Whiteflow's records say. Pass acknowledge: true only after the merchant has checked the record themselves; it clears the local flag so a new, identical request can be made.

ParameterTypeDescription
acknowledgebooleanWith idempotency_key: the merchant checked this record; stop treating it as unresolved.
idempotency_keystringOne operation; leave out to list every unresolved one.