company Createmutation
mutation
2024-10latest
Requires write
access scope or write
access scope. Also: The API client must be installed on a Shopify Plus store.
Creates a company.
Arguments
The fields to use when creating the company.
Was this section helpful?
CompanyCreatePayload returns
The created company.
The list of errors that occurred from executing the mutation.
Was this section helpful?
Code examples for MUTATION: companyCreate
Query Reference for MUTATION: companyCreate
"mutation companyCreate($input: CompanyCreateInput!) {\n companyCreate(input: $input) {\n company {\n # Company fields\n }\n userErrors {\n field\n message\n }\n }\n}"
Input Reference for MUTATION: companyCreate
"{\n \"input\": {\n \"company\": {\n \"customerSince\": \"2019-09-07T15:50:00Z\",\n \"externalId\": \"<your-externalId>\",\n \"name\": \"<your-name>\",\n \"note\": \"<your-note>\"\n },\n \"companyContact\": {\n \"email\": \"<your-email>\",\n \"firstName\": \"<your-firstName>\",\n \"lastName\": \"<your-lastName>\",\n \"locale\": \"<your-locale>\",\n \"phone\": \"<your-phone>\",\n \"title\": \"<your-title>\"\n },\n \"companyLocation\": {\n \"billingAddress\": {\n \"address1\": \"<your-address1>\",\n \"address2\": \"<your-address2>\",\n \"city\": \"<your-city>\",\n \"countryCode\": \"AC\",\n \"firstName\": \"<your-firstName>\",\n \"lastName\": \"<your-lastName>\",\n \"phone\": \"<your-phone>\",\n \"recipient\": \"<your-recipient>\",\n \"zip\": \"<your-zip>\",\n \"zoneCode\": \"<your-zoneCode>\"\n },\n \"billingSameAsShipping\": true,\n \"buyerExperienceConfiguration\": {\n \"checkoutToDraft\": true,\n \"deposit\": {\n \"percentage\": 1.1\n },\n \"editableShippingAddress\": true,\n \"paymentTermsTemplateId\": \"gid://shopify/<objectName>/10079785100\"\n },\n \"externalId\": \"<your-externalId>\",\n \"locale\": \"<your-locale>\",\n \"name\": \"<your-name>\",\n \"note\": \"<your-note>\",\n \"phone\": \"<your-phone>\",\n \"shippingAddress\": {\n \"address1\": \"<your-address1>\",\n \"address2\": \"<your-address2>\",\n \"city\": \"<your-city>\",\n \"countryCode\": \"AC\",\n \"firstName\": \"<your-firstName>\",\n \"lastName\": \"<your-lastName>\",\n \"phone\": \"<your-phone>\",\n \"recipient\": \"<your-recipient>\",\n \"zip\": \"<your-zip>\",\n \"zoneCode\": \"<your-zoneCode>\"\n },\n \"taxExemptions\": [\n \"CA_BC_COMMERCIAL_FISHERY_EXEMPTION\"\n ],\n \"taxRegistrationId\": \"<your-taxRegistrationId>\"\n }\n }\n}"
Schema Reference for MUTATION: companyCreate
"input CompanyCreateInput {\n company: CompanyInput!\n companyContact: CompanyContactInput\n companyLocation: CompanyLocationInput\n}\n\ninput CompanyInput {\n customerSince: DateTime\n externalId: String\n name: String\n note: String\n}\n\ninput CompanyContactInput {\n email: String\n firstName: String\n lastName: String\n locale: String\n phone: String\n title: String\n}\n\ninput CompanyLocationInput {\n billingAddress: CompanyAddressInput\n billingSameAsShipping: Boolean\n buyerExperienceConfiguration: BuyerExperienceConfigurationInput\n externalId: String\n locale: String\n name: String\n note: String\n phone: String\n shippingAddress: CompanyAddressInput\n taxExemptions: [TaxExemption!]\n taxRegistrationId: String\n}\n"
Display Examples for MUTATION: companyCreate
[ { "example": { "type_name": "companycreate", "title": "Create a company", "description": "Create a company with a company contact and company location.", "query_string": "mutation CompanyCreate($input: CompanyCreateInput!) {\n companyCreate(input: $input) {\n company {\n id\n name\n externalId\n mainContact {\n id\n customer {\n id\n email\n firstName\n lastName\n }\n }\n contacts(first: 5) {\n edges {\n node {\n id\n customer {\n email\n firstName\n lastName\n }\n }\n }\n }\n contactRoles(first: 5) {\n edges {\n node {\n id\n name\n }\n }\n }\n locations(first: 5) {\n edges {\n node {\n id\n name\n shippingAddress {\n firstName\n lastName\n address1\n city\n province\n zip\n country\n }\n }\n }\n }\n }\n userErrors {\n field\n message\n code\n }\n }\n}", "variables": { "input": { "company": { "name": "Postal Cards Inc", "externalId": "01456606-0001" }, "companyLocation": { "name": "Ottawa Postal Cards", "shippingAddress": { "firstName": "Avery", "lastName": "Brown", "address1": "150 Elgin Street", "address2": "8th Floor", "city": "Ottawa", "zoneCode": "ON", "zip": "K2P 1L4", "countryCode": "CA" }, "billingSameAsShipping": true }, "companyContact": { "email": "avery.brown@example.com", "firstName": "Avery", "lastName": "Brown" } } }, "response": { "data": { "companyCreate": { "company": { "id": "gid://shopify/Company/1059559575", "name": "Postal Cards Inc", "externalId": "01456606-0001", "mainContact": { "id": "gid://shopify/CompanyContact/1059341835", "customer": { "id": "gid://shopify/Customer/1073339466", "email": "avery.brown@example.com", "firstName": "Avery", "lastName": "Brown" } }, "contacts": { "edges": [ { "node": { "id": "gid://shopify/CompanyContact/1059341835", "customer": { "email": "avery.brown@example.com", "firstName": "Avery", "lastName": "Brown" } } } ] }, "contactRoles": { "edges": [ { "node": { "id": "gid://shopify/CompanyContactRole/1007033458", "name": "Location admin" } }, { "node": { "id": "gid://shopify/CompanyContactRole/1007033459", "name": "Ordering only" } } ] }, "locations": { "edges": [ { "node": { "id": "gid://shopify/CompanyLocation/966871284", "name": "Ottawa Postal Cards", "shippingAddress": { "firstName": "Avery", "lastName": "Brown", "address1": "150 Elgin Street", "city": "Ottawa", "province": "Ontario", "zip": "K2P 1L4", "country": "Canada" } } } ] } }, "userErrors": [] } } }, "api_name": "admin", "minimum_api_version": "2024-01", "maximum_api_version": "unstable", "location": "/components/business_customers/test/unit/graph_api/admin/mutations/company_create_test.rb", "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation CompanyCreate($input: CompanyCreateInput!) { companyCreate(input: $input) { company { id name externalId mainContact { id customer { id email firstName lastName } } contacts(first: 5) { edges { node { id customer { email firstName lastName } } } } contactRoles(first: 5) { edges { node { id name } } } locations(first: 5) { edges { node { id name shippingAddress { firstName lastName address1 city province zip country } } } } } userErrors { field message code } } }\",\n \"variables\": {\n \"input\": {\n \"company\": {\n \"name\": \"Postal Cards Inc\",\n \"externalId\": \"01456606-0001\"\n },\n \"companyLocation\": {\n \"name\": \"Ottawa Postal Cards\",\n \"shippingAddress\": {\n \"firstName\": \"Avery\",\n \"lastName\": \"Brown\",\n \"address1\": \"150 Elgin Street\",\n \"address2\": \"8th Floor\",\n \"city\": \"Ottawa\",\n \"zoneCode\": \"ON\",\n \"zip\": \"K2P 1L4\",\n \"countryCode\": \"CA\"\n },\n \"billingSameAsShipping\": true\n },\n \"companyContact\": {\n \"email\": \"avery.brown@example.com\",\n \"firstName\": \"Avery\",\n \"lastName\": \"Brown\"\n }\n }\n }\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation CompanyCreate($input: CompanyCreateInput!) {\n companyCreate(input: $input) {\n company {\n id\n name\n externalId\n mainContact {\n id\n customer {\n id\n email\n firstName\n lastName\n }\n }\n contacts(first: 5) {\n edges {\n node {\n id\n customer {\n email\n firstName\n lastName\n }\n }\n }\n }\n contactRoles(first: 5) {\n edges {\n node {\n id\n name\n }\n }\n }\n locations(first: 5) {\n edges {\n node {\n id\n name\n shippingAddress {\n firstName\n lastName\n address1\n city\n province\n zip\n country\n }\n }\n }\n }\n }\n userErrors {\n field\n message\n code\n }\n }\n }`,\n {\n variables: {\n \"input\": {\n \"company\": {\n \"name\": \"Postal Cards Inc\",\n \"externalId\": \"01456606-0001\"\n },\n \"companyLocation\": {\n \"name\": \"Ottawa Postal Cards\",\n \"shippingAddress\": {\n \"firstName\": \"Avery\",\n \"lastName\": \"Brown\",\n \"address1\": \"150 Elgin Street\",\n \"address2\": \"8th Floor\",\n \"city\": \"Ottawa\",\n \"zoneCode\": \"ON\",\n \"zip\": \"K2P 1L4\",\n \"countryCode\": \"CA\"\n },\n \"billingSameAsShipping\": true\n },\n \"companyContact\": {\n \"email\": \"avery.brown@example.com\",\n \"firstName\": \"Avery\",\n \"lastName\": \"Brown\"\n }\n }\n },\n },\n);\n\nconst data = await response.json();\n", "ruby_example": "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation CompanyCreate($input: CompanyCreateInput!) {\n companyCreate(input: $input) {\n company {\n id\n name\n externalId\n mainContact {\n id\n customer {\n id\n email\n firstName\n lastName\n }\n }\n contacts(first: 5) {\n edges {\n node {\n id\n customer {\n email\n firstName\n lastName\n }\n }\n }\n }\n contactRoles(first: 5) {\n edges {\n node {\n id\n name\n }\n }\n }\n locations(first: 5) {\n edges {\n node {\n id\n name\n shippingAddress {\n firstName\n lastName\n address1\n city\n province\n zip\n country\n }\n }\n }\n }\n }\n userErrors {\n field\n message\n code\n }\n }\n }\nQUERY\n\nvariables = {\n \"input\": {\n \"company\": {\n \"name\": \"Postal Cards Inc\",\n \"externalId\": \"01456606-0001\"\n },\n \"companyLocation\": {\n \"name\": \"Ottawa Postal Cards\",\n \"shippingAddress\": {\n \"firstName\": \"Avery\",\n \"lastName\": \"Brown\",\n \"address1\": \"150 Elgin Street\",\n \"address2\": \"8th Floor\",\n \"city\": \"Ottawa\",\n \"zoneCode\": \"ON\",\n \"zip\": \"K2P 1L4\",\n \"countryCode\": \"CA\"\n },\n \"billingSameAsShipping\": true\n },\n \"companyContact\": {\n \"email\": \"avery.brown@example.com\",\n \"firstName\": \"Avery\",\n \"lastName\": \"Brown\"\n }\n }\n}\n\nresponse = client.query(query: query, variables: variables)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation CompanyCreate($input: CompanyCreateInput!) {\n companyCreate(input: $input) {\n company {\n id\n name\n externalId\n mainContact {\n id\n customer {\n id\n email\n firstName\n lastName\n }\n }\n contacts(first: 5) {\n edges {\n node {\n id\n customer {\n email\n firstName\n lastName\n }\n }\n }\n }\n contactRoles(first: 5) {\n edges {\n node {\n id\n name\n }\n }\n }\n locations(first: 5) {\n edges {\n node {\n id\n name\n shippingAddress {\n firstName\n lastName\n address1\n city\n province\n zip\n country\n }\n }\n }\n }\n }\n userErrors {\n field\n message\n code\n }\n }\n }`,\n \"variables\": {\n \"input\": {\n \"company\": {\n \"name\": \"Postal Cards Inc\",\n \"externalId\": \"01456606-0001\"\n },\n \"companyLocation\": {\n \"name\": \"Ottawa Postal Cards\",\n \"shippingAddress\": {\n \"firstName\": \"Avery\",\n \"lastName\": \"Brown\",\n \"address1\": \"150 Elgin Street\",\n \"address2\": \"8th Floor\",\n \"city\": \"Ottawa\",\n \"zoneCode\": \"ON\",\n \"zip\": \"K2P 1L4\",\n \"countryCode\": \"CA\"\n },\n \"billingSameAsShipping\": true\n },\n \"companyContact\": {\n \"email\": \"avery.brown@example.com\",\n \"firstName\": \"Avery\",\n \"lastName\": \"Brown\"\n }\n }\n },\n },\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n mutation CompanyCreate($input: CompanyCreateInput!) {\n companyCreate(input: $input) {\n company {\n id\n name\n externalId\n mainContact {\n id\n customer {\n id\n email\n firstName\n lastName\n }\n }\n contacts(first: 5) {\n edges {\n node {\n id\n customer {\n email\n firstName\n lastName\n }\n }\n }\n }\n contactRoles(first: 5) {\n edges {\n node {\n id\n name\n }\n }\n }\n locations(first: 5) {\n edges {\n node {\n id\n name\n shippingAddress {\n firstName\n lastName\n address1\n city\n province\n zip\n country\n }\n }\n }\n }\n }\n userErrors {\n field\n message\n code\n }\n }\n }\nQUERY;\n\n$variables = [\n \"input\" => [\n \"company\" => [\n \"name\" => \"Postal Cards Inc\",\n \"externalId\" => \"01456606-0001\",\n ],\n \"companyLocation\" => [\n \"name\" => \"Ottawa Postal Cards\",\n \"shippingAddress\" => [\n \"firstName\" => \"Avery\",\n \"lastName\" => \"Brown\",\n \"address1\" => \"150 Elgin Street\",\n \"address2\" => \"8th Floor\",\n \"city\" => \"Ottawa\",\n \"zoneCode\" => \"ON\",\n \"zip\" => \"K2P 1L4\",\n \"countryCode\" => \"CA\",\n ],\n \"billingSameAsShipping\" => true,\n ],\n \"companyContact\" => [\n \"email\" => \"avery.brown@example.com\",\n \"firstName\" => \"Avery\",\n \"lastName\" => \"Brown\",\n ],\n ],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" }, "titleStringKey": "variables", "inputVariableEntries": [ { "arg": { "name": "input", "description": "The fields to use when creating the company.", "type": { "kind": "INPUT_OBJECT", "name": "CompanyCreateInput", "list": false, "non_null": true }, "defaultValue": null, "typeSignature": "CompanyCreateInput!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "input", "argValue": " {\"company\":{\"name\":\"Postal Cards Inc\",\"externalId\":\"01456606-0001\"},\"companyLocation\":{\"name\":\"Ottawa Postal Cards\",\"shippingAddress\":{\"firstName\":\"Avery\",\"lastName\":\"Brown\",\"address1\":\"150 Elgin Street\",\"address2\":\"8th Floor\",\"city\":\"Ottawa\",\"zoneCode\":\"ON\",\"zip\":\"K2P 1L4\",\"countryCode\":\"CA\"},\"billingSameAsShipping\":true},\"companyContact\":{\"email\":\"avery.brown@example.com\",\"firstName\":\"Avery\",\"lastName\":\"Brown\"}}", "typeKind": "MUTATION" } ] }, { "example": { "type_name": "companycreate", "title": "Create a company with required fields only", "description": "Create a company with no company contact and the default company location.", "query_string": "mutation CompanyCreate($input: CompanyCreateInput!) {\n companyCreate(input: $input) {\n company {\n id\n name\n mainContact {\n id\n }\n contactRoles(first: 5) {\n edges {\n node {\n id\n name\n }\n }\n }\n locations(first: 5) {\n edges {\n node {\n id\n name\n shippingAddress {\n firstName\n lastName\n address1\n city\n province\n zip\n country\n }\n }\n }\n }\n }\n userErrors {\n field\n message\n code\n }\n }\n}", "variables": { "input": { "company": { "name": "Postal Cards Inc" } } }, "response": { "data": { "companyCreate": { "company": { "id": "gid://shopify/Company/1059559574", "name": "Postal Cards Inc", "mainContact": null, "contactRoles": { "edges": [ { "node": { "id": "gid://shopify/CompanyContactRole/1007033456", "name": "Location admin" } }, { "node": { "id": "gid://shopify/CompanyContactRole/1007033457", "name": "Ordering only" } } ] }, "locations": { "edges": [ { "node": { "id": "gid://shopify/CompanyLocation/966871283", "name": "Postal Cards Inc", "shippingAddress": null } } ] } }, "userErrors": [] } } }, "api_name": "admin", "minimum_api_version": "2024-01", "maximum_api_version": "unstable", "location": "/components/business_customers/test/unit/graph_api/admin/mutations/company_create_test.rb", "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation CompanyCreate($input: CompanyCreateInput!) { companyCreate(input: $input) { company { id name mainContact { id } contactRoles(first: 5) { edges { node { id name } } } locations(first: 5) { edges { node { id name shippingAddress { firstName lastName address1 city province zip country } } } } } userErrors { field message code } } }\",\n \"variables\": {\n \"input\": {\n \"company\": {\n \"name\": \"Postal Cards Inc\"\n }\n }\n }\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation CompanyCreate($input: CompanyCreateInput!) {\n companyCreate(input: $input) {\n company {\n id\n name\n mainContact {\n id\n }\n contactRoles(first: 5) {\n edges {\n node {\n id\n name\n }\n }\n }\n locations(first: 5) {\n edges {\n node {\n id\n name\n shippingAddress {\n firstName\n lastName\n address1\n city\n province\n zip\n country\n }\n }\n }\n }\n }\n userErrors {\n field\n message\n code\n }\n }\n }`,\n {\n variables: {\n \"input\": {\n \"company\": {\n \"name\": \"Postal Cards Inc\"\n }\n }\n },\n },\n);\n\nconst data = await response.json();\n", "ruby_example": "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation CompanyCreate($input: CompanyCreateInput!) {\n companyCreate(input: $input) {\n company {\n id\n name\n mainContact {\n id\n }\n contactRoles(first: 5) {\n edges {\n node {\n id\n name\n }\n }\n }\n locations(first: 5) {\n edges {\n node {\n id\n name\n shippingAddress {\n firstName\n lastName\n address1\n city\n province\n zip\n country\n }\n }\n }\n }\n }\n userErrors {\n field\n message\n code\n }\n }\n }\nQUERY\n\nvariables = {\n \"input\": {\n \"company\": {\n \"name\": \"Postal Cards Inc\"\n }\n }\n}\n\nresponse = client.query(query: query, variables: variables)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation CompanyCreate($input: CompanyCreateInput!) {\n companyCreate(input: $input) {\n company {\n id\n name\n mainContact {\n id\n }\n contactRoles(first: 5) {\n edges {\n node {\n id\n name\n }\n }\n }\n locations(first: 5) {\n edges {\n node {\n id\n name\n shippingAddress {\n firstName\n lastName\n address1\n city\n province\n zip\n country\n }\n }\n }\n }\n }\n userErrors {\n field\n message\n code\n }\n }\n }`,\n \"variables\": {\n \"input\": {\n \"company\": {\n \"name\": \"Postal Cards Inc\"\n }\n }\n },\n },\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n mutation CompanyCreate($input: CompanyCreateInput!) {\n companyCreate(input: $input) {\n company {\n id\n name\n mainContact {\n id\n }\n contactRoles(first: 5) {\n edges {\n node {\n id\n name\n }\n }\n }\n locations(first: 5) {\n edges {\n node {\n id\n name\n shippingAddress {\n firstName\n lastName\n address1\n city\n province\n zip\n country\n }\n }\n }\n }\n }\n userErrors {\n field\n message\n code\n }\n }\n }\nQUERY;\n\n$variables = [\n \"input\" => [\n \"company\" => [\n \"name\" => \"Postal Cards Inc\",\n ],\n ],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" }, "titleStringKey": "variables", "inputVariableEntries": [ { "arg": { "name": "input", "description": "The fields to use when creating the company.", "type": { "kind": "INPUT_OBJECT", "name": "CompanyCreateInput", "list": false, "non_null": true }, "defaultValue": null, "typeSignature": "CompanyCreateInput!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "input", "argValue": " {\"company\":{\"name\":\"Postal Cards Inc\"}}", "typeKind": "MUTATION" } ] }, { "example": { "type_name": "companycreate", "title": "Creating a company without a name returns an error", "description": "Create a company with no company contact and the default company location.", "query_string": "mutation CompanyCreate($input: CompanyCreateInput!) {\n companyCreate(input: $input) {\n company {\n id\n name\n mainContact {\n id\n }\n contactRoles(first: 5) {\n edges {\n node {\n id\n name\n }\n }\n }\n locations(first: 5) {\n edges {\n node {\n id\n name\n shippingAddress {\n firstName\n lastName\n address1\n city\n province\n zip\n country\n }\n }\n }\n }\n }\n userErrors {\n field\n message\n code\n }\n }\n}", "variables": { "input": { "company": { "externalId": "123" } } }, "response": { "data": { "companyCreate": { "company": null, "userErrors": [ { "field": [ "input", "company", "name" ], "message": "Name must exist", "code": "REQUIRED" } ] } } }, "api_name": "admin", "minimum_api_version": "2024-01", "maximum_api_version": "unstable", "location": "/components/business_customers/test/unit/graph_api/admin/mutations/company_create_test.rb", "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation CompanyCreate($input: CompanyCreateInput!) { companyCreate(input: $input) { company { id name mainContact { id } contactRoles(first: 5) { edges { node { id name } } } locations(first: 5) { edges { node { id name shippingAddress { firstName lastName address1 city province zip country } } } } } userErrors { field message code } } }\",\n \"variables\": {\n \"input\": {\n \"company\": {\n \"externalId\": \"123\"\n }\n }\n }\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation CompanyCreate($input: CompanyCreateInput!) {\n companyCreate(input: $input) {\n company {\n id\n name\n mainContact {\n id\n }\n contactRoles(first: 5) {\n edges {\n node {\n id\n name\n }\n }\n }\n locations(first: 5) {\n edges {\n node {\n id\n name\n shippingAddress {\n firstName\n lastName\n address1\n city\n province\n zip\n country\n }\n }\n }\n }\n }\n userErrors {\n field\n message\n code\n }\n }\n }`,\n {\n variables: {\n \"input\": {\n \"company\": {\n \"externalId\": \"123\"\n }\n }\n },\n },\n);\n\nconst data = await response.json();\n", "ruby_example": "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation CompanyCreate($input: CompanyCreateInput!) {\n companyCreate(input: $input) {\n company {\n id\n name\n mainContact {\n id\n }\n contactRoles(first: 5) {\n edges {\n node {\n id\n name\n }\n }\n }\n locations(first: 5) {\n edges {\n node {\n id\n name\n shippingAddress {\n firstName\n lastName\n address1\n city\n province\n zip\n country\n }\n }\n }\n }\n }\n userErrors {\n field\n message\n code\n }\n }\n }\nQUERY\n\nvariables = {\n \"input\": {\n \"company\": {\n \"externalId\": \"123\"\n }\n }\n}\n\nresponse = client.query(query: query, variables: variables)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation CompanyCreate($input: CompanyCreateInput!) {\n companyCreate(input: $input) {\n company {\n id\n name\n mainContact {\n id\n }\n contactRoles(first: 5) {\n edges {\n node {\n id\n name\n }\n }\n }\n locations(first: 5) {\n edges {\n node {\n id\n name\n shippingAddress {\n firstName\n lastName\n address1\n city\n province\n zip\n country\n }\n }\n }\n }\n }\n userErrors {\n field\n message\n code\n }\n }\n }`,\n \"variables\": {\n \"input\": {\n \"company\": {\n \"externalId\": \"123\"\n }\n }\n },\n },\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n mutation CompanyCreate($input: CompanyCreateInput!) {\n companyCreate(input: $input) {\n company {\n id\n name\n mainContact {\n id\n }\n contactRoles(first: 5) {\n edges {\n node {\n id\n name\n }\n }\n }\n locations(first: 5) {\n edges {\n node {\n id\n name\n shippingAddress {\n firstName\n lastName\n address1\n city\n province\n zip\n country\n }\n }\n }\n }\n }\n userErrors {\n field\n message\n code\n }\n }\n }\nQUERY;\n\n$variables = [\n \"input\" => [\n \"company\" => [\n \"externalId\" => \"123\",\n ],\n ],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" }, "titleStringKey": "variables", "inputVariableEntries": [ { "arg": { "name": "input", "description": "The fields to use when creating the company.", "type": { "kind": "INPUT_OBJECT", "name": "CompanyCreateInput", "list": false, "non_null": true }, "defaultValue": null, "typeSignature": "CompanyCreateInput!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "input", "argValue": " {\"company\":{\"externalId\":\"123\"}}", "typeKind": "MUTATION" } ] } ]