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

# Initialize checkout session

> 
Initialize a checkout session and automatically redirect to the checkout URL. This endpoint works exactly 
like the current CMS checkout-init page - you can navigate to it with query parameters and it will 
automatically redirect the browser to the checkout page.

Perfect for direct links, email links, or anywhere you want automatic redirection.

**This endpoint is completely public and requires no authentication.**

**Additional Query Parameters**: Any extra query parameters you add will be automatically forwarded to the 
checkout URL. This is useful for tracking parameters (utm_source, utm_campaign, etc.) or custom parameters.

**Customer Prefill**: You can prefill customer information to streamline checkout:
- `customerId`: Link to existing customer account
- `customerEmail`: Prefill customer email
- `customerFirstName`: Prefill customer first name
- `customerLastName`: Prefill customer last name
- `customerPhone`: Prefill customer phone number
- `customerTags`: Apply tags to customer (comma-separated or JSON array: "segment:vip,source:facebook")

**Checkout Token Forwarding**: Include the checkout token in the final checkout URL:
- `includeCheckoutToken`: Set to the desired query parameter name (default: "checkoutToken")
- Example: `includeCheckoutToken=checkoutToken` will append `?checkoutToken=ch_abc123` to the checkout URL
- Example: `includeCheckoutToken=token` will append `?token=ch_abc123` to the checkout URL

Example usage:
```
GET /api/public/v1/checkout/init?storeId=store_123&items=[{"variantId":"var_123","quantity":1}]&currency=USD
→ Redirects to: https://checkout.example.com/checkout/ch_abc123/op?token=cms_token_xyz

GET /api/public/v1/checkout/init?storeId=store_123&items=[...]&currency=USD&utm_source=email&custom_param=value
→ Redirects to: https://checkout.example.com/checkout/ch_abc123/op?token=cms_token_xyz&utm_source=email&custom_param=value

GET /api/public/v1/checkout/init?storeId=store_123&items=[...]&currency=USD&customerEmail=john@example.com&customerFirstName=John&customerLastName=Doe
→ Redirects to checkout with customer information prefilled
```
    



## OpenAPI

