Scheduled Services
Schedule services through the unified cart checkout flow
Service scheduling is part of E-shop. Services and providers define what can be scheduled, and cart checkout creates one Order plus separate OrderBooking child records. There is no second booking-order root: products and bookings still share the same cart, totals, payment, and customer order.
Setup
import { initialize } from 'arky-sdk/storefront';
const arky = initialize('arky_pk_...', {
market: 'us',
locale: 'en',
});
await arky.eshop.cart.load();
Service Flow
The service controller keeps availability, calendar state, selected slots, and service cart items together.
const { items: services } = await arky.eshop.service.list({ limit: 20 });
const service = services[0];
await arky.eshop.service.initialize();
await arky.eshop.service.select(service);
await arky.eshop.service.findFirstAvailable();
const state = arky.eshop.service.state.get();
const slot = state.slots[0];
arky.eshop.service.selectTimeSlot(slot);
await arky.eshop.service.addToCart();
The selected service line is now in eshop.cart.booking_items and the backend cart.
const cartSnapshot = arky.eshop.cart.snapshot.get();
console.log(cartSnapshot.booking_items);
Quote And Checkout
Quote and checkout stay on the cart, even for service-only orders.
const quote = await arky.eshop.cart.quote();
const order = await arky.eshop.cart.checkout({
payment_method_key: 'cash',
});
console.log(order.order_id, quote?.money.total);
Service-only orders do not require a shipping address or shipping method. Mixed carts can include shipping context for product lines and zone-based taxes.
Mixed Carts
Product and service appointment lines can be quoted and checked out together:
await arky.eshop.cart.addProduct(product, variant, 1);
await arky.eshop.service.addToCart();
await arky.eshop.cart.quote({
shipping_method_id: 'standard',
shipping_address,
});
await arky.eshop.cart.checkout({
payment_method_key: 'credit_card',
shipping_method_id: 'standard',
shipping_address,
});
Lower-Level Escape Hatch
If you are building a custom scheduler, you can still add service items manually through the cart helper.
await arky.eshop.cart.addBooking({
id: `${serviceId}-${from}`,
service_id: serviceId,
provider_id: providerId,
slots: [{ from, to }],
forms: [],
});
Prefer the service controller when it fits. It keeps the storefront lean and matches the platform flow.