The firm's website calls this for /pay/{token}, the link in an invoice's email. Answers while the invoice is owed and the business takes payments online; otherwise 404. Limited to 30 calls a minute per address (429).
Parameters
tokenstring, in the path, required
Response 200 · object
The invoice.
invoicePayPage, required
An invoice as its customer sees it on a pay link.
numberstring, required
issued_onstring (date), required
due_onstring (date), required
linesarray of InvoiceLine, required
idinteger (int64), required
descriptionstring, required
quantitystring, required
unit_penceinteger (int64), required
vat_ratestring, required
One of: standardreducedzeroexemptnone
net_penceinteger (int64), required
totalsobject, required
paid_penceinteger (int64), required
owed_penceinteger (int64), required
pay_witharray of string, required
The providers the invoice can be paid with, in the order to offer them.
Opens the payment page of the provider the body names (one of the pay page's pay_with; the first when none) for what the invoice still owes, coming back to the website's /pay/done?attempt={ref}. 404 as for GET; 409 for a provider the business doesn't take payments with. Limited to 30 calls a minute per address (429).
The status of the payment the website's return page names by its ref, and nothing else. Only the provider's webhook changes it, so the page asks again while it is "open". Limited to 30 calls a minute per address (429).
Parameters
refstring, in the path, required
Response 200 · object
The status.
paymentobject, required
statusstring, required
One of: openheldsucceededfailedexpiredreleasedrefunded
Where the provider sends the browser after the firm signs in; no tenant key or session, as the sealed state names the firm (Stripe sends it as state, PayPal as merchantId, the partner referral's tracking ID, with merchantIdInPayPal, permissionsGranted and consentStatus). Redirects to the admin UI's Settings → Payments with connected={provider}, or with error saying why (an account another firm holds, or a second account while one is connected, is refused).
Parameters
providerstring, in the path, required
codestring, in the query
statestring, in the query
merchantIdstring, in the query
merchantIdInPayPalstring, in the query
permissionsGrantedstring, in the query
consentStatusstring, in the query
errorstring, in the query
Response 302
To the admin UI.
POST/v1/webhooks/{provider}
A payment provider's webhook
For the provider only; no tenant key or session. The body is checked against the provider's signature (Stripe-Signature; PayPal's checked by PayPal, a 500 while PayPal can't be reached) and the firm found by the event's connected account. Each event is applied once. An event for an account no active firm holds is answered and ignored.
Needs the payments.manage permission. The firm's connections that aren't disconnected and the providers offered.
Response 200 · object
The connections.
paymentsPaymentsOverview, required
connectionsarray of PaymentConnection, required
idinteger (int64), required
providerstring, required
One of: stripepaypal
account_idstring, required
The firm's account with the provider.
statusstring, required
"onboarding" until the firm has given the provider its details; "active" while the provider lets it take payments; "restricted" when it has stopped them.
Needs the payments.manage permission. The provider's sign-in address, carrying a sealed state that names the firm, the staff member and the provider, good for 10 minutes. The provider sends the browser back to /v1/payments/{provider}/return.
Needs the payments.manage permission. Tells the provider DoRoutes no longer acts for the firm's account and marks the connection disconnected; customers can't pay online through it. 404 when the firm has no connection with the provider.
Parameters
providerstring, in the path, required
Response 200 · object
The connections.
paymentsPaymentsOverview, required
connectionsarray of PaymentConnection, required
idinteger (int64), required
providerstring, required
One of: stripepaypal
account_idstring, required
The firm's account with the provider.
statusstring, required
"onboarding" until the firm has given the provider its details; "active" while the provider lets it take payments; "restricted" when it has stopped them.