Coupon Assignment API

API Endpoint

An API to assign and update coupon assignments.

Coupon Assignment API

Coupon Assignment Collection

POST /coupons-assignment
RequestsGlobalNon-Global GroupedNon-Global IndividualNon-Global With Date Filter
Headers
Content-Type: application/json
Accept: application/json
Body
{
  "global": true,
  "coupon_ids": [
    1
  ],
  "limit": 5,
  "ticket_limit": 0,
  "taggable": true,
  "timezone": "America/New_York",
  "start_date": "2023-06-22 12:00:00",
  "end_date": "2023-08-22 13:00:00"
}
Schema
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "global": {
      "type": "boolean"
    },
    "offer_type": {
      "enum": [
        "group",
        "individual"
      ]
    },
    "limit": {
      "description": "Total coupons available"
      "type": "integer",
      "exclusiveMinimum": 0
    },
    "ticket_limit": {
      "description": "Limits per order"
      "type": "integer",
      "minimum": 0
    },
    "taggable": {
      "type": "boolean"
    },
    "start_date": {
      "description": "From when coupon offer is valid.",
      "format": "YYYY-MM-DD mm:hh:ss",
      "type": "string"
    },
    "end_date": {
      "description": "Until when coupon offer is valid.",
      "format": "YYYY-MM-DD mm:hh:ss",
      "type": "string"
    },
    "coupon_ids": {
      "type": "array",
      "items": {
        "type": "integer"
      }
    },
    "event_ids": {
      "type": "array",
      "items": {
        "type": "integer"
      }
    },
    "price_level_ids": {
      "type": "array",
      "items": {
        "type": "integer"
      }
    },
    "bundle_ids": {
      "type": "array",
      "items": {
        "type": "integer"
      }
    },
    "date_filter": {
      "type": "object",
      "properties": {
        "start": {
          "description": "When date filter starts to work",
          "format": "YYYY-MM-DD mm:hh:ss",
          "type": "string"
        },
        "end": {
          "description": "When date filter ends to work",
          "format": "YYYY-MM-DD mm:hh:ss",
          "type": "string"
        },
        "days": {
          "type": "array",
          "description": "Days to include. Time intersections for the same day are not allowed",
          "items": {
            "type": "object",
            "properties": {
              "day": {
                "description": "Sunday - 1, Monday - 2 ... Saturday - 7.",
                "enum": [
                  1,
                  2,
                  3,
                  4,
                  5,
                  6,
                  7
                ]
              },
              "start_time": {
                "format": "mm:hh:ss",
                "type": "string"
              },
              "end_time": {
                "format": "mm:hh:ss",
                "type": "string"
              }
            },
            "required": [
              "day"
            ]
          },
          "minItems": 1
        },
        "event_ids": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        },
        "price_level_ids": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        },
        "bundle_ids": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        }
      },
      "required": [
        "start",
        "end",
        "days",
        "event_ids",
        "price_level_ids",
        "bundle_ids"
      ]
    }
  },
  "required": [
    "limit",
    "taggable",
    "timezone",
    "start_date",
    "end_date"
  ]
}
Responses200400401403
Headers
Content-Type: application/json
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": "400",
      "detail": [
        "Bad request"
      ]
    }
  ]
}
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": "401",
      "detail": "Unauthorized"
    }
  ]
}
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": "403",
      "detail": "Forbidden"
    }
  ]
}
Headers
Content-Type: application/json
Accept: application/json
Body
{
    "global": false,
    "offer_type": "group",
    "coupon_ids": [1],
    "event_ids": [1, 9],
    "price_level_ids": [99],
    "bundle_ids": [],
    "limit": 5,
    "ticket_limit": 0,
    "taggable": true,
    "timezone": "America/New_York",
    "start_date": "2023-06-22 12:00:00",
    "end_date": "2023-08-22 13:00:00",
}
Schema
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "global": {
      "type": "boolean"
    },
    "offer_type": {
      "enum": [
        "group",
        "individual"
      ]
    },
    "limit": {
      "description": "Total coupons available"
      "type": "integer",
      "exclusiveMinimum": 0
    },
    "ticket_limit": {
      "description": "Limits per order"
      "type": "integer",
      "minimum": 0
    },
    "taggable": {
      "type": "boolean"
    },
    "start_date": {
      "description": "From when coupon offer is valid.",
      "format": "YYYY-MM-DD mm:hh:ss",
      "type": "string"
    },
    "end_date": {
      "description": "Until when coupon offer is valid.",
      "format": "YYYY-MM-DD mm:hh:ss",
      "type": "string"
    },
    "coupon_ids": {
      "type": "array",
      "items": {
        "type": "integer"
      }
    },
    "event_ids": {
      "type": "array",
      "items": {
        "type": "integer"
      }
    },
    "price_level_ids": {
      "type": "array",
      "items": {
        "type": "integer"
      }
    },
    "bundle_ids": {
      "type": "array",
      "items": {
        "type": "integer"
      }
    },
    "date_filter": {
      "type": "object",
      "properties": {
        "start": {
          "description": "When date filter starts to work",
          "format": "YYYY-MM-DD mm:hh:ss",
          "type": "string"
        },
        "end": {
          "description": "When date filter ends to work",
          "format": "YYYY-MM-DD mm:hh:ss",
          "type": "string"
        },
        "days": {
          "type": "array",
          "description": "Days to include. Time intersections for the same day are not allowed",
          "items": {
            "type": "object",
            "properties": {
              "day": {
                "description": "Sunday - 1, Monday - 2 ... Saturday - 7.",
                "enum": [
                  1,
                  2,
                  3,
                  4,
                  5,
                  6,
                  7
                ]
              },
              "start_time": {
                "format": "mm:hh:ss",
                "type": "string"
              },
              "end_time": {
                "format": "mm:hh:ss",
                "type": "string"
              }
            },
            "required": [
              "day"
            ]
          },
          "minItems": 1
        },
        "event_ids": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        },
        "price_level_ids": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        },
        "bundle_ids": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        }
      },
      "required": [
        "start",
        "end",
        "days",
        "event_ids",
        "price_level_ids",
        "bundle_ids"
      ]
    }
  },
  "required": [
    "limit",
    "taggable",
    "timezone",
    "start_date",
    "end_date"
  ]
}
Responses200400401403
Headers
Content-Type: application/json
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": "400",
      "detail": [
        "Bad request"
      ]
    }
  ]
}
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": "401",
      "detail": "Unauthorized"
    }
  ]
}
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": "403",
      "detail": "Forbidden"
    }
  ]
}
Headers
Content-Type: application/json
Accept: application/json
Body
{
    "global": false,
    "offer_type": "individual",
    "coupon_ids": [1],
    "event_ids": [1, 9],
    "price_level_ids": [99],
    "bundle_ids": [],
    "limit": 5,
    "ticket_limit": 0,
    "taggable": true,
    "timezone": "America/New_York",
    "start_date": "2023-06-22 12:00:00",
    "end_date": "2023-08-22 13:00:00",
}
Schema
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "global": {
      "type": "boolean"
    },
    "offer_type": {
      "enum": [
        "group",
        "individual"
      ]
    },
    "limit": {
      "description": "Total coupons available"
      "type": "integer",
      "exclusiveMinimum": 0
    },
    "ticket_limit": {
      "description": "Limits per order"
      "type": "integer",
      "minimum": 0
    },
    "taggable": {
      "type": "boolean"
    },
    "start_date": {
      "description": "From when coupon offer is valid.",
      "format": "YYYY-MM-DD mm:hh:ss",
      "type": "string"
    },
    "end_date": {
      "description": "Until when coupon offer is valid.",
      "format": "YYYY-MM-DD mm:hh:ss",
      "type": "string"
    },
    "coupon_ids": {
      "type": "array",
      "items": {
        "type": "integer"
      }
    },
    "event_ids": {
      "type": "array",
      "items": {
        "type": "integer"
      }
    },
    "price_level_ids": {
      "type": "array",
      "items": {
        "type": "integer"
      }
    },
    "bundle_ids": {
      "type": "array",
      "items": {
        "type": "integer"
      }
    },
    "date_filter": {
      "type": "object",
      "properties": {
        "start": {
          "description": "When date filter starts to work",
          "format": "YYYY-MM-DD mm:hh:ss",
          "type": "string"
        },
        "end": {
          "description": "When date filter ends to work",
          "format": "YYYY-MM-DD mm:hh:ss",
          "type": "string"
        },
        "days": {
          "type": "array",
          "description": "Days to include. Time intersections for the same day are not allowed",
          "items": {
            "type": "object",
            "properties": {
              "day": {
                "description": "Sunday - 1, Monday - 2 ... Saturday - 7.",
                "enum": [
                  1,
                  2,
                  3,
                  4,
                  5,
                  6,
                  7
                ]
              },
              "start_time": {
                "format": "mm:hh:ss",
                "type": "string"
              },
              "end_time": {
                "format": "mm:hh:ss",
                "type": "string"
              }
            },
            "required": [
              "day"
            ]
          },
          "minItems": 1
        },
        "event_ids": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        },
        "price_level_ids": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        },
        "bundle_ids": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        }
      },
      "required": [
        "start",
        "end",
        "days",
        "event_ids",
        "price_level_ids",
        "bundle_ids"
      ]
    }
  },
  "required": [
    "limit",
    "taggable",
    "timezone",
    "start_date",
    "end_date"
  ]
}
Responses200400401403
Headers
Content-Type: application/json
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": "400",
      "detail": [
        "Bad request"
      ]
    }
  ]
}
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": "401",
      "detail": "Unauthorized"
    }
  ]
}
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": "403",
      "detail": "Forbidden"
    }
  ]
}
Headers
Content-Type: application/json
Accept: application/json
Body
{
  "global": false,
  "coupon_ids": [
    1
  ],
  "event_ids": [
    1,
    9
  ],
  "price_level_ids": [
    99
  ],
  "bundle_ids": [],
  "limit": 5,
  "ticket_limit": 0,
  "taggable": true,
  "timezone": "America/New_York",
  "start_date": "2023-06-22 12:00:00",
  "end_date": "2023-08-22 13:00:00",
  "date_filter": {
    "event_ids": [
      9
    ],
    "price_level_ids": [
      99
    ],
    "bundle_ids": [],
    "start": "2023-07-19 00:00:00",
    "end": "2023-07-30 23:59:59",
    "days": [
      {
        "day": 1,
        "start_time": "12:00:00",
        "end_time": "15:00:00"
      },
      {
        "day": 1,
        "start_time": "15:30:00",
        "end_time": "16:00:00"
      },
      {
        "day": 2
      }
    ],
    "exclude_dates": [
      "2023-07-22"
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "global": {
      "type": "boolean"
    },
    "offer_type": {
      "enum": [
        "group",
        "individual"
      ]
    },
    "limit": {
      "description": "Total coupons available"
      "type": "integer",
      "exclusiveMinimum": 0
    },
    "ticket_limit": {
      "description": "Limits per order"
      "type": "integer",
      "minimum": 0
    },
    "taggable": {
      "type": "boolean"
    },
    "start_date": {
      "description": "From when coupon offer is valid.",
      "format": "YYYY-MM-DD mm:hh:ss",
      "type": "string"
    },
    "end_date": {
      "description": "Until when coupon offer is valid.",
      "format": "YYYY-MM-DD mm:hh:ss",
      "type": "string"
    },
    "coupon_ids": {
      "type": "array",
      "items": {
        "type": "integer"
      }
    },
    "event_ids": {
      "type": "array",
      "items": {
        "type": "integer"
      }
    },
    "price_level_ids": {
      "type": "array",
      "items": {
        "type": "integer"
      }
    },
    "bundle_ids": {
      "type": "array",
      "items": {
        "type": "integer"
      }
    },
    "date_filter": {
      "type": "object",
      "properties": {
        "start": {
          "description": "When date filter starts to work",
          "format": "YYYY-MM-DD mm:hh:ss",
          "type": "string"
        },
        "end": {
          "description": "When date filter ends to work",
          "format": "YYYY-MM-DD mm:hh:ss",
          "type": "string"
        },
        "days": {
          "type": "array",
          "description": "Days to include. Time intersections for the same day are not allowed",
          "items": {
            "type": "object",
            "properties": {
              "day": {
                "description": "Sunday - 1, Monday - 2 ... Saturday - 7.",
                "enum": [
                  1,
                  2,
                  3,
                  4,
                  5,
                  6,
                  7
                ]
              },
              "start_time": {
                "format": "mm:hh:ss",
                "type": "string"
              },
              "end_time": {
                "format": "mm:hh:ss",
                "type": "string"
              }
            },
            "required": [
              "day"
            ]
          },
          "minItems": 1
        },
        "event_ids": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        },
        "price_level_ids": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        },
        "bundle_ids": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        }
      },
      "required": [
        "start",
        "end",
        "days",
        "event_ids",
        "price_level_ids",
        "bundle_ids"
      ]
    }
  },
  "required": [
    "limit",
    "taggable",
    "timezone",
    "start_date",
    "end_date"
  ]
}
Responses200400401403
Headers
Content-Type: application/json
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": "400",
      "detail": [
        "Bad request"
      ]
    }
  ]
}
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": "401",
      "detail": "Unauthorized"
    }
  ]
}
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": "403",
      "detail": "Forbidden"
    }
  ]
}

