Skip to content

Commit abc42dc

Browse files
authored
Merge pull request #8 from rees46/chore/purge-promocodes
chore: delete not sent promo codes
2 parents 6ce5a52 + 6fd0731 commit abc42dc

File tree

1 file changed

+50
-1
lines changed

1 file changed

+50
-1
lines changed

source/includes/_promocodes.md.erb

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,58 @@ Method uploads list of unique promo codes to the selected list. All non-unique p
9393
| id | true | Promo codes list ID |
9494
| codes | true | List of promo codes |
9595

96+
97+
98+
99+
100+
## Delete not sent promo codes
101+
102+
> Headers
103+
104+
```
105+
Content-type: application/json
106+
```
107+
108+
> Body example
109+
110+
```json
111+
{
112+
"shop_id": "...",
113+
"shop_secret": "...",
114+
"id": "...",
115+
}
116+
```
117+
118+
> Request example
119+
120+
```shell
121+
curl --header "Content-Type: application/json" \
122+
--request DELETE \
123+
--data-binary "@data.json" \
124+
https://<%= config[:api_endpoint] %>/promo_codes/purge
125+
```
126+
127+
Method deletes promo codes from the list which were not sent to any user. It's useful to clean up time sensitive codes.
128+
129+
130+
### HTTP Request
131+
132+
`DELETE https://<%= config[:api_endpoint] %>/promo_codes/purge`
133+
134+
`Content-Type: application/json`
135+
136+
### Query Parameters
137+
138+
| Parameter | Required | Description |
139+
|--------------|-----------|---------------------|
140+
| shop_id | true | Your API key |
141+
| shop_secret | true | Your API secret key |
142+
| id | true | Promo codes list ID |
143+
96144
### Errors
97145

98-
When promo codes list is empty, method returns 404 error.
146+
When promo codes list is not found, method returns 404 error.
147+
99148

100149

101150

0 commit comments

Comments
 (0)