Skip to main content

Delete Rule Promotion Codes

DELETE 

https://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

Responses

No Content

Authorization: http

name: BearerAuthtype: httpscheme: bearer
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());
Request Collapse all
Base URL
https://useast.api.elasticpath.com
Auth
Parameters
— pathrequired
— headerrequired
Body required
{
  "data": {
    "type": "promotion_codes",
    "codes": [
      {
        "code": "string",
        "uses": 0,
        "user": "string",
        "consume_unit": "per_application",
        "max_users_per_shopper": {
          "max_uses": 0,
          "includes_guests": false
        },
        "is_for_new_shopper": true
      }
    ]
  }
}
ResponseClear

Click the Send API Request button above and see the response here!

We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies.