Centra API Documentation

website·Indexed 30 days ago

https://internal-centra-dev-app.vercel.app/

Technical documentation for Centra's suite of APIs, including the Storefront API for cart and checkout flows, the Integration API for PIM and B2B account management, and legacy Order, Checkout, and SOAP integration services. Covers GraphQL mutations and queries, payment integrations with Stripe and Adyen, and best practices for catalog imports and stock queries.

Tokens
178.9K
Snippets
578
Records
1.1K
Agent score
75%

What's inside Centra

  1. Overview of the Centra Storefront Accelerator

    The Storefront Accelerator is a Next.js-based reference implementation designed to help developers quickly deploy e-commerce websites. It is licensed under MIT and provides a starting point for common e-commerce features including product listing pages (with filters and search), product details pages, basket sidebars, localization, customer accounts (sign-in, registration, subscriptions, order history), bundles, and a multi-step checkout process (address, delivery, and payments).
    # The code is hosted on GitHub
    git clone https://github.com/centrahq/storefront-accelerator
  2. Overview of Centra Price Injections

    Price injections allow a backend system to override the prices normally applied by Centra's pricing engine for individual cart lines or shipping methods. While the monetary value is replaced, Centra retains control over the product catalog, tax logic, and voucher handling. Common use cases include dynamic CO₂ fees, donations, made-to-measure pricing from external configurators, and B2B/loyalty segment pricing.
  3. Overview of Storefront API cached data types

    The Storefront API automatically caches specific data types to ensure fast, real-time delivery. These are divided into two categories:

    Configuration Data:

    • Markets
    • Pricelists
    • Languages

    Product Catalog Data:

    • DisplayItems
    • Categories
    • Brands
    • Collections
    • Affiliates
    • BrickAndMortars
  4. Overview of Centra Fraud Prevention integration

    Centra supports post-authorization fraud checks, where the fraud check occurs after the payment is authorized and the order is placed. This requires a custom Partner Integration to act as a bridge between the Centra store and the external fraud prevention solution (e.g., Riskified, Signifyd). Pre-authorization checks (before the order is placed) can be handled using Centra's reCaptcha implementation.
  5. Overview of Storefront API capabilities

    The Storefront API is a high-performance GraphQL API designed for building modern storefronts. It supports both server-side and client-side implementations and utilizes a strongly typed schema to ensure data consistency. Key technical features include the ability to execute multiple queries or mutations in a single call to reduce bandwidth and latency, and support for both session-based and no-session configuration modes.
  6. Overview of Storefront API capabilities

    The Storefront API is a high-performance GraphQL API designed for building modern storefronts. It supports both server-side and client-side implementations and utilizes a strongly typed schema to ensure data consistency. Key architectural features include the ability to execute multiple queries or mutations in a single network call to reduce bandwidth and latency.
  7. Overview of Mailchimp E-commerce integration flow

    The Mailchimp E-commerce plugin in Centra acts as a mailtrigger to automate receipt emails for orders placed, shipped, or returned. It allows developers to connect marketing campaigns with sales to track conversions within Mailchimp.

    Key flow steps:

    1. Configure API keys and settings in Centra.
    2. Centra automatically installs a Store in Mailchimp using the Centra instance's base currency.
    3. Events in Centra trigger emails in Mailchimp based on configured settings.
    4. Products added to receipts are synced to the Mailchimp product catalog (without prices, as Mailchimp stores support only a single currency).
    5. Campaign conversion tracking is achieved by passing the Mailchimp Campaign ID and Mailchimp Landing Site during the POST /payment call to Centra.
  8. Overview of Adyen Express Checkout integration flow

    Integrating Adyen Express Checkout (Google Pay and Apple Pay) follows a consistent sequence of Centra API calls across web, iOS, and Android platforms. The flow ensures that cart state, shipping, and payment instructions are synchronized before final submission.
    1. query expressCheckoutWidgets: Fetch Adyen config (client key, payment methods, environment).
    2. query selection: Retrieve current cart state.
    3. mutation addItem: (PDP flow only) Add item to selection on the fly.
    4. mutation paymentInstructions(paymentInitiateOnly: true): Recalculate totals and shipping methods for the shopper's address.
    5. mutation setShippingMethod: Persist the selected shipping option.
    6. mutation paymentInstructions: Submit final payment with wallet data and addresses.
    7. mutation paymentResult: Handle 3DS / additional details callback.
    8. query order: Fetch the placed order for the confirmation screen.
  9. Overview of the Checkout API architecture

    The Checkout API is a hybrid server-side and client-side API. It allows developers to extract product catalog data for local caching or static page generation (server-side) while enabling customers to manage their carts and finalize orders via JavaScript (client-side). A backend is required for practical implementations to handle caching of infrequently changing data, server-to-server tracking, and accessing restricted data to avoid rate limiting and API overage charges.
  10. Overview of the SOAP Integration API

    The SOAP Integration API is designed for legacy systems that require SOAP as their primary integration method. It provides endpoints to programmatically manipulate core business entities, including products, customers, invoices, warehouses, and orders.
  11. Overview of Centra Webhooks

    The Centra Webhook plugin allows developers to create event-driven notifications when data changes in Centra. Webhooks are triggered by events (e.g., new orders, product description changes) and sent to a URL defined in the plugin. Because webhooks are not guaranteed to arrive or be in order, developers should implement a 'fetch everything' function to restore data after network or application failures.
  12. Overview of Checkout API capabilities

    The Checkout API provides several core functionalities for e-commerce integration:

    • Product Data: Filter products based on custom attributes, brands, or availability defined in plugin settings.
    • Selection Handling: Finalize orders using third-party payment methods via defined integration flows, reducing the need for per-payment-method customization.
    • Routing: Use the API to determine what to render based on the accessed URI, allowing Centra's routing to act as a fallback.
    • Customer Handling: Manage customer lifecycles including registration, profile modification, sign-in, password reset, and sign-out, ensuring cart persistence across sessions and browsers.