| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [View Raw Code] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
The createCheckoutSession function creates a new checkout session with GoDaddy's commerce API.
import { createCheckoutSession } from "@godaddy/react";
const session = await createCheckoutSession(input, options);The first parameter accepts all checkout session configuration options from the GraphQL schema:
The CheckoutSessionOptions interface allows you to configure authentication and other settings:
interface CheckoutSessionOptions {
auth?: {
clientId: string;
clientSecret: string;
};
}When provided, these credentials will be used to obtain an access token for API requests. If not provided, the function will use empty strings which may result in authentication failures.
The checkout session supports multiple environments through the input parameter:
The checkout session automatically requests the following OAuth2 scope:
The operatingHours field configures local pickup scheduling — time zones, lead times, pickup windows, and slot intervals.
operatingHours: {
default: {
timeZone: 'America/New_York',
leadTime: 60,
pickupWindowInDays: 7,
pickupSlotInterval: 30,
hours: {
monday: { enabled: true, openTime: '09:00', closeTime: '17:00' },
tuesday: { enabled: true, openTime: '09:00', closeTime: '17:00' },
wednesday: { enabled: true, openTime: '09:00', closeTime: '17:00' },
thursday: { enabled: true, openTime: '09:00', closeTime: '17:00' },
friday: { enabled: true, openTime: '09:00', closeTime: '18:00' },
saturday: { enabled: true, openTime: '10:00', closeTime: '16:00' },
sunday: { enabled: false, openTime: null, closeTime: null },
},
},
}| Field | Type | Required | Description |
|---|---|---|---|
| timeZone | string | Yes | IANA timezone for the store (e.g. America/New_York). All slot times are displayed in this timezone. |
| leadTime | number | Yes | Minimum advance notice in minutes before a pickup can be scheduled. Controls the earliest available slot (now + leadTime). |
| pickupWindowInDays | number | Yes | Number of days ahead customers can schedule pickup. Set to 0 for ASAP-only mode (no date/time picker). |
| pickupSlotInterval | number | No | Minutes between selectable time slots (e.g. 30 → 10:00, 10:30, 11:00…). Defaults to 30 if omitted. Separate from leadTime — the interval controls slot spacing, while leadTime controls advance notice. |
| hours | object | Yes | Per-day operating hours. Each day has enabled (boolean), openTime (HH:mm or null), and closeTime (HH:mm or null). |
The appearance field customizes the checkout's look and feel.
appearance: {
theme: 'base',
variables: {
primary: '#4f46e5',
background: '#ffffff',
foreground: '#111827',
radius: '0.5rem',
},
}| Value | Description |
|---|---|
| base | Default theme |
| orange | Orange accent theme |
| purple | Purple accent theme |
All fields are optional strings. Pass any subset to override the defaults.
| Variable | Description |
|---|---|
| accent | Accent color |
| accentForeground | Text on accent backgrounds |
| background | Page background |
| border | Border color |
| card | Card background |
| cardForeground | Text on cards |
| defaultFontFamily | Default font family |
| destructive | Destructive action color (errors, delete) |
| destructiveForeground | Text on destructive backgrounds |
| fontMono | Monospace font family |
| fontSans | Sans-serif font family |
| fontSerif | Serif font family |
| foreground | Primary text color |
| input | Input field background |
| muted | Muted/subtle background |
| mutedForeground | Text on muted backgrounds |
| popover | Popover background |
| popoverForeground | Text in popovers |
| primary | Primary brand color |
| primaryForeground | Text on primary backgrounds |
| radius | Border radius (e.g. 0.5rem) |
| ring | Focus ring color |
| secondary | Secondary color |
| secondaryBackground | Secondary background |
| secondaryForeground | Text on secondary backgrounds |
This package ships a TanStack Intent skill that teaches AI coding agents how to authenticate with the GoDaddy Commerce Platform using OAuth2 client credentials and create checkout sessions. For API discovery and testing, the skill directs agents to use @godaddy/cli.
Tell your agent:
Read node_modules/@godaddy/react/skills/commerce-api/SKILL.md and use it to authenticate with the GoDaddy Commerce APIs.
From your project directory, run:
npx @tanstack/intent@latest list
This will show the commerce-api skill and its path. To set up persistent skill-to-task mappings in your AGENTS.md, run:
npx @tanstack/intent@latest install
Then ask your agent to follow the instructions it outputs.
For now the schema will be downloaded from the order schema.
pnpm run codegen
| Back | FazBrowse Home | New Git URL |