Skip to main content

Credits

Balance in the customer's favour, applicable to future invoices. Applying and removing credits are commands on the invoice itself.

CommandHTTPDescription
credits listGET /v1/creditsList credits
credits createPOST /v1/creditsAdd a credit
credits getGET /v1/credits/{id}Get a credit
credits updatePATCH /v1/credits/{id}Update a credit
credits deleteDELETE /v1/credits/{id}Delete a credit

Examples​

--params carries query and path parameters (id, page, filters); --json carries the request body; --fields limits which fields come back — worth using on every list/get to save context. See Global flags for the full reference.

# List credits
kobana billing credits list \
--fields "id,public_id,external_id,billing_account_id,organization_id"

# Get a credit
kobana billing credits get --params '{"id": "CREDIT_ID"}'

# Add a credit
kobana billing credits create \
--json '{"billing_account_id": "BILLING_ACCOUNT_ID", "type": "promotional", "amount_cents": 10000}'

# Update a credit
kobana billing credits update \
--params '{"id": "CREDIT_ID"}' \
--json '{"external_id": "EXTERNAL_ID", "type": "promotional", "amount_cents": 100}'

# Delete a credit
kobana billing credits delete --params '{"id": "CREDIT_ID"}' --dry-run

Next steps​