Appearance
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
| Method | URL path | Required access |
|---|---|---|
PUT | /api/v1/user/syncBag | Origin + Brand key + Hub selected + Customer |
PUT | /api/v1/syncBag | Origin + Brand key + Hub selected |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
body.payload | object | yes | — |
body.payload.bag | array of object | yes | — |
body.payload.bag[].hubProductId | number | yes | — |
body.payload.bag[].quantity | number | yes | — |
body.payload.bag[].packageId | string | optional | Whitespace trimmed |
body.payload.bag[].points_source | boolean | optional | Default (false) |
body.payload.bag[].isPromotional | boolean | optional | — |
body.payload.modification | array of object | optional | — |
body.payload.modification[].created | boolean | optional | — |
body.payload.modification[].updated | boolean | optional | — |
body.payload.modification[].deleted | boolean | optional | — |
body.payload.modification[].hubProductId | number | yes | — |
body.payload.modification[].points_source | boolean | optional | Default (false) |
body.payload.modification[].quantity | number | optional | — |
body.payload.syncBag | boolean | optional | — |
body.payload.addressId | number | optional | — |
body.payload.points | number | optional | Minimum (0) |
body.payload.discounts | array of string | optional | — |
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
| Method | URL path | Required access |
|---|---|---|
DELETE | /api/v1/user/emptyCart | Origin + 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
| Method | URL path | Required access |
|---|---|---|
PUT | /api/v1/explicitDiscount | Origin + Brand key + Hub selected + Customer |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
body.payload | object | yes | — |
body.payload.discounts | array of string | yes | — |
body.payload.addressId | number | optional | — |
body.payload.points | number | optional | Minimum (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
| Method | URL path | Required access |
|---|---|---|
POST | /api/v1/user/wishlist/create | Origin + Customer + Brand key |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
body.payload | object | yes | — |
body.payload.productId | number | yes | — |
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
| Method | URL path | Required access |
|---|---|---|
GET | /api/v1/user/wishlist | Origin + 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
| Method | URL path | Required access |
|---|---|---|
DELETE | /api/v1/user/wishlist/:wishlistId | Origin + Customer + Brand key |
Request fields:
| Field | Type | Required | Rules / meaning |
|---|---|---|---|
path.wishlistId | number | yes | — |
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
| Method | URL path | Required access |
|---|---|---|
DELETE | /api/v1/user/wishlist | Origin + 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).