Get Promotion Codes
GEThttps://useast.api.elasticpath.com/v2/promotions/:promotionID/codes
You can use this endpoint to retrieve promotion codes.
note
- The
codes.max_uses
attribute represents the maximum usage of the codes. - The
codes.uses
attribute represents the remaining number of times the codes can be used for the promotion. - Codes created before April 27, 2023 will only have
codes.uses
attribute in the response body.
Request
Responses
- 200
- 401
Response Headers
Unauthorized
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.Get, "https://useast.api.elasticpath.com/v2/promotions/:promotionID/codes");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear