maybeUnsetDefaultShippingAddressesStep - Medusa Core Workflows Reference

This documentation provides a reference to the maybeUnsetDefaultShippingAddressesStep. It belongs to the @medusajs/medusa/core-flows package.

This step unsets the is_default_billing property of existing customer addresses if the is_default_billing property in the addresses in the input is set to true.

Example#

Code
1const data = maybeUnsetDefaultShippingAddressesStep({2  create: [{3    customer_id: "cus_123",4    first_name: "John",5    last_name: "Doe",6    address_1: "123 Main St",7    city: "Anytown",8    country_code: "US",9    postal_code: "12345",10    phone: "555-555-5555",11    is_default_shipping: true12  }],13  update: {14    selector: {15      customer_id: "cus_123"16    },17    update: {18      is_default_shipping: true19    }20  }21})

Input#

MaybeUnsetDefaultShippingAddressesStepInputMaybeUnsetDefaultShippingAddressesStepInput
The addresses being created or updated.
createCreateCustomerAddressDTO[]Optional
The addresses being created. If the address has the is_default_shipping property set to true, the existing default shipping address of the customer will be unset.
updateobjectOptional
The addresses being updated.
Was this page helpful?
Ask Anything
FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break