customerCreate mutation

Version unstable

Creates a new customer.

Required access

write_customers access scope.

Interactive example

This is an example mutation query. Use the embedded interactive tool below to edit the query.

Hint: use Ctrl + Space for autocompleting fields.


Argument Description
input ( CustomerInput! ) required

Specifies the fields to use when creating the customer.

CustomerInput fields

  • acceptsMarketing (Boolean)

    Whether the customer has consented to receive marketing material via email.

  • acceptsMarketingUpdatedAt (DateTime)

    The date and time when the customer consented or objected to receiving marketing material by email. Set whenever the customer consents or objects to marketing material.

  • An input that specifies addresses for a customer.

  • email (String)

    The unique email address of the customer.

  • firstName (String)

    The customer's first name.

  • id (ID)

    Specifies the customer to update, or creates a new customer if one doesn't exist.

  • lastName (String)

    The customer's last name.

  • locale (String)

    The customer's locale.

  • marketingOptInLevel (CustomerMarketingOptInLevel)

    The marketing subscription opt-in level (as described by the M3AAWG best practices guideline) that was enabled when the customer consented to receiving marketing material by email.

  • metafields ([MetafieldInput!])

    Attaches additional metadata to the customer.

  • note (String)

    A note about the customer.

  • phone (String)

    The unique phone number for the customer.

  • privateMetafields ([PrivateMetafieldInput!])

    The private metafields to associated with this product.

  • tags ([String!])

    A comma separated list of tags associated with the customer. Updating tags overwrites any existing tags that were previously added to the customer. To add new tags without overwriting existing tags, use the tagsAdd mutation.

  • taxExempt (Boolean)