TanqoryDocs

tanqoryExtCompaniesCreateFromCustomers

  • Mutation
  • Customers and B2B

Requires write_customers access scope. About access scopes

Sets up one company for each customer, in one transaction: the company is named after the customer's default address company, else the customer's name; its one location takes that name, the default address (shipping and billing, when it has a street and a country), the customer's phone and language, the checkout and payment terms of input.buyerExperienceConfiguration and, with copyTaxSettings, the customer's tax exemption; the customer becomes the main contact with the Location admin role there; with addPastOrders the customer's orders of no company location move to it. REQUIRED (no customer), LIMIT_REACHED (more than 250), RESOURCE_NOT_FOUND (a customer, field ["customerIds", i]; nothing is written), payment terms errors as companyLocationCreate. Requires write_customers access scope.

Arguments

ArgumentTypeRequiredDefault
customerIds[ID!]!Required
inputTanqoryExtCompaniesFromCustomersInputOptional

Returns

TanqoryExtCompaniesFromCustomersPayload Return type of tanqoryExtCompaniesCreateFromCustomers.

FieldTypeDescription
companies[Company!]

The companies set up, in the order of customerIds.

userErrors[BusinessCustomerUserError!]!

Problems with the input. Empty when the call succeeded.

Example request

A starting point: required arguments as variables and a few fields of the result. Replace the placeholders.

Set STORE_ID and TANQORY_ACCESS_TOKEN in your environment first (Make your first API call).

curl
curl -X POST "https://api.tanqory.com/admin/2026-10/stores/$STORE_ID/graphql" \
  -H "Authorization: Bearer $TANQORY_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{"query":"mutation TanqoryExtCompaniesCreateFromCustomers($customerIds: [ID!]!) {\n  tanqoryExtCompaniesCreateFromCustomers(customerIds: $customerIds) {\n    companies { id }\n    userErrors {\n      code\n      field\n      message\n    }\n  }\n}","variables":{"customerIds":[]}}'

Built from commit c0b3fb3fdef7 · API version 2026-10