# Coupons

## GET /v1/stores/{storeId}/coupons

> Fetches all coupons for a store id

```json
{"openapi":"3.1.1","info":{"title":"PayNow Management API","version":"v1"},"tags":[{"name":"coupons"}],"security":[{"APIKey":[]}],"components":{"securitySchemes":{"APIKey":{"type":"apiKey","description":"An API Key token generated in the Dashboard in the format 'APIKey TOKEN_HERE'.","name":"Authorization","in":"header"}},"schemas":{"FlakeId":{"type":"string","additionalProperties":false,"format":"flake-id"},"CouponFilterStatusEnum":{"enum":["all","active","inactive"],"type":"string","description":"Will filter by coupon status."},"CouponFilterTypeEnum":{"enum":["all","manual","generated"],"type":"string","description":"Will filter by coupon creation type."},"CouponDto":{"required":["code","created_at","discount_amount","discount_apply_before_sales","discount_apply_individually","discount_type","duration","enabled","id","minimum_order_value","redeem_limit_customer_amount","redeem_limit_customer_enabled","redeem_limit_store_amount","redeem_limit_store_enabled","store_id","usable_on_one_time_purchase","usable_on_subscription"],"type":"object","properties":{"id":{"$ref":"#/components/schemas/FlakeId"},"store_id":{"$ref":"#/components/schemas/FlakeId"},"enabled":{"type":"boolean","description":"Indicates whether the coupon is enabled."},"code":{"type":"string","description":"The unique code associated with the coupon."},"note":{"type":["null","string"],"description":"A note or internal description of the coupon."},"duration":{"$ref":"#/components/schemas/CouponDurationEnum"},"duration_in_months":{"type":["null","integer"],"description":"The number of months the coupon is valid, used if the duration is repeating.","format":"int32"},"discount_type":{"$ref":"#/components/schemas/CouponDiscountTypeEnum"},"discount_amount":{"type":"integer","description":"The discount amount in the smallest currency unit (e.g., cents).","format":"int64"},"discount_apply_individually":{"type":"boolean","description":"Indicates whether the discount should be applied individually to required tags or products."},"discount_apply_before_sales":{"type":"boolean","description":"Indicates whether the discount is applied before existing sales."},"apply_to_products":{"type":["null","array"],"items":{"$ref":"#/components/schemas/FlakeId"},"description":"A list of product IDs the coupon applies to."},"apply_to_tags":{"type":["null","array"],"items":{"$ref":"#/components/schemas/FlakeId"},"description":"A list of tag IDs the coupon applies to."},"usable_by_customer_id":{"$ref":"#/components/schemas/FlakeId"},"minimum_order_value":{"type":"integer","description":"The minimum order value required to use the coupon.","format":"int64"},"redeem_limit_store_enabled":{"type":"boolean","description":"Indicates whether a global redemption limit is enabled."},"redeem_limit_store_amount":{"type":"integer","description":"The maximum number of times the coupon can be redeemed across the store.","format":"int64"},"redeem_limit_customer_enabled":{"type":"boolean","description":"Indicates whether a per-customer redemption limit is enabled."},"redeem_limit_customer_amount":{"type":"integer","description":"The maximum number of times the coupon can be redeemed per customer.","format":"int64"},"usable_on_one_time_purchase":{"type":"boolean","description":"Indicates whether the coupon can be used for one-time purchases."},"usable_on_subscription":{"type":"boolean","description":"Indicates whether the coupon can be used for subscriptions."},"usable_at":{"type":["null","string"],"description":"The date and time when the coupon becomes valid.","format":"date-time"},"expires_at":{"type":["null","string"],"description":"The date and time when the coupon expires.","format":"date-time"},"created_by":{"$ref":"#/components/schemas/ActorDto"},"created_at":{"type":"string","description":"The date and time when the coupon was created.","format":"date-time"},"updated_by":{"$ref":"#/components/schemas/ActorDto"},"updated_at":{"type":["null","string"],"description":"The date and time when the coupon was last updated.","format":"date-time"}},"additionalProperties":false,"description":"Represents a detailed view of a coupon, including configuration and audit information."},"CouponDurationEnum":{"enum":["once","forever","repeating"],"type":"string","description":"Defines the duration for which a coupon remains valid."},"CouponDiscountTypeEnum":{"enum":["unspecified","percent","amount"],"type":"string","description":"Specifies the type of discount applied by a coupon."},"ActorDto":{"required":["type"],"type":"object","properties":{"type":{"$ref":"#/components/schemas/PayNowActorType"},"id":{"$ref":"#/components/schemas/FlakeId"}},"additionalProperties":false},"PayNowActorType":{"enum":["anonymous","user","api_key","customer","game_server","internal","admin","platform","global_customer"],"type":"string"},"PayNowError":{"required":["code","message","status"],"type":"object","properties":{"status":{"type":"integer","description":"The HTTP status code.","format":"int32"},"code":{"type":"string","description":"The PayNow parseable error code."},"message":{"type":"string","description":"The human-readable error message."},"trace_id":{"type":["null","string"],"description":"A distributed trace ID used for debugging."},"errors":{"type":["null","array"],"items":{"$ref":"#/components/schemas/ValidationError"},"description":"An array of multiple errors. Only used by some API services."}},"additionalProperties":false,"description":"Represents a PayNow error"},"ValidationError":{"required":["code","message","path","validation"],"type":"object","properties":{"code":{"type":"string","description":"The parseable error code."},"message":{"type":"string","description":"The human-readable error message."},"path":{"type":"string","description":"The path leading to the validation error."},"validation":{"type":"string","description":"Type of the validation that failed."}},"additionalProperties":false,"description":"A validation error."}}},"paths":{"/v1/stores/{storeId}/coupons":{"get":{"tags":["coupons"],"summary":"Fetches all coupons for a store id","operationId":"StoreCoupons_GetCouponsForStore","parameters":[{"name":"storeId","in":"path","description":"","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}},{"name":"limit","in":"query","description":"The maximum number of items to return in a single request.","schema":{"maximum":100,"minimum":1,"type":"integer","format":"int32"}},{"name":"after","in":"query","description":"Returns items after the specified ID.\nUsed for forward pagination through results.","schema":{"$ref":"#/components/schemas/FlakeId"}},{"name":"before","in":"query","description":"Returns items before the specified ID.\nUsed for backward pagination through results.","schema":{"$ref":"#/components/schemas/FlakeId"}},{"name":"asc","in":"query","description":"Determines the sort order of returned items.\nWhen true, items are returned in ascending order.\nWhen false, items are returned in descending order.","schema":{"type":"boolean"}},{"name":"status","in":"query","description":"Filter by status","schema":{"$ref":"#/components/schemas/CouponFilterStatusEnum"}},{"name":"type","in":"query","description":"Filter by creation type of coupons.","schema":{"$ref":"#/components/schemas/CouponFilterTypeEnum"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CouponDto"}}}}},"default":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayNowError"}}}}}}}}}
```

