title: "Mutations" weight: 2 date: 2023-07-04T11:02:06.199Z showtoc: true
Adds an item to the order. If custom fields are defined on the OrderLine entity, a third argument 'customFields' will be available.
{{% gql-fields %}}
Add a Payment to the Order
{{% gql-fields %}}
Adjusts an OrderLine. If custom fields are defined on the OrderLine entity, a third argument 'customFields' of type OrderLineCustomFieldsInput will be available.
{{% gql-fields %}}
Applies the given coupon code to the active Order
{{% gql-fields %}}
Authenticates the user using a named authentication strategy
{{% gql-fields %}}
Create a new Customer Address
{{% gql-fields %}}
Delete an existing Address
{{% gql-fields %}}
Authenticates the user using the native authentication strategy. This mutation is an alias for authenticate({ native: { ... }})
{{% gql-fields %}}
End the current authenticated session
{{% gql-fields %}}
Regenerate and send a verification token for a new Customer registration. Only applicable if authOptions.requireVerification is set to true.
{{% gql-fields %}}
Register a Customer account with the given credentials. There are three possible registration flows:
If authOptions.requireVerification is set to true:
verifyCustomerAccount mutation without a password. The Customer is then
verified and authenticated in one step.verifyCustomerAccount mutation with the chosen password of the Customer. The Customer is then
verified and authenticated in one step.If authOptions.requireVerification is set to false:
{{% gql-fields %}}
Remove all OrderLine from the Order
{{% gql-fields %}}
Removes the given coupon code from the active Order
{{% gql-fields %}}
Remove an OrderLine from the Order
{{% gql-fields %}}
Requests a password reset email to be sent
{{% gql-fields %}}
Request to update the emailAddress of the active Customer. If authOptions.requireVerification is enabled
(as is the default), then the identifierChangeToken will be assigned to the current User and
a IdentifierChangeRequestEvent will be raised. This can then be used e.g. by the EmailPlugin to email
that verification token to the Customer, which is then used to verify the change of email address.
{{% gql-fields %}}
Resets a Customer's password based on the provided token
{{% gql-fields %}}
Set the Customer for the Order. Required only if the Customer is not currently logged in
{{% gql-fields %}}
Sets the billing address for this order
{{% gql-fields %}}
Allows any custom fields to be set for the active order
{{% gql-fields %}}
Sets the shipping address for this order
{{% gql-fields %}}
Sets the shipping method by id, which can be obtained with the eligibleShippingMethods query.
An Order can have multiple shipping methods, in which case you can pass an array of ids. In this case,
you should configure a custom ShippingLineAssignmentStrategy in order to know which OrderLines each
shipping method will apply to.
{{% gql-fields %}}
Transitions an Order to a new state. Valid next states can be found by querying nextOrderStates
{{% gql-fields %}}
Update an existing Customer
{{% gql-fields %}}
Update an existing Address
{{% gql-fields %}}
Confirm the update of the emailAddress with the provided token, which has been generated by the
requestUpdateCustomerEmailAddress mutation.
{{% gql-fields %}}
Update the password of the active Customer
{{% gql-fields %}}
Verify a Customer email address with the token sent to that address. Only applicable if authOptions.requireVerification is set to true.
If the Customer was not registered with a password in the registerCustomerAccount mutation, the password must be
provided here.
{{% gql-fields %}}