Skip to content

Get or create Stripe customer and optionally create checkout session

POST
/billing
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

Media typeapplication/json
object
budgetPriceId

Price ID for a monthly budget tier (all channels).

string
successUrl
required
string
cancelUrl
required
string
Examplegenerated
{
"budgetPriceId": "example",
"successUrl": "example",
"cancelUrl": "example"
}

Responses

200

Successful response

Media typeapplication/json

POST /billing response: organization usage limits + optional Checkout session.

object
organizationId
required
string
organizationType
required
string
Allowed values: free paid
creator
required
string
name
required
string
messagesCap
required
number
costCap
required
number
smsCap
number
callCap
number
billingVersion
number
Allowed values: 1 3
anniversaryDate
required

ISO date (YYYY-MM-DD) when the billing cycle resets.

string
allowOverage
required
boolean
createdAt
required
string
updatedAt
required
string
sessionId
string
url
string
Example
{
"organizationType": "free",
"billingVersion": 1
}

400

Bad Request - validation errors, invalid input

Media typeapplication/json

Standard error response for API errors.

object
trackingId
required

Unique tracking ID for the request.

string
error
required

Structured error details for API error responses.

object
code
required

Machine-readable error code.

string
message
required

Human-readable error message.

string
fix

Actionable hint for fixing the error.

string
Examplegenerated
{
"trackingId": "example",
"error": {
"code": "example",
"message": "example",
"fix": "example"
}
}

401

Unauthorized

402

Payment Required - usage limits exceeded

Media typeapplication/json

Standard error response for API errors.

object
trackingId
required

Unique tracking ID for the request.

string
error
required

Structured error details for API error responses.

object
code
required

Machine-readable error code.

string
message
required

Human-readable error message.

string
fix

Actionable hint for fixing the error.

string
Examplegenerated
{
"trackingId": "example",
"error": {
"code": "example",
"message": "example",
"fix": "example"
}
}

500

Internal Server Error

502

Bad Gateway - provider error

Media typeapplication/json

Standard error response for API errors.

object
trackingId
required

Unique tracking ID for the request.

string
error
required

Structured error details for API error responses.

object
code
required

Machine-readable error code.

string
message
required

Human-readable error message.

string
fix

Actionable hint for fixing the error.

string
Examplegenerated
{
"trackingId": "example",
"error": {
"code": "example",
"message": "example",
"fix": "example"
}
}