# The coupon generation model

Source: https://developers.swell.is/backend-api/coupon-generations/the-coupon-generation-model

## Fields

- `id` (objectId): Unique identifier for the coupon codes generated.
- `codes` (Coupon code): An array of coupon codes to be generated.
- `count` (int, required): Specifies the number of codes to be generated and limit for generations is 10,000. For example, `count=100` would generate 100 coupon codes. Default: `0`.
- `date_created` (date, auto): Date the coupon code is generated.
- `date_updated` (date, auto): Date the coupon code was last updated.
- `parent` (Coupon): Expandable link to the parent coupon.
- `parent_id` (objectId, required): Unique identifier of the parent coupon.
- `pattern` (string): Specifies the code pattern for generated coupons.
- `pattern_type` (enum): Determines the pattern type for the codes generated, which can be either `default` or `custom`. Specify the `pattern` when using `custom`. Possible values: `default`, `custom`. Default: `"default"`.

## Example response

```json
{
  "complete": true,
  "count": 1000,
  "date_created": "2015-09-02T20:57:03.441Z",
  "date_updated": "2015-09-02T20:57:20.033Z",
  "parent_id": "559c5799bcb1de1d1c4821da",
  "pattern": "TABATHA-{0000000}",
  "pattern_type": "custom",
  "id": "55e7629f5c0dfa1e3c2dd4c1"
},
```
