mutations.md 42 KB


title: "Mutations" weight: 2 date: 2023-07-04T11:02:07.589Z showtoc: true

generated: true

Mutations

addCustomersToGroup

Add Customers to a CustomerGroup

{{% gql-fields %}}

  • addCustomersToGroup(customerGroupId: ID!, customerIds: [ID!]!): CustomerGroup! {{% /gql-fields %}}

addFulfillmentToOrder

{{% gql-fields %}}

addItemToDraftOrder

Adds an item to the draft Order.

{{% gql-fields %}}

addManualPaymentToOrder

Used to manually create a new Payment against an Order. This can be used by an Administrator when an Order is in the ArrangingPayment state.

It is also used when a completed Order has been modified (using modifyOrder) and the price has increased. The extra payment can then be manually arranged by the administrator, and the details used to create a new Payment.

{{% gql-fields %}}

addMembersToZone

Add members to a Zone

{{% gql-fields %}}

  • addMembersToZone(zoneId: ID!, memberIds: [ID!]!): Zone! {{% /gql-fields %}}

addNoteToCustomer

{{% gql-fields %}}

addNoteToOrder

{{% gql-fields %}}

addOptionGroupToProduct

Add an OptionGroup to a Product

{{% gql-fields %}}

  • addOptionGroupToProduct(productId: ID!, optionGroupId: ID!): Product! {{% /gql-fields %}}

adjustDraftOrderLine

Adjusts a draft OrderLine. If custom fields are defined on the OrderLine entity, a third argument 'customFields' of type OrderLineCustomFieldsInput will be available.

{{% gql-fields %}}

applyCouponCodeToDraftOrder

Applies the given coupon code to the draft Order

{{% gql-fields %}}

assignAssetsToChannel

Assign assets to channel

{{% gql-fields %}}

assignCollectionsToChannel

Assigns Collections to the specified Channel

{{% gql-fields %}}

assignFacetsToChannel

Assigns Facets to the specified Channel

{{% gql-fields %}}

assignPaymentMethodsToChannel

Assigns PaymentMethods to the specified Channel

{{% gql-fields %}}

assignProductVariantsToChannel

Assigns ProductVariants to the specified Channel

{{% gql-fields %}}

assignProductsToChannel

Assigns all ProductVariants of Product to the specified Channel

{{% gql-fields %}}

assignPromotionsToChannel

Assigns Promotions to the specified Channel

{{% gql-fields %}}

assignRoleToAdministrator

Assign a Role to an Administrator

{{% gql-fields %}}

  • assignRoleToAdministrator(administratorId: ID!, roleId: ID!): Administrator! {{% /gql-fields %}}

assignShippingMethodsToChannel

Assigns ShippingMethods to the specified Channel

{{% gql-fields %}}

assignStockLocationsToChannel

Assigns StockLocations to the specified Channel

{{% gql-fields %}}

authenticate

Authenticates the user using a named authentication strategy

{{% gql-fields %}}

cancelJob

{{% gql-fields %}}

  • cancelJob(jobId: ID!): Job! {{% /gql-fields %}}

cancelOrder

{{% gql-fields %}}

cancelPayment

{{% gql-fields %}}

createAdministrator

Create a new Administrator

{{% gql-fields %}}

createAssets

Create a new Asset

{{% gql-fields %}}

createChannel

Create a new Channel

{{% gql-fields %}}

createCollection

Create a new Collection

{{% gql-fields %}}

createCountry

Create a new Country

{{% gql-fields %}}

createCustomer

Create a new Customer. If a password is provided, a new User will also be created an linked to the Customer.

{{% gql-fields %}}

createCustomerAddress

Create a new Address and associate it with the Customer specified by customerId

{{% gql-fields %}}

createCustomerGroup

Create a new CustomerGroup

{{% gql-fields %}}

createDraftOrder

Creates a draft Order

{{% gql-fields %}}

  • createDraftOrder: Order! {{% /gql-fields %}}

createFacet

Create a new Facet

{{% gql-fields %}}

createFacetValues

Create one or more FacetValues

{{% gql-fields %}}

createPaymentMethod

Create existing PaymentMethod

{{% gql-fields %}}

createProduct

Create a new Product

{{% gql-fields %}}

createProductOption

Create a new ProductOption within a ProductOptionGroup

{{% gql-fields %}}

createProductOptionGroup

Create a new ProductOptionGroup

{{% gql-fields %}}

createProductVariants

Create a set of ProductVariants based on the OptionGroups assigned to the given Product

{{% gql-fields %}}

createPromotion

{{% gql-fields %}}

createProvince

Create a new Province

{{% gql-fields %}}

createRole

Create a new Role

{{% gql-fields %}}

createSeller

Create a new Seller

{{% gql-fields %}}

createShippingMethod

Create a new ShippingMethod

{{% gql-fields %}}

createStockLocation

{{% gql-fields %}}

createTag

Create a new Tag

{{% gql-fields %}}

