---
title: "Get a promocode by id"
method: GET
path: "/v1/promocodes/{promocodeId}"
tags: ["PromoCodeQuery"]
---

# Get a promocode by id

`GET /v1/promocodes/{promocodeId}`

## Path parameters

- `promocodeId` string, required

## Response `200`

A successful response.

- PromocodequeryserviceGetByIdResponse
  - `promocodeId` string
  - `promotionId` string
  - `state` 'NOT_EXIST' | 'AVAILABLE' | 'PROMOTION_ASSIGNED' | 'CAMPAIGN_LINKED' | 'HIDDEN'
  - `version` integer
  - `createdAt` string, date-time
  - `updatedAt` string, date-time
  - `availableCommands` PromocodecommandAvailableCommand[]
    - `command` 'CREATE' | 'LINK_CAMPAIGN' | 'UNLINK_CAMPAIGN' | 'HIDE' | 'SHOW' | 'LOAD_CODES_FILE' | 'CONFIGURE_PERSONALIZED' | 'REASSIGN_PROMOTION' | 'SET_TYPE' | 'CONFIGURE_CUSTOMER_SORTING' | 'CONFIGURE_CODES_ALERT'
    - `url` string
    - `httpMethod` 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'
  - `uniqueCodes` object
  - `type` 'GENERIC' | 'PERSONALIZED' | 'NO_CODE'
  - `fallbackConfig` 'UNKNOWN' | 'USE_FALLBACK_CODE' | 'REJECT_CUSTOMER'
  - `allocationConfig` 'UNSET' | 'ALWAYS_NEW_CODE' | 'ONE_CODE_PER_CUSTOMER'
  - `alertConfig` CodeUniqueCodesAlertConfig
    - `percentThreshold` integer
    - `notifyByEmail` boolean
    - `notifyByWebhook` boolean
  - `campaignIds` string[]

## Other responses

- `default` — An unexpected error response.

---

[API](https://skmtc.net/optimove/apis/optimove-api.md) · [All operations](https://skmtc.net/optimove/apis/optimove-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/optimove/optimove-api/versions/fc55c5b1bec5/schema)
