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 invoiceId → data.invoiceId id integer · min: 1 required
Example: 46376 Unique id identifier
Accept Example Content-Type Example amount string · enum required
· Example: 130.00 130.00 2.50 29.10 4.41 90.45 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).
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).
https://cloud.hostup.se/api/billing/invoice/{id}/apply-credit 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"
}' {
"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"
}
} {
"amount": "130.00"
}