Purchase credits
Adds credits to the wallet against a Chargebee charge for the given item price. How the charge is collected depends on how the company is billed: card-billed companies are charged immediately against the supplied payment intent, while companies billed on their subscription invoice have the charge added to that invoice and need no payment intent.
/v1/hq/credit_wallets/{wallet_id}/purchaseAuthorization
BearerTokenAuth
The Noona HQ API uses Bearer token for authentication.
Endpoints that return generic information that does not contain sensitive data do not require authentication. Endpoints that require authentication are specifically marked in the documentation.
Authorization: Bearer your-token
In: header
Path Parameters
Request Body
application/json
The Chargebee item price ID for the credit pack to purchase.
The Chargebee authorization transaction ID obtained client-side via Chargebee.js. Required only when the company is billed by card, and rejected with 400 if omitted in that case. Companies billed on their subscription invoice must leave it unset; any value sent is ignored. The server validates that the intent belongs to the authenticated company. The authorized amount is not checked here — Chargebee rejects the charge if it does not cover the pack price.
Response Body
application/json
curl -X POST "https://api.noona.is/v1/hq/credit_wallets/string/purchase" \ -H "Content-Type: application/json" \ -d '{ "item_price_id": "string" }'{
"id": "string",
"company": "string",
"type": "sms",
"balance": 0,
"currency": "string",
"low_balance_threshold": 0,
"auto_top_up": {
"enabled": true,
"threshold": 0,
"amount": 0,
"item_price_id": "string"
},
"free_allowance": {
"limit": 0,
"used": 0,
"period_start": "2019-08-24T14:15:22Z"
},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}