Skip to content

graft orders

Orders, their lifecycle, payments and payment links.

Command Does
graft orders create Create an order.
graft orders delete Delete an order that is still active and release what it reserved.
graft orders get One order with its lines, totals and payments.
graft orders ledger get The order, every invoice against it, and what is still outstanding.
graft orders list List orders.
graft orders payment-link send Email the payment link to the order’s customer from Graft.
graft orders payment-link-delete Remove the order’s payment link.
graft orders payment-link-set Attach a Stripe Payment Link (https://buy.stripe.com/…) or hosted invoice (https://invoice.stripe.com/…).
graft orders payments Record money received by hand (cash, bank transfer).
graft orders transitions Move the order through its lifecycle.
graft orders update Change the line items, deposit, notes or customer of an order that is still active.

Create an order. Send line items with kind (resource, addon, fee, discount), quantity and unitAmountMinor; the server computes every amount. Money is integer minor units (cents) plus a currency code. A discount line is negative, every other kind is not.

Endpoint: POST /api/v1/orders

Terminal window
graft orders create -d '{"currency":"EUR","customerRecordId":"000000000000000000000020","lineItems":[{"kind":"resource","description":"24ft pontoon, 4 hours","quantity":1,"unitAmountMinor":60000}],"deposit":null}'

Delete an order that is still active and release what it reserved.

Endpoint: DELETE /api/v1/orders/:orderId · Arguments: <orderId>

Terminal window
graft orders delete <orderId>

Asks for confirmation; pass --yes to skip it (required in scripts).

One order with its lines, totals and payments.

Endpoint: GET /api/v1/orders/:orderId · Arguments: <orderId>

Terminal window
graft orders get <orderId>

The order, every invoice against it, and what is still outstanding.

Endpoint: GET /api/v1/orders/:orderId/ledger · Arguments: <orderId>

Terminal window
graft orders ledger get <orderId>

List orders. Cursor-paginated: pass limit (default 25, max 100) and cursor from the previous response’s meta.cursor. Filter with status, customerRecordId, from and to.

Endpoint: GET /api/v1/orders

Terminal window
graft orders list

Add --all to fetch every page.

Email the payment link to the order’s customer from Graft. Replies go to the sender. No body.

Endpoint: POST /api/v1/orders/:orderId/payment-link/send · Arguments: <orderId>

Terminal window
graft orders payment-link send <orderId>
Section titled “graft orders payment-link-delete <orderId>”

Remove the order’s payment link.

Endpoint: DELETE /api/v1/orders/:orderId/payment-link · Arguments: <orderId>

Terminal window
graft orders payment-link-delete <orderId>

Asks for confirmation; pass --yes to skip it (required in scripts).

Attach a Stripe Payment Link (https://buy.stripe.com/…) or hosted invoice (https://invoice.stripe.com/…). Any other host is refused.

Endpoint: PUT /api/v1/orders/:orderId/payment-link · Arguments: <orderId>

Terminal window
graft orders payment-link-set <orderId> -d '{"url":"https://buy.stripe.com/test_abc123"}'

Record money received by hand (cash, bank transfer).

Endpoint: POST /api/v1/orders/:orderId/payments · Arguments: <orderId>

Terminal window
graft orders payments <orderId> -d '{"amountMinor":15000,"reference":"Bank transfer 4421"}'

Move the order through its lifecycle. Allowed: draft to pending_payment, confirmed or cancelled; pending_payment to confirmed or cancelled; confirmed to in_progress, completed or cancelled; in_progress to completed or cancelled. completed and cancelled are final. Anything else is 409 CONFLICT.

Endpoint: POST /api/v1/orders/:orderId/transitions · Arguments: <orderId>

Terminal window
graft orders transitions <orderId> -d '{"status":"confirmed"}'

Change the line items, deposit, notes or customer of an order that is still active.

Endpoint: PATCH /api/v1/orders/:orderId · Arguments: <orderId>

Terminal window
graft orders update <orderId>