---
updatedAt: 2026-11-11T07:32:40.000Z
agentTools:
  projectIndex: https://docs.yotpo.com/llms.txt
---

# Upload dynamic coupon codes

Uploads unique coupon codes for a review-request email (`coupon_action`, for example `map_review`). The response reports how many codes were accepted and any rejected codes (empty, duplicate, or wrong length). Unsupported `coupon_action` values currently return `500`.

> 👍 How to use this endpoint
>
> * For example responses, click the relevant status code on the right.
> * You can upload up to 1,000 codes.

## Coupon actions

<Table align={["left","left"]}>
  <thead>
    <tr>
      <th>
        Issue coupon when...
      </th>

      <th>
        Parameter
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        The customer writes a product or site review
      </td>

      <td>
        `map_review`
      </td>
    </tr>

    <tr>
      <td>
        The customer shares a review on the Landing Page
      </td>

      <td>
        `map_share`
      </td>
    </tr>

    <tr>
      <td>
        The customer writes and shares a review
      </td>

      <td>
        `map_review_share`
      </td>
    </tr>
  </tbody>
</Table>

## Error codes

<Table align={["left","left"]}>
  <thead>
    <tr>
      <th>
        Code
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `empty_cells`
        "Empty cells"
      </td>

      <td>
        The array you uploaded contains empty dynamic coupon codes.
      </td>
    </tr>

    <tr>
      <td>
        `code_length`\
        "Max/Min code digit requirements"
      </td>

      <td>
        The dynamic coupon code is too long to too short.
      </td>
    </tr>

    <tr>
      <td>
        `duplicate_code`\
        "Duplicated content"
      </td>

      <td>
        You used the same dynamic coupon code more than once. The codes must be unique.
      </td>
    </tr>
  </tbody>
</Table>

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Reviews API (V1)",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.yotpo.com",
      "description": "Main API server for authenticated and write operations"
    }
  ],
  "components": {
    "securitySchemes": {
      "X-Yotpo-Token": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Yotpo-Token",
        "description": "Your Yotpo account access token. See [Yotpo Authentication](ref:yotpo-authentication) to learn how to generate your token."
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Missing or invalid access token",
        "content": {
          "application/json": {
            "examples": {
              "Unauthorized": {
                "value": {
                  "status": {
                    "message": "You are not authorized to access this page.",
                    "code": 401,
                    "error_type": "Exceptions::AccessDenied"
                  }
                }
              }
            },
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Human-readable error message"
                    },
                    "code": {
                      "type": "integer",
                      "description": "HTTP status code"
                    },
                    "error_type": {
                      "type": "string",
                      "description": "Internal error class"
                    }
                  },
                  "description": "Error details."
                }
              }
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "X-Yotpo-Token": []
    }
  ],
  "paths": {
    "/apps/{store_id}/coupons/unique": {
      "post": {
        "summary": "Upload dynamic coupon codes",
        "description": "Uploads unique coupon codes for a review-request email (`coupon_action`, for example `map_review`). The response reports how many codes were accepted and any rejected codes (empty, duplicate, or wrong length). Unsupported `coupon_action` values currently return `500`.",
        "operationId": "upload-unique-coupon-codes",
        "parameters": [
          {
            "name": "store_id",
            "in": "path",
            "description": "The store ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "coupon_action",
                  "codes"
                ],
                "properties": {
                  "coupon_action": {
                    "type": "string",
                    "description": "The review-request email the codes are used in, for example `map_review`."
                  },
                  "codes": {
                    "type": "array",
                    "description": "Array of dynamic coupon codes",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              },
              "examples": {
                "HTTP+JSON": {
                  "value": {
                    "coupon_action": "map_review",
                    "codes": [
                      "sdfj789klvd",
                      "sdfsfd1313jkl",
                      "mkklwlwer43qkjl"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": {
                      "status": {
                        "code": 200,
                        "message": "OK"
                      },
                      "response": {
                        "total_codes": 20,
                        "errors": {
                          "empty_cell": {
                            "error_text": "Empty cells",
                            "error_count": 0
                          },
                          "code_length": {
                            "error_text": "Max/Min code digit requirements",
                            "error_count": 0
                          },
                          "duplicate_code": {
                            "error_text": "Duplicated content",
                            "error_count": 0
                          }
                        },
                        "new_codes": 3
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "ratelimit-limit": {
                "description": "The maximum number of requests allowed in the current time window",
                "schema": {
                  "type": "integer"
                }
              },
              "ratelimit-remaining": {
                "description": "The number of requests remaining in the current time window",
                "schema": {
                  "type": "integer"
                }
              },
              "ratelimit-reset": {
                "description": "The time (in seconds) until the rate limit resets",
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-limit-minute": {
                "description": "The maximum number of requests allowed per minute",
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining-minute": {
                "description": "The number of requests remaining in the current minute",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": {}
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            },
            "headers": {
              "ratelimit-limit": {
                "description": "The maximum number of requests allowed in the current time window",
                "schema": {
                  "type": "integer"
                }
              },
              "ratelimit-remaining": {
                "description": "The number of requests remaining in the current time window",
                "schema": {
                  "type": "integer"
                }
              },
              "ratelimit-reset": {
                "description": "The time (in seconds) until the rate limit resets",
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-limit-minute": {
                "description": "The maximum number of requests allowed per minute",
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining-minute": {
                "description": "The number of requests remaining in the current minute",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [
      {
        "value": "application/json",
        "key": "Content-Type"
      }
    ],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```