Mark an invoice paid: received by bank transfer
const url = 'https://api.sloose.com/billing/admin/orgs/org_9f3c/invoices/in_1Abc/paid';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"amount":1,"receivedOn":"example","reference":"example","note":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.sloose.com/billing/admin/orgs/org_9f3c/invoices/in_1Abc/paid \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "amount": 1, "receivedOn": "example", "reference": "example", "note": "example" }'Backoffice route: a staff session, or ADMIN_TOKEN; never a customer’s session. Records a transfer received against one of the org’s open invoices billed by invoice, and marks it paid out of band at Stripe, which sends invoice.paid through the flow every payment takes. The transfer — when it arrived, its reference, the amount, and the note — is written on the invoice’s metadata at Stripe too. Stripe “paid” means we consider it settled: an amount other than what is owed needs a note saying why it settles it (a fee or an exchange shortfall absorbed). Whether a shortfall is small enough to absorb is the person’s judgement; nothing here measures it. Written down as org.invoice_paid.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The org id.
Example
org_9f3cThe org id.
The Stripe invoice id.
Example
in_1AbcThe Stripe invoice id.
Request Bodyrequired
Section titled “Request Bodyrequired”object
What arrived, in cents of the invoice’s currency.
YYYY-MM-DD.
Examplegenerated
{ "amount": 1, "receivedOn": "example", "reference": "example", "note": "example"}Responses
Section titled “Responses”Marked paid.
object
What arrived less what was owed: negative is short.
Examplegenerated
{ "invoiceId": "example", "number": "example", "owed": 1, "amount": 1, "difference": 1, "currency": "example"}The request is not one this can make, or the amount differs with no note (DIFFERENCE_NEEDS_NOTE).
object
Examplegenerated
{ "error": "example", "code": "example"}A bearer that is neither the token nor a live session (code: AUTH_REQUIRED).
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}A customer’s session, an API token, or no bearer at all — not staff, and not the ADMIN_TOKEN (code: ADMIN_REQUIRED).
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}No such invoice of this org’s (INVOICE_NOT_FOUND).
object
Examplegenerated
{ "error": "example", "code": "example"}Not waiting for payment (INVOICE_NOT_OPEN), or charged to a card (NOT_INVOICE_BILLED).
object
Examplegenerated
{ "error": "example", "code": "example"}Stripe refused the request (PAYMENT_PROVIDER_REFUSED) — nothing was charged, though a step taken before the refusal stands: the org’s first Stripe customer, or an existing customer’s billing email brought up to date — or was unavailable (PAYMENT_PROVIDER_UNAVAILABLE: unreachable, failing or rate-limiting), which may or may not have gone through — check before retrying. Stripe’s own words are logged, not returned.
object
Example
{ "code": "PAYMENT_PROVIDER_REFUSED"}