Skip to content

Shopify Dude Answer

Shopify B2B Draft Orders Show Retail Prices: Check the Purchasing Entity

When a B2B draft order uses the wrong price, check whether it identifies the company, company contact, and company location—not just a customer ID.

Quick answer

For a Shopify B2B draft order, identify the purchasing company, company contact, and company location. A customer ID alone is not the same B2B buying context.

The company location is particularly important: Shopify B2B catalogs are assigned to locations, and those catalogs can control product availability and pricing. Use draftOrderCalculate to preview the result before creating and invoicing the draft.

On this page

Why a customer ID can give the wrong context

A company contact is also a customer record, but the customer alone does not identify which business location is purchasing. A buyer may represent several locations with different catalogs, addresses, payment terms, or tax settings. A draft created with purchasingEntity.customerId is not equivalent to one created with purchasingEntity.purchasingCompany.

If the wrong price appears, verify the purchasing entity before adding manual discounts or hard-coding wholesale prices.

Supply the complete B2B purchasing entity

For a B2B draft, DraftOrderInput.purchasingEntity.purchasingCompany expects three IDs: companyId, companyLocationId, and companyContactId. The contact must belong to the company and be authorized for the location. A simplified input object looks like this:

{
  "purchasingEntity": {
    "purchasingCompany": {
      "companyId": "gid://shopify/Company/111",
      "companyLocationId": "gid://shopify/CompanyLocation/222",
      "companyContactId": "gid://shopify/CompanyContact/333"
    }
  },
  "lineItems": [
    { "variantId": "gid://shopify/ProductVariant/444", "quantity": 2 }
  ]
}

Those IDs are placeholders. Do not derive them from company names, customer tags, or shipping addresses.

Calculate first, create second

Use the GraphQL Admin API draftOrderCalculate mutation with that input to preview the actual draft pricing before sending anything to a buyer:

mutation PreviewB2B($input: DraftOrderInput!) {
  draftOrderCalculate(input: $input) {
    calculatedDraftOrder {
      totalPriceSet { presentmentMoney { amount currencyCode } }
      lineItems { sku discountedTotalSet {
        presentmentMoney { amount currencyCode }
      } }
    }
    userErrors { field message }
  }
}

Pass the JSON object as the input variable. Once totals are correct, call draftOrderCreate(input: $input) with the same buying context. Check userErrors in both responses; an HTTP 200 does not mean the mutation succeeded.

Other reasons a B2B draft price differs

  • Wrong location: the buyer is linked to a different company location with another catalog.
  • Catalog coverage: the variant may not be published or priced in the catalog assigned to that location.
  • Custom item or override: manually priced lines are not the same as ordinary variant pricing. Check any line-item price overrides.
  • Currency and taxes: compare prices in the same presentment currency, and distinguish unit price from totals after discounts, tax, and shipping.
  • Contact mapping: an email address or customer tag is not a reliable replacement for a real CompanyContact ID.

Also remember that draft orders do not reserve inventory automatically; reservation is a separate option. And Shopify’s draft order input does not support subscription selling plans. Neither should be silently simulated as a regular B2B draft line.

Common misunderstanding

“This customer belongs to a company, so Shopify will infer the correct wholesale catalog.” A customer can represent more than one company location. The draft order must carry the intended purchasing company context. Do not fix a missing context by subtracting a manual percentage from retail prices; that can hide a data-model error and create reconciliation problems.

How to test this

  • Choose one product with a known retail price and a different B2B catalog price.
  • Calculate a draft with the intended company, contact, and location. Confirm line and total prices.
  • Repeat for a second location with a different catalog, if available.
  • Compare the result against the B2B buyer’s storefront or a correctly configured Admin draft.
  • Test an unavailable variant and inspect userErrors or warnings.
  • Create a test draft only after the calculation matches; inspect the invoice checkout before sharing it.

Sources and further reading