Getting started building for B2B on Shopify
When a merchant engages in business-to-business (B2B) transactions, they sell their goods and services directly to other companies. You can use the GraphQL Admin API to build apps that solve the challenges that come with B2B commerce.
What you'll learnAnchor link to section titled "What you'll learn"
In this tutorial, you'll learn how to do the following tasks:
RequirementsAnchor link to section titled "Requirements"
- You've created a Partner account and a development store.
- You've added products to your development store.
- Your app has the
write_draft_ordersaccess scopes. For more information on requesting access scopes when your app is installed, refer to Getting started with OAuth.
- You're familiar with the concept of selling B2B.
Step 1: Create a companyAnchor link to section titled "Step 1: Create a company"
When a merchant sells with B2B, a company represents information about who makes a B2B purchase. The following example creates a company by calling the
companyCreate mutation with the following inputs:
name: The name of the company.
companyLocation: The location of the company. A
companyLocationmust be added to attach important information, like tax exemptions, to the company.
companyContact: A contact at the company who can make purchases. A
companyContactmust be added to create orders and draft orders.
Step 2: Create a B2B catalogAnchor link to section titled "Step 2: Create a B2B catalog"
A catalog is a set of products that's published and priced for certain customers based on specified conditions, such as whether they're buying for a certain B2B company location. For example, you can create a catalog that allows the Canadian branch of a company to purchase only the t-shirt products on the store, and they receive a 30% discount.
The following example uses the
catalogCreate mutation to create and associate a catalog with the company location from the previous step:
Step 3: Create a draft order for a companyAnchor link to section titled "Step 3: Create a draft order for a company"
Merchants might want to create draft orders for company approval when selling B2B.
purchasingCompany input specifies the company ID, location, and contact. Billing and shipping information are included in the response because they aren't automatically populated from the company location. The
lineItems object indicates the items to be purchased in the order.
For more information on all possible inputs, refer to the
- Learn how to create and add information to a company location by setting up tax exemptions and payment terms.
- Learn how to associate a price list and publication to a B2B catalog to determine the published products and prices for customers ordering for a specific B2B company location.
- Learn how to manage draft orders for B2B clients by calculating and sending invoices.