# Giftcards

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

> Get Gift Cards for a store

```json
{"openapi":"3.1.1","info":{"title":"PayNow Management API","version":"v1"},"tags":[{"name":"giftcards"}],"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"},"GiftCardDto":{"required":["balance","code","enabled","id","starting_balance","store_id","usable_at"],"type":"object","properties":{"id":{"$ref":"#/components/schemas/FlakeId"},"store_id":{"$ref":"#/components/schemas/FlakeId"},"enabled":{"type":"boolean","description":"Indicates whether the gift card is currently enabled and can be used."},"code":{"type":"string","description":"The unique code that customers use to redeem the gift card."},"note":{"type":["null","string"],"description":"Optional note or description associated with the gift card."},"balance":{"type":"integer","description":"The current balance remaining on the gift card in cents.","format":"int64"},"starting_balance":{"type":"integer","description":"The original balance when the gift card was first created in cents.","format":"int64"},"usable_at":{"type":"string","description":"The date and time when the gift card becomes usable.","format":"date-time"},"expires_at":{"type":["null","string"],"description":"The date and time when the gift card expires, if applicable.","format":"date-time"},"created_at":{"type":["null","string"],"description":"The date and time when the gift card was created.","format":"date-time"},"created_by":{"$ref":"#/components/schemas/ActorDto"},"updated_at":{"type":["null","string"],"description":"The date and time when the gift card was last updated, if applicable.","format":"date-time"},"updated_by":{"$ref":"#/components/schemas/ActorDto"},"canceled_at":{"type":["null","string"],"description":"The date and time when the gift card was canceled, if applicable.","format":"date-time"},"canceled_by":{"$ref":"#/components/schemas/ActorDto"}},"additionalProperties":false,"description":"Represents a gift card in the PayNow system."},"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}/giftcards":{"get":{"tags":["giftcards"],"summary":"Get Gift Cards for a store","operationId":"GiftCards_GetGiftCards","parameters":[{"name":"storeId","in":"path","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":"code","in":"query","description":"A gift card code to filter by.","schema":{"type":"string"}},{"name":"include_canceled","in":"query","description":"Should canceled gift cards be included in the response?","schema":{"type":"boolean"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GiftCardDto"}}}}},"default":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayNowError"}}}}}}}}}
```

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

> Create a Gift Card for a store

```json
{"openapi":"3.1.1","info":{"title":"PayNow Management API","version":"v1"},"tags":[{"name":"giftcards"}],"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"},"CreateGiftCardDto":{"required":["enabled","code","balance","usable_at"],"type":"object","properties":{"enabled":{"type":"boolean"},"code":{"type":"string"},"note":{"type":"string"},"balance":{"type":"integer","format":"int64"},"usable_at":{"type":"string","format":"date-time"},"expires_at":{"type":["null","string"],"format":"date-time"}}},"GiftCardDto":{"required":["balance","code","enabled","id","starting_balance","store_id","usable_at"],"type":"object","properties":{"id":{"$ref":"#/components/schemas/FlakeId"},"store_id":{"$ref":"#/components/schemas/FlakeId"},"enabled":{"type":"boolean","description":"Indicates whether the gift card is currently enabled and can be used."},"code":{"type":"string","description":"The unique code that customers use to redeem the gift card."},"note":{"type":["null","string"],"description":"Optional note or description associated with the gift card."},"balance":{"type":"integer","description":"The current balance remaining on the gift card in cents.","format":"int64"},"starting_balance":{"type":"integer","description":"The original balance when the gift card was first created in cents.","format":"int64"},"usable_at":{"type":"string","description":"The date and time when the gift card becomes usable.","format":"date-time"},"expires_at":{"type":["null","string"],"description":"The date and time when the gift card expires, if applicable.","format":"date-time"},"created_at":{"type":["null","string"],"description":"The date and time when the gift card was created.","format":"date-time"},"created_by":{"$ref":"#/components/schemas/ActorDto"},"updated_at":{"type":["null","string"],"description":"The date and time when the gift card was last updated, if applicable.","format":"date-time"},"updated_by":{"$ref":"#/components/schemas/ActorDto"},"canceled_at":{"type":["null","string"],"description":"The date and time when the gift card was canceled, if applicable.","format":"date-time"},"canceled_by":{"$ref":"#/components/schemas/ActorDto"}},"additionalProperties":false,"description":"Represents a gift card in the PayNow system."},"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}/giftcards":{"post":{"tags":["giftcards"],"summary":"Create a Gift Card for a store","operationId":"GiftCards_CreateGiftCard","parameters":[{"name":"storeId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGiftCardDto"}},"text/json":{"schema":{"$ref":"#/components/schemas/CreateGiftCardDto"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/CreateGiftCardDto"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCardDto"}}}},"default":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayNowError"}}}}}}}}}
```

