Get or create Stripe customer and optionally create checkout session
const url = 'https://api.pingram.io/billing';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"budgetPriceId":"example","successUrl":"example","cancelUrl":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.pingram.io/billing \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "budgetPriceId": "example", "successUrl": "example", "cancelUrl": "example" }'Authorizations
Request Bodyrequired
object
Price ID for a monthly budget tier (all channels).
Examplegenerated
{ "budgetPriceId": "example", "successUrl": "example", "cancelUrl": "example"}Responses
200
Successful response
POST /billing response: organization usage limits + optional Checkout session.
object
ISO date (YYYY-MM-DD) when the billing cycle resets.
Example
{ "organizationType": "free", "billingVersion": 1}400
Bad Request - validation errors, invalid input
Standard error response for API errors.
object
Unique tracking ID for the request.
Structured error details for API error responses.
object
Machine-readable error code.
Human-readable error message.
Actionable hint for fixing the error.
Examplegenerated
{ "trackingId": "example", "error": { "code": "example", "message": "example", "fix": "example" }}401
Unauthorized
402
Payment Required - usage limits exceeded
Standard error response for API errors.
object
Unique tracking ID for the request.
Structured error details for API error responses.
object
Machine-readable error code.
Human-readable error message.
Actionable hint for fixing the error.
Examplegenerated
{ "trackingId": "example", "error": { "code": "example", "message": "example", "fix": "example" }}500
Internal Server Error
502
Bad Gateway - provider error
Standard error response for API errors.
object
Unique tracking ID for the request.
Structured error details for API error responses.
object
Machine-readable error code.
Human-readable error message.
Actionable hint for fixing the error.
Examplegenerated
{ "trackingId": "example", "error": { "code": "example", "message": "example", "fix": "example" }}