---
title: "Cria um cupom"
method: POST
path: "/v1/coupons"
tags: ["Coupons"]
---

# Cria um cupom

`POST /v1/coupons`

## Request

- Base URL: `https://api.sandbox.mupag.com.br`
- URL: `https://api.sandbox.mupag.com.br/v1/coupons`
- Auth: HTTP bearer

## Headers

- `Idempotency-Key` string, required

## Request body

- CouponRequest
  - `type` string, required
  - `code` string, required
  - `description` string
  - `membership_id` string, uuid
  - `discount_type` string, required
  - `discount_value` integer, required
  - `max_uses_total` integer
  - `max_uses_per_customer` integer
  - `min_purchase_amount_cents` integer
  - `first_purchase_only` boolean
  - `applicable_products` string[]
  - `applicable_plans` string[]
  - `valid_from` string, date-time
  - `valid_until` string, date-time
  - `created_by_account_id` string, uuid

## Response `201`

Cupom criado

- CouponDetail
  - `id` string, uuid, required
  - `merchantId` string, uuid, required
  - `environment` string, required
  - `type` string, required
  - `code` string, required
  - `description` string
  - `membershipId` string, uuid
  - `discountType` string, required
  - `discountValue` integer, required
  - `maxUsesTotal` integer
  - `maxUsesPerCustomer` integer, required
  - `minPurchaseAmountCents` integer
  - `firstPurchaseOnly` boolean, required
  - `applicableProducts` string[], required
  - `applicablePlans` string[], required
  - `validFrom` string, date-time, nullable
  - `validUntil` string, date-time, nullable
  - `status` string, required
  - `timesRedeemed` integer, required
  - `createdByAccountId` string, uuid
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, required
  - `disabledAt` string, date-time

## Other responses

- `401`: Falha de autenticação
- `403`: Permissão insuficiente
- `409`: Conflito de idempotência ou estado
- `422`: Erro de validação

---

[API](https://skmtc.dev/mupag/apis/mupag-public-merchant-api.md) · [All operations](https://skmtc.dev/mupag/apis/mupag-public-merchant-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mupag/apis/mupag-public-merchant-api/revisions/677904516d2d?raw)
