Adobe Commerce only. Learn more.

updateGiftRegistry mutation

The updateGiftRegistry mutation modifies properties of specified gift registry. It does not update the items in a gift registry or registrants. Use the updateGiftRegistryItems or updateGiftRegistryRegistrants mutation to modify gift registry items or registrants.

This mutation requires a valid customer authentication token.

Syntax

1
2
3
4
5
6
7
8
mutation {
  updateGiftRegistry(
    giftRegistryUid: ID!
    giftRegistry: UpdateGiftRegistryInput!
  ) {
    UpdateGiftRegistryOutput
  }
}

Example usage

The following example changes the privacy, the message, and the event date for a gift registry.

Request:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
mutation{
  updateGiftRegistry(
    giftRegistryUid: "D0R6d2B7aZWOQuuWftHZ0iwuexQPgaei",
    giftRegistry: {
      privacy_settings: PUBLIC
      message: "Help us celebrate Bill and Julie's wedding, which will be held on May 8, 2021"
      dynamic_attributes: {
        code: "event_date"
        value: "2021-05-08"
      }
    })
  {
    gift_registry {
      uid
      event_name
      message
      status
      privacy_settings
      dynamic_attributes {
        code
        label
        value
      }
    }
  }
}

Response:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{
  "data": {
    "updateGiftRegistry": {
      "gift_registry": {
        "uid": "D0R6d2B7aZWOQuuWftHZ0iwuexQPgaei",
        "event_name": "Bill and Julie's wedding",
        "message": "Help us celebrate Bill and Julie's wedding, which will be held on May 8, 2021",
        "status": "ACTIVE",
        "privacy_settings": "PUBLIC",
        "dynamic_attributes": [
          {
            "code": "event_country",
            "label": "Country",
            "value": "US"
          },
          {
            "code": "event_date",
            "label": "Wedding Date",
            "value": "2021-05-08"
          },
          {
            "code": "event_location",
            "label": "Location",
            "value": "Ann Arbor, MI"
          },
          {
            "code": "number_of_guests",
            "label": "Number of Guests",
            "value": "101"
          }
        ]
      }
    }
  }
}

Input attributes

The updateGiftRegistry mutation requires the following input objects.

Attribute Data Type Description
giftRegistryUid ID! The unique ID of the gift registry to update
giftRegistry UpdateGiftRegistryInput! Defines the attributes to be updated.

UpdateGiftRegistryInput attributes

The UpdateGiftRegistryInput object contains the following attributes:

Attribute Data Type Description
dynamic_attributes [GiftRegistryDynamicAttributeInput] An array of attributes that define elements of the gift registry. Each attribute is specified as a code-value pair
event_name String The name of the event
message String A message describing the event
privacy_settings GiftRegistryPrivacySettings! Indicates whether the registry is PRIVATE or PUBLIC
shipping_address GiftRegistryShippingAddressInput The address for shipping the gift registry. Specify either the address_data object or the address_id attribute. Validation fails if both are provided
status GiftRegistryStatus An enum that states whether the gift registry is ACTIVE or INACTIVE. Only the registry owner can access this attribute

GiftRegistryDynamicAttributeInput attributes

The GiftRegistryDynamicAttributeInput object contains the following attributes:

Attribute Data Type Description
code ID! A unique key for an additional attribute of the event
value String! A corresponding value for the code

GiftRegistryShippingAddressInput attributes

The GiftRegistryShippingAddressInput object contains the following attributes:

Attribute Data Type Description
address_data CustomerAddressInput The complete details of the shipping address
address_id ID The ID of a pre-defined customer address

CustomerAddressInput attributes

CustomerAddressInput attributes

The CustomerAddressInput object can contain the following attributes:

Attribute Data Type Description
city String The city or town
company String The customer’s company
country_code String The customer’s country
country_id String Deprecated. Use country_code instead. The customer’s country
custom_attributes CustomerAddressAttributeInput Deprecated. Not applicable for GraphQL
default_billing Boolean Indicates whether the address is the default billing address
default_shipping Boolean Indicates whether the address is the default shipping address
fax String The fax number
firstname String The first name of the person associated with the shipping/billing address
lastname String The family name of the person associated with the shipping/billing address
middlename String The middle name of the person associated with the shipping/billing address
postcode String The customer’s ZIP or postal code
prefix String An honorific, such as Dr., Mr., or Mrs.
region CustomerAddressRegionInput An object that defines the customer’s state or province
street [String] An array of strings that define the street number and name
suffix String A value such as Sr., Jr., or III
telephone String The telephone number
vat_id String The customer’s Tax/VAT number (for corporate customers)

