Skip to main content
The checkout API allows you to programmatically create purchase sessions for your customers. This is useful for custom storefronts, integrations, or automated sales flows.
Unsupported product types — The following cannot be used to initiate a checkout through the API:
  • Service products
  • Coaching products
  • Products with pay-what-you-want pricing
For these, redirect customers to your Chariow storefront or use the Snap Widget embed on your website.
All sales initiated via the checkout API will have their Channel set to “API” on your store dashboard. This helps you identify and track sales originating from your API integrations separately from other channels like your storefront or Snap Widget.

Repeat Purchases

The ability to purchase a product multiple times depends on the product type:
For blocked product types, if a customer’s access has been revoked (e.g., after a refund), they will be able to purchase the product again. The system checks for active access grants only.

Checkout Flow Overview

The Chariow checkout API handles the complete purchase flow from initiation to completion:
The product must be published before initiating a checkout. Unpublished products will return a 404 error.
1

Initiate Checkout

Call the /checkout endpoint with product ID and customer details
2

Handle Response

Check the step field in the response:
  • payment: Redirect customer to checkout_url for payment
  • completed: Sale completed immediately (free products)
  • already_purchased: Customer already owns this product
3

Process Payment

Customer completes payment on the secure Chariow payment page
4

Receive Webhook

Get notified of sale status changes via webhooks (recommended)
5

Deliver Product

Customer receives automatic access to files, licenses, courses, etc.

Product Types Supported

The checkout API supports the following Chariow product types:
  • Downloadable Products: Digital files (PDFs, software, media)
  • Courses: Educational content with lessons and chapters
  • Licenses: Software license keys with activation management
  • Bundles: Collections of multiple products
Service and Coaching product types are not supported via the Public API. For these products, redirect customers to your Chariow store or use the Snap Widget. Products using pay-what-you-want pricing are also not supported.

Initiating a Checkout

Create a new checkout session:

Request Parameters

Shipping Address Fields

When the product has “Require shipping address” enabled, you must include shipping address fields in your checkout request:
These fields are required only when the product has shipping enabled. If shipping is not required, these fields are ignored.

Example with Shipping Address

Checkout Response States

The checkout response includes a step field indicating the current state:

Awaiting Payment

For paid products, you’ll receive a payment URL:
Redirect the customer to checkout_url to complete their payment.

Completed (Free Products)

For free products, the sale completes immediately:

Already Purchased

If the customer already owns the product:

Custom Redirect URLs

You can specify a custom redirect URL to send customers to your own thank-you page after payment completion:
The redirect URL must be a valid active URL (max 2048 characters). When not provided, customers will be redirected to the default Chariow post-purchase page.

Multi-Currency Support

Specify the payment currency to charge customers in a different currency from your store’s default:
The response will include exchange rate information when currency conversion is applied.

Applying Discount Codes

Pass a discount code to apply savings:
The response will show the discounted amount:

Custom Fields

If your product has custom fields configured, you can collect and validate them during checkout:
Custom fields must match the product’s configured custom field definitions. Invalid or missing required custom fields will result in validation errors.

Campaign Tracking

Track the source of sales by including a campaign ID:
This helps you:
  • Track which marketing campaigns drive the most sales
  • Attribute revenue to specific channels
  • Analyse campaign performance in your Chariow dashboard

Custom Metadata

Store custom data with the sale for your own tracking and integration purposes:

Important Notes

  • Maximum 10 keys allowed per sale
  • Each value is limited to 255 characters
  • Keys should be strings with alphanumeric characters and underscores
  • Custom metadata is included in Pulse webhook payloads
Use custom metadata to link Chariow sales with your CRM, analytics platform, or internal systems. The metadata is returned in all sale-related webhooks.

Error Handling

Common checkout errors and how to handle them:

Example Error Response

Always check the errors object for field-specific validation messages to help users correct their input.

Best Practices

Handle All Response Steps

Always check the step field and handle all possible states:

Use Pulses for Sale Updates

Don’t rely solely on redirect URLs to track sale completion. Set up Pulses (webhooks) to receive reliable notifications:
  • Sale completed
  • Payment received
  • Refund processed
See the Pulses Guide for setup instructions.

Validate Before Checkout

Reduce failed checkouts by validating data before calling the API:
  • Email format validation
  • Phone number format validation
  • Required field checks
  • Custom field validation

Handle Network Errors

Implement proper error handling for network issues:

Store Sale IDs

Always store the returned sale ID (purchase.id) for:
  • Customer service inquiries
  • Refund processing
  • Access management
  • Analytics tracking

Test with Different Scenarios

Test your integration with:
  • Free products (immediate completion)
  • Paid products (payment flow)
  • Products with discount codes
  • Products with custom fields
  • Invalid product IDs
  • Invalid discount codes

Next Steps

Sales Guide

Learn how to retrieve and manage sales

Pulses

Set up notifications for completed sales

Checkout API

View the complete Checkout API reference