## POST /v1/stores/{storeId}/coupons

>

```json
{"openapi":"3.1.1","info":{"title":"PayNow Management API","version":"v1"},"tags":[{"name":"coupons"}],"security":[{"APIKey":[]}],"components":{"securitySchemes":{"APIKey":{"type":"apiKey","description":"An API Key token generated in the Dashboard in the format 'APIKey TOKEN_HERE'.","name":"Authorization","in":"header"}},"schemas":{"FlakeId":{"type":"string","additionalProperties":false,"format":"flake-id"},"CreateCouponDto":{"required":["enabled","code","duration","discount_type","discount_amount","discount_apply_individually","discount_apply_before_sales","minimum_order_value","redeem_limit_store_enabled","redeem_limit_store_amount","redeem_limit_customer_enabled","redeem_limit_customer_amount","usable_on_one_time_purchase","usable_on_subscription"],"type":"object","properties":{"enabled":{"type":"boolean"},"code":{"type":"string"},"note":{"type":"string"},"duration":{"$ref":"#/components/schemas/CouponDurationEnum"},"duration_in_months":{"type":["null","integer"],"format":"int32"},"discount_type":{"$ref":"#/components/schemas/CouponDiscountTypeEnum"},"discount_amount":{"type":"integer","format":"int64"},"discount_apply_individually":{"type":"boolean"},"discount_apply_before_sales":{"type":"boolean"},"apply_to_products":{"type":"array","items":{"$ref":"#/components/schemas/FlakeId"}},"apply_to_tags":{"type":"array","items":{"$ref":"#/components/schemas/FlakeId"}},"usable_by_customer_id":{"$ref":"#/components/schemas/FlakeId"},"minimum_order_value":{"type":"integer","format":"int64"},"redeem_limit_store_enabled":{"type":"boolean"},"redeem_limit_store_amount":{"type":"integer","format":"int64"},"redeem_limit_customer_enabled":{"type":"boolean"},"redeem_limit_customer_amount":{"type":"integer","format":"int64"},"usable_on_one_time_purchase":{"type":"boolean"},"usable_on_subscription":{"type":"boolean"},"usable_at":{"type":["null","string"],"format":"date-time"},"expires_at":{"type":["null","string"],"format":"date-time"}}},"CouponDurationEnum":{"enum":["once","forever","repeating"],"type":"string","description":"Defines the duration for which a coupon remains valid."},"CouponDiscountTypeEnum":{"enum":["unspecified","percent","amount"],"type":"string","description":"Specifies the type of discount applied by a coupon."},"CouponDto":{"required":["code","created_at","discount_amount","discount_apply_before_sales","discount_apply_individually","discount_type","duration","enabled","id","minimum_order_value","redeem_limit_customer_amount","redeem_limit_customer_enabled","redeem_limit_store_amount","redeem_limit_store_enabled","store_id","usable_on_one_time_purchase","usable_on_subscription"],"type":"object","properties":{"id":{"$ref":"#/components/schemas/FlakeId"},"store_id":{"$ref":"#/components/schemas/FlakeId"},"enabled":{"type":"boolean","description":"Indicates whether the coupon is enabled."},"code":{"type":"string","description":"The unique code associated with the coupon."},"note":{"type":["null","string"],"description":"A note or internal description of the coupon."},"duration":{"$ref":"#/components/schemas/CouponDurationEnum"},"duration_in_months":{"type":["null","integer"],"description":"The number of months the coupon is valid, used if the duration is repeating.","format":"int32"},"discount_type":{"$ref":"#/components/schemas/CouponDiscountTypeEnum"},"discount_amount":{"type":"integer","description":"The discount amount in the smallest currency unit (e.g., cents).","format":"int64"},"discount_apply_individually":{"type":"boolean","description":"Indicates whether the discount should be applied individually to required tags or products."},"discount_apply_before_sales":{"type":"boolean","description":"Indicates whether the discount is applied before existing sales."},"apply_to_products":{"type":["null","array"],"items":{"$ref":"#/components/schemas/FlakeId"},"description":"A list of product IDs the coupon applies to."},"apply_to_tags":{"type":["null","array"],"items":{"$ref":"#/components/schemas/FlakeId"},"description":"A list of tag IDs the coupon applies to."},"usable_by_customer_id":{"$ref":"#/components/schemas/FlakeId"},"minimum_order_value":{"type":"integer","description":"The minimum order value required to use the coupon.","format":"int64"},"redeem_limit_store_enabled":{"type":"boolean","description":"Indicates whether a global redemption limit is enabled."},"redeem_limit_store_amount":{"type":"integer","description":"The maximum number of times the coupon can be redeemed across the store.","format":"int64"},"redeem_limit_customer_enabled":{"type":"boolean","description":"Indicates whether a per-customer redemption limit is enabled."},"redeem_limit_customer_amount":{"type":"integer","description":"The maximum number of times the coupon can be redeemed per customer.","format":"int64"},"usable_on_one_time_purchase":{"type":"boolean","description":"Indicates whether the coupon can be used for one-time purchases."},"usable_on_subscription":{"type":"boolean","description":"Indicates whether the coupon can be used for subscriptions."},"usable_at":{"type":["null","string"],"description":"The date and time when the coupon becomes valid.","format":"date-time"},"expires_at":{"type":["null","string"],"description":"The date and time when the coupon expires.","format":"date-time"},"created_by":{"$ref":"#/components/schemas/ActorDto"},"created_at":{"type":"string","description":"The date and time when the coupon was created.","format":"date-time"},"updated_by":{"$ref":"#/components/schemas/ActorDto"},"updated_at":{"type":["null","string"],"description":"The date and time when the coupon was last updated.","format":"date-time"}},"additionalProperties":false,"description":"Represents a detailed view of a coupon, including configuration and audit information."},"ActorDto":{"required":["type"],"type":"object","properties":{"type":{"$ref":"#/components/schemas/PayNowActorType"},"id":{"$ref":"#/components/schemas/FlakeId"}},"additionalProperties":false},"PayNowActorType":{"enum":["anonymous","user","api_key","customer","game_server","internal","admin","platform","global_customer"],"type":"string"},"PayNowError":{"required":["code","message","status"],"type":"object","properties":{"status":{"type":"integer","description":"The HTTP status code.","format":"int32"},"code":{"type":"string","description":"The PayNow parseable error code."},"message":{"type":"string","description":"The human-readable error message."},"trace_id":{"type":["null","string"],"description":"A distributed trace ID used for debugging."},"errors":{"type":["null","array"],"items":{"$ref":"#/components/schemas/ValidationError"},"description":"An array of multiple errors. Only used by some API services."}},"additionalProperties":false,"description":"Represents a PayNow error"},"ValidationError":{"required":["code","message","path","validation"],"type":"object","properties":{"code":{"type":"string","description":"The parseable error code."},"message":{"type":"string","description":"The human-readable error message."},"path":{"type":"string","description":"The path leading to the validation error."},"validation":{"type":"string","description":"Type of the validation that failed."}},"additionalProperties":false,"description":"A validation error."}}},"paths":{"/v1/stores/{storeId}/coupons":{"post":{"tags":["coupons"],"operationId":"StoreCoupons_CreateCouponForStore","parameters":[{"name":"storeId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCouponDto"}},"text/json":{"schema":{"$ref":"#/components/schemas/CreateCouponDto"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/CreateCouponDto"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponDto"}}}},"default":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayNowError"}}}}}}}}}
```

