saleor-checkout
Implement the Saleor checkout flow — checkout creation, line items, shipping/billing addresses, delivery methods, payment, and completion. Use when building checkout experiences.
Best use case
saleor-checkout is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Implement the Saleor checkout flow — checkout creation, line items, shipping/billing addresses, delivery methods, payment, and completion. Use when building checkout experiences.
Teams using saleor-checkout should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/saleor-checkout/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How saleor-checkout Compares
| Feature / Agent | saleor-checkout | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Implement the Saleor checkout flow — checkout creation, line items, shipping/billing addresses, delivery methods, payment, and completion. Use when building checkout experiences.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Saleor Checkout Flow
## Before writing code
**Fetch live docs**:
1. Web-search `site:docs.saleor.io checkout flow steps` for the end-to-end checkout process
2. Web-search `site:docs.saleor.io checkout mutations graphql` for checkout creation and update mutations
3. Web-search `site:docs.saleor.io transaction payment checkout` for the transaction-based payment flow
4. Fetch `https://docs.saleor.io/docs/developer/checkout` and review checkout lifecycle and required fields
5. Web-search `site:docs.saleor.io delivery methods shipping checkout` for shipping method selection
6. Fetch `https://docs.saleor.io/docs/developer/payments` and review payment initialization and completion
## Checkout Flow Steps
The Saleor checkout follows a sequential flow:
| Step | Mutation | Description |
|------|----------|-------------|
| 1. Create checkout | `checkoutCreate` | Initialize checkout with channel and lines |
| 2. Add/update lines | `checkoutLinesAdd` / `checkoutLinesUpdate` | Manage line items in the cart |
| 3. Set email | `checkoutEmailUpdate` | Set customer email (for guest checkout) |
| 4. Set shipping address | `checkoutShippingAddressUpdate` | Required for physical goods |
| 5. Set billing address | `checkoutBillingAddressUpdate` | Required for payment processing |
| 6. Select delivery method | `checkoutDeliveryMethodUpdate` | Choose shipping method or warehouse pickup |
| 7. Initialize payment | `transactionInitialize` | Start payment with payment App |
| 8. Process payment | `transactionProcess` | Handle additional payment steps (3DS, redirects) |
| 9. Complete checkout | `checkoutComplete` | Finalize and create the order |
> Steps 3-6 can be done in any order, but all must be complete before payment initialization. The checkout validates required fields at each step.
## Checkout Creation
Create a checkout by specifying the channel and initial line items:
| Field | Required | Description |
|-------|----------|-------------|
| `channel` | Yes | Channel slug (determines currency, country, available products) |
| `lines` | Yes | Array of `{variantId, quantity}` objects |
| `email` | No | Customer email (can be set later) |
| `shippingAddress` | No | Shipping address (can be set later) |
| `billingAddress` | No | Billing address (can be set later) |
> **Fetch live docs** for the complete `CheckoutCreateInput` schema -- additional fields include `languageCode`, `validationRules`, and `metadata`.
## Channel-Aware Checkout
Checkouts are always scoped to a channel:
| Aspect | Channel Impact |
|--------|---------------|
| Currency | Prices displayed in the channel currency |
| Country | Default country and allowed shipping destinations |
| Product availability | Only products with channel listings are purchasable |
| Shipping methods | Only shipping zones covering the channel's countries |
| Payment gateways | Only payment Apps configured for the channel |
| Tax calculation | Tax rules based on channel and country |
## Checkout Line Management
### Line Mutations
| Operation | Mutation | Notes |
|-----------|----------|-------|
| Add lines | `checkoutLinesAdd` | Add new variants to checkout |
| Update lines | `checkoutLinesUpdate` | Change quantities of existing lines |
| Delete lines | `checkoutLinesDelete` | Remove lines from checkout |
| Replace all lines | `checkoutLinesAdd` with `forceNewLine: false` | Merges with existing lines |
### Line Fields
| Field | Description |
|-------|-------------|
| `variant` | The product variant being purchased |
| `quantity` | Number of units |
| `totalPrice` | Calculated total for the line |
| `unitPrice` | Price per unit (includes discounts) |
| `undiscountedTotalPrice` | Price before promotions |
| `requiresShipping` | Whether this line needs physical delivery |
## Address Management
### Shipping Address
Setting the shipping address triggers recalculation of available delivery methods:
| Field | Required | Description |
|-------|----------|-------------|
| `firstName` | Yes | Customer first name |
| `lastName` | Yes | Customer last name |
| `streetAddress1` | Yes | Primary street address |
| `streetAddress2` | No | Additional address line |
| `city` | Yes | City name |
| `postalCode` | Varies | Postal or ZIP code |
| `country` | Yes | ISO 3166-1 alpha-2 country code |
| `countryArea` | Varies | State or province |
| `phone` | No | Phone number |
### Billing Address
Required before payment. Can be set independently or copied from shipping address. Uses the same address input schema.
## Delivery Method Selection
After setting the shipping address, query available delivery methods:
| Method Type | Description |
|-------------|-------------|
| Shipping method | Standard carrier-based shipping (price or weight based) |
| Warehouse pickup | Click-and-collect from a physical warehouse |
| Custom shipping App | Dynamic rates from a shipping App via sync webhook |
Use `checkoutDeliveryMethodUpdate` to set the selected method by its ID.
> **Fetch live docs** for the `deliveryMethod` union type -- it includes both `ShippingMethod` and `Warehouse` for pickup.
## Payment Initialization (Transaction Flow)
Saleor uses a transaction-based payment model:
| Step | Mutation | Description |
|------|----------|-------------|
| 1. Initialize | `transactionInitialize` | Sends request to payment App; returns data or action needed |
| 2. Process (if needed) | `transactionProcess` | Handle additional steps like 3DS authentication |
| 3. Complete | `checkoutComplete` | Finalize checkout after successful payment |
### Transaction Initialize Input
| Field | Description |
|-------|-------------|
| `id` | Checkout ID |
| `paymentGateway` | Payment App ID and data (gateway-specific) |
| `amount` | Amount to charge (usually checkout total) |
| `idempotencyKey` | Unique key to prevent duplicate transactions |
### Transaction Initialize Response
| Field | Description |
|-------|-------------|
| `transaction` | Created transaction object |
| `transactionEvent` | Initial event (e.g., `CHARGE_REQUESTED`) |
| `data` | Gateway-specific response (e.g., client secret for Stripe) |
## Checkout Completion
After successful payment, call `checkoutComplete`:
| Outcome | Description |
|---------|-------------|
| Success | Returns `order` object; checkout is consumed |
| Confirmation needed | Returns `confirmationNeeded: true` with `confirmationData` |
| Error | Returns `errors` array with field and message |
> Checkout completion is idempotent -- calling it multiple times with the same checkout ID returns the same order.
## Error Handling
Common checkout errors and their causes:
| Error Code | Cause | Resolution |
|------------|-------|------------|
| `INSUFFICIENT_STOCK` | Variant out of stock | Remove line or reduce quantity |
| `INVALID_SHIPPING_METHOD` | Selected method unavailable for address | Re-query available methods |
| `SHIPPING_ADDRESS_NOT_SET` | Missing shipping address | Set address before delivery method |
| `BILLING_ADDRESS_NOT_SET` | Missing billing address | Set address before payment |
| `VOUCHER_NOT_APPLICABLE` | Voucher invalid for this checkout | Remove voucher or adjust checkout |
| `CHECKOUT_NOT_FULLY_PAID` | Payment incomplete | Complete payment before checkout |
## Abandoned Checkout Handling
| Strategy | Description |
|----------|-------------|
| Query stale checkouts | Use `checkouts` query filtered by `lastChange` date |
| Email recovery | Send reminder emails for checkouts with email set |
| Metadata tracking | Use checkout `metadata` to store abandonment funnel data |
| TTL cleanup | Saleor automatically removes expired checkouts (configurable) |
> **Fetch live docs** for checkout expiration settings and the `checkouts` admin query filter syntax.
## Best Practices
- Always create checkouts scoped to a specific channel
- Validate stock availability before checkout completion (Saleor checks automatically, but early validation improves UX)
- Use `transactionInitialize` / `transactionProcess` for payments (not legacy `checkoutPaymentCreate`)
- Set both shipping and billing addresses before payment initialization
- Use `idempotencyKey` on transaction initialization to prevent duplicate charges
- Handle `confirmationNeeded` responses for payment methods requiring additional authentication
- Query `availableShippingMethods` and `availablePaymentGateways` dynamically after address changes
- Store custom data in checkout `metadata` for analytics and recovery workflows
- Implement error handling for every checkout step -- validate responses before proceeding
Fetch the Saleor checkout and transaction documentation for exact mutation inputs, error codes, and payment flow patterns before implementing.Related Skills
woo-checkout
Customize WooCommerce checkout — classic and block-based checkout, custom fields, validation, order processing, and checkout extensibility. Use when modifying the checkout flow, adding custom checkout fields, or integrating checkout extensions.
ucp-embedded-checkout
Implement UCP Embedded Checkout Protocol — iframe/webview-based checkout UI for human escalation using JSON-RPC 2.0 over postMessage. Use when the checkout status is requires_escalation and the buyer needs a merchant-hosted UI.
ucp-checkout-rest
Implement UCP Checkout over the REST binding — create, get, update, complete, and cancel checkout sessions with proper headers, idempotency, status transitions, and error handling. Use when building REST-based UCP checkout endpoints or clients.
ucp-checkout-mcp
Implement UCP Checkout over the MCP (Model Context Protocol) binding — expose checkout operations as MCP tools for AI agents. Use when building an MCP server that AI agents like Claude or Gemini can call for commerce, or when integrating with Shopify's MCP endpoint.
ucp-checkout-a2a
Implement UCP Checkout over the A2A (Agent-to-Agent) binding — enable autonomous agent-to-agent commerce using Agent Cards and structured message parts. Use when building agent-to-agent commerce flows.
spree-checkout
Implement Spree's checkout — the Order state machine (cart → address → delivery → payment → confirm → complete), the Payment and Shipment sub-state machines, the return flow (ReturnAuthorization → CustomerReturn → Reimbursement → Refund), guest checkout, payment-step skipping for credit-covered orders, and the V3 checkout API surface. Use when building or customizing checkout flows, debugging state transitions, or wiring custom checkout steps.
shopify-checkout-ui
Build Shopify checkout UI extensions — extension targets, UI primitives, Preact/Remote DOM rendering, checkout APIs, metafield access, post-purchase extensions, and thank-you page customization. Use when customizing Shopify checkout.
saleor-webhooks
Configure Saleor webhooks — async and sync events, subscription payloads, JWS/HMAC signature verification, retry policy, and event types. Use when building webhook-driven integrations.
saleor-testing
Test Saleor applications — pytest setup, Django test client, GraphQL test patterns, App testing, factory_boy fixtures, and webhook testing. Use when writing tests for Saleor projects.
saleor-storefront
Build Next.js storefronts for Saleor — GraphQL client setup, channel routing, Tailwind CSS, server components, checkout flow, and SEO. Use when developing Saleor storefronts.
saleor-shipping
Configure Saleor shipping — shipping zones, methods (price/weight-based), custom shipping Apps, warehouse-based allocation, and click-and-collect. Use when setting up delivery options.
saleor-setup
Set up a Saleor development environment — saleor-platform Docker Compose, CLI, PostgreSQL/Redis prerequisites, manage.py commands, environment variables, project structure. Use when starting a new Saleor project.