CustomerAddressAttributeInput attributes

The CustomerAddressAttributeInput data type has been deprecated because the contents are not applicable for GraphQL. It can contain the following attributes:

Attribute Data Type Description
attribute_code String Attribute code
value String Attribute value

CustomerAddressRegionInput attributes

The customerAddressRegionInput object can contain the following attributes:

Attribute Data Type Description
region String The state or province name
region_code String The address region code
region_id Int Deprecated. Use region instead. Uniquely identifies the region

Output attributes

The UpdateGiftRegistryOutput output object contains the following attribute:

Attribute Data Type Description
gift_registry GiftRegistry Contains the updated gift registry

GiftRegistry attributes

The GiftRegistry object returns the following attributes:

Attribute Data Type Description
created_at String! The date on which the gift registry was created. Only the registry owner can access this attribute
dynamic_attributes [GiftRegistryDynamicAttribute] An array of attributes that define elements of the gift registry. Each attribute is specified as a code-value pair
event_name String! The name the customer assigned to the event
items [GiftRegistryItemInterface] An array of products added to the gift registry
message String! The message text the customer entered to describe the event
owner_name String! The customer who created the gift registry
privacy_settings GiftRegistryPrivacySettings! An enum that states whether the gift registry is PRIVATE or PUBLIC. Only the registry owner can access this attribute
registrants [GiftRegistryRegistrant] Contains details about each registrant for the event
shipping_address CustomerAddress Contains the customer’s shipping address. Only the registry owner can access this attribute
status GiftRegistryStatus! An enum that states whether the gift registry is ACTIVE or INACTIVE. Only the registry owner can access this attribute
type [GiftRegistryType] Contains details about the type of gift registry
uid ID! The unique ID assigned to the gift registry

GiftRegistryDynamicAttribute attributes

The GiftRegistryDynamicAttribute object implements GiftRegistryDynamicAttributeInterface. It also defines the following attribute.

Attribute Data Type Description
group GiftRegistryDynamicAttributeGroup! An enum that categorizes the dynamic attribute set. The possible values are EVENT_INFORMATION, PRIVACY_SETTINGS, REGISTRANT, GENERAL_INFORMATION, DETAILED_INFORMATION, and SHIPPING_ADDRESS.

GiftRegistryDynamicAttributeInterface attributes

The GiftRegistryDynamicAttribute and GiftRegistryRegistrantDynamicAttribute data types implement the GiftRegistryDynamicAttributeInterface.

This interface contains the following attributes:

Attribute Data type Description
code ID! The internal ID of the dynamic attribute
label String! The display name of the dynamic attribute
value String! A corresponding value for the code

GiftRegistryDynamicAttributeMetadataInterface

The GiftRegistryDynamicAttributeMetadata data type implements the GiftRegistryDynamicAttributeMetadataInterface.

This interface contains the following attributes:

Attribute Data Type Description
attribute_group String! Indicates which group of the dynamic attribute a member of
code ID! The internal ID of the dynamic attribute
input_type String! The input type of the dynamic attribute
is_required Boolean! Indicates whether the dynamic attribute is required
label String! The display name of the dynamic attribute
sort_order Int The order in which to display the dynamic attribute

GiftRegistryItemInterface attributes

This GiftRegistryItemInterface contains the following attributes:

Attribute Data Type Description
created_at String! The date the product was added to the gift registry
note String A brief message about the gift registry item
product ProductInterface The details about the product
quantity Float! The requested quantity of the product
quantity_fulfilled Float! The fulfilled quantity of the product
uid ID! The unique ID assigned to the gift registry item

GiftRegistryRegistrant attributes

The GiftRegistryRegistrant object contains the following attributes:

Attribute Data type Description
dynamic_attributes [GiftRegistryRegistrantDynamicAttribute] An array of attributes that define elements of the gift registry. Each attribute is specified as a code-value pair
email String! The email address of the registrant. Only the registry owner can access this attribute
firstname String! The first name of the registrant
lastname String! The last name of the registrant
uid ID! The unique ID assigned to the registrant

GiftRegistryRegistrantDynamicAttribute attributes

The GiftRegistryRegistrantDynamicAttribute data type implements the GiftRegistryDynamicAttributeInterface. It does not introduce any additional attributes.

GiftRegistryType attributes

The GiftRegistryType object contains the following attributes:

Attribute Data type Description
dynamic_attributes_metadata [GiftRegistryDynamicAttributeMetadataInterface] An array of attributes that define elements of the gift registry. Each attribute is specified as a code-value pair
label String! The display name of the gift registry type
uid ID! The unique ID assigned to the gift registry type