Decline a request to pay by invoice
const url = 'https://api.sloose.com/billing/admin/orgs/org_9f3c/invoice-requests/ir_9f3c/decline';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"reason":"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/invoice-requests/ir_9f3c/decline \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "reason": "example" }'Backoffice route: a staff session, or ADMIN_TOKEN; never a customer’s session. Closes the org’s open request without billing it by invoice; the org may ask again. The reason is the staff record’s (org.invoice_request.decline), never the request’s, and nobody is mailed — tell the customer yourself.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The org id.
Example
org_9f3cThe org id.
The request.
Example
ir_9f3cThe request.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Examplegenerated
{ "reason": "example"}Responses
Section titled “Responses”Declined.
object
object
Example
{ "request": { "status": "open" }}No reason given.
object
Examplegenerated
{ "error": "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 request open on this org.
object
Examplegenerated
{ "error": "example"}