# Endpoints

### Don't be that person

{% hint style="info" %}
Most of our endpoints use "POST" requests to keep transmission of sensitive data secure - but this service is not to be used for storing any personal data - and is up to you the developer to make sure that your experience conforms with this requirement.
{% endhint %}

### Fetch a stores Id {storeId}

Cupid exposes an active store id for a given myShopify domain.

{% openapi src="<https://3012941138-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkmkFZVDpQaVDOibcbLjX%2Fuploads%2FLwB56QoSje1BYhYoP52m%2Fswagger.json?alt=media&token=17dcc4e4-beef-4737-8518-a97113807a90>" path="/wishlist/storeid/{storeMyshopifyDomain}" method="get" %}
[swagger.json](https://3012941138-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkmkFZVDpQaVDOibcbLjX%2Fuploads%2FLwB56QoSje1BYhYoP52m%2Fswagger.json?alt=media\&token=17dcc4e4-beef-4737-8518-a97113807a90)
{% endopenapi %}

### Fetch a wishlist by a users Email

Returns a complete wishlist for a provided email.

{% openapi src="<https://3012941138-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkmkFZVDpQaVDOibcbLjX%2Fuploads%2FLwB56QoSje1BYhYoP52m%2Fswagger.json?alt=media&token=17dcc4e4-beef-4737-8518-a97113807a90>" path="/wishlist/email/{storeId}" method="post" %}
[swagger.json](https://3012941138-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkmkFZVDpQaVDOibcbLjX%2Fuploads%2FLwB56QoSje1BYhYoP52m%2Fswagger.json?alt=media\&token=17dcc4e4-beef-4737-8518-a97113807a90)
{% endopenapi %}

### Fetch a wishlist by a wishlist Id

This is our default experience endpoint for non authenticated users, typically we recommend storing a wishlist Id in localstorage and fetching the wishlist at the beginning of the browsing session for SPA's

{% openapi src="<https://3012941138-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkmkFZVDpQaVDOibcbLjX%2Fuploads%2FLwB56QoSje1BYhYoP52m%2Fswagger.json?alt=media&token=17dcc4e4-beef-4737-8518-a97113807a90>" path="/wishlist/id/{storeId}" method="post" %}
[swagger.json](https://3012941138-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkmkFZVDpQaVDOibcbLjX%2Fuploads%2FLwB56QoSje1BYhYoP52m%2Fswagger.json?alt=media\&token=17dcc4e4-beef-4737-8518-a97113807a90)
{% endopenapi %}

### Delete a wishlist by a wishlist Id

Delete a wishlist and all of its events, not to be confused with "tombstone"-ing a wishlist which will clear the public history of a given wishlist, but keep the id.

{% openapi src="<https://3012941138-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkmkFZVDpQaVDOibcbLjX%2Fuploads%2FLwB56QoSje1BYhYoP52m%2Fswagger.json?alt=media&token=17dcc4e4-beef-4737-8518-a97113807a90>" path="/wishlist/event/{storeId}/{wishlistId}" method="delete" %}
[swagger.json](https://3012941138-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkmkFZVDpQaVDOibcbLjX%2Fuploads%2FLwB56QoSje1BYhYoP52m%2Fswagger.json?alt=media\&token=17dcc4e4-beef-4737-8518-a97113807a90)
{% endopenapi %}

### Create an event on a wishlist

{% hint style="info" %}
Submitting an event without providing a wishlist Id will create a wishlist and return the id for you to store client side.
{% endhint %}

This is the default experience, you can provide any eventType for your own purposes, but we have some protected events that provide certain functionality. Cupid stores wishlists as a timeseries of events, and accepts freeform event bodies, allowing developers to build highly flexible experiences.

**Reserved events include:**

`wishlist/add`

Will add a product to a rendered wishlist

`wishlist/remove`

Will remove a product from a rendered wishlist

{% hint style="info" %}
Wishlist prefixed events are deduplicated when a wishlist is rendered, returning only the current status of the wishlist, if you send 3 wishlist/add events for a given object Id, you will only receive the latest event. If an object has been removed from a wishlist after it is added, no reference to that will be returned.
{% endhint %}

`email/add`

Will add an email to a rendered withlist

`tombstone`

Will hide all events that took place before the tombstone event, perfect for a "clear wishlist" button.

{% hint style="info" %}
We strongly recommend you do not send Cupid any sensitive customer information - we do try to take every precaution, but will not be held responsible if you send a wishlist information of a personal nature.
{% endhint %}

{% openapi src="<https://3012941138-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkmkFZVDpQaVDOibcbLjX%2Fuploads%2FLwB56QoSje1BYhYoP52m%2Fswagger.json?alt=media&token=17dcc4e4-beef-4737-8518-a97113807a90>" path="/wishlist/event/{storeId}" method="post" %}
[swagger.json](https://3012941138-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkmkFZVDpQaVDOibcbLjX%2Fuploads%2FLwB56QoSje1BYhYoP52m%2Fswagger.json?alt=media\&token=17dcc4e4-beef-4737-8518-a97113807a90)
{% endopenapi %}
