API ReferenceapipaymentsPOST /v1/admin/promos

POST /v1/admin/promos

Service: payments · operationId: (none)

Required scopes

(no scope declared — review service config)

Request body

{
  "type": "object",
  "properties": {
    "code": {
      "type": "string",
      "minLength": 1,
      "maxLength": 50
    },
    "percent_off": {
      "type": "number",
      "minimum": 1,
      "maximum": 100
    },
    "amount_off": {
      "type": "integer",
      "exclusiveMinimum": 0
    },
    "valid_until": {
      "type": "string",
      "format": "date-time"
    },
    "max_redemptions": {
      "type": "integer",
      "exclusiveMinimum": 0
    }
  },
  "required": [
    "code"
  ]
}

Responses

201 Promotion code created

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "active": {
      "type": "boolean"
    },
    "percent_off": {
      "type": [
        "number",
        "null"
      ]
    },
    "amount_off": {
      "type": [
        "integer",
        "null"
      ]
    },
    "currency": {
      "type": [
        "string",
        "null"
      ]
    },
    "expires_at": {
      "type": [
        "string",
        "null"
      ]
    },
    "max_redemptions": {
      "type": [
        "integer",
        "null"
      ]
    },
    "times_redeemed": {
      "type": "integer"
    },
    "created_at": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "code",
    "active",
    "percent_off",
    "amount_off",
    "currency",
    "expires_at",
    "max_redemptions",
    "times_redeemed",
    "created_at"
  ]
}

400 Validation error

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

401 Unauthorized

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

403 Forbidden

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

Example

curl -X POST https://payments.platform.loop.health/v1/admin/promos \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'