## GET /v1/stores/{storeId}/giftcards/{giftCardId}

> Get a Gift Card By ID for a store

```json
{"openapi":"3.1.1","info":{"title":"PayNow Management API","version":"v1"},"tags":[{"name":"giftcards"}],"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"},"GiftCardDto":{"required":["balance","code","enabled","id","starting_balance","store_id","usable_at"],"type":"object","properties":{"id":{"$ref":"#/components/schemas/FlakeId"},"store_id":{"$ref":"#/components/schemas/FlakeId"},"enabled":{"type":"boolean","description":"Indicates whether the gift card is currently enabled and can be used."},"code":{"type":"string","description":"The unique code that customers use to redeem the gift card."},"note":{"type":["null","string"],"description":"Optional note or description associated with the gift card."},"balance":{"type":"integer","description":"The current balance remaining on the gift card in cents.","format":"int64"},"starting_balance":{"type":"integer","description":"The original balance when the gift card was first created in cents.","format":"int64"},"usable_at":{"type":"string","description":"The date and time when the gift card becomes usable.","format":"date-time"},"expires_at":{"type":["null","string"],"description":"The date and time when the gift card expires, if applicable.","format":"date-time"},"created_at":{"type":["null","string"],"description":"The date and time when the gift card was created.","format":"date-time"},"created_by":{"$ref":"#/components/schemas/ActorDto"},"updated_at":{"type":["null","string"],"description":"The date and time when the gift card was last updated, if applicable.","format":"date-time"},"updated_by":{"$ref":"#/components/schemas/ActorDto"},"canceled_at":{"type":["null","string"],"description":"The date and time when the gift card was canceled, if applicable.","format":"date-time"},"canceled_by":{"$ref":"#/components/schemas/ActorDto"}},"additionalProperties":false,"description":"Represents a gift card in the PayNow system."},"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}/giftcards/{giftCardId}":{"get":{"tags":["giftcards"],"summary":"Get a Gift Card By ID for a store","operationId":"GiftCards_GetGiftCard","parameters":[{"name":"storeId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}},{"name":"giftCardId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCardDto"}}}},"default":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayNowError"}}}}}}}}}
```

## DELETE /v1/stores/{storeId}/giftcards/{giftCardId}

> Delete a Gift Card By ID for a store

