Skip to content

Create Wishlist Item

Add a product to the authenticated customer's wishlist.

Endpoint

POST /api/shop/wishlists

Request Headers

HeaderRequiredDescription
Content-TypeYesapplication/json
X-STOREFRONT-KEYYesYour storefront API key
AuthorizationYesCustomer Bearer token (Bearer <accessToken>)

Request Body

json
{
  "productId": 2
}
FieldTypeRequiredDescription
productIdintegerYesID of the product to add to the wishlist.

Response Fields (201 Created)

FieldTypeDescription
idintegerNew wishlist item ID
messagestringConfirmation message
productobjectAssociated product details

TIP

The exact response shape follows the package's serialization. Confirm field presence against the live endpoint for your installation.

Validation

  • productId is required and must reference an existing product.
  • A valid customer Bearer token is required.
  • Adding the same product again is a no-op or returns the existing item (use Toggle to add/remove).

Use Cases

  • "Add to wishlist" buttons on product pages
  • Save-for-later from cart or category listings

Released under the MIT License.