Create a coupon assignment
POST/coupons-assignment

Creating coupon assignment could be done as global, which would affect all events / price levels / bundles and as non-global, by specifying resources’ ids.

Depending on offer_type(“group” | “individual”), one or several assignments would be created.

date_filter only works with series events.


POST /coupons-assignment
RequestsMain
Headers
Content-Type: application/json
Accept: application/json
Body
{
  "edit_id": 1,
  "event_ids": [
    1,
    9
  ],
  "price_level_ids": [
    99
  ],
  "bundle_ids": [],
  "limit": 5,
  "ticket_limit": 0,
  "taggable": true,
  "timezone": "America/New_York",
  "start_date": "2023-06-22 12:00:00",
  "end_date": "2023-08-22 13:00:00",
  "date_filter": null
}
Schema
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "global": {
      "type": "boolean"
    },
    "offer_type": {
      "enum": [
        "group",
        "individual"
      ]
    },
    "limit": {
      "description": "Total coupons available"
      "type": "integer",
      "exclusiveMinimum": 0
    },
    "ticket_limit": {
      "description": "Limits per order"
      "type": "integer",
      "minimum": 0
    },
    "taggable": {
      "type": "boolean"
    },
    "start_date": {
      "description": "From when coupon offer is valid.",
      "format": "YYYY-MM-DD mm:hh:ss",
      "type": "string"
    },
    "end_date": {
      "description": "Until when coupon offer is valid.",
      "format": "YYYY-MM-DD mm:hh:ss",
      "type": "string"
    },
    "coupon_ids": {
      "type": "array",
      "items": {
        "type": "integer"
      }
    },
    "event_ids": {
      "type": "array",
      "items": {
        "type": "integer"
      }
    },
    "price_level_ids": {
      "type": "array",
      "items": {
        "type": "integer"
      }
    },
    "bundle_ids": {
      "type": "array",
      "items": {
        "type": "integer"
      }
    },
    "date_filter": {
      "type": "object",
      "properties": {
        "start": {
          "description": "When date filter starts to work",
          "format": "YYYY-MM-DD mm:hh:ss",
          "type": "string"
        },
        "end": {
          "description": "When date filter ends to work",
          "format": "YYYY-MM-DD mm:hh:ss",
          "type": "string"
        },
        "days": {
          "type": "array",
          "description": "Days to include. Time intersections for the same day are not allowed",
          "items": {
            "type": "object",
            "properties": {
              "day": {
                "description": "Sunday - 1, Monday - 2 ... Saturday - 7.",
                "enum": [
                  1,
                  2,
                  3,
                  4,
                  5,
                  6,
                  7
                ]
              },
              "start_time": {
                "format": "mm:hh:ss",
                "type": "string"
              },
              "end_time": {
                "format": "mm:hh:ss",
                "type": "string"
              }
            },
            "required": [
              "day"
            ]
          },
          "minItems": 1
        },
        "event_ids": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        },
        "price_level_ids": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        },
        "bundle_ids": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        }
      },
      "required": [
        "start",
        "end",
        "days",
        "event_ids",
        "price_level_ids",
        "bundle_ids"
      ]
    }
  },
  "required": [
    "limit",
    "taggable",
    "timezone",
    "start_date",
    "end_date"
  ]
}
Responses200400401403
Headers
Content-Type: application/json
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": "400",
      "detail": [
        "Bad request"
      ]
    }
  ]
}
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": "401",
      "detail": "Unauthorized"
    }
  ]
}
Headers
Content-Type: application/json
Body
{
  "errors": [
    {
      "status": "403",
      "detail": "Forbidden"
    }
  ]
}

Update a coupon assignment
POST/coupons-assignment

For updating coupon assignments, all attributes are the same except global and offer_type - those are non-applicable.

To remove date_filter pass null.


Generated by aglio on 30 Jul 2024