# Sales

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

> Get sales associated with a store.

```json
{"openapi":"3.1.1","info":{"title":"PayNow Management API","version":"v1"},"tags":[{"name":"sales"}],"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"},"SaleDto":{"required":["apply_to_product_ids","apply_to_tag_ids","begins_at","created_at","created_by","discount_amount","discount_type","enabled","id","minimum_order_value","name","store_id"],"type":"object","properties":{"id":{"$ref":"#/components/schemas/FlakeId"},"store_id":{"$ref":"#/components/schemas/FlakeId"},"enabled":{"type":"boolean","description":"Indicates whether the sale is enabled."},"name":{"type":"string","description":"The name of the sale."},"discount_type":{"$ref":"#/components/schemas/SaleDiscountType"},"discount_amount":{"type":"integer","description":"The discount value. For percent discounts, this represents the percentage \nmultiplied by 10 (e.g., 250 = 25%). For amount discounts, this represents \nthe value in the smallest currency unit (e.g., cents).","format":"int32"},"apply_to_product_ids":{"type":"array","items":{"$ref":"#/components/schemas/FlakeId"},"description":"A list of product IDs the sale applies to."},"apply_to_tag_ids":{"type":"array","items":{"$ref":"#/components/schemas/FlakeId"},"description":"A list of tag IDs the sale applies to."},"minimum_order_value":{"type":"integer","description":"The minimum order value required to apply the sale, in the smallest currency unit (e.g., cents).","format":"int32"},"begins_at":{"type":"string","description":"The date and time when the sale begins.","format":"date-time"},"ends_at":{"type":["null","string"],"description":"The date and time when the sale ends.","format":"date-time"},"created_by":{"$ref":"#/components/schemas/ActorDto"},"created_at":{"type":"string","description":"The date and time when the sale was created.","format":"date-time"},"updated_by":{"$ref":"#/components/schemas/ActorDto"},"updated_at":{"type":["null","string"],"description":"The date and time when the sale was last updated.","format":"date-time"}},"additionalProperties":false,"description":"Represents a detailed view of a Sale, including configuration and audit information."},"SaleDiscountType":{"enum":["percent","amount"],"type":"string"},"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}/sales":{"get":{"tags":["sales"],"summary":"Get sales associated with a store.","operationId":"Sales_GetSales","parameters":[{"name":"storeId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SaleDto"}}}}},"default":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayNowError"}}}}}}}}}
```

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

> Create a sale by ID for a store

```json
{"openapi":"3.1.1","info":{"title":"PayNow Management API","version":"v1"},"tags":[{"name":"sales"}],"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"},"CreateSaleDto":{"required":["enabled","name","discount_type","discount_amount","apply_to_product_ids","apply_to_tag_ids","minimum_order_value","begins_at"],"type":"object","properties":{"enabled":{"type":"boolean"},"name":{"type":"string"},"discount_type":{"$ref":"#/components/schemas/SaleDiscountType"},"discount_amount":{"type":"integer","format":"int32"},"apply_to_product_ids":{"type":"array","items":{"$ref":"#/components/schemas/FlakeId"}},"apply_to_tag_ids":{"type":"array","items":{"$ref":"#/components/schemas/FlakeId"}},"minimum_order_value":{"type":"integer","format":"int32"},"begins_at":{"type":"string","format":"date-time"},"ends_at":{"type":["null","string"],"format":"date-time"}}},"SaleDiscountType":{"enum":["percent","amount"],"type":"string"},"SaleDto":{"required":["apply_to_product_ids","apply_to_tag_ids","begins_at","created_at","created_by","discount_amount","discount_type","enabled","id","minimum_order_value","name","store_id"],"type":"object","properties":{"id":{"$ref":"#/components/schemas/FlakeId"},"store_id":{"$ref":"#/components/schemas/FlakeId"},"enabled":{"type":"boolean","description":"Indicates whether the sale is enabled."},"name":{"type":"string","description":"The name of the sale."},"discount_type":{"$ref":"#/components/schemas/SaleDiscountType"},"discount_amount":{"type":"integer","description":"The discount value. For percent discounts, this represents the percentage \nmultiplied by 10 (e.g., 250 = 25%). For amount discounts, this represents \nthe value in the smallest currency unit (e.g., cents).","format":"int32"},"apply_to_product_ids":{"type":"array","items":{"$ref":"#/components/schemas/FlakeId"},"description":"A list of product IDs the sale applies to."},"apply_to_tag_ids":{"type":"array","items":{"$ref":"#/components/schemas/FlakeId"},"description":"A list of tag IDs the sale applies to."},"minimum_order_value":{"type":"integer","description":"The minimum order value required to apply the sale, in the smallest currency unit (e.g., cents).","format":"int32"},"begins_at":{"type":"string","description":"The date and time when the sale begins.","format":"date-time"},"ends_at":{"type":["null","string"],"description":"The date and time when the sale ends.","format":"date-time"},"created_by":{"$ref":"#/components/schemas/ActorDto"},"created_at":{"type":"string","description":"The date and time when the sale was created.","format":"date-time"},"updated_by":{"$ref":"#/components/schemas/ActorDto"},"updated_at":{"type":["null","string"],"description":"The date and time when the sale was last updated.","format":"date-time"}},"additionalProperties":false,"description":"Represents a detailed view of a Sale, 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}/sales":{"post":{"tags":["sales"],"summary":"Create a sale by ID for a store","operationId":"Sales_CreateSale","parameters":[{"name":"storeId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSaleDto"}},"text/json":{"schema":{"$ref":"#/components/schemas/CreateSaleDto"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/CreateSaleDto"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaleDto"}}}},"default":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayNowError"}}}}}}}}}
```

## GET /v1/stores/{storeId}/sales/{saleId}

> Get a sale by ID for a store

```json
{"openapi":"3.1.1","info":{"title":"PayNow Management API","version":"v1"},"tags":[{"name":"sales"}],"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"},"SaleDto":{"required":["apply_to_product_ids","apply_to_tag_ids","begins_at","created_at","created_by","discount_amount","discount_type","enabled","id","minimum_order_value","name","store_id"],"type":"object","properties":{"id":{"$ref":"#/components/schemas/FlakeId"},"store_id":{"$ref":"#/components/schemas/FlakeId"},"enabled":{"type":"boolean","description":"Indicates whether the sale is enabled."},"name":{"type":"string","description":"The name of the sale."},"discount_type":{"$ref":"#/components/schemas/SaleDiscountType"},"discount_amount":{"type":"integer","description":"The discount value. For percent discounts, this represents the percentage \nmultiplied by 10 (e.g., 250 = 25%). For amount discounts, this represents \nthe value in the smallest currency unit (e.g., cents).","format":"int32"},"apply_to_product_ids":{"type":"array","items":{"$ref":"#/components/schemas/FlakeId"},"description":"A list of product IDs the sale applies to."},"apply_to_tag_ids":{"type":"array","items":{"$ref":"#/components/schemas/FlakeId"},"description":"A list of tag IDs the sale applies to."},"minimum_order_value":{"type":"integer","description":"The minimum order value required to apply the sale, in the smallest currency unit (e.g., cents).","format":"int32"},"begins_at":{"type":"string","description":"The date and time when the sale begins.","format":"date-time"},"ends_at":{"type":["null","string"],"description":"The date and time when the sale ends.","format":"date-time"},"created_by":{"$ref":"#/components/schemas/ActorDto"},"created_at":{"type":"string","description":"The date and time when the sale was created.","format":"date-time"},"updated_by":{"$ref":"#/components/schemas/ActorDto"},"updated_at":{"type":["null","string"],"description":"The date and time when the sale was last updated.","format":"date-time"}},"additionalProperties":false,"description":"Represents a detailed view of a Sale, including configuration and audit information."},"SaleDiscountType":{"enum":["percent","amount"],"type":"string"},"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}/sales/{saleId}":{"get":{"tags":["sales"],"summary":"Get a sale by ID for a store","operationId":"Sales_GetSale","parameters":[{"name":"storeId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}},{"name":"saleId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaleDto"}}}},"default":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayNowError"}}}}}}}}}
```

## DELETE /v1/stores/{storeId}/sales/{saleId}

> Delete a sale by ID for a store

```json
{"openapi":"3.1.1","info":{"title":"PayNow Management API","version":"v1"},"tags":[{"name":"sales"}],"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}/sales/{saleId}":{"delete":{"tags":["sales"],"summary":"Delete a sale by ID for a store","operationId":"Sales_DeleteSaleById","parameters":[{"name":"storeId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}},{"name":"saleId","in":"path","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}/sales/{saleId}

> Update a sale by ID for a store

```json
{"openapi":"3.1.1","info":{"title":"PayNow Management API","version":"v1"},"tags":[{"name":"sales"}],"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"},"UpdateSaleDto":{"type":"object","properties":{"enabled":{"type":"boolean"},"name":{"type":"string"},"discount_type":{"$ref":"#/components/schemas/SaleDiscountType"},"discount_amount":{"type":"integer","format":"int32"},"apply_to_product_ids":{"type":"array","items":{"$ref":"#/components/schemas/FlakeId"}},"apply_to_tag_ids":{"type":"array","items":{"$ref":"#/components/schemas/FlakeId"}},"minimum_order_value":{"type":"integer","format":"int32"},"begins_at":{"type":"string","format":"date-time"},"ends_at":{"type":["null","string"],"format":"date-time"}}},"SaleDiscountType":{"enum":["percent","amount"],"type":"string"},"SaleDto":{"required":["apply_to_product_ids","apply_to_tag_ids","begins_at","created_at","created_by","discount_amount","discount_type","enabled","id","minimum_order_value","name","store_id"],"type":"object","properties":{"id":{"$ref":"#/components/schemas/FlakeId"},"store_id":{"$ref":"#/components/schemas/FlakeId"},"enabled":{"type":"boolean","description":"Indicates whether the sale is enabled."},"name":{"type":"string","description":"The name of the sale."},"discount_type":{"$ref":"#/components/schemas/SaleDiscountType"},"discount_amount":{"type":"integer","description":"The discount value. For percent discounts, this represents the percentage \nmultiplied by 10 (e.g., 250 = 25%). For amount discounts, this represents \nthe value in the smallest currency unit (e.g., cents).","format":"int32"},"apply_to_product_ids":{"type":"array","items":{"$ref":"#/components/schemas/FlakeId"},"description":"A list of product IDs the sale applies to."},"apply_to_tag_ids":{"type":"array","items":{"$ref":"#/components/schemas/FlakeId"},"description":"A list of tag IDs the sale applies to."},"minimum_order_value":{"type":"integer","description":"The minimum order value required to apply the sale, in the smallest currency unit (e.g., cents).","format":"int32"},"begins_at":{"type":"string","description":"The date and time when the sale begins.","format":"date-time"},"ends_at":{"type":["null","string"],"description":"The date and time when the sale ends.","format":"date-time"},"created_by":{"$ref":"#/components/schemas/ActorDto"},"created_at":{"type":"string","description":"The date and time when the sale was created.","format":"date-time"},"updated_by":{"$ref":"#/components/schemas/ActorDto"},"updated_at":{"type":["null","string"],"description":"The date and time when the sale was last updated.","format":"date-time"}},"additionalProperties":false,"description":"Represents a detailed view of a Sale, 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}/sales/{saleId}":{"patch":{"tags":["sales"],"summary":"Update a sale by ID for a store","operationId":"Sales_UpdateSale","parameters":[{"name":"storeId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}},{"name":"saleId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSaleDto"}},"text/json":{"schema":{"$ref":"#/components/schemas/UpdateSaleDto"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/UpdateSaleDto"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaleDto"}}}},"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/sales.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.
