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: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 details2
Handle Response
Check the
step field in the response:- payment: Redirect customer to
checkout_urlfor 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 astep 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:Applying Discount Codes
Pass a discount code to apply savings: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:- 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
Error Handling
Common checkout errors and how to handle them:Example Error Response
Best Practices
Handle All Response Steps
Always check thestep 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
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