createTaxCategory

Create a new TaxCategory

{{% gql-fields %}}

createTaxRate

Create a new TaxRate

{{% gql-fields %}}

createZone

Create a new Zone

{{% gql-fields %}}

deleteAdministrator

Delete an Administrator

{{% gql-fields %}}

deleteAdministrators

Delete multiple Administrators

{{% gql-fields %}}

deleteAsset

Delete an Asset

{{% gql-fields %}}

deleteAssets

Delete multiple Assets

{{% gql-fields %}}

deleteChannel

Delete a Channel

{{% gql-fields %}}

deleteChannels

Delete multiple Channels

{{% gql-fields %}}

deleteCollection

Delete a Collection and all of its descendants

{{% gql-fields %}}

deleteCollections

Delete multiple Collections and all of their descendants

{{% gql-fields %}}

deleteCountries

Delete multiple Countries

{{% gql-fields %}}

deleteCountry

Delete a Country

{{% gql-fields %}}

deleteCustomer

Delete a Customer

{{% gql-fields %}}

deleteCustomerAddress

Update an existing Address

{{% gql-fields %}}

  • deleteCustomerAddress(id: ID!): Success! {{% /gql-fields %}}

deleteCustomerGroup

Delete a CustomerGroup

{{% gql-fields %}}

deleteCustomerGroups

Delete multiple CustomerGroups

{{% gql-fields %}}

deleteCustomerNote

{{% gql-fields %}}

deleteCustomers

Deletes Customers

{{% gql-fields %}}

deleteDraftOrder

Deletes a draft Order

{{% gql-fields %}}

deleteFacet

Delete an existing Facet

{{% gql-fields %}}

deleteFacetValues

Delete one or more FacetValues

{{% gql-fields %}}

deleteFacets

Delete multiple existing Facets

{{% gql-fields %}}

deleteOrderNote

{{% gql-fields %}}

deletePaymentMethod

Delete a PaymentMethod

{{% gql-fields %}}

deletePaymentMethods

Delete multiple PaymentMethods

{{% gql-fields %}}

deleteProduct

Delete a Product

{{% gql-fields %}}

deleteProductOption

Delete a ProductOption

{{% gql-fields %}}

deleteProductVariant

Delete a ProductVariant

{{% gql-fields %}}

deleteProductVariants

Delete multiple ProductVariants

{{% gql-fields %}}

deleteProducts

Delete multiple Products

{{% gql-fields %}}

deletePromotion

{{% gql-fields %}}

deletePromotions

{{% gql-fields %}}

deleteProvince

Delete a Province

{{% gql-fields %}}

deleteRole

Delete an existing Role

{{% gql-fields %}}

deleteRoles

Delete multiple Roles

{{% gql-fields %}}

deleteSeller

Delete a Seller

{{% gql-fields %}}

deleteSellers

Delete multiple Sellers

{{% gql-fields %}}

deleteShippingMethod

Delete a ShippingMethod

{{% gql-fields %}}

deleteShippingMethods

Delete multiple ShippingMethods

{{% gql-fields %}}

deleteStockLocation

{{% gql-fields %}}

deleteStockLocations

{{% gql-fields %}}

deleteTag

Delete an existing Tag

{{% gql-fields %}}

deleteTaxCategories

Deletes multiple TaxCategories

{{% gql-fields %}}

deleteTaxCategory

Deletes a TaxCategory

{{% gql-fields %}}

deleteTaxRate

Delete a TaxRate

{{% gql-fields %}}

deleteTaxRates

Delete multiple TaxRates

{{% gql-fields %}}

deleteZone

Delete a Zone

{{% gql-fields %}}

deleteZones

Delete a Zone

{{% gql-fields %}}

flushBufferedJobs

{{% gql-fields %}}

  • flushBufferedJobs(bufferIds: [String!]): Success! {{% /gql-fields %}}

importProducts

{{% gql-fields %}}

login

Authenticates the user using the native authentication strategy. This mutation is an alias for authenticate({ native: { ... }})

{{% gql-fields %}}

logout

{{% gql-fields %}}

  • logout: Success! {{% /gql-fields %}}

modifyOrder

Allows an Order to be modified after it has been completed by the Customer. The Order must first be in the Modifying state.

{{% gql-fields %}}

moveCollection

Move a Collection to a different parent or index

{{% gql-fields %}}

refundOrder

{{% gql-fields %}}

reindex

{{% gql-fields %}}

  • reindex: Job! {{% /gql-fields %}}

removeCollectionsFromChannel

Removes Collections from the specified Channel

{{% gql-fields %}}

removeCouponCodeFromDraftOrder

Removes the given coupon code from the draft Order

{{% gql-fields %}}

  • removeCouponCodeFromDraftOrder(orderId: ID!, couponCode: String!): Order {{% /gql-fields %}}

removeCustomersFromGroup

Remove Customers from a CustomerGroup