## GET /v1/stores/{storeId}/coupons/{couponId}

> Retrieves a coupon by ID

```json
{"openapi":"3.1.1","info":{"title":"PayNow Management API","version":"v1"},"tags":[{"name":"coupons"}],"security":[{"APIKey":[]}],"components":{"securitySchemes":{"APIKey":{"type":"apiKey","description":"An API Key token generated in the Dashboard in the format 'APIKey TOKEN_HERE'.","name":"Authorization","in":"header"}},"schemas":{"FlakeId":{"type":"string","additionalProperties":false,"format":"flake-id"},"CouponDto":{"required":["code","created_at","discount_amount","discount_apply_before_sales","discount_apply_individually","discount_type","duration","enabled","id","minimum_order_value","redeem_limit_customer_amount","redeem_limit_customer_enabled","redeem_limit_store_amount","redeem_limit_store_enabled","store_id","usable_on_one_time_purchase","usable_on_subscription"],"type":"object","properties":{"id":{"$ref":"#/components/schemas/FlakeId"},"store_id":{"$ref":"#/components/schemas/FlakeId"},"enabled":{"type":"boolean","description":"Indicates whether the coupon is enabled."},"code":{"type":"string","description":"The unique code associated with the coupon."},"note":{"type":["null","string"],"description":"A note or internal description of the coupon."},"duration":{"$ref":"#/components/schemas/CouponDurationEnum"},"duration_in_months":{"type":["null","integer"],"description":"The number of months the coupon is valid, used if the duration is repeating.","format":"int32"},"discount_type":{"$ref":"#/components/schemas/CouponDiscountTypeEnum"},"discount_amount":{"type":"integer","description":"The discount amount in the smallest currency unit (e.g., cents).","format":"int64"},"discount_apply_individually":{"type":"boolean","description":"Indicates whether the discount should be applied individually to required tags or products."},"discount_apply_before_sales":{"type":"boolean","description":"Indicates whether the discount is applied before existing sales."},"apply_to_products":{"type":["null","array"],"items":{"$ref":"#/components/schemas/FlakeId"},"description":"A list of product IDs the coupon applies to."},"apply_to_tags":{"type":["null","array"],"items":{"$ref":"#/components/schemas/FlakeId"},"description":"A list of tag IDs the coupon applies to."},"usable_by_customer_id":{"$ref":"#/components/schemas/FlakeId"},"minimum_order_value":{"type":"integer","description":"The minimum order value required to use the coupon.","format":"int64"},"redeem_limit_store_enabled":{"type":"boolean","description":"Indicates whether a global redemption limit is enabled."},"redeem_limit_store_amount":{"type":"integer","description":"The maximum number of times the coupon can be redeemed across the store.","format":"int64"},"redeem_limit_customer_enabled":{"type":"boolean","description":"Indicates whether a per-customer redemption limit is enabled."},"redeem_limit_customer_amount":{"type":"integer","description":"The maximum number of times the coupon can be redeemed per customer.","format":"int64"},"usable_on_one_time_purchase":{"type":"boolean","description":"Indicates whether the coupon can be used for one-time purchases."},"usable_on_subscription":{"type":"boolean","description":"Indicates whether the coupon can be used for subscriptions."},"usable_at":{"type":["null","string"],"description":"The date and time when the coupon becomes valid.","format":"date-time"},"expires_at":{"type":["null","string"],"description":"The date and time when the coupon expires.","format":"date-time"},"created_by":{"$ref":"#/components/schemas/ActorDto"},"created_at":{"type":"string","description":"The date and time when the coupon was created.","format":"date-time"},"updated_by":{"$ref":"#/components/schemas/ActorDto"},"updated_at":{"type":["null","string"],"description":"The date and time when the coupon was last updated.","format":"date-time"}},"additionalProperties":false,"description":"Represents a detailed view of a coupon, including configuration and audit information."},"CouponDurationEnum":{"enum":["once","forever","repeating"],"type":"string","description":"Defines the duration for which a coupon remains valid."},"CouponDiscountTypeEnum":{"enum":["unspecified","percent","amount"],"type":"string","description":"Specifies the type of discount applied by a coupon."},"ActorDto":{"required":["type"],"type":"object","properties":{"type":{"$ref":"#/components/schemas/PayNowActorType"},"id":{"$ref":"#/components/schemas/FlakeId"}},"additionalProperties":false},"PayNowActorType":{"enum":["anonymous","user","api_key","customer","game_server","internal","admin","platform","global_customer"],"type":"string"},"PayNowError":{"required":["code","message","status"],"type":"object","properties":{"status":{"type":"integer","description":"The HTTP status code.","format":"int32"},"code":{"type":"string","description":"The PayNow parseable error code."},"message":{"type":"string","description":"The human-readable error message."},"trace_id":{"type":["null","string"],"description":"A distributed trace ID used for debugging."},"errors":{"type":["null","array"],"items":{"$ref":"#/components/schemas/ValidationError"},"description":"An array of multiple errors. Only used by some API services."}},"additionalProperties":false,"description":"Represents a PayNow error"},"ValidationError":{"required":["code","message","path","validation"],"type":"object","properties":{"code":{"type":"string","description":"The parseable error code."},"message":{"type":"string","description":"The human-readable error message."},"path":{"type":"string","description":"The path leading to the validation error."},"validation":{"type":"string","description":"Type of the validation that failed."}},"additionalProperties":false,"description":"A validation error."}}},"paths":{"/v1/stores/{storeId}/coupons/{couponId}":{"get":{"tags":["coupons"],"summary":"Retrieves a coupon by ID","operationId":"StoreCoupons_GetCouponByIdForStore","parameters":[{"name":"storeId","in":"path","description":"","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}},{"name":"couponId","in":"path","description":"","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponDto"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayNowError"}}}},"default":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayNowError"}}}}}}}}}
```

