Delete a Promotion Code
DELETEhttps://useast.api.elasticpath.com/v2/promotions/:promotionID/codes/:code
Use this endpoint to delete a single promotion code.
Request
Path Parameters
promotionID stringrequired
Specifies the unique identifier of the promotion associated with the codes.
code stringrequired
Specifies the code that you want to delete.
Header Parameters
Authorization Bearerrequired
The Bearer token required to get access to the API.
Responses
- 204
- 401
- 404
No Content
Unauthorized
- application/json
- Schema
- Example (auto)
- Example
Schema
detailstring
statusstring
titlestring
[
null
]
[
{
"errors": [
{
"status": 401,
"title": "Unauthorized"
}
]
}
]
Not Found
- application/json
- Schema
- Example (auto)
- Example
Schema
detailstring
statusstring
titlestring
[
null
]
[
{
"errors": [
{
"detail": "promotion not found",
"status": 404,
"title": "Not Found"
}
]
}
]
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/promotions/:promotionID/codes/:code");
request.Headers.Add("Authorization", "Bearer <token>");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear