createAddress
Topics: Commerce
Create a new address. Requires address:write permission.
Examples
Add Shipping Address
mutation AddShippingAddress($input: CreateAddressInput!) {
createAddress(input: $input) {
address {
id customerId contactId addressType
street1 city postalCode country timezone isDefault
}
errors { path message }
}
}Variables
{
"input": {
"customerId": "cus_01h455vb4pex5vsknk084sn02q",
"contactId": "con_01h455vb4pex5vsknk084sn02r",
"addressType": "SHIPPING",
"street1": "18 Example Street",
"city": "Berlin",
"postalCode": "10115",
"country": "DE",
"timezone": "Europe/Berlin",
"isDefault": true
}
}Exact field SDL
"""Create a new address. Requires address:write permission."""
createAddress(
"""Address data"""
input: CreateAddressInput!
): UpsertAddressPayload! @topic(names: ["commerce"]) @topic_example(names: ["crm.add-shipping-address"])Declared on Mutation. Access is checked by the platform for each operation.