Centra Storefront API

website·Indexed 33 days ago

https://centra.dev

API reference for the Centra Storefront API, featuring GraphQL queries and mutations for managing sessions, selections, wishlists, and cart operations. Includes detailed documentation on handling line attributes, custom pricing, subscription intervals, and payment integrations such as Stripe Payment Intents.

Tokens
183.5K
Snippets
577
Records
1.1K
Agent score
69%

What's inside Centra

  1. Overview of the Centra Storefront API Checkout process

    The checkout process is powered by the Checkout and Selection fields. Querying the Checkout field triggers critical shipping and tax calculations, which require details such as the full ship-to address. It is recommended to always query the Checkout field when the customer is on the checkout page or when a mutation is instantiated from that page. The Storefront API returns the last valid state of Selection and Checkout even if userErrors are present, allowing the UI to remain consistent.
  2. Overview of Centra Storefront API capabilities

    The Storefront API is a GraphQL-based API designed for high-performance storefronts. Key features include:

    • Strongly Typed Schema: Ensures reliability and consistency.
    • Batching: Ability to execute multiple queries or mutations in a single call to enhance performance.
    • Flexible Modes: Supports both Session Mode (for cart/checkout management based on market, price list, and language) and No-Session Mode (stateless, ideal for custom caches).
    • Advanced Search & Filtering: Provides full-text search and comprehensive filtering via displayItems.filters (categories, collections, brands).
    • Affiliate Tracking: Automatically connects affiliates to selections when users arrive via affiliate links.
    • Selection Integration: Allows checking out selections created in the Centra backend using the claimSelection mutation.
    mutation { claimSelection(id: "...", hash: "...") { ... } }
  3. Overview of the Centra SOAP Integration API

    The SOAP Integration API is designed for legacy systems that require SOAP as their primary integration method. It allows developers to programmatically manipulate core business entities, including products, customers, invoices, warehouses, and orders.
  4. Overview of Price Injections in Centra Storefront API

    Price injections allow a backend system to override the prices Centra's pricing engine normally applies to individual cart lines or shipping methods. While the monetary value is replaced, Centra retains control over the product catalog, tax logic, and voucher handling. This is typically used for dynamic CO₂ fees, donations, made-to-measure pricing, or B2B customer-segment pricing.
  5. Overview of the Centra Event System

    The Centra event system provides a pull-based stream of events via the Integration API, allowing developers to identify changes in Centra objects without periodic polling of every data type. It is primarily intended for backend synchronizations and transformations.

    Key concepts include:

    • Object Type: The entity that was changed (e.g., Order, Product).
    • Change Type: How the entity was changed. Common types include CREATED, UPDATED, and DELETED. Special types include:
      • COMPLETED: Used for objects with a "Completed" status (e.g., Order, Shipment, Return, PurchaseOrder, PurchaseDelivery).
      • DEPENDENT_DATA_CHANGED: Triggered by indirect changes to connected entities (e.g., updating a ProductMedia image triggers events for the associated Product and ProductVariant).
  6. Overview of voucher methods

    Centra supports three voucher methods, all of which share the same discount structure and capabilities:

    1. AUTO: Applied automatically when specific criteria are met.
    2. CODE: Applied when a customer enters a specific alphanumeric code.
    3. URL: Applied via a specific URI link.
  7. Overview of Split Shipments integration flow

    Implementing split shipments involves integrating an External Allocation System (EAS) with Centra's Storefront API. The EAS acts as the stock master and determines how orders are split based on inventory levels or other factors. The general flow is:

    1. Configure the External Allocation Plugin in Centra.
    2. Implement the EAS API contract to handle requests and responses.
    3. Trigger the EAS call via a GraphQL mutation in the Storefront API during checkout.
    4. Retrieve Delivery Group information via the Storefront API after order placement.
    5. Create shipments from Delivery Groups using the Integration API.
    6. Manage Delivery Groups within Centra AMS.
  8. Overview of External Gift Card payment scenarios

    The External Gift Cards plugin allows Centra merchants to accept gift cards issued by third-party providers. It supports both digital and physical cards and handles two primary payment scenarios:

    • 100% gift card: The gift card balance covers the entire order total.
    • Split payment: The gift card covers part of the total, and the remaining balance is paid via a standard payment plugin (e.g., credit card).
  9. Overview of Centra Storefront API capabilities

    The Storefront API is a GraphQL-based interface designed for building modern storefronts. It supports both server-side and client-side implementations and utilizes token authentication for session-based cart management and order finalization. Key technical features include a strongly typed schema for reliability and the ability to execute multiple queries or mutations in a single network call to reduce latency and bandwidth.
  10. Overview of Stripe Express Checkout integration

    The Stripe Express Checkout integration allows storefronts to mount Google Pay and Apple Pay using Stripe's ExpressCheckoutElement. Unlike traditional Stripe integrations, this uses a deferred payment-intent pattern: no PaymentIntent is created until the shopper confirms payment in the wallet sheet. This prevents the creation of orphaned intents if a shopper cancels the flow. The integration relies on the expressCheckoutWidgets query and Storefront API payment instructions.
  11. Overview of Mailchimp E-commerce integration for Centra

    The Mailchimp E-commerce plugin in Centra is a mailtrigger plugin designed to automate receipt emails when orders are placed, shipped, or returned. It allows developers to connect marketing campaigns with sales to track conversions within Mailchimp. When configured, Centra automatically installs a Store in Mailchimp using the base currency of the Centra instance. Note that because Mailchimp stores are limited to a single currency, products sent to the Mailchimp product catalog will not contain prices.
  12. Overview of Centra Storefront API capabilities

    The Storefront API is a GraphQL-based interface designed for building modern storefronts. It supports both server-side and client-side implementations and uses token authentication for session-based cart management and order finalization. Key capabilities include:

    • Product Catalog & Discovery: Custom attribute filtering, brand/availability searches, dynamic product listing pages (PLP), product display pages (PDP), and category listings.
    • Cart & Checkout: Adding products and bundles, subscription handling, and seamless order finalization.
    • Logistics & Payments: Integration with pre-built payment providers, tax calculation (including external engines), and shipping options such as 'buy online, ship from store' and 'buy online, pick up in-store'.
    • Infrastructure: URI-based routing for page rendering and flexible configuration for affiliates, allocation rules, brick-and-mortar locations, and customizable bundles.