Create an invoice
Raises an invoice: an order for a buyer to pay, with a page to pay it on. This is how a script makes an order. The answer has the order’s ID (orderId) and the page it is paid on (payUrl), which you can hand to the buyer yourself.
With send on, the invoice is also emailed to the buyer with its PDF. A store may email one invoice in five minutes, so a script that makes many leaves send off and delivers the link itself.
A product line costs what the product costs. For any other price, add a line of your own with a description and a unitPrice. An invoice carries no automatic tax. A store may hold up to 2,000 unpaid invoices at once.
Needs the invoices.write permission (Raise Invoices). It makes an order, and is counted against a budget of its own: 60 a minute for each key.
Authorizations
A secret API key, made under Developers in the dashboard: Authorization: Bearer shoply_sk_...
Headers
A word of your own for this one change, up to 180 letters, digits, dots, dashes, underscores and colons. Sent again with the same key, the request is not carried out twice: the first answer comes back, with Idempotent-Replay: true.
Path Parameters
The store's ID. A key reaches the store it was made in: GET /key answers which.
Body
The buyer's email address.
"buyer@example.com"
The payment methods the buyer may pay with, by their names in the payment methods list. At least one the store has switched on.
What is being charged for, up to 50 lines. Each is a product from the catalogue (productId, variantId, quantity) or a line of your own (description, quantity, unitPrice).
The buyer's name, up to 120 characters. Printed on the invoice.
A note printed on the invoice, up to 1,000 characters.
How many days the buyer has to pay: 1 to 30.
Whether to email the invoice to the buyer now.
Response
It worked.
Whether the request did what was asked.
Words for a person. Empty when it worked.
Why it was refused, as a word that does not change. Empty when it worked.
The thing asked for: an object, or for a list its rows.
For a paged list: how many pages there are.
For a paged list: how many rows there are in all.
Anything else the route answers beside the thing itself.

