> ## Documentation Index
> Fetch the complete documentation index at: https://revinel.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a Stripe Checkout session for a tier price



## OpenAPI

````yaml https://api.revinel.com/v1/openapi.json post /workspaces/{workspaceId}/checkout-sessions
openapi: 3.1.1
info:
  title: Revinel API
  version: 1.0.0
  description: >-
    Public surface of the Revinel platform. Consumed by `@revinel/sdk` and
    `@revinel/react`.


    **Errors** are returned as an oRPC envelope: `{ defined: boolean, code:
    string, status: number, message: string, data?: object }`. Input-validation
    failures return HTTP **422** with `code: "INPUT_VALIDATION_FAILED"` and
    `data.fieldErrors` / `data.formErrors`.
servers:
  - url: https://api.revinel.com/v1
security: []
paths:
  /workspaces/{workspaceId}/checkout-sessions:
    post:
      tags:
        - Tiers
      summary: Create a Stripe Checkout session for a tier price
      operationId: tiers.checkout
      parameters:
        - name: workspaceId
          in: path
          required: true
          schema:
            type: string
            description: The publisher workspace the tier price belongs to.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                tierPriceId:
                  type: string
                  description: The tier price (plan) the advertiser is subscribing to.
                email:
                  type: string
                  format: email
                  description: Pre-fills the advertiser's email on Stripe Checkout.
                cancelUrl:
                  type: string
                  format: uri
                  description: >-
                    Where Stripe returns the visitor on cancel. Must match the
                    publisher's site or Revinel.
              required:
                - tierPriceId
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                    description: Stripe Checkout URL to redirect the advertiser to.
                  sessionId:
                    type: string
                    description: The Stripe Checkout session ID.
                required:
                  - url
                  - sessionId
        '409':
          description: '409'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: CONFLICT_FIELD
                      status:
                        const: 409
                      message:
                        type: string
                        default: CONFLICT_FIELD
                      data:
                        type: object
                        properties:
                          formErrors:
                            type: array
                            items:
                              type: string
                          fieldErrors:
                            type: object
                            propertyNames:
                              type: string
                            additionalProperties:
                              type: array
                              items:
                                type: string
                        required:
                          - formErrors
                          - fieldErrors
                    required:
                      - defined
                      - code
                      - status
                      - message
                      - data
                  - type: object
                    properties:
                      defined:
                        const: false
                      code:
                        type: string
                      status:
                        type: number
                      message:
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
        '422':
          description: '422'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: INPUT_VALIDATION_FAILED
                      status:
                        const: 422
                      message:
                        type: string
                        default: INPUT_VALIDATION_FAILED
                      data:
                        type: object
                        properties:
                          formErrors:
                            type: array
                            items:
                              type: string
                          fieldErrors:
                            type: object
                            propertyNames:
                              type: string
                            additionalProperties:
                              type: array
                              items:
                                type: string
                        required:
                          - formErrors
                          - fieldErrors
                    required:
                      - defined
                      - code
                      - status
                      - message
                      - data
                  - type: object
                    properties:
                      defined:
                        const: false
                      code:
                        type: string
                      status:
                        type: number
                      message:
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message

````