VTEX B2B GraphQL icon

VTEX B2B GraphQL

Interact with VTEX B2B Organizations GraphQL API

Actions15

Cost Center → Create

AI-generated

Summary

Create a new cost center using a GraphQL mutation.

Inputs

  • customQuery — Custom GraphQL mutation string for creating a cost center; leave empty to use the node's default mutation.
  • variables — JSON object containing variables for the GraphQL mutation, typically including the input data for the new cost center.

Output shape

a single cost center record

The response contains the created cost center's fields (e.g., id, name, href) as returned by the GraphQL mutation.

Examples

Example 1: Create a cost center using the default mutation

customQuery: (default mutation) variables: {"input": {"name": "Marketing", "organizationId": "123"}}

Example 2: Provide a custom mutation and variables

customQuery: "mutation { createCostCenter(input: $input) { id name } }" variables: {"input": {"name": "Research", "description": "R&D division"}}

Example 3: Create with variables only, no custom query

customQuery: "" variables: {"input": {"name": "Sales", "organizationId": "456"}}

Discussion