DeluxHostAPI Reference
Account credit

Apply account credit to an invoice

POST
/v1/credit/invoices/{id}/apply

Requires confirm: true. Inspect the resource before retrying an uncertain outcome. Requires Idempotency-Key. Use the same key and payload to replay a completed response. A 409 for a pending or failed attempt requires checking the resource; a new key could duplicate a charge or purchase.

Authorization

apiToken billing:pay
headerAuthorizationBearer <token>

A personal API token: Authorization: Bearer dh_live_…. See Authentication for scopes.

Scope: billing:pay

Path Parameters

id*number

Header Parameters

Idempotency-Key*string

Unique per account and operation. Reuse only for an identical request. Completed requests replay the encrypted stored response; pending or failed attempts return 409 and are never automatically rerun.

Length1 <= length <= 128

Request Body

application/json
  1. body
confirm*boolean

Response Body

Operation completed or accepted; asynchronous actions may still be running.

application/json
  1. response
ok*boolean
balanceCents*number
appliedCents*number
creditAppliedCents*number
dueCents*number
paid*boolean
curl -X POST 'https://api.deluxhost.net/v1/credit/invoices/0/apply' \  -H "Authorization: Bearer $DELUXHOST_TOKEN" \  -H 'Idempotency-Key: string' \  -H 'Content-Type: application/json' \  -d '{  "confirm": true}'
Example Response
{  "ok": true,  "balanceCents": 0,  "appliedCents": 0,  "creditAppliedCents": 0,  "dueCents": 0,  "paid": true}