Apply credit to a specific invoice

Apply an available credit on your account to reduce an outstanding invoice amount. The API returns an invoiceId that you can then use to call POST /api/billing/pay.

Billing & Payments Invoices

Context

Used in the dashboard

/billing

Workflow links

Path Parameters

id integer · min: 1 required Example: 46376

Unique id identifier

Headers

Accept Example
Content-Type Example

Body

required
application/json
amount string · enum required · Example: 130.00
130.00
2.50
29.10
4.41
90.45

Responses

200
data object required
data.amount string · enum required · Example: 130.00
130.00
2.50
29.10
4.41
90.45
data.invoiceId string required · Example: 46376
data.message string required · Example: Credit has been applied to invoice

Human-readable message.

requestId string required · Example: 2121ae20-bd9d-41e9-aeeb-5dd1dd1a24ba

Unique request identifier (UUID).

success boolean required · Example: true

True for successful responses.

timestamp string required · Example: 2026-02-10T00:00:00.000Z

ISO 8601 timestamp (UTC).

400
code string required · Example: BAD_REQUEST

Machine-readable error code.

error string required · Example: Bad Request

HTTP status title (e.g. 'Bad Request').

message string required · Example: Failed to apply credit

Human-readable message.

requestId string required · Example: 2121ae20-bd9d-41e9-aeeb-5dd1dd1a24ba

Unique request identifier (UUID).

timestamp string required · Example: 2026-02-10T00:00:00.000Z

ISO 8601 timestamp (UTC).

POST https://cloud.hostup.se/api/billing/invoice/{id}/apply-credit
For AI assistants
cURL
curl -X POST "https://cloud.hostup.se/api/billing/invoice/46376/apply-credit" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": "130.00"
  }'
Response
{
  "success": true,
  "timestamp": "2026-02-10T00:00:00.000Z",
  "requestId": "2121ae20-bd9d-41e9-aeeb-5dd1dd1a24ba",
  "data": {
    "message": "Credit has been applied to invoice",
    "invoiceId": "46376",
    "amount": "130.00"
  }
}
Request Body Example 1
{
  "amount": "130.00"
}