> For the complete documentation index, see [llms.txt](https://docs.claret.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.claret.app/api-reference/utilities/create-a-stripe-checkout-session-for-a-one-time-credit-top-up.md).

# Create a Stripe Checkout Session for a one-time credit top-up

```json
{"openapi":"3.1.0","info":{"title":"Claret","version":"1.0.0"},"tags":[{"name":"Utilities","description":"Token management, credit top-up, and asynchronous job status."}],"servers":[{"url":"https://plan.claret.app/{tenant}/api/v1","description":"Production","variables":{"tenant":{"default":"your-tenant","description":"Your Claret tenant identifier (the slug in your Claret URL)."}}}],"security":[{"http":[]}],"components":{"securitySchemes":{"http":{"type":"http","scheme":"bearer"}},"schemas":{"ApiCreditTopUpRequest":{"type":"object","properties":{"product_code":{"type":"string","maxLength":255},"success_url":{"type":"string","format":"uri","maxLength":2048},"cancel_url":{"type":"string","format":"uri","maxLength":2048}},"required":["product_code","success_url","cancel_url"],"title":"ApiCreditTopUpRequest"}},"responses":{"AuthenticationException":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error overview."}},"required":["message"]}}}},"ValidationException":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Errors overview."},"errors":{"type":"object","description":"A detailed description of each field that failed validation.","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["message","errors"]}}}}}},"paths":{"/credits/top-up":{"post":{"operationId":"tenant.public.credits.top-up","summary":"Create a Stripe Checkout Session for a one-time credit top-up","tags":["Utilities"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiCreditTopUpRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","const":"Checkout session created successfully."},"data":{"type":"array","prefixItems":[{"type":"object","properties":{"checkout_url":{"type":"string"},"session_id":{"type":"string"},"credit_units":{"type":"integer"}},"required":["checkout_url","session_id","credit_units"]}],"minItems":1,"maxItems":1,"additionalItems":false},"meta":{"anyOf":[{"type":"array","items":{}},{"type":"string"}]},"links":{"type":"string"}},"required":["message","data","meta","links"]}}}},"401":{"$ref":"#/components/responses/AuthenticationException"},"404":{"description":"","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","const":"https://httpstatuses.com/404"},"title":{"type":"string","const":"Not Found"},"status":{"type":"integer","const":404},"detail":{"type":"string","const":"Credit product not found."},"request_id":{"type":"string"},"errors":{"type":"string"}},"required":["type","title","status","detail","request_id","errors"]}}}},"422":{"$ref":"#/components/responses/ValidationException"},"500":{"description":"","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","const":"https://httpstatuses.com/500"},"title":{"type":"string","const":"Internal Server Error"},"status":{"type":"integer","const":500},"detail":{"type":"string","const":"Failed to create checkout session."},"request_id":{"type":"string"},"errors":{"type":"string"}},"required":["type","title","status","detail","request_id","errors"]}}}}}}}}}
```
