> Agent-readable docs index: /llms.txt. Download /docs.zip to grep all markdown files locally.

---
title: "updateCartBuyerIdentity"
description: "Updates the buyer's identity if it was not provided in the createCart mutation."
---

<Note>BuyerIdentity must be provided either by `createCart` mutation or by `updateCartBuyerIdentity` mutation before checkout. Otherwise, `BUYER_IDENTITY_MISSING` error will be returned upon cart submission.</Note>

<Note>For `SHOPIFY` orders, Rye sends receipts for the placed order to the email set in the buyer identity. For `AMAZON` orders however, Rye does not send receipts. If you are applying a margin to the product, consider sending a customized receipt, taking information from our `ORDER_PLACED` [webhook](/webhooks).</Note>

***

### Arguments

<ParamField path="input" type={<a href="/api-reference/cartbuyeridentityupdateinput">CartBuyerIdentityUpdateInput!</a>} required>
  The `input` object contains the unique identifier (`ID`) for the cart and the buyer identity details that need to be associated with the cart.
</ParamField>

***

### Returns

<ParamField path="CartResponse.*" type={<a href="/api-reference/cartresponse">CartResponse</a>}>
  Any requested field from the [`CartResponse`](/api-reference/cartresponse) object.
</ParamField>

***

### Example - request

```json Query arguments
{
    "input": {
        "id": "{{cartId}}",
        "buyerIdentity": {
            "firstName": "{{firstName}}",
            "lastName": "{{lastName}}",
            "email": "{{email}}",
            "phone": "{{phone}}",
            "address1": "{{address1}}",
            "address2": "{{address2}}",
            "city": "{{city}}",
            "provinceCode": "{{provinceCode}}",
            "countryCode": "US",
            "postalCode": "{{postalCode}}"
        }
    }
}
```

```GraphQL GraphQL
mutation ($input: CartBuyerIdentityUpdateInput!) {
    updateCartBuyerIdentity(input: $input) {
        cart {
            cost {
                isEstimated
                subtotal {
                    value
                    displayValue
                    currency
                }
                tax {
                    value
                    displayValue
                    currency
                }
                shipping {
                    value
                    displayValue
                    currency
                }
                total {
                    value
                    displayValue
                    currency
                }
            }
            id
            buyerIdentity {
                firstName
                lastName
                address1
                address2
                city
                provinceCode
                countryCode
                postalCode
                email
                phone
            }
            stores {
                ... on AmazonStore {
                    errors {
                        code
                        message
                        details {
                            productIds
                        }
                    }
                    store
                    cartLines {
                        quantity
                        product {
                            id
                        }
                    }
                    offer {
                        errors {
                            code
                            message
                            details {
                                ... on AmazonOfferErrorDetails {
                                productIds
                            }
                            }
                        }
                        subtotal {
                            value
                            displayValue
                            currency
                        }
                        margin {
                            value
                            displayValue
                            currency
                        }
                        notAvailableIds
                        shippingMethods {
                            id
                            label
                            price {
                                value
                                displayValue
                                currency
                            }
                            taxes {
                                value
                                displayValue
                                currency
                            }
                            total {
                                value
                                displayValue
                                currency
                            }
                        }

                        selectedShippingMethod {
                            id
                            label
                            price {
                                value
                                displayValue
                                currency
                            }
                            taxes {
                                value
                                displayValue
                                currency
                            }
                            total {
                                value
                                displayValue
                                currency
                            }
                        }
                    }
                }
                ... on ShopifyStore {
                    errors {
                        code
                        message
                        details {
                            variantIds
                        }
                    }
                    store
                    cartLines {
                        quantity
                        variant {
                            id
                        }
                    }
                    offer {
                        errors {
                            code
                            message
                            details {
                                ... on ShopifyOfferErrorDetails {
                                variantIds
                            }
                            }
                        }
                        subtotal {
                            value
                            displayValue
                            currency
                        }
                        margin {
                            value
                            displayValue
                            currency
                        }
                        notAvailableIds
                        shippingMethods {
                            id
                            label
                            price {
                                value
                                displayValue
                                currency
                            }
                            taxes {
                                value
                                displayValue
                                currency
                            }
                            total {
                                value
                                displayValue
                                currency
                            }
                        }

                        selectedShippingMethod {
                            id
                            label
                            price {
                                value
                                displayValue
                                currency
                            }
                            taxes {
                                value
                                displayValue
                                currency
                            }
                            total {
                                value
                                displayValue
                                currency
                            }
                        }
                    }
                }
            }
        }
        errors {
            code
            message
        }
    }
}
```


---

*Powered by [holocron.so](https://holocron.so)*
