customerAddBuyingListItem
Requires a customer (portal or buyer app) session.
Add/merge a line on a buying list. screen 12.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation CustomerAddBuyingListItem($input: CustomerAddBuyingListItemInput!) {
customerAddBuyingListItem(input: $input) {
id
name
createdByName
canDelete
canEdit
currency
items {
id
addedByName
productName
variantName
imageUrl
lineTotal
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation CustomerAddBuyingListItem($input: CustomerAddBuyingListItemInput!) {\n customerAddBuyingListItem(input: $input) {\n id\n name\n createdByName\n canDelete\n canEdit\n currency\n items {\n id\n addedByName\n productName\n variantName\n imageUrl\n lineTotal\n }\n }\n}",
"variables": {
"input": {
"listId": "id",
"productId": "id",
"quantity": 0,
"variantId": "id"
}
}
}
EOF
Variables:
{
"input": {
"listId": "id",
"productId": "id",
"quantity": 0,
"variantId": "id"
}
}
Response:
{
"data": {
"customerAddBuyingListItem": {
"id": "id",
"name": "string",
"createdByName": "string",
"canDelete": true,
"canEdit": true,
"currency": "string",
"items": [
{
"id": "id",
"addedByName": "string",
"productName": "string",
"variantName": "string",
"imageUrl": "string",
"lineTotal": 0
}
]
}
}
}
customerAddBuyingListItem(
input: CustomerAddBuyingListItemInput!
): CustomerBuyingListView!
Arguments
customerAddBuyingListItem.input ● CustomerAddBuyingListItemInput! non-null input
The details of the customer add buying list item request.
Type
CustomerBuyingListView object
A durable partner-shared buying list. screen 12.