---
agentTools:
  projectIndex: https://soundee.readme.io/llms.txt
---

# Update a coupon

Update a coupon code.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Soundee Producer API",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.soundee.com/me"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "x-default": "your_api_key"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/coupons/{id}": {
      "put": {
        "summary": "Update a coupon",
        "description": "Update a coupon code.",
        "operationId": "update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The id of the coupon you're updating",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The name/code of the coupon."
                  },
                  "amount": {
                    "type": "number",
                    "description": "The amount of the discount. A percentage when the parameter `type` is set to `rate`, a price when the parameter `type` is set to `fixed`",
                    "default": 25,
                    "format": "float"
                  },
                  "upgrades": {
                    "type": "string",
                    "description": "Whether the coupon applies to upgrades or not. `0`: does not apply to upgrades `1`: applies to upgrades `2`: only applies to upgrades",
                    "default": "0",
                    "enum": [
                      "0",
                      "1",
                      "2"
                    ]
                  },
                  "active": {
                    "type": "boolean",
                    "description": "To enable or disable the coupon",
                    "default": true
                  },
                  "maxUsage": {
                    "type": "integer",
                    "description": "The number of times that the coupon can be used. This is the total number of times per coupon, not the number of times per customer.",
                    "default": 0,
                    "format": "int32"
                  },
                  "type": {
                    "type": "string",
                    "description": "The type of discount.",
                    "default": "rate",
                    "enum": [
                      "rate",
                      "fixed"
                    ]
                  },
                  "minCartItems": {
                    "type": "integer",
                    "description": "The minimum items the cart should have before the coupon applies.",
                    "default": 0,
                    "format": "int32"
                  },
                  "minCartAmount": {
                    "type": "number",
                    "description": "The minimum total amount the cart should have before the coupon applies.",
                    "default": 0,
                    "format": "float"
                  },
                  "stopBulkDiscounts": {
                    "type": "boolean",
                    "description": "When set to `true`, further bulk discounts will stop processing for eligible items.",
                    "default": false
                  },
                  "startDate": {
                    "type": "string",
                    "description": "The moment the coupon should be active.",
                    "format": "date-time"
                  },
                  "endDate": {
                    "type": "string",
                    "description": "The moment the coupon should expire.",
                    "format": "date-time"
                  },
                  "neverEnd": {
                    "type": "boolean",
                    "description": "When set to `true`, the `endDate` will be ignored.",
                    "default": false
                  },
                  "conditions": {
                    "type": "object",
                    "description": "Which stores, licenses, product types, or specific products the coupon applies to or not.",
                    "properties": {
                      "stores": {
                        "type": "object",
                        "description": "Which stores the coupon applies to or not.",
                        "properties": {
                          "exclude": {
                            "type": "boolean",
                            "description": "Choose `true` if you want the coupon to apply to the values in the `list`. Choose `false` if you don't want to coupon to apply to the selected values in the `list`.",
                            "default": false
                          },
                          "list": {
                            "type": "array",
                            "description": "The list of IDs.",
                            "items": {
                              "type": "integer",
                              "format": "int32"
                            }
                          }
                        }
                      },
                      "entityTypes": {
                        "type": "object",
                        "description": "Which entities type (track, kit, sound kit) the coupon applies to or not.",
                        "properties": {
                          "exclude": {
                            "type": "boolean",
                            "description": "Choose `true` if you want the coupon to apply to the values in the `list`. Choose `false` if you don't want to coupon to apply to the selected values in the `list`.",
                            "default": false
                          },
                          "list": {
                            "type": "array",
                            "description": "The list of IDs.",
                            "items": {
                              "type": "integer",
                              "format": "int32"
                            }
                          }
                        }
                      },
                      "entities": {
                        "type": "object",
                        "description": "Which entities the coupon applies to or not. Each of your tracks, kits, services have a unique entity ID.",
                        "properties": {
                          "exclude": {
                            "type": "boolean",
                            "description": "Choose `true` if you want the coupon to apply to the values in the `list`. Choose `false` if you don't want to coupon to apply to the selected values in the `list`.",
                            "default": false
                          },
                          "list": {
                            "type": "array",
                            "description": "The list of IDs.",
                            "items": {
                              "type": "integer",
                              "format": "int32"
                            }
                          }
                        }
                      },
                      "licenses": {
                        "type": "object",
                        "description": "Which licenses the coupon applies to or not.",
                        "properties": {
                          "exclude": {
                            "type": "boolean",
                            "description": "Choose `true` if you want the coupon to apply to the values in the `list`. Choose `false` if you don't want to coupon to apply to the selected values in the `list`.",
                            "default": false
                          },
                          "list": {
                            "type": "array",
                            "description": "The list of IDs.",
                            "items": {
                              "type": "integer",
                              "format": "int32"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "624f08222da1410037f571f0:637a36cabaf1f2002ba0c382"
}
```