younifyd
Menu

companyCreate

Creates a Company for B2B commerce. This mutation creates the company and can optionally create an initial CompanyContact and CompanyLocation in a single operation.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the companyCreate action (under Company).
  3. Fill in the fields below, then reference the result from later steps as {{companycreate.response.data}}.

Query

This is the mutation the action sends by default. Edit it in the step's Query field to change which fields come back.

graphql
mutation CompanyCreate($input: CompanyCreateInput!) {
  companyCreate(input: $input) {
    company {
      contactCount
      contactsCount {
        count
        precision
      }
      createdAt
      customerSince
      defaultCursor
      defaultRole {
        id
        name
        note
      }
      externalId
      hasTimelineComment
      id
      lifetimeDuration
      locationsCount {
        count
        precision
      }
      mainContact {
        company
        createdAt
        customer
        id
        isMainContact
        lifetimeDuration
        locale
        title
        updatedAt
      }
      name
      note
      ordersCount {
        count
        precision
      }
      totalSpent {
        amount
        currencyCode
      }
      updatedAt
    }
    userErrors {
      code
      field
      message
    }
  }
}

Variables

Pass these as a JSON object in the step's Variables field.

inputobjectrequired

The fields to use when creating the company.

companyobjectrequired4 fields
companyContactobject6 fields
companyLocationobject12 fields
json
{
  "input": {
    "company": {
      "name": "string",
      "note": "string",
      "externalId": "string",
      "customerSince": "string"
    },
    "companyContact": {
      "firstName": "string",
      "lastName": "string",
      "email": "string",
      "title": "string",
      "locale": "string",
      "phone": "string"
    },
    "companyLocation": {
      "name": "string",
      "phone": "string",
      "locale": "string",
      "externalId": "string",
      "note": "string",
      "buyerExperienceConfiguration": {
        "checkoutToDraft": "string",
        "paymentTermsTemplateId": "string",
        "editableShippingAddress": "string",
        "deposit": "string"
      },
      "billingAddress": {
        "address1": "string",
        "address2": "string",
        "city": "string",
        "zip": "string",
        "recipient": "string",
        "firstName": "string",
        "lastName": "string",
        "phone": "string",
        "zoneCode": "string",
        "countryCode": "string"
      },
      "shippingAddress": {
        "address1": "string",
        "address2": "string",
        "city": "string",
        "zip": "string",
        "recipient": "string",
        "firstName": "string",
        "lastName": "string",
        "phone": "string",
        "zoneCode": "string",
        "countryCode": "string"
      },
      "billingSameAsShipping": false,
      "taxRegistrationId": "string",
      "taxExemptions": [
        "string"
      ],
      "taxExempt": false
    }
  }
}

Response

Read the result with {{companycreate.response.data.data.companyCreate}}. If the API returns errors, the step fails and they are at {{companycreate.response.data.errors}}.

companyobject
contactCountnumber
contactsCountobject2 fields
createdAtstring
customerSincestring
defaultCursorstring
defaultRoleobject3 fields
externalIdstring
hasTimelineCommentboolean
idstring
lifetimeDurationstring
locationsCountobject2 fields
mainContactobject9 fields
namestring
notestring
ordersCountobject2 fields
totalSpentobject2 fields
updatedAtstring
userErrorsarray<object>
codeobject
fieldobject
messageobject

Need more? See the Shopify guide for connection setup and behaviour shared by every action.