Pay
3 operations in the WP Waterfall API.
- getAn invoice to pay, by the name in its emailed link
- getThe PDF of an invoice, by the name in its emailed link
- postA fresh client secret for an invoice link
An invoice to pay, by the name in its emailed link
get/pay/{name}Permalink to An invoice to pay, by the name in its emailed link
- Dashboard session only, no API key
No sign-in. The name is the random value in the link WP Waterfall emails with an invoice. Answers what the invoice page shows: the amount, the due date, the lines, who it is for, and, while the invoice is open, the client secret the Stripe Payment Element pays it with. A paid or void invoice answers its plain state until the link ends. A link ends the later of 60 days after it is sent and 30 days after the due date, or when staff end it; after that it answers 404 like an unknown name, so a name cannot be tested for. The answer is never cached and never indexed. Limited per address and per link, and 429 past that.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
name required | path | string | The invoice number and the token, joined by a hyphen, such as 2VRBR54J-0003 and 26 lowercase letters and digits (a to z, 2 to 7). At most 64 characters of letters, digits, and hyphens. The server uses only the last 26 characters. |
Responses
| Status | Body | Description |
|---|---|---|
200 | InvoicePage | The invoice |
400 | Problem | The request could not be read: bad JSON, a bad header, or a malformed value. |
404 | Problem | No such invoice link. The same answer for an unknown, malformed, revoked, and expired name. |
422 | Problem | The request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field. |
429 | Problem | Too many calls from this address or for this link |
200 response fields
| Name | Type | Description |
|---|---|---|
id required | string (uuid) | Our invoice id, the one in the page address. |
state required | string | One of: open, paid, void. |
invoice_number required | string or null | The invoice number, such as "2VRBR54J-0002", or null before Stripe numbers it. |
currency required | string | |
tax_cents | integer | The tax Stripe put on the invoice, inside total_cents. 0 or absent when there is none. |
total_cents required | integer | |
amount_due_cents required | integer | What is still owed. 0 once paid or voided. |
due_at required | string or null (date-time) | |
paid_at required | string or null (date-time) | |
memo required | string or null | The note staff wrote, or null. |
lines required | array of object | |
lines[].description required | string | Our own words, such as "Dedicated server, 4 vCPUs, 31 GB memory, month to month". |
lines[].quantity required | integer | Range: 1 to any. |
lines[].amount_cents required | integer | |
billed_to required | array of string | The company the invoice is for: its billing name and address, as one line each. |
from required | string | Who sent it. Always WP Waterfall. |
client_secret required | string or null | Pays the open invoice with Stripe.js. Null unless the invoice is open and the caller can pay. |
can_pay required | boolean | False for staff looking at the invoice as the customer: they read it and cannot pay it. |
auto_charge_consent required | boolean | True for the first invoice of a month to month server: paying it lets the card be charged monthly. |
pdf_available required | boolean | True when the invoice has a PDF at GET /v1/billing/invoices/{id}/pdf. |
publishable_key required | string or null | A Stripe publishable key to use instead of the one the page was built with, or null. Only a staff test company on a live platform needs one, because it pays in Stripe test mode. |
The PDF of an invoice, by the name in its emailed link
get/pay/{name}/pdfPermalink to The PDF of an invoice, by the name in its emailed link
- Dashboard session only, no API key
No sign-in. The invoice's PDF, sent inline from this address so the customer never sees a Stripe address. The file is read from Stripe each time with a size limit of 5 MB and a time limit of 10 seconds, and is never stored here. 404 for an unknown name or an invoice with no PDF.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
name required | path | string | The invoice number and the token, joined by a hyphen, such as 2VRBR54J-0003 and 26 lowercase letters and digits (a to z, 2 to 7). At most 64 characters of letters, digits, and hyphens. The server uses only the last 26 characters. |
Responses
| Status | Body | Description |
|---|---|---|
200 | string (binary) | The PDF |
400 | Problem | The request could not be read: bad JSON, a bad header, or a malformed value. |
404 | Problem | No such invoice link. The same answer for an unknown, malformed, revoked, and expired name. |
422 | Problem | The request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field. |
429 | Problem | Too many calls from this address or for this link |
502 | Problem | The PDF could not be fetched. Try again in a moment. |
A fresh client secret for an invoice link
post/pay/{name}/refreshPermalink to A fresh client secret for an invoice link
- Dashboard session only, no API key
No sign-in. Send no body. Answers the same invoice as the read, with a new client secret while the invoice is open, after a payment attempt ended or the page sat open a while. The state is current too, so a page that finds the invoice paid shows it. Limited to 20 renewals a minute per link.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
name required | path | string | The invoice number and the token, joined by a hyphen, such as 2VRBR54J-0003 and 26 lowercase letters and digits (a to z, 2 to 7). At most 64 characters of letters, digits, and hyphens. The server uses only the last 26 characters. |
Idempotency-Key required | header | string | Send a fresh unique value on every POST: a POST without it answers 422. The answer is stored for 24 hours, so a retry with the same key and body returns the first answer, and the same key with a different body returns 422. |
Responses
| Status | Body | Description |
|---|---|---|
200 | InvoicePage | The invoice, with a fresh client secret while it is open |
400 | Problem | The request could not be read: bad JSON, a bad header, or a malformed value. |
404 | Problem | No such invoice link. The same answer for an unknown, malformed, revoked, and expired name. |
409 | Problem | The current state does not allow this: the same change is already running, or another change got there first. |
422 | Problem | The request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field. |
429 | Problem | Too many calls from this address or for this link |
200 response fields
| Name | Type | Description |
|---|---|---|
id required | string (uuid) | Our invoice id, the one in the page address. |
state required | string | One of: open, paid, void. |
invoice_number required | string or null | The invoice number, such as "2VRBR54J-0002", or null before Stripe numbers it. |
currency required | string | |
tax_cents | integer | The tax Stripe put on the invoice, inside total_cents. 0 or absent when there is none. |
total_cents required | integer | |
amount_due_cents required | integer | What is still owed. 0 once paid or voided. |
due_at required | string or null (date-time) | |
paid_at required | string or null (date-time) | |
memo required | string or null | The note staff wrote, or null. |
lines required | array of object | |
lines[].description required | string | Our own words, such as "Dedicated server, 4 vCPUs, 31 GB memory, month to month". |
lines[].quantity required | integer | Range: 1 to any. |
lines[].amount_cents required | integer | |
billed_to required | array of string | The company the invoice is for: its billing name and address, as one line each. |
from required | string | Who sent it. Always WP Waterfall. |
client_secret required | string or null | Pays the open invoice with Stripe.js. Null unless the invoice is open and the caller can pay. |
can_pay required | boolean | False for staff looking at the invoice as the customer: they read it and cannot pay it. |
auto_charge_consent required | boolean | True for the first invoice of a month to month server: paying it lets the card be charged monthly. |
pdf_available required | boolean | True when the invoice has a PDF at GET /v1/billing/invoices/{id}/pdf. |
publishable_key required | string or null | A Stripe publishable key to use instead of the one the page was built with, or null. Only a staff test company on a live platform needs one, because it pays in Stripe test mode. |