.png)

Shopify B2B Integration Guide
Shopify B2B integrates with enterprise systems through the Admin GraphQL API, selected webhooks, asynchronous bulk operations, and scope-controlled authentication.
Shopify B2B integration options at a glance
Shopify B2B uses the Admin GraphQL API as its preferred integration interface for Companies, CompanyLocations, Catalogs, PriceLists, Products, Customers, Orders, and webhook subscriptions. Selected webhook topics can notify external systems about changes, while asynchronous GraphQL bulk operations support initial loads and large-scale reconciliation. Shopify also retains a legacy REST Admin API for existing implementations and provides limited file and media APIs. Martini can securely consume these APIs, receive webhook notifications through an exposed API, orchestrate bulk-operation monitoring, paginate and checkpoint synchronization, transform B2B relationships, and route validated data to enterprise applications.
| Integration point | Supported by Shopify B2B? | Common use cases | How Martini supports it |
|---|---|---|---|
| Admin GraphQL API | Yes | Primary interface for querying and mutating Companies, CompanyLocations, Catalogs, PriceLists, Products, Customers, Orders, and webhook subscriptions. | Martini can consume GraphQL APIs, store endpoint and credential configuration securely, map responses, orchestrate mutations, and handle GraphQL errors and retries. |
| Webhooks and outbound callbacks | Limited | Selected topics can notify integrations about order, product, customer, company, inventory, app, and store configuration changes. Coverage is not universal across B2B objects or fields. | Martini can expose an API endpoint for Shopify webhook delivery, acknowledge notifications quickly, deduplicate events, retrieve current resources, and process larger workloads asynchronously. |
| Bulk and asynchronous operations | Yes | GraphQL bulk operations support large exports and initial or recovery synchronization for Products, Customers, Orders, Companies, and related data where fields are available. | Martini can start bulk queries, monitor operation status, retrieve generated results, parse them, transform relationships, and load downstream systems idempotently. |
| Pagination and incremental synchronization | Yes | Cursor-based pagination, updatedAt filters where supported, webhook notifications, and scheduled reconciliation support ongoing synchronization. | Martini workflows can persist cursors and checkpoints, process pages until completion, combine event-driven and scheduled flows, and recover from interrupted runs. |
| REST Admin API | Legacy | Existing integrations or specific legacy dependencies may continue to use Shopify’s REST Admin API, although GraphQL is recommended for new development. | Martini can consume REST APIs when required, while keeping the integration isolated so future migration to GraphQL can be managed deliberately. |
| File and media APIs | Limited | GraphQL file and media operations support store content and product media, but they are not a general-purpose B2B document repository. | Martini can call the documented file and media operations and map results, while treating document scope and retention as explicit integration requirements. |
| Authentication and access tokens | Yes | OAuth, custom or public app authorization, online or offline access tokens, and scope-based authorization control Admin API access. | Martini can store tokens and configuration as secured environment values or secrets and implement authorization or token lifecycle logic where required. |
| Database and analytics access | No | No direct customer database access is documented; Shopify data should be accessed through supported APIs and exports. | Martini can load API results into an approved database or analytical pipeline, but it does not bypass Shopify through direct database access. |
How Shopify B2B exposes data and business events
Shopify B2B Admin GraphQL API
Shopify identifies the Admin GraphQL API as the preferred interface for new integrations. It exposes queries and mutations for B2B resources including Companies, CompanyLocations, Catalogs, PriceLists, Products, Customers, Orders, and webhook subscriptions. Access is controlled by API scopes and the merchant’s enabled Shopify plan features.
Martini implementation pattern
Martini implementation pattern: A Martini workflow calls the versioned Shopify Admin GraphQL endpoint with secured access-token configuration, requests only the fields required by the target model, follows cursors, evaluates returned errors and throttle information, transforms related B2B objects, and writes results to downstream applications or databases.
Implementation sequence
Shopify B2B webhooks
Shopify supports webhook subscriptions for selected topics, including certain order, product, customer, company, inventory, app, and store configuration events. Webhook coverage is topic-specific and does not represent a universal change feed for every B2B object or field.
Martini implementation pattern
Martini implementation pattern: Martini exposes an API endpoint for Shopify webhook delivery, acknowledges the notification promptly, validates and deduplicates the event, then invokes an asynchronous workflow to retrieve the current Shopify resource and update the target system. Scheduled reconciliation remains necessary for completeness.
Implementation sequence
Shopify B2B bulk operations
Shopify GraphQL bulk operations provide asynchronous large-volume queries and exports. They are appropriate for initial loads, periodic reconciliation, and recovery processes involving Companies, Customers, Products, Orders, and related data where the required fields are available.
Martini implementation pattern
Martini implementation pattern: A scheduled workflow starts a bulk query, stores the operation identifier, polls or checks the operation lifecycle, retrieves the generated result when complete, parses the output, and loads downstream systems with stable keys and duplicate protection.
Implementation sequence
Shopify B2B REST Admin API
Shopify’s REST Admin API remains available for existing integrations, but it is classified as legacy and is not the recommended starting point for new development. It may still be relevant for a specific existing dependency or migration constraint.
Martini implementation pattern
Martini implementation pattern: Martini can consume required REST endpoints through an API workflow, isolate legacy mappings from newer GraphQL flows, and apply the same pagination, authentication, retry, and idempotency controls used elsewhere in the integration.
Implementation sequence
Common Shopify B2B integration patterns
Pattern 1: Synchronize companies and customers with an ERP
When to use this pattern
Use this pattern when Shopify B2B is the commerce-facing source for business organizations, purchasing locations, and buyer contacts while an ERP or customer master remains responsible for finance and enterprise account processes.
Integration direction
Example Mapping
| Shopify B2B Field | Canonical Field | Target Field |
|---|---|---|
| Company.id | organizationId | NetSuite customer internal or external ID |
| CompanyLocation.id | purchasingLocationId | NetSuite customer location reference |
| Customer.email | contactEmail | NetSuite contact email |
| CompanyLocation.address | billingOrShippingAddress | NetSuite address book |
Martini implementation pattern
A scheduled workflow performs paginated or bulk extraction of Companies, CompanyLocations, and Customers, while selected webhook topics can initiate focused updates. Martini preserves parent-child relationships, validates required identifiers and addresses, applies create-or-update rules, and routes rejected or throttled records to a controlled retry or exception flow.
Martini capabilities used
- workflows
- API consumption
- pagination and checkpointing
- data mapping
- business rules
- error handling
Pattern 2: Synchronize products and B2B pricing
When to use this pattern
Use this pattern when an ERP or product-information process owns product data or pricing and Shopify B2B must reflect current Products, ProductVariants, Catalogs, and PriceLists for purchasing companies and locations.
Integration direction
Example Mapping
| Shopify B2B Field | Canonical Field | Target Field |
|---|---|---|
| ProductVariant.id | productVariantId | Shopify ProductVariant ID |
| ProductVariant.sku | sku | Shopify variant SKU |
| PriceList.price | customerPrice | Shopify B2B price-list price |
| Catalog.id | catalogId | Shopify Catalog ID |
Martini implementation pattern
Martini receives product or pricing changes from the source system, transforms SKUs, currencies, effective dates, and catalog relationships, then calls Shopify GraphQL mutations. Validation prevents incomplete pricing updates, while throttling and transient failures are retried with controlled backoff and failed business validations are routed for review.
Martini capabilities used
- workflows
- GraphQL API consumption
- data transformation
- business rules
- secure configuration
- retry handling
Pattern 3: Process B2B orders into fulfillment and finance
When to use this pattern
Use this pattern when Shopify B2B orders need to create sales orders in an ERP or fulfillment application and status updates need to be returned to Shopify or another business system.
Integration direction
Example Mapping
| Shopify B2B Field | Canonical Field | Target Field |
|---|---|---|
| Order.id | commerceOrderId | NetSuite sales order external ID |
| Order.customer | buyerReference | NetSuite customer reference |
| Order.lineItems | orderLines | NetSuite item lines |
| Order.shippingAddress | shipToAddress | NetSuite shipping address |
Martini implementation pattern
A selected Shopify order webhook starts a Martini workflow that acknowledges the event, retrieves the full Order and available Company or CompanyLocation context, validates customer and product identifiers, and submits an idempotent sales-order request. The workflow distinguishes duplicate events, temporary failures, missing resources, and permanent validation errors before updating fulfillment or exception status.
Martini capabilities used
- API exposure
- webhook consumption
- workflow orchestration
- data mapping
- idempotency
- error handling
Pattern 4: Perform initial migration and recurring reconciliation
When to use this pattern
Use this pattern for an initial Shopify B2B data load, periodic completeness checks, or recovery after an event-processing interruption. It combines bulk operations with incremental queries and selected webhooks.
Integration direction
Example Mapping
| Shopify B2B Field | Canonical Field | Target Field |
|---|---|---|
| Company.updatedAt | sourceUpdatedAt | warehouse source timestamp |
| Order.id | orderKey | warehouse order key |
| ProductVariant.inventoryQuantity | availableQuantity | warehouse inventory measure |
| PriceList.currency | pricingCurrency | warehouse pricing currency |
Martini implementation pattern
A Martini scheduler starts asynchronous bulk operations for large datasets, stores operation and page checkpoints, parses completed results, and loads the target with stable Shopify IDs. Subsequent runs combine webhook notifications, updatedAt filters where supported, and scheduled reconciliation so missed, delayed, or out-of-order events do not permanently desynchronize systems.
Martini capabilities used
- scheduled workflows
- bulk API orchestration
- JSON processing
- checkpointing
- data mapping
- monitoring and retry
Applications commonly integrated with Shopify B2B
Shopify B2B can be integrated with named enterprise applications for finance, customer management, fulfillment, tax, marketing, and reporting. The exact scope depends on the merchant’s Shopify plan, installed applications, API permissions, and the target system’s interfaces.
| Application | Scenario | Direction | Martini Pattern |
|---|---|---|---|
| NetSuite | Synchronize Shopify B2B Companies, Customers, Products, Orders, inventory, fulfillment, pricing, and financial status with ERP processes. | Shopify B2B → Martini → NetSuite | Martini can consume Shopify Admin GraphQL queries and webhooks, map B2B objects to NetSuite records through its available APIs, apply idempotent create-or-update rules, and route validation or throttling failures for retry. |
| SAP S/4HANA | Connect B2B customer master data and commerce orders with enterprise finance, sales, inventory, and fulfillment processes. | Shopify B2B → Martini → SAP S/4HANA | A Martini workflow can combine Shopify webhook-driven order processing with scheduled Company and Product synchronization, transform Shopify identifiers and pricing structures into SAP models, and maintain checkpoints and exception handling. |
| Salesforce | Synchronize business accounts, contacts, customer activity, and commerce orders with CRM processes. | Shopify B2B → Martini → Salesforce | Martini can retrieve Shopify Companies, CompanyLocations, Customers, and Orders, map organization and contact relationships into Salesforce, and apply business rules to prevent duplicate account or contact creation. |
| Microsoft Dynamics 365 | Align Shopify Companies, Customers, Orders, Products, and inventory with ERP and CRM processes. | Shopify B2B → Martini → Microsoft Dynamics 365 | Martini can orchestrate bidirectional API workflows, use Shopify global IDs and external identifiers as stable keys, transform catalog and order data, and retry temporary downstream failures without duplicating transactions. |
| Klaviyo | Send customer, order, and product activity to support B2B marketing segmentation and lifecycle communication. | Shopify B2B → Martini → Klaviyo | Martini can consume selected Shopify events or scheduled queries, normalize Customer, Order, Product, and ProductVariant data, and publish only the fields and events supported by the customer’s Klaviyo implementation. |
| ShipStation | Pass Shopify orders into fulfillment workflows and return shipment or fulfillment status to Shopify. | Shopify B2B → Martini → ShipStation | A Martini workflow can receive an order notification, retrieve the complete Shopify Order and B2B context, validate fulfillment data, submit the mapped order to ShipStation, and process status updates asynchronously. |
| Avalara | Submit transaction and customer information for tax calculation and tax reporting. | Shopify B2B → Martini → Avalara | Martini can map Shopify order, customer, address, and line-item data to Avalara’s supported API model, apply tax-processing rules, and return or persist tax results according to the commerce workflow. |
| Power BI | Consolidate Shopify B2B orders, products, customers, companies, and pricing data for reporting and analysis. | Shopify B2B → Martini → Power BI | Martini can run scheduled or bulk Shopify extracts, parse asynchronous results, normalize related B2B objects, and load the data into a reporting pipeline or supported analytical target. |
How to build a Shopify B2B integration in Martini
Objective
Establish the Shopify B2B connection using a versioned Admin GraphQL endpoint, the required access token, and only the scopes needed by the integration.
Instructions in Martini
- Configure the Shopify shop endpoint and API version in Martini environment settings.
- Store access tokens and related credentials in secured environment configuration or secrets.
- Confirm the merchant plan, enabled B2B features, and required API scopes.
Objective
Select an event-driven, scheduled, or bulk-operation trigger based on the resource and completeness requirements.
Instructions in Martini
- Use a Martini API endpoint for selected Shopify webhook topics.
- Use a scheduler for incremental queries and periodic reconciliation.
- Use a bulk-operation workflow for initial loads and large recovery exports.
Objective
Retrieve the current Shopify resource or collection and preserve pagination, operation, and synchronization state.
Instructions in Martini
- Call the Admin GraphQL API with a minimal field selection.
- Follow cursor-based pagination until the connection is complete.
- Persist cursors, bulk-operation identifiers, and run checkpoints.
Objective
Coordinate Shopify calls, downstream requests, validation, enrichment, and asynchronous processing as a maintainable Martini workflow.
Instructions in Martini
- Separate webhook acknowledgment from long-running processing.
- Use conditional routing for resource types and business outcomes.
- Encapsulate reusable retrieval or normalization logic in reusable integration assets.
Objective
Convert Shopify’s B2B relationships into the target system’s canonical model without losing Company, CompanyLocation, Catalog, PriceList, Product, ProductVariant, Customer, or Order context.
Instructions in Martini
- Map Shopify global IDs and external identifiers to stable canonical keys.
- Preserve parent-child relationships and location-level commercial attributes.
- Transform JSON, pricing, addresses, line items, and timestamps to the target format.
Objective
Validate permissions, identifiers, pricing, order contents, feature availability, and target-system business conditions before writing data.
Instructions in Martini
- Reject incomplete or unauthorized data without indefinite retries.
- Use idempotent create-or-update rules for synchronization.
- Apply merchant-specific rules for catalogs, payment terms, pricing, and fulfillment.
Common Shopify B2B data objects used in integrations
| Object | Typical Use | Common target systems | Martini handling |
|---|---|---|---|
| Company | Represents the business customer organization purchasing from the Shopify store. | NetSuite, SAP S/4HANA, Salesforce, Microsoft Dynamics 365 | Martini retrieves Company data through GraphQL, maps the organization using the Shopify global ID or governed external key, and applies idempotent create-or-update logic. |
| CompanyLocation | Represents a purchasing location associated with a Company, including addresses, contacts, payment terms, and catalog assignments. | NetSuite, SAP S/4HANA, Salesforce, Microsoft Dynamics 365 | Martini preserves the Company-to-CompanyLocation relationship and maps location-level commercial attributes without flattening them into the parent Company. |
| Catalog | Defines a B2B assortment and pricing configuration assigned to eligible companies or company locations. | ERP, product-information systems, reporting platforms | Martini synchronizes catalog assignments and related pricing relationships, validates availability, and retains identifiers needed for reconciliation. |
| PriceList | Contains B2B pricing rules for products or variants. | NetSuite, SAP S/4HANA, Microsoft Dynamics 365, reporting platforms | Martini maps product or variant identifiers, currency, and effective pricing fields, then applies business rules before updating a target pricing model. |
| Product | Represents a product offered through the Shopify store and referenced by catalogs and orders. | ERP, PIM, Microsoft Dynamics 365, Power BI | Martini can retrieve Products through paginated or bulk GraphQL operations, transform product attributes, and synchronize them using stable Shopify or external identifiers. |
| ProductVariant | Represents a purchasable product variant with inventory, identifiers, and pricing attributes. | ERP, PIM, ShipStation, reporting platforms | Martini preserves the Product-to-ProductVariant relationship and maps SKU, inventory, price, and variant identifiers to downstream systems. |
Authentication and security considerations
Scope-controlled access
Shopify Admin API access uses OAuth or Admin API access tokens, with permissions controlled by scopes such as company, customer, order, product, inventory, and file scopes. Request only the scopes required by the workflows.
Secure credential handling
Martini can store Shopify tokens and endpoint configuration in secured environment configuration or secrets rather than embedding credentials in workflow definitions or source code.
Plan and feature validation
Shopify B2B capabilities are plan-dependent. Confirm that Companies, catalogs, pricing, payment terms, checkout, and customer-account features required by the integration are enabled before deployment.
Operational considerations for Shopify B2B integrations
Throttling and query cost
Shopify Admin GraphQL uses query-cost accounting and throttling. Request only required fields, avoid unnecessarily deep queries, monitor throttle information, and use controlled backoff for temporary throttling.
Pagination and bulk lifecycle
Persist GraphQL cursors and synchronization checkpoints. Bulk operations are asynchronous and require monitoring for running, completed, failed, and canceled states before retrieving and processing results.
Webhook reliability
Webhook delivery can be delayed, duplicated, or out of order. Store an event or resource-based idempotency key, acknowledge promptly, process larger workloads asynchronously, and use periodic reconciliation.
Versioning and schema changes
Configure the Shopify API version explicitly, avoid undocumented fields, and test queries and mutations against a non-production store before changing versions.
B2B relationships
Keep Company, CompanyLocation, Catalog, PriceList, Customer, Product, ProductVariant, and Order relationships explicit. Flattening them too early can produce incorrect customer, pricing, or order mappings.
Why use Martini instead of scripts or point-to-point integrations?
Orchestrate more than an API call
Martini coordinates Shopify API requests, webhook intake, bulk-operation monitoring, scheduled reconciliation, downstream writes, validation, and exception handling in maintainable workflows.
Reuse integration logic
Teams can centralize authentication configuration, pagination, mappings, idempotency rules, and retry behavior instead of duplicating them across point-to-point scripts.
Adapt to enterprise models
Shopify B2B relationships can be transformed into ERP, CRM, fulfillment, tax, or analytical models while retaining identifiers and business context needed for reconciliation.
Operate reliably
Martini supports controlled retries, checkpoints, asynchronous processing, monitoring, and error routing, providing a stronger operational foundation than isolated scripts.
Frequently asked questions
Shopify B2B can be integrated through the Admin GraphQL API, selected webhooks, asynchronous GraphQL bulk operations, cursor-based pagination, and scheduled reconciliation. The legacy REST Admin API may support existing implementations. Authentication uses OAuth or Shopify Admin API access tokens with scope-based authorization.
Yes. Martini can consume Shopify’s Admin GraphQL API, receive selected Shopify webhook events through an exposed API endpoint, orchestrate asynchronous bulk operations, and synchronize Shopify B2B data with enterprise applications using workflows, mappings, validation, and error handling.
No. A dedicated Shopify B2B connector is not required. Martini can use Shopify’s native Admin GraphQL API, selected webhooks, bulk operations, authentication methods, and legacy REST endpoints where an existing dependency requires them.
Lonti does not charge an additional per-connector or per-vendor fee to integrate Shopify B2B. The integration is subject to the provisioned capacity of the Martini environment. Separate costs may apply from Shopify, cloud infrastructure, or other third-party systems based on subscription, usage, and deployment model.
The Admin GraphQL API is the recommended starting point for new Shopify B2B integrations because it supports the relevant B2B objects and mutations. REST Admin API is legacy and is generally reserved for existing integrations or specific migration constraints.
Shopify supports webhook subscriptions for selected topics such as certain order, product, customer, company, inventory, app, and store configuration events. Coverage is topic-specific, so each required event must be verified. Webhooks should be combined with scheduled reconciliation rather than treated as a complete change feed.
A robust design normally combines an initial GraphQL bulk extraction, selected webhooks, cursor-based incremental queries, scheduled reconciliation, and idempotent create-or-update workflows. Company and CompanyLocation relationships, catalog assignments, pricing, product variants, and order context should remain distinct during mapping.
Martini can map and transform Shopify JSON responses, validate business rules, persist cursors and operation checkpoints, and route data to downstream APIs or databases. Workflows can distinguish throttling and temporary service failures from authorization, missing-resource, and permanent validation errors, using controlled retries and exception handling.
Related Martini documentation
Workflows
Connect Shopify B2B with your enterprise systems
Use Martini to build secure, maintainable Shopify B2B integrations across APIs, webhooks, bulk operations, enterprise applications, and data workflows.