younifyd
Menu

cartBuyerIdentityUpdate

Updates the buyer identity on a Cart, including contact information, location, and checkout preferences.

Use it in a workflow

  1. Add a step and choose the Shopify Storefront connector.
  2. Pick the cartBuyerIdentityUpdate action (under Cart).
  3. Fill in the fields below, then reference the result from later steps as {{cartbuyeridentityupdate.response.data}}.

Query

This is the mutation the action sends by default. Edit it in the step's Query field to change which fields come back.

graphql
mutation CartBuyerIdentityUpdate($cartId: ID!, $buyerIdentity: CartBuyerIdentityInput!) {
  cartBuyerIdentityUpdate(cartId: $cartId, buyerIdentity: $buyerIdentity) {
    cart {
      appliedGiftCards {
        amountUsed
        amountUsedV2
        balance
        balanceV2
        id
        lastCharacters
        presentmentAmountUsed
      }
      attributes {
        key
        value
      }
      buyerIdentity {
        countryCode
        customer
        deliveryAddressPreferences
        email
        phone
        preferences
        purchasingCompany
      }
      checkoutUrl
      cost {
        checkoutChargeAmount
        subtotalAmount
        subtotalAmountEstimated
        totalAmount
        totalAmountEstimated
        totalDutyAmount
        totalDutyAmountEstimated
        totalTaxAmount
        totalTaxAmountEstimated
      }
      createdAt
      delivery
      discountAllocations {
        discountApplication
        discountedAmount
        sourceDiscountApplication
        targetType
      }
      discountApplications {
        allocationMethod
        targetSelection
        targetType
        totalAllocatedAmount
        value
      }
      discountCodes {
        applicable
        code
      }
      estimatedCost {
        checkoutChargeAmount
        subtotalAmount
        totalAmount
        totalDutyAmount
        totalTaxAmount
      }
      id
      note
      totalQuantity
      updatedAt
    }
    userErrors {
      code
      field
      message
    }
    warnings {
      code
      message
      target
    }
  }
}

Variables

Pass these as a JSON object in the step's Variables field.

cartIdstringrequired

The ID of the cart.

buyerIdentityobjectrequired

The customer associated with the cart. Used to determine [international pricing](https://shopify.dev/custom-storefronts/internationalization/international-pricing). Buyer identity should match the customer's shipping address.

emailstring
phonestring
companyLocationIdstring
countryCodestring

One ofAFAXALDZADAOAIAGARAMAWACAUATAZBSBHBDBBBYBEBZBJBMBTBOBABWBVBRIOBNBGBFBIKHCACVBQKY

customerAccessTokenstring
deliveryAddressPreferencesarray<object>4 fields
preferencesobject2 fields
json
{
  "cartId": "string",
  "buyerIdentity": {
    "email": "string",
    "phone": "string",
    "companyLocationId": "string",
    "countryCode": "AF",
    "customerAccessToken": "string",
    "deliveryAddressPreferences": [
      {
        "deliveryAddress": "string",
        "oneTimeUse": "string",
        "deliveryAddressValidationStrategy": "string",
        "customerAddressId": "string"
      }
    ],
    "preferences": {
      "delivery": {
        "deliveryMethod": "string",
        "pickupHandle": "string",
        "coordinates": "string"
      },
      "wallet": [
        "string"
      ]
    }
  }
}

Response

Read the result with {{cartbuyeridentityupdate.response.data.data.cartBuyerIdentityUpdate}}. If the API returns errors, the step fails and they are at {{cartbuyeridentityupdate.response.data.errors}}.

cartobject
appliedGiftCardsarray<object>
attributesarray<object>
buyerIdentityobject7 fields
checkoutUrlstring
costobject9 fields
createdAtstring
deliveryobject
discountAllocationsarray<object>
discountApplicationsarray<object>
discountCodesarray<object>
estimatedCostobject5 fields
idstring
notestring
totalQuantitynumber
updatedAtstring
userErrorsarray<object>
codeobject
fieldobject
messageobject
warningsarray<object>
codeobject
messageobject
targetobject

Need more? See the Shopify Storefront guide for connection setup and behaviour shared by every action.