moveCartItemsToGiftRegistry mutation
The moveCartItemsToGiftRegistry
mutation moves all items from the cart to a gift registry.
This mutation requires a valid customer authentication token.
Syntax
1
2
3
4
5
6
7
8
mutation {
moveCartItemsToGiftRegistry (
cartUid: ID!,
giftRegistryUid: ID!
) {
MoveCartItemsToGiftRegistryOutput
}
}
Example usage
The following example moves all items from the cart to 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
27
28
29
30
mutation {
moveCartItemsToGiftRegistry (
cartUid:"8k0Q4MpH2IGahWrTRtqM61YV2MtLPApz",
giftRegistryUid:"Owu5mdQ3uyfOAWzj8lFlHZW4uCDaMWC6"
) {
gift_registry {
uid
created_at
owner_name
status
type {
label
}
message
items {
product {
sku
name
}
}
}
status
user_errors {
code
message
product_uid
gift_registry_uid
}
}
}
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
{
"data": {
"moveCartItemsToGiftRegistry": {
"gift_registry": {
"uid": "Owu5mdQ3uyfOAWzj8lFlHZW4uCDaMWC6",
"status": "ACTIVE",
"created_at": "2021-05-06 21:19:05",
"owner_name": "Veronica Costello",
"type": {
"label": "Birthday"
},
"message": "Birthday",
"items": [
{
"product": {
"sku": "24-UG06",
"name": "Affirm Water Bottle "
}
}
]
},
"status": true,
"user_errors": []
}
}
}
Input attributes
The moveCartItemsToGiftRegistry
mutation requires the following input:
Attribute | Data Type | Description |
---|---|---|
cartUid |
ID! | The unique ID that identifies the customer’s cart |
giftRegistryUid |
ID! | The unique ID of a GiftRegistry object |
Output attributes
The MoveCartItemsToGiftRegistryOutput
object can contain the following attributes:
Attribute | Data Type | Description |
---|---|---|
gift_registry |
GiftRegistry! | The gift registry containing the moved items |
status |
Boolean! | Indicates whether the attempt to move the cart items to the gift registry was successful |
user_errors |
[GiftRegistryItemsUserError!] | An array of errors encountered while moving items from the cart to the 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 |
GiftRegistryItemsUserError attributes
The GiftRegistryItemsUserError
object contains information about errors that are specific to gift registries.
Attribute | Data Type | Description |
---|---|---|
code |
GiftRegistryItemsUserErrorType! | A gift registry specific error code. Possible values include OUT_OF_STOCK , NOT_FOUND , and UNDEFINED |
message |
String! | A localized error message |
product_uid |
ID | The unique ID of the product containing an error |
gift_registry_item_uid |
ID | The unique ID of the gift registry item containing an error |
gift_registry_uid |
ID | The unique ID of the GiftRegistry object containing an error |