## DELETE /v1/stores/{storeId}/coupons/{couponId}

> Deletes a coupon

```json
{"openapi":"3.1.1","info":{"title":"PayNow Management API","version":"v1"},"tags":[{"name":"coupons"}],"security":[{"APIKey":[]}],"components":{"securitySchemes":{"APIKey":{"type":"apiKey","description":"An API Key token generated in the Dashboard in the format 'APIKey TOKEN_HERE'.","name":"Authorization","in":"header"}},"schemas":{"FlakeId":{"type":"string","additionalProperties":false,"format":"flake-id"},"PayNowError":{"required":["code","message","status"],"type":"object","properties":{"status":{"type":"integer","description":"The HTTP status code.","format":"int32"},"code":{"type":"string","description":"The PayNow parseable error code."},"message":{"type":"string","description":"The human-readable error message."},"trace_id":{"type":["null","string"],"description":"A distributed trace ID used for debugging."},"errors":{"type":["null","array"],"items":{"$ref":"#/components/schemas/ValidationError"},"description":"An array of multiple errors. Only used by some API services."}},"additionalProperties":false,"description":"Represents a PayNow error"},"ValidationError":{"required":["code","message","path","validation"],"type":"object","properties":{"code":{"type":"string","description":"The parseable error code."},"message":{"type":"string","description":"The human-readable error message."},"path":{"type":"string","description":"The path leading to the validation error."},"validation":{"type":"string","description":"Type of the validation that failed."}},"additionalProperties":false,"description":"A validation error."}}},"paths":{"/v1/stores/{storeId}/coupons/{couponId}":{"delete":{"tags":["coupons"],"summary":"Deletes a coupon","operationId":"StoreCoupons_DeleteCouponForStore","parameters":[{"name":"storeId","in":"path","description":"","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}},{"name":"couponId","in":"path","description":"","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}}],"responses":{"204":{"description":"No Content"},"default":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayNowError"}}}}}}}}}
```

## PATCH /v1/stores/{storeId}/coupons/{couponId}

> Performs a Delta Update of a Coupon

```json
{"openapi":"3.1.1","info":{"title":"PayNow Management API","version":"v1"},"tags":[{"name":"coupons"}],"security":[{"APIKey":[]}],"components":{"securitySchemes":{"APIKey":{"type":"apiKey","description":"An API Key token generated in the Dashboard in the format 'APIKey TOKEN_HERE'.","name":"Authorization","in":"header"}},"schemas":{"FlakeId":{"type":"string","additionalProperties":false,"format":"flake-id"},"UpdateCouponDto":{"type":"object","properties":{"enabled":{"type":"boolean"},"code":{"type":"string"},"note":{"type":"string"},"duration":{"$ref":"#/components/schemas/CouponDurationEnum"},"duration_in_months":{"type":["null","integer"],"format":"int32"},"discount_type":{"$ref":"#/components/schemas/CouponDiscountTypeEnum"},"discount_amount":{"type":"integer","format":"int64"},"discount_apply_individually":{"type":"boolean"},"discount_apply_before_sales":{"type":"boolean"},"apply_to_products":{"type":"array","items":{"$ref":"#/components/schemas/FlakeId"}},"apply_to_tags":{"type":"array","items":{"$ref":"#/components/schemas/FlakeId"}},"usable_by_customer_id":{"$ref":"#/components/schemas/FlakeId"},"minimum_order_value":{"type":"integer","format":"int64"},"redeem_limit_store_enabled":{"type":"boolean"},"redeem_limit_store_amount":{"type":"integer","format":"int64"},"redeem_limit_customer_enabled":{"type":"boolean"},"redeem_limit_customer_amount":{"type":"integer","format":"int64"},"usable_on_one_time_purchase":{"type":"boolean"},"usable_on_subscription":{"type":"boolean"},"usable_at":{"type":["null","string"],"format":"date-time"},"expires_at":{"type":["null","string"],"format":"date-time"}}},"CouponDurationEnum":{"enum":["once","forever","repeating"],"type":"string","description":"Defines the duration for which a coupon remains valid."},"CouponDiscountTypeEnum":{"enum":["unspecified","percent","amount"],"type":"string","description":"Specifies the type of discount applied by a coupon."},"CouponDto":{"required":["code","created_at","discount_amount","discount_apply_before_sales","discount_apply_individually","discount_type","duration","enabled","id","minimum_order_value","redeem_limit_customer_amount","redeem_limit_customer_enabled","redeem_limit_store_amount","redeem_limit_store_enabled","store_id","usable_on_one_time_purchase","usable_on_subscription"],"type":"object","properties":{"id":{"$ref":"#/components/schemas/FlakeId"},"store_id":{"$ref":"#/components/schemas/FlakeId"},"enabled":{"type":"boolean","description":"Indicates whether the coupon is enabled."},"code":{"type":"string","description":"The unique code associated with the coupon."},"note":{"type":["null","string"],"description":"A note or internal description of the coupon."},"duration":{"$ref":"#/components/schemas/CouponDurationEnum"},"duration_in_months":{"type":["null","integer"],"description":"The number of months the coupon is valid, used if the duration is repeating.","format":"int32"},"discount_type":{"$ref":"#/components/schemas/CouponDiscountTypeEnum"},"discount_amount":{"type":"integer","description":"The discount amount in the smallest currency unit (e.g., cents).","format":"int64"},"discount_apply_individually":{"type":"boolean","description":"Indicates whether the discount should be applied individually to required tags or products."},"discount_apply_before_sales":{"type":"boolean","description":"Indicates whether the discount is applied before existing sales."},"apply_to_products":{"type":["null","array"],"items":{"$ref":"#/components/schemas/FlakeId"},"description":"A list of product IDs the coupon applies to."},"apply_to_tags":{"type":["null","array"],"items":{"$ref":"#/components/schemas/FlakeId"},"description":"A list of tag IDs the coupon applies to."},"usable_by_customer_id":{"$ref":"#/components/schemas/FlakeId"},"minimum_order_value":{"type":"integer","description":"The minimum order value required to use the coupon.","format":"int64"},"redeem_limit_store_enabled":{"type":"boolean","description":"Indicates whether a global redemption limit is enabled."},"redeem_limit_store_amount":{"type":"integer","description":"The maximum number of times the coupon can be redeemed across the store.","format":"int64"},"redeem_limit_customer_enabled":{"type":"boolean","description":"Indicates whether a per-customer redemption limit is enabled."},"redeem_limit_customer_amount":{"type":"integer","description":"The maximum number of times the coupon can be redeemed per customer.","format":"int64"},"usable_on_one_time_purchase":{"type":"boolean","description":"Indicates whether the coupon can be used for one-time purchases."},"usable_on_subscription":{"type":"boolean","description":"Indicates whether the coupon can be used for subscriptions."},"usable_at":{"type":["null","string"],"description":"The date and time when the coupon becomes valid.","format":"date-time"},"expires_at":{"type":["null","string"],"description":"The date and time when the coupon expires.","format":"date-time"},"created_by":{"$ref":"#/components/schemas/ActorDto"},"created_at":{"type":"string","description":"The date and time when the coupon was created.","format":"date-time"},"updated_by":{"$ref":"#/components/schemas/ActorDto"},"updated_at":{"type":["null","string"],"description":"The date and time when the coupon was last updated.","format":"date-time"}},"additionalProperties":false,"description":"Represents a detailed view of a coupon, including configuration and audit information."},"ActorDto":{"required":["type"],"type":"object","properties":{"type":{"$ref":"#/components/schemas/PayNowActorType"},"id":{"$ref":"#/components/schemas/FlakeId"}},"additionalProperties":false},"PayNowActorType":{"enum":["anonymous","user","api_key","customer","game_server","internal","admin","platform","global_customer"],"type":"string"},"PayNowError":{"required":["code","message","status"],"type":"object","properties":{"status":{"type":"integer","description":"The HTTP status code.","format":"int32"},"code":{"type":"string","description":"The PayNow parseable error code."},"message":{"type":"string","description":"The human-readable error message."},"trace_id":{"type":["null","string"],"description":"A distributed trace ID used for debugging."},"errors":{"type":["null","array"],"items":{"$ref":"#/components/schemas/ValidationError"},"description":"An array of multiple errors. Only used by some API services."}},"additionalProperties":false,"description":"Represents a PayNow error"},"ValidationError":{"required":["code","message","path","validation"],"type":"object","properties":{"code":{"type":"string","description":"The parseable error code."},"message":{"type":"string","description":"The human-readable error message."},"path":{"type":"string","description":"The path leading to the validation error."},"validation":{"type":"string","description":"Type of the validation that failed."}},"additionalProperties":false,"description":"A validation error."}}},"paths":{"/v1/stores/{storeId}/coupons/{couponId}":{"patch":{"tags":["coupons"],"summary":"Performs a Delta Update of a Coupon","operationId":"StoreCoupons_UpdateCouponForStore","parameters":[{"name":"storeId","in":"path","description":"","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}},{"name":"couponId","in":"path","description":"","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}}],"requestBody":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCouponDto"}},"text/json":{"schema":{"$ref":"#/components/schemas/UpdateCouponDto"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/UpdateCouponDto"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponDto"}}}},"default":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayNowError"}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.paynow.gg/management/management-api/coupons.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
