Skip to main content

createAiCreditCheckoutSession

Requires permission billing:ai_credit:purchase.

Creates a real Stripe (test-mode by config) checkout session for an AI-credit top-up.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

mutation CreateAiCreditCheckoutSession($input: CreateAiCreditCheckoutInput!) {
createAiCreditCheckoutSession(input: $input) {
amountCents
label
sessionId
url
}
}

Variables:

{
"input": {
"amountCents": 0,
"cancelUrl": "string",
"successUrl": "string"
}
}

Response:

{
"data": {
"createAiCreditCheckoutSession": {
"amountCents": 0,
"label": "string",
"sessionId": "string",
"url": "string"
}
}
}
createAiCreditCheckoutSession(
input: CreateAiCreditCheckoutInput!
): AiCreditCheckoutSession!

Arguments​

createAiCreditCheckoutSession.input ● CreateAiCreditCheckoutInput! non-null input​

The details of the ai credit checkout to create.

Type​

AiCreditCheckoutSession object​

A payment page for topping up AI credits.