Add prepaid credit
POST
Adds credit to a credit entitlement. The same idempotency_key adds it once; with another amount it answers 409. Secret and trusted tokens may call it; a limited token may not (403).
header
AuthorizationBearer <token>A secret, trusted or limited token. See Authentication.
entitlement_id*stringA credit entitlement id.
The credit to add.
application/json- body
amount*numberMore than 0, at most 1,000,000,000, at most 6 decimals. In the agreement's currency.
idempotency_key*string1 to 100 of A-Z a-z 0-9 _ . : -. The same key adds the credit once.
description?stringUp to 200 characters.
Success.
application/json- response
entitlement_id?stringThe credit entitlement.
added?booleanfalse when this key was already used for the same amount: nothing more was added.
balance?numberThe balance after this request.
curl -X POST 'https://api.comecero.com/api/v1/usage/entitlements/string/credits' \ -H 'Content-Type: application/json' \ -d '{ "amount": 50, "idempotency_key": "welcome-credit-cust_8412", "description": "Welcome credit"}'Example Response
{ "entitlement_id": "credit_cust_8412", "added": true, "balance": 50}