Skip to main content
POST
/
v1
/
rewards
/
{id}
/
codes
/
generate
Generate reward codes
curl --request POST \
  --url https://api.oneofnone.io/v1/rewards/{id}/codes/generate \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "count": 250,
  "prefix": "<string>"
}
'
{
  "codes": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "rewardId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "code": "<string>",
      "reservedFor": "<string>",
      "redeemedBy": "<string>",
      "redeemedAt": "<string>",
      "orderId": "<string>",
      "externalOrderId": "<string>",
      "createdAt": "<string>",
      "expiresAt": "<string>",
      "updatedAt": "<string>",
      "externalIds": {
        "shopify": {
          "discountId": "<string>",
          "codeId": "<string>",
          "syncedAt": "<string>",
          "error": "<string>"
        },
        "stripe": {
          "discountId": "<string>",
          "codeId": "<string>",
          "syncedAt": "<string>",
          "error": "<string>"
        }
      }
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.oneofnone.io/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-api-key
string
header
required

Path Parameters

id
string<uuid>
required

Body

application/json
count
integer
required
Required range: 1 <= x <= 500
prefix
string
Required string length: 1 - 32

Response

Generated codes

codes
(object | null)[]
required