{{% gql-fields %}}

  • removeCustomersFromGroup(customerGroupId: ID!, customerIds: [ID!]!): CustomerGroup! {{% /gql-fields %}}

removeDraftOrderLine

Remove an OrderLine from the draft Order

{{% gql-fields %}}

removeFacetsFromChannel

Removes Facets from the specified Channel

{{% gql-fields %}}

removeMembersFromZone

Remove members from a Zone

{{% gql-fields %}}

  • removeMembersFromZone(zoneId: ID!, memberIds: [ID!]!): Zone! {{% /gql-fields %}}

removeOptionGroupFromProduct

Remove an OptionGroup from a Product. If the OptionGroup is in use by any ProductVariants the mutation will return a ProductOptionInUseError, and the OptionGroup will not be removed. Setting the force argument to true will override this and remove the OptionGroup anyway, as well as removing any of the group's options from the Product's ProductVariants.

{{% gql-fields %}}

removePaymentMethodsFromChannel

Removes PaymentMethods from the specified Channel

{{% gql-fields %}}

removeProductVariantsFromChannel

Removes ProductVariants from the specified Channel

{{% gql-fields %}}

removeProductsFromChannel

Removes all ProductVariants of Product from the specified Channel

{{% gql-fields %}}

removePromotionsFromChannel

Removes Promotions from the specified Channel

{{% gql-fields %}}

removeSettledJobs

Remove all settled jobs in the given queues older than the given date. Returns the number of jobs deleted.

{{% gql-fields %}}

  • removeSettledJobs(queueNames: [String!], olderThan: DateTime): Int! {{% /gql-fields %}}

removeShippingMethodsFromChannel

Removes ShippingMethods from the specified Channel

{{% gql-fields %}}

removeStockLocationsFromChannel

Removes StockLocations from the specified Channel

{{% gql-fields %}}

runPendingSearchIndexUpdates

{{% gql-fields %}}

  • runPendingSearchIndexUpdates: Success! {{% /gql-fields %}}

setCustomerForDraftOrder

{{% gql-fields %}}

setDraftOrderBillingAddress

Sets the billing address for a draft Order

{{% gql-fields %}}

setDraftOrderCustomFields

Allows any custom fields to be set for the active order

{{% gql-fields %}}

setDraftOrderShippingAddress

Sets the shipping address for a draft Order

{{% gql-fields %}}

setDraftOrderShippingMethod

Sets the shipping method by id, which can be obtained with the eligibleShippingMethodsForDraftOrder query

{{% gql-fields %}}

setOrderCustomFields

{{% gql-fields %}}

settlePayment

{{% gql-fields %}}

settleRefund

{{% gql-fields %}}

transitionFulfillmentToState

{{% gql-fields %}}

transitionOrderToState

{{% gql-fields %}}

transitionPaymentToState

{{% gql-fields %}}

updateActiveAdministrator

Update the active (currently logged-in) Administrator

{{% gql-fields %}}

updateAdministrator

Update an existing Administrator

{{% gql-fields %}}

updateAsset

Update an existing Asset

{{% gql-fields %}}

updateChannel

Update an existing Channel

{{% gql-fields %}}

updateCollection

Update an existing Collection

{{% gql-fields %}}

updateCountry

Update an existing Country

{{% gql-fields %}}

updateCustomer

Update an existing Customer

{{% gql-fields %}}

updateCustomerAddress

Update an existing Address

{{% gql-fields %}}

updateCustomerGroup

Update an existing CustomerGroup

{{% gql-fields %}}

updateCustomerNote

{{% gql-fields %}}

updateFacet

Update an existing Facet

{{% gql-fields %}}

updateFacetValues

Update one or more FacetValues

{{% gql-fields %}}

updateGlobalSettings

{{% gql-fields %}}

updateOrderNote

{{% gql-fields %}}

updatePaymentMethod

Update an existing PaymentMethod

{{% gql-fields %}}

updateProduct

Update an existing Product

{{% gql-fields %}}

updateProductOption

Create a new ProductOption within a ProductOptionGroup

{{% gql-fields %}}

updateProductOptionGroup

Update an existing ProductOptionGroup

{{% gql-fields %}}

updateProductVariants

Update existing ProductVariants

{{% gql-fields %}}

updateProducts

Update multiple existing Products

{{% gql-fields %}}

updatePromotion

{{% gql-fields %}}

updateProvince

Update an existing Province

{{% gql-fields %}}

updateRole

Update an existing Role

{{% gql-fields %}}

updateSeller

Update an existing Seller

{{% gql-fields %}}

updateShippingMethod

Update an existing ShippingMethod

{{% gql-fields %}}

updateStockLocation

{{% gql-fields %}}

updateTag

Update an existing Tag

{{% gql-fields %}}

updateTaxCategory

Update an existing TaxCategory

{{% gql-fields %}}

updateTaxRate

Update an existing TaxRate

{{% gql-fields %}}

updateZone

Update an existing Zone

{{% gql-fields %}}