Skip to content

Pay

3 operations in the WP Waterfall API.

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

NameInTypeDescription
name requiredpathstringThe 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

StatusBodyDescription
200InvoicePageThe invoice
400ProblemThe request could not be read: bad JSON, a bad header, or a malformed value.
404ProblemNo such invoice link. The same answer for an unknown, malformed, revoked, and expired name.
422ProblemThe request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field.
429ProblemToo many calls from this address or for this link

200 response fields

NameTypeDescription
id requiredstring (uuid)Our invoice id, the one in the page address.
state requiredstringOne of: open, paid, void.
invoice_number requiredstring or nullThe invoice number, such as "2VRBR54J-0002", or null before Stripe numbers it.
currency requiredstring
tax_centsintegerThe tax Stripe put on the invoice, inside total_cents. 0 or absent when there is none.
total_cents requiredinteger
amount_due_cents requiredintegerWhat is still owed. 0 once paid or voided.
due_at requiredstring or null (date-time)
paid_at requiredstring or null (date-time)
memo requiredstring or nullThe note staff wrote, or null.
lines requiredarray of object
lines[].description requiredstringOur own words, such as "Dedicated server, 4 vCPUs, 31 GB memory, month to month".
lines[].quantity requiredintegerRange: 1 to any.
lines[].amount_cents requiredinteger
billed_to requiredarray of stringThe company the invoice is for: its billing name and address, as one line each.
from requiredstringWho sent it. Always WP Waterfall.
client_secret requiredstring or nullPays the open invoice with Stripe.js. Null unless the invoice is open and the caller can pay.
can_pay requiredbooleanFalse for staff looking at the invoice as the customer: they read it and cannot pay it.
auto_charge_consent requiredbooleanTrue for the first invoice of a month to month server: paying it lets the card be charged monthly.
pdf_available requiredbooleanTrue when the invoice has a PDF at GET /v1/billing/invoices/{id}/pdf.
publishable_key requiredstring or nullA 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

NameInTypeDescription
name requiredpathstringThe 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

StatusBodyDescription
200string (binary)The PDF
400ProblemThe request could not be read: bad JSON, a bad header, or a malformed value.
404ProblemNo such invoice link. The same answer for an unknown, malformed, revoked, and expired name.
422ProblemThe request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field.
429ProblemToo many calls from this address or for this link
502ProblemThe 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

NameInTypeDescription
name requiredpathstringThe 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 requiredheaderstringSend 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

StatusBodyDescription
200InvoicePageThe invoice, with a fresh client secret while it is open
400ProblemThe request could not be read: bad JSON, a bad header, or a malformed value.
404ProblemNo such invoice link. The same answer for an unknown, malformed, revoked, and expired name.
409ProblemThe current state does not allow this: the same change is already running, or another change got there first.
422ProblemThe request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field.
429ProblemToo many calls from this address or for this link

200 response fields

NameTypeDescription
id requiredstring (uuid)Our invoice id, the one in the page address.
state requiredstringOne of: open, paid, void.
invoice_number requiredstring or nullThe invoice number, such as "2VRBR54J-0002", or null before Stripe numbers it.
currency requiredstring
tax_centsintegerThe tax Stripe put on the invoice, inside total_cents. 0 or absent when there is none.
total_cents requiredinteger
amount_due_cents requiredintegerWhat is still owed. 0 once paid or voided.
due_at requiredstring or null (date-time)
paid_at requiredstring or null (date-time)
memo requiredstring or nullThe note staff wrote, or null.
lines requiredarray of object
lines[].description requiredstringOur own words, such as "Dedicated server, 4 vCPUs, 31 GB memory, month to month".
lines[].quantity requiredintegerRange: 1 to any.
lines[].amount_cents requiredinteger
billed_to requiredarray of stringThe company the invoice is for: its billing name and address, as one line each.
from requiredstringWho sent it. Always WP Waterfall.
client_secret requiredstring or nullPays the open invoice with Stripe.js. Null unless the invoice is open and the caller can pay.
can_pay requiredbooleanFalse for staff looking at the invoice as the customer: they read it and cannot pay it.
auto_charge_consent requiredbooleanTrue for the first invoice of a month to month server: paying it lets the card be charged monthly.
pdf_available requiredbooleanTrue when the invoice has a PDF at GET /v1/billing/invoices/{id}/pdf.
publishable_key requiredstring or nullA 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.