```json
{"openapi":"3.1.1","info":{"title":"PayNow Management API","version":"v1"},"tags":[{"name":"giftcards"}],"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"},"GiftCardDto":{"required":["balance","code","enabled","id","starting_balance","store_id","usable_at"],"type":"object","properties":{"id":{"$ref":"#/components/schemas/FlakeId"},"store_id":{"$ref":"#/components/schemas/FlakeId"},"enabled":{"type":"boolean","description":"Indicates whether the gift card is currently enabled and can be used."},"code":{"type":"string","description":"The unique code that customers use to redeem the gift card."},"note":{"type":["null","string"],"description":"Optional note or description associated with the gift card."},"balance":{"type":"integer","description":"The current balance remaining on the gift card in cents.","format":"int64"},"starting_balance":{"type":"integer","description":"The original balance when the gift card was first created in cents.","format":"int64"},"usable_at":{"type":"string","description":"The date and time when the gift card becomes usable.","format":"date-time"},"expires_at":{"type":["null","string"],"description":"The date and time when the gift card expires, if applicable.","format":"date-time"},"created_at":{"type":["null","string"],"description":"The date and time when the gift card was created.","format":"date-time"},"created_by":{"$ref":"#/components/schemas/ActorDto"},"updated_at":{"type":["null","string"],"description":"The date and time when the gift card was last updated, if applicable.","format":"date-time"},"updated_by":{"$ref":"#/components/schemas/ActorDto"},"canceled_at":{"type":["null","string"],"description":"The date and time when the gift card was canceled, if applicable.","format":"date-time"},"canceled_by":{"$ref":"#/components/schemas/ActorDto"}},"additionalProperties":false,"description":"Represents a gift card in the PayNow system."},"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}/giftcards/{giftCardId}":{"delete":{"tags":["giftcards"],"summary":"Delete a Gift Card By ID for a store","operationId":"GiftCards_DeleteGiftCard","parameters":[{"name":"storeId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}},{"name":"giftCardId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCardDto"}}}},"default":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayNowError"}}}}}}}}}
```

## PATCH /v1/stores/{storeId}/giftcards/{giftCardId}

> Update a Gift Card By ID for a store

```json
{"openapi":"3.1.1","info":{"title":"PayNow Management API","version":"v1"},"tags":[{"name":"giftcards"}],"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"},"UpdateGiftCardDto":{"type":"object","properties":{"enabled":{"type":"boolean"},"code":{"type":"string"},"note":{"type":"string"},"balance":{"type":"integer","format":"int64"},"usable_at":{"type":"string","format":"date-time"},"expires_at":{"type":["null","string"],"format":"date-time"}}},"GiftCardDto":{"required":["balance","code","enabled","id","starting_balance","store_id","usable_at"],"type":"object","properties":{"id":{"$ref":"#/components/schemas/FlakeId"},"store_id":{"$ref":"#/components/schemas/FlakeId"},"enabled":{"type":"boolean","description":"Indicates whether the gift card is currently enabled and can be used."},"code":{"type":"string","description":"The unique code that customers use to redeem the gift card."},"note":{"type":["null","string"],"description":"Optional note or description associated with the gift card."},"balance":{"type":"integer","description":"The current balance remaining on the gift card in cents.","format":"int64"},"starting_balance":{"type":"integer","description":"The original balance when the gift card was first created in cents.","format":"int64"},"usable_at":{"type":"string","description":"The date and time when the gift card becomes usable.","format":"date-time"},"expires_at":{"type":["null","string"],"description":"The date and time when the gift card expires, if applicable.","format":"date-time"},"created_at":{"type":["null","string"],"description":"The date and time when the gift card was created.","format":"date-time"},"created_by":{"$ref":"#/components/schemas/ActorDto"},"updated_at":{"type":["null","string"],"description":"The date and time when the gift card was last updated, if applicable.","format":"date-time"},"updated_by":{"$ref":"#/components/schemas/ActorDto"},"canceled_at":{"type":["null","string"],"description":"The date and time when the gift card was canceled, if applicable.","format":"date-time"},"canceled_by":{"$ref":"#/components/schemas/ActorDto"}},"additionalProperties":false,"description":"Represents a gift card in the PayNow system."},"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}/giftcards/{giftCardId}":{"patch":{"tags":["giftcards"],"summary":"Update a Gift Card By ID for a store","operationId":"GiftCards_UpdateGiftCard","parameters":[{"name":"storeId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}},{"name":"giftCardId","in":"path","required":true,"schema":{"$ref":"#/components/schemas/FlakeId"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateGiftCardDto"}},"text/json":{"schema":{"$ref":"#/components/schemas/UpdateGiftCardDto"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/UpdateGiftCardDto"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCardDto"}}}},"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/giftcards.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.
