Delete Rule Promotion Codes
DELETEhttps://useast.api.elasticpath.com/v2/rule-promotions/:promotionID/codes
Deletes one or more promotion codes from a specific rule promotion.
- Supports bulk deletion, allowing multiple codes to be removed in a single request.
- Removes promotion codes permanently, making them unavailable for future use.
- If a code has already been redeemed, it will be removed from the system but may still reflect in historical transactions.
A successful request returns a 204 No Content
response, indicating the specified promotion codes have been deleted.
Request
Path Parameters
promotionID stringrequired
The unique identifier of the rule promotion.
Header Parameters
Authorization Bearerrequired
The Bearer token required to get access to the API.
- application/json
Bodyrequired
data object
Responses
- 204
No Content
Authorization: http
name: BearerAuthtype: httpscheme: bearer
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Delete, "https://useast.api.elasticpath.com/v2/rule-promotions/:promotionID/codes");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"data\": {\n \"type\": \"promotion_codes\",\n \"codes\": [\n {\n \"code\": \"string\",\n \"uses\": 0,\n \"user\": \"string\",\n \"consume_unit\": \"per_application\",\n \"max_users_per_shopper\": {\n \"max_uses\": 0,\n \"includes_guests\": false\n },\n \"is_for_new_shopper\": true\n }\n ]\n }\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear