Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add clear cart method #7

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions source/includes/_products.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -459,3 +459,46 @@ curl https://<%= config[:api_endpoint] %>/products/not_widgetable?shop_id=...&sh
Returns a list of `avaiable` and `not ignored` products which are not `widgetable`: can't be displayed in search, recommendations and messages due to missing one of mandatory parameters (`name`, `price`, `url` or `image_url`) or failed to fetch product's photo during import operation.



## Clear client's shopping cart

```shell

# By phone number
curl --location --request DELETE 'https://<%= config[:api_endpoint] %>/products/cart/clear?phone=PHONE&shop_id=SHOP_ID&shop_secret=SHOP_SECRET'

# By phone email
curl --location --request DELETE 'https://<%= config[:api_endpoint] %>/products/cart/clear?email=EMAIL&shop_id=SHOP_ID&shop_secret=SHOP_SECRET'


```

```javascript
// No implementation. See CURL}
```

```java
// No implementation. See CURL
```

### HTTP Request

`DELETE https://<%= config[:api_endpoint] %>/products/cart/clear`

### Query Parameters

| Parameter | Required | Description |
|------------|----------|--------------------------------------------------------------------------------------------------------------------------------------|
| shop_id | true | Your API key |
| shop_secret | true | Your API secret key |
| email* | true | User's email |
| phone* | true | User's phone number |

<aside class="notice">
At least of identifiers (marked by *) must present in request: email, phone. It's used to identify user.
</aside>


### API response

Returns `{"status": "success"}` JSON object.
Loading