---
updatedAt: 2026-06-25T13:16:45.000Z
agentTools:
  projectIndex: https://loyalty.developer.dotdigital.com/llms.txt
---

# Creates a coupon code

Creates a coupon code for a specific reward and customer.

# OpenAPI definition

```json
{
  "openapi": "3.0.4",
  "info": {
    "title": "Dotdigital Loyalty",
    "description": "Manage loyalty program members, rewards, and rules. Use this API to retrieve\nmember details, points history, redemption history, and tier progress; list\navailable rewards and generate coupon codes; and list reward rules and register\nsocial media engagement events for a customer.",
    "version": "v1.0.1"
  },
  "externalDocs": {
    "description": "Learn more about Dotdigital Loyalty APIs",
    "url": "https://developer-loyalty.dotdigital.com/"
  },
  "servers": [
    {
      "url": "https://{region}-api.dotdigital.com",
      "variables": {
        "region": {
          "description": "The Dotdigital region id your account belongs to",
          "enum": [
            "r1",
            "r2",
            "r3"
          ],
          "default": "r1"
        }
      }
    }
  ],
  "security": [
    {
      "basicAuth": []
    }
  ],
  "paths": {
    "/loyalty/v1/rewards/{rewardId}/coupon-code": {
      "post": {
        "tags": [
          "Rewards"
        ],
        "summary": "Creates a coupon code",
        "description": "Creates a coupon code for a specific reward and customer.",
        "parameters": [
          {
            "name": "rewardId",
            "in": "path",
            "description": "The unqiue reward id you want to issue a coupon for.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCouponCodeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "description": "The coupon code",
                  "example": "ABC12345"
                }
              }
            }
          },
          "400": {
            "description": "Bad request"
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CreateCouponCodeRequest": {
        "required": [
          "customerId"
        ],
        "type": "object",
        "properties": {
          "customerId": {
            "type": "integer",
            "description": "Shopify customer id",
            "format": "int64",
            "example": 3455522443
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "x-samples-languages": [
    "curl",
    "csharp",
    "java",
    "javascript",
    "node",
    "python",
    "php",
    "ruby"
  ]
}
```

# Sibling pages

* [List rewards](https://loyalty.developer.dotdigital.com/reference/get_loyalty-v1-rewards.md)