````yaml /openapi.json get /api/public/v1/checkout/init
openapi: 3.0.3
info:
  title: TagadaPay API
  description: >-

    # TagadaPay API Documentation


    Welcome to the TagadaPay API. This REST API lets you process payments,
    manage subscriptions, handle customers, deploy plugins, and orchestrate
    checkout funnels — all programmatically.


    ## Authentication


    Authenticate every request with a Bearer token. Get your API key from the
    [TagadaPay Dashboard](https://app.tagada.io).


    ```

    Authorization: Bearer your-api-key

    ```


    All requests must be made over HTTPS with `Content-Type: application/json`.


    ## Rate Limits


    | Plan | Requests/min | Burst |

    |------|-------------|-------|

    | Standard | 100 | 150 |

    | Premium | 500 | 750 |


    Exceeding the limit returns `429 Too Many Requests`.


    ## Errors


    | Code | Meaning |

    |------|---------|

    | 400 | Bad request — invalid parameters |

    | 401 | Unauthorized — missing or invalid API key |

    | 403 | Forbidden — insufficient permissions |

    | 404 | Not found |

    | 409 | Conflict |

    | 429 | Rate limited |

    | 500 | Server error |


    ## Support


    - Email: api-support@tagada.io

    - Docs: [docs.tagadapay.com](https://docs.tagadapay.com)
        
  version: 1.0.0
servers:
  - url: https://api.tagada.io/
    description: Production
  - url: https://api.tagada.dev/
    description: Sandbox / Development
security:
  - bearerAuth: []
tags:
  - name: auth
    description: Test your API key and verify authentication.
  - name: stores
    description: Create and manage stores within your account.
  - name: products
    description: Create products with variants, prices, and currency options.
  - name: customers
    description: Manage customer records, addresses, and payment instruments.
  - name: orders
    description: List and retrieve orders with line items, payments, and metadata.
  - name: payments
    description: Process, list, refund, void, and dispute payments.
  - name: subscriptions
    description: >-
      Create and manage recurring subscriptions — billing, cancellation,
      rebilling, and processor changes.
  - name: payment-flows
    description: Configure payment routing strategies with cascading processor fallbacks.
  - name: payment-instruments
    description: >-
      Manage stored payment methods — cards, bank accounts, and tokenized
      instruments.
  - name: processors
    description: List connected payment processors (Stripe, NMI, Checkout.com, etc.).
  - name: promotions
    description: Create and manage discount promotions with rules and conditions.
  - name: promotion-codes
    description: Generate and manage reusable promotion/coupon codes.
  - name: block-rules
    description: >-
      Configure fraud prevention rules to block transactions by IP, email, card
      BIN, country, etc.
  - name: webhooks
    description: Register webhook endpoints to receive real-time event notifications.
  - name: events
    description: Query application events, statistics, and audit logs.
  - name: domains
    description: Add, verify, and manage custom domains for your checkout and funnels.
  - name: funnels
    description: >-
      Create and manage checkout funnels with routing, A/B testing, and CDN
      deployment.
  - name: funnel-sessions
    description: Retrieve funnel session data for analytics and debugging.
  - name: funnel-tracking
    description: Track funnel step events for conversion analytics.
  - name: plugins
    description: Deploy, manage, and configure checkout plugins.
  - name: plugins-v2
    description: >-
      V2 plugin system — deploy, mount, split-test, fork, promote, and manage
      plugin instances.
  - name: checkout
    description: >-
      Initialize checkout sessions and process payments through the hosted
      checkout.
  - name: 3ds
    description: >-
      3D Secure authentication — create sessions, authenticate, and handle
      challenges.
  - name: builder
    description: Generate and validate builder session tokens for the visual page editor.
  - name: health
    description: API health check endpoint.
  - name: test
    description: Test and debugging utilities for the event system (sandbox only).
paths:
  /api/public/v1/checkout/init:
    get:
      tags:
        - checkout
      summary: Initialize checkout session
      description: >-

        Initialize a checkout session and automatically redirect to the checkout
        URL. This endpoint works exactly 

        like the current CMS checkout-init page - you can navigate to it with
        query parameters and it will 

        automatically redirect the browser to the checkout page.


        Perfect for direct links, email links, or anywhere you want automatic
        redirection.


        **This endpoint is completely public and requires no authentication.**


        **Additional Query Parameters**: Any extra query parameters you add will
        be automatically forwarded to the 

        checkout URL. This is useful for tracking parameters (utm_source,
        utm_campaign, etc.) or custom parameters.


        **Customer Prefill**: You can prefill customer information to streamline
        checkout:

        - `customerId`: Link to existing customer account

        - `customerEmail`: Prefill customer email

        - `customerFirstName`: Prefill customer first name

        - `customerLastName`: Prefill customer last name

        - `customerPhone`: Prefill customer phone number

        - `customerTags`: Apply tags to customer (comma-separated or JSON array:
        "segment:vip,source:facebook")


        **Checkout Token Forwarding**: Include the checkout token in the final
        checkout URL:

        - `includeCheckoutToken`: Set to the desired query parameter name
        (default: "checkoutToken")

        - Example: `includeCheckoutToken=checkoutToken` will append
        `?checkoutToken=ch_abc123` to the checkout URL

        - Example: `includeCheckoutToken=token` will append `?token=ch_abc123`
        to the checkout URL


        Example usage:

        ```

        GET
        /api/public/v1/checkout/init?storeId=store_123&items=[{"variantId":"var_123","quantity":1}]&currency=USD

        → Redirects to:
        https://checkout.example.com/checkout/ch_abc123/op?token=cms_token_xyz


        GET
        /api/public/v1/checkout/init?storeId=store_123&items=[...]&currency=USD&utm_source=email&custom_param=value

        → Redirects to:
        https://checkout.example.com/checkout/ch_abc123/op?token=cms_token_xyz&utm_source=email&custom_param=value


        GET
        /api/public/v1/checkout/init?storeId=store_123&items=[...]&currency=USD&customerEmail=john@example.com&customerFirstName=John&customerLastName=Doe

        → Redirects to checkout with customer information prefilled

        ```
            
      operationId: get-api-public-v1-checkout-init
      parameters:
        - name: data
          in: query
          required: false
          schema:
            type: string
        - name: storeId
          in: query
          required: false
          schema:
            type: string
        - name: items
          in: query
          required: false
          schema:
            type: string
        - name: currency
          in: query
          required: false
          schema:
            type: string
        - name: locale
          in: query
          required: false
          schema:
            type: string
        - name: cartToken
          in: query
          required: false
          schema:
            type: string
        - name: returnUrl
          in: query
          required: false
          schema:
            type: string
        - name: checkoutUrl
          in: query
          required: false
          schema:
            type: string
        - name: cid
          in: query
          required: false
          schema:
            type: string
        - name: customerId
          in: query
          required: false
          schema:
            type: string
        - name: customerEmail
          in: query
          required: false
          schema:
            type: string
        - name: customerFirstName
          in: query
          required: false
          schema:
            type: string
        - name: customerLastName
          in: query
          required: false
          schema:
            type: string
        - name: customerPhone
          in: query
          required: false
          schema:
            type: string
        - name: customerTags
          in: query
          required: false
          schema:
            type: string
        - name: includeCheckoutToken
          in: query
          required: false
          schema:
            type: string
        - name: shippingAddress
          in: query
          required: false
          schema:
            type: string
        - name: shippingCountry
          in: query
          required: false
          schema:
            type: string
        - name: draft
          in: query
          required: false
          schema:
            type: string
        - name: funnelId
          in: query
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema: {}
              examples:
                redirect:
                  summary: Automatic redirect
                  value: >-
                    HTTP 302 Redirect to:
                    https://checkout.example.com/checkout/ch_abc123/op?token=cms_token_xyz
        default:
          $ref: '#/components/responses/error'
components:
  responses:
    error:
      description: Error response
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
              code:
                type: string
              issues:
                type: array
                items:
                  type: object
                  properties:
                    message:
                      type: string
                  required:
                    - message
                  additionalProperties: false
            required:
              - message
              - code
            additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Enter your API key as: `Bearer your-api-key`'

````