Skip to content

Cart and wishlist ​

Sync the shopping bag, apply discounts to it, or save products to a wishlist. A wishlist is separate from the cart used to create an order.

Access labels such as Origin + Brand key + Customer are defined in Headers and access. Each endpoint ends in a Try it console; set the host and keys once in its Settings tab or on the overview.

Sync bag with client ​

MethodURL pathRequired access
PUT/api/v1/user/syncBagOrigin + Brand key + Hub selected + Customer
PUT/api/v1/syncBagOrigin + Brand key + Hub selected

Request fields:

FieldTypeRequiredRules / meaning
body.payloadobjectyes—
body.payload.bagarray of objectyes—
body.payload.bag[].hubProductIdnumberyes—
body.payload.bag[].quantitynumberyes—
body.payload.bag[].packageIdstringoptionalWhitespace trimmed
body.payload.bag[].points_sourcebooleanoptionalDefault (false)
body.payload.bag[].isPromotionalbooleanoptional—
body.payload.modificationarray of objectoptional—
body.payload.modification[].createdbooleanoptional—
body.payload.modification[].updatedbooleanoptional—
body.payload.modification[].deletedbooleanoptional—
body.payload.modification[].hubProductIdnumberyes—
body.payload.modification[].points_sourcebooleanoptionalDefault (false)
body.payload.modification[].quantitynumberoptional—
body.payload.syncBagbooleanoptional—
body.payload.addressIdnumberoptional—
body.payload.pointsnumberoptionalMinimum (0)
body.payload.discountsarray of stringoptional—

Example (first URL):

bash
curl -X PUT "$BASE_URL/api/v1/user/syncBag" \
  -H "Origin: $ORIGIN" \
  -H "api-key: $API_KEY" \
  -H "Authorization: Bearer $CUSTOMER_TOKEN" \
  -H 'Content-Type: application/json' \
  --data-raw '{"payload":{"bag":[{"hubProductId":1,"quantity":1}]}}'

Response: JSON with success: true and result containing the operation’s service data.

Source: app/v1/controller/syncBag_controller.js:11 → syncBagWithClient; routes: routes/v1/syncBag_route.js:59; service: _syncBagWithClient (app/v1/service/syncBag_service.js:18).

Empty cart ​

MethodURL pathRequired access
DELETE/api/v1/user/emptyCartOrigin + Brand key + Hub selected + Customer

Request fields: no body, query, or path fields are read by this controller. Context comes from the headers/middleware above.

Example:

bash
curl -X DELETE "$BASE_URL/api/v1/user/emptyCart" \
  -H "Origin: $ORIGIN" \
  -H "api-key: $API_KEY" \
  -H "Authorization: Bearer $CUSTOMER_TOKEN"

Response: JSON with success: true and result containing the operation’s service data.

Source: app/v1/controller/syncBag_controller.js:93 → emptyCart; routes: routes/v1/syncBag_route.js:69; service: _emptyCart (app/v1/service/syncBag_service.js:1162).

Apply explicit discount ​

MethodURL pathRequired access
PUT/api/v1/explicitDiscountOrigin + Brand key + Hub selected + Customer

Request fields:

FieldTypeRequiredRules / meaning
body.payloadobjectyes—
body.payload.discountsarray of stringyes—
body.payload.addressIdnumberoptional—
body.payload.pointsnumberoptionalMinimum (0)

Example:

bash
curl -X PUT "$BASE_URL/api/v1/explicitDiscount" \
  -H "Origin: $ORIGIN" \
  -H "api-key: $API_KEY" \
  -H "Authorization: Bearer $CUSTOMER_TOKEN" \
  -H 'Content-Type: application/json' \
  --data-raw '{"payload":{"discounts":["example"]}}'

Response: JSON with success: true and result containing the operation’s service data.

Source: app/v1/controller/syncBag_controller.js:108 → applyExplicitDiscount; routes: routes/v1/syncBag_route.js:79; service: _applyExplicitDiscount (app/v1/service/syncBag_service.js:1173).

Add to wishlist ​

MethodURL pathRequired access
POST/api/v1/user/wishlist/createOrigin + Customer + Brand key

Request fields:

FieldTypeRequiredRules / meaning
body.payloadobjectyes—
body.payload.productIdnumberyes—

Example:

bash
curl -X POST "$BASE_URL/api/v1/user/wishlist/create" \
  -H "Origin: $ORIGIN" \
  -H "api-key: $API_KEY" \
  -H "Authorization: Bearer $CUSTOMER_TOKEN" \
  -H 'Content-Type: application/json' \
  --data-raw '{"payload":{"productId":1}}'

Response: JSON with success: true and result containing the operation’s service data.

Source: app/v1/controller/wishlist_controller.js:10 → addToWishlist; routes: routes/v1/wishlist_route.js:50; service: _addToWishlist (app/v1/service/wishlist_service.js:6).

Get user wishlist ​

MethodURL pathRequired access
GET/api/v1/user/wishlistOrigin + Customer + Brand key

Request fields: no body, query, or path fields are read by this controller. Context comes from the headers/middleware above.

Example:

bash
curl -X GET "$BASE_URL/api/v1/user/wishlist" \
  -H "Origin: $ORIGIN" \
  -H "api-key: $API_KEY" \
  -H "Authorization: Bearer $CUSTOMER_TOKEN"

Response: JSON with success: true and result containing the operation’s service data. Result fields/details: An array of saved wishlist entries with associated product details.

Source: app/v1/controller/wishlist_controller.js:38 → getUserWishlist; routes: routes/v1/wishlist_route.js:60; service: _getWishlist (app/v1/service/wishlist_service.js:65).

Remove wishlist ​

MethodURL pathRequired access
DELETE/api/v1/user/wishlist/:wishlistIdOrigin + Customer + Brand key

Request fields:

FieldTypeRequiredRules / meaning
path.wishlistIdnumberyes—

Example:

bash
curl -X DELETE "$BASE_URL/api/v1/user/wishlist/1" \
  -H "Origin: $ORIGIN" \
  -H "api-key: $API_KEY" \
  -H "Authorization: Bearer $CUSTOMER_TOKEN"

Response: JSON with success: true and result containing the operation’s service data.

Source: app/v1/controller/wishlist_controller.js:50 → removeWishlist; routes: routes/v1/wishlist_route.js:70; service: _removeWishlist (app/v1/service/wishlist_service.js:31).

Empty wishlist ​

MethodURL pathRequired access
DELETE/api/v1/user/wishlistOrigin + Customer + Brand key

Request fields: no body, query, or path fields are read by this controller. Context comes from the headers/middleware above.

Example:

bash
curl -X DELETE "$BASE_URL/api/v1/user/wishlist" \
  -H "Origin: $ORIGIN" \
  -H "api-key: $API_KEY" \
  -H "Authorization: Bearer $CUSTOMER_TOKEN"

Response: JSON with success: true and result containing the operation’s service data.

Source: app/v1/controller/wishlist_controller.js:79 → emptyWishlist; routes: routes/v1/wishlist_route.js:80; service: _emptyWishlist (app/v1/service/wishlist_service.js:51).

Batch platform, Shopify app and API documentation