Skip to content

Decline a request to pay by invoice

POST
/billing/admin/orgs/{orgId}/invoice-requests/{requestId}/decline
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 organisation’s open request without billing it by invoice; the organisation 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.

orgId
required

The organisation id.

string
Example
org_9f3c

The organisation id.

requestId
required

The request.

string
Example
ir_9f3c

The request.

Media typeapplication/json
object
reason
string
key
additional properties
Examplegenerated
{
"reason": "example"
}

Declined.

Media typeapplication/json
object
request
required
object
id
required
string
status
required
string
Allowed values: open billed declined
billingEntity
required
string
country
required
string
taxId
required
string | null
poNumber
required
string | null
currency
required
string
createdAt
required
string
decidedAt
required
string | null
Example
{
"request": {
"status": "open"
}
}

No reason given.

Media typeapplication/json
object
error
required
string
key
additional properties
Examplegenerated
{
"error": "example"
}

A bearer that is neither the token nor a live session (code: AUTH_REQUIRED).

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
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).

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

No such request open on this organisation.

Media typeapplication/json
object
error
required
string
key
additional properties
Examplegenerated
{
"error": "example"
}

The restore switch is on (code: MAINTENANCE): every route but /health and /robots.txt is refused before anything is read, except the operator’s own POST /staff/people/{id}/delete with the ADMIN_TOKEN. Sloose is down for maintenance. Please try again in a few minutes.

Media typeapplication/json
object
error
required
string
code
required
string
Allowed value: MAINTENANCE
Example
{
"code": "MAINTENANCE"
}
Retry-After
integer

Seconds until asking again is worth it (300 while the switch is on).

Report a problem with this page

sloose.com