Skip to content
Connect an agent
Billing

Read one invoice or receipt

One document with its lines, totals, who it is billed to, the issuer, and the card as a brand and last four digits.

GET/user/billing/documents/{id}

TL;DR

QuestionAnswer
What does it do?Read one invoice or receipt.
What does it take?id in the path.
What does it return?Status 200 with a body of type BillingDocumentDetail.
What can go wrong?400 the id is not shaped like an invoice id; 401 not signed in; 404 no such document for this account; 429 too many requests; 502 stripe could not complete the request; 503 billing is not set up on this server. Every failure uses the one error envelope.

What it does

One document with its lines, totals, who it is billed to, the issuer, and the card as a brand and last four digits. A document that does not exist, is another account's, or is not Plotwork's is the same 404.

Path parameters

FieldTypeRequiredDescription
idstringyesThe document id, as the list gave it.

Responses

StatusMeaningBody
200The document.BillingDocumentDetail
400The id is not shaped like an invoice id.ErrorResponse
401Not signed in.ErrorResponse
404No such document for this account.ErrorResponse
429Too many requests.ErrorResponse
502Stripe could not complete the request.ErrorResponse
503Billing is not set up on this server.ErrorResponse

Response body

A 200 answer has the type BillingDocumentDetail.

FieldTypeRequiredDescription
idstringyesThe id to ask for the document and its PDF with.
kind"invoice" | "receipt"yesA receipt is an invoice that has been paid; anything else is an invoice.
numberstringyesThe number printed on the document, which an accounts department quotes back.
descriptionstringyesWhat it was for, such as the plan. Empty when Stripe names nothing.
currencystringyesThe three-letter currency, in capitals. at least 3 characters; at most 3 characters.
totalCentsintegeryesThe total in whole cents (the currency's minor unit).
statusstringyesThe invoice's own word: paid, open, void, or uncollectible. A draft is never listed.
issuedAtintegeryesWhen it was issued, in milliseconds since the epoch.
paidAtinteger | nullyesWhen it was paid, in milliseconds since the epoch, or null while it is not.
downloadablebooleanyesFalse when there is no PDF to fetch, so the PDF route would answer 404.
linesDocumentLine[]yes
lines[].descriptionstringyes
lines[].quantityintegeryesminimum 1.
lines[].amountCentsintegeryes
lines[].periodStartinteger | nullyesThe start of the service period, in milliseconds since the epoch, or null.
lines[].periodEndinteger | nullyesThe end of the service period, in milliseconds since the epoch, or null.
subtotalCentsinteger | nullyes
taxCentsinteger | nullyesThe tax, or null when Stripe names none.
amountPaidCentsinteger | nullyes
billedToobjectyes
billedTo.namestring | nullyes
billedTo.emailstring | nullyes
issuerobject | nullyesThe Stripe account's business name and its tax numbers, from the invoice. There is no address: Stripe does not put one on an invoice.
issuer.namestringyes
issuer.linesstring[]yes
paidWithobject | nullyesThe card the payment was taken from: its brand and last four digits, and nothing more of it. Null when it was not paid by card.
paidWith.brandstringyes
paidWith.last4stringyespattern ^\d{4}$.

See also

DocWhy
API referenceEvery endpoint, and the error envelope
SchemasEvery request and response type
Tool referenceThe operations as callable tools