Gift Cards
Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as
Authorization: APIKey TOKEN.Path parameters
storeIdFlakeIdRequired
Query parameters
limitintegerOptional
The maximum number of items to return in a single request.
afterFlakeIdOptional
Returns items after the specified ID.
Used for forward pagination through results.
beforeFlakeIdOptional
Returns items before the specified ID.
Used for backward pagination through results.
ascbooleanOptional
Determines the sort order of returned items.
When true, items are returned in ascending order.
When false, items are returned in descending order.
codestringOptional
A gift card code to filter by.
include_canceledbooleanOptional
Should canceled gift cards be included in the response?
Response
200OKGiftCardDto[]
Represents a gift card in the PayNow system.
Show fieldsHide fields
balanceintegerRequired
The current balance remaining on the gift card in cents.
codestringRequired
The unique code that customers use to redeem the gift card.
enabledbooleanRequired
Indicates whether the gift card is currently enabled and can be used.
idFlakeIdRequired
starting_balanceintegerRequired
The original balance when the gift card was first created in cents.
store_idFlakeIdRequired
usable_atstringRequired
The date and time when the gift card becomes usable.
canceled_atstringOptional
The date and time when the gift card was canceled, if applicable.
canceled_byActorDtoOptional
typeenumRequired
Possible enum values
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
idFlakeIdOptional
created_atstringOptional
The date and time when the gift card was created.
created_byActorDtoOptional
typeenumRequired
Possible enum values
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
idFlakeIdOptional
expires_atstringOptional
The date and time when the gift card expires, if applicable.
notestringOptional
Optional note or description associated with the gift card.
updated_atstringOptional
The date and time when the gift card was last updated, if applicable.
updated_byActorDtoOptional
typeenumRequired
Possible enum values
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
idFlakeIdOptional
Failed requests return a PayNowError body. See the error response guide.
curl -X GET "https://api.paynow.gg/v1/stores/{storeId}/giftcards" \
-H "Authorization: APIKey TOKEN"import { createManagementClient } from "@paynow-gg/typescript-sdk";
const paynow = createManagementClient({
apiKey: "API_KEY",
storeId: "STORE_ID",
});
const result = await paynow.giftcards.getGiftCards();import requests
headers = {"Authorization": "APIKey TOKEN"}
response = requests.get("https://api.paynow.gg/v1/stores/{storeId}/giftcards", headers=headers)Response200
[
{
"balance": 2500,
"code": "GIFT-2024-ABCD1234",
"enabled": true,
"id": "411486491630370816",
"starting_balance": 5000,
"store_id": "411486491630370816",
"usable_at": "2024-01-01T00:00:00Z",
"note": "string",
"expires_at": "2024-01-01T00:00:00Z",
"created_at": "2024-01-01T00:00:00Z",
"created_by": {
"type": "anonymous",
"id": "411486491630370816"
},
"updated_at": "2024-01-01T00:00:00Z",
"updated_by": {
"type": "anonymous",
"id": "411486491630370816"
},
"canceled_at": "2024-01-01T00:00:00Z",
"canceled_by": {
"type": "anonymous",
"id": "411486491630370816"
}
}
]Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as
Authorization: APIKey TOKEN.Path parameters
storeIdFlakeIdRequired
Request body
balanceintegerRequired
codestringRequired
enabledbooleanRequired
usable_atstringRequired
expires_atstringOptional
notestringOptional
Response
200OKGiftCardDto
Represents a gift card in the PayNow system.
Show fieldsHide fields
balanceintegerRequired
The current balance remaining on the gift card in cents.
codestringRequired
The unique code that customers use to redeem the gift card.
enabledbooleanRequired
Indicates whether the gift card is currently enabled and can be used.
idFlakeIdRequired
starting_balanceintegerRequired
The original balance when the gift card was first created in cents.
store_idFlakeIdRequired
usable_atstringRequired
The date and time when the gift card becomes usable.
canceled_atstringOptional
The date and time when the gift card was canceled, if applicable.
canceled_byActorDtoOptional
typeenumRequired
Possible enum values
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
idFlakeIdOptional
created_atstringOptional
The date and time when the gift card was created.
created_byActorDtoOptional
typeenumRequired
Possible enum values
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
idFlakeIdOptional
expires_atstringOptional
The date and time when the gift card expires, if applicable.
notestringOptional
Optional note or description associated with the gift card.
updated_atstringOptional
The date and time when the gift card was last updated, if applicable.
updated_byActorDtoOptional
typeenumRequired
Possible enum values
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
idFlakeIdOptional
Failed requests return a PayNowError body. See the error response guide.
curl -X POST "https://api.paynow.gg/v1/stores/{storeId}/giftcards" \
-H "Authorization: APIKey TOKEN" \
-H "Content-Type: application/json" \
-d '{
"enabled": true,
"code": "string",
"balance": 0,
"usable_at": "2024-01-01T00:00:00Z",
"note": "string",
"expires_at": "2024-01-01T00:00:00Z"
}'import { createManagementClient } from "@paynow-gg/typescript-sdk";
const paynow = createManagementClient({
apiKey: "API_KEY",
storeId: "STORE_ID",
});
const result = await paynow.giftcards.createGiftCard({
enabled: true,
code: "string",
balance: 0,
usable_at: "2024-01-01T00:00:00Z",
note: "string",
expires_at: "2024-01-01T00:00:00Z",
});import requests
headers = {"Authorization": "APIKey TOKEN"}
payload = {
"enabled": True,
"code": "string",
"balance": 0,
"usable_at": "2024-01-01T00:00:00Z",
"note": "string",
"expires_at": "2024-01-01T00:00:00Z",
}
response = requests.post("https://api.paynow.gg/v1/stores/{storeId}/giftcards", headers=headers, json=payload)Response200
{
"balance": 2500,
"code": "GIFT-2024-ABCD1234",
"enabled": true,
"id": "411486491630370816",
"starting_balance": 5000,
"store_id": "411486491630370816",
"usable_at": "2024-01-01T00:00:00Z",
"note": "string",
"expires_at": "2024-01-01T00:00:00Z",
"created_at": "2024-01-01T00:00:00Z",
"created_by": {
"type": "anonymous",
"id": "411486491630370816"
},
"updated_at": "2024-01-01T00:00:00Z",
"updated_by": {
"type": "anonymous",
"id": "411486491630370816"
},
"canceled_at": "2024-01-01T00:00:00Z",
"canceled_by": {
"type": "anonymous",
"id": "411486491630370816"
}
}Get a Gift Card By ID for a store
GEThttps://api.paynow.gg/v1/stores/{storeId}/giftcards/{giftCardId}
Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as
Authorization: APIKey TOKEN.Path parameters
storeIdFlakeIdRequired
giftCardIdFlakeIdRequired
Response
200OKGiftCardDto
Represents a gift card in the PayNow system.
Show fieldsHide fields
balanceintegerRequired
The current balance remaining on the gift card in cents.
codestringRequired
The unique code that customers use to redeem the gift card.
enabledbooleanRequired
Indicates whether the gift card is currently enabled and can be used.
idFlakeIdRequired
starting_balanceintegerRequired
The original balance when the gift card was first created in cents.
store_idFlakeIdRequired
usable_atstringRequired
The date and time when the gift card becomes usable.
canceled_atstringOptional
The date and time when the gift card was canceled, if applicable.
canceled_byActorDtoOptional
typeenumRequired
Possible enum values
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
idFlakeIdOptional
created_atstringOptional
The date and time when the gift card was created.
created_byActorDtoOptional
typeenumRequired
Possible enum values
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
idFlakeIdOptional
expires_atstringOptional
The date and time when the gift card expires, if applicable.
notestringOptional
Optional note or description associated with the gift card.
updated_atstringOptional
The date and time when the gift card was last updated, if applicable.
updated_byActorDtoOptional
typeenumRequired
Possible enum values
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
idFlakeIdOptional
Failed requests return a PayNowError body. See the error response guide.
curl -X GET "https://api.paynow.gg/v1/stores/{storeId}/giftcards/{giftCardId}" \
-H "Authorization: APIKey TOKEN"import { createManagementClient } from "@paynow-gg/typescript-sdk";
const paynow = createManagementClient({
apiKey: "API_KEY",
storeId: "STORE_ID",
});
const result = await paynow.giftcards.getGiftCard("411486491630370816");import requests
headers = {"Authorization": "APIKey TOKEN"}
response = requests.get("https://api.paynow.gg/v1/stores/{storeId}/giftcards/{giftCardId}", headers=headers)Response200
{
"balance": 2500,
"code": "GIFT-2024-ABCD1234",
"enabled": true,
"id": "411486491630370816",
"starting_balance": 5000,
"store_id": "411486491630370816",
"usable_at": "2024-01-01T00:00:00Z",
"note": "string",
"expires_at": "2024-01-01T00:00:00Z",
"created_at": "2024-01-01T00:00:00Z",
"created_by": {
"type": "anonymous",
"id": "411486491630370816"
},
"updated_at": "2024-01-01T00:00:00Z",
"updated_by": {
"type": "anonymous",
"id": "411486491630370816"
},
"canceled_at": "2024-01-01T00:00:00Z",
"canceled_by": {
"type": "anonymous",
"id": "411486491630370816"
}
}Update a Gift Card By ID for a store
PATCHhttps://api.paynow.gg/v1/stores/{storeId}/giftcards/{giftCardId}
Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as
Authorization: APIKey TOKEN.Path parameters
storeIdFlakeIdRequired
giftCardIdFlakeIdRequired
Request body
balanceintegerOptional
codestringOptional
enabledbooleanOptional
expires_atstringOptional
notestringOptional
usable_atstringOptional
Response
200OKGiftCardDto
Represents a gift card in the PayNow system.
Show fieldsHide fields
balanceintegerRequired
The current balance remaining on the gift card in cents.
codestringRequired
The unique code that customers use to redeem the gift card.
enabledbooleanRequired
Indicates whether the gift card is currently enabled and can be used.
idFlakeIdRequired
starting_balanceintegerRequired
The original balance when the gift card was first created in cents.
store_idFlakeIdRequired
usable_atstringRequired
The date and time when the gift card becomes usable.
canceled_atstringOptional
The date and time when the gift card was canceled, if applicable.
canceled_byActorDtoOptional
typeenumRequired
Possible enum values
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
idFlakeIdOptional
created_atstringOptional
The date and time when the gift card was created.
created_byActorDtoOptional
typeenumRequired
Possible enum values
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
idFlakeIdOptional
expires_atstringOptional
The date and time when the gift card expires, if applicable.
notestringOptional
Optional note or description associated with the gift card.
updated_atstringOptional
The date and time when the gift card was last updated, if applicable.
updated_byActorDtoOptional
typeenumRequired
Possible enum values
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
idFlakeIdOptional
Failed requests return a PayNowError body. See the error response guide.
curl -X PATCH "https://api.paynow.gg/v1/stores/{storeId}/giftcards/{giftCardId}" \
-H "Authorization: APIKey TOKEN" \
-H "Content-Type: application/json" \
-d '{
"enabled": true,
"code": "string",
"note": "string",
"balance": 0,
"usable_at": "2024-01-01T00:00:00Z",
"expires_at": "2024-01-01T00:00:00Z"
}'import { createManagementClient } from "@paynow-gg/typescript-sdk";
const paynow = createManagementClient({
apiKey: "API_KEY",
storeId: "STORE_ID",
});
const result = await paynow.giftcards.updateGiftCard("411486491630370816", {
enabled: true,
code: "string",
note: "string",
balance: 0,
usable_at: "2024-01-01T00:00:00Z",
expires_at: "2024-01-01T00:00:00Z",
});import requests
headers = {"Authorization": "APIKey TOKEN"}
payload = {
"enabled": True,
"code": "string",
"note": "string",
"balance": 0,
"usable_at": "2024-01-01T00:00:00Z",
"expires_at": "2024-01-01T00:00:00Z",
}
response = requests.patch("https://api.paynow.gg/v1/stores/{storeId}/giftcards/{giftCardId}", headers=headers, json=payload)Response200
{
"balance": 2500,
"code": "GIFT-2024-ABCD1234",
"enabled": true,
"id": "411486491630370816",
"starting_balance": 5000,
"store_id": "411486491630370816",
"usable_at": "2024-01-01T00:00:00Z",
"note": "string",
"expires_at": "2024-01-01T00:00:00Z",
"created_at": "2024-01-01T00:00:00Z",
"created_by": {
"type": "anonymous",
"id": "411486491630370816"
},
"updated_at": "2024-01-01T00:00:00Z",
"updated_by": {
"type": "anonymous",
"id": "411486491630370816"
},
"canceled_at": "2024-01-01T00:00:00Z",
"canceled_by": {
"type": "anonymous",
"id": "411486491630370816"
}
}Delete a Gift Card By ID for a store
DELETEhttps://api.paynow.gg/v1/stores/{storeId}/giftcards/{giftCardId}
Headers
AuthorizationAPI KeyRequired
Authentication token for this request, sent as
Authorization: APIKey TOKEN.Path parameters
storeIdFlakeIdRequired
giftCardIdFlakeIdRequired
Response
200OKGiftCardDto
Represents a gift card in the PayNow system.
Show fieldsHide fields
balanceintegerRequired
The current balance remaining on the gift card in cents.
codestringRequired
The unique code that customers use to redeem the gift card.
enabledbooleanRequired
Indicates whether the gift card is currently enabled and can be used.
idFlakeIdRequired
starting_balanceintegerRequired
The original balance when the gift card was first created in cents.
store_idFlakeIdRequired
usable_atstringRequired
The date and time when the gift card becomes usable.
canceled_atstringOptional
The date and time when the gift card was canceled, if applicable.
canceled_byActorDtoOptional
typeenumRequired
Possible enum values
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
idFlakeIdOptional
created_atstringOptional
The date and time when the gift card was created.
created_byActorDtoOptional
typeenumRequired
Possible enum values
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
idFlakeIdOptional
expires_atstringOptional
The date and time when the gift card expires, if applicable.
notestringOptional
Optional note or description associated with the gift card.
updated_atstringOptional
The date and time when the gift card was last updated, if applicable.
updated_byActorDtoOptional
typeenumRequired
Possible enum values
anonymoususerapi_keycustomergame_serverinternaladminplatformglobal_customer
idFlakeIdOptional
Failed requests return a PayNowError body. See the error response guide.
curl -X DELETE "https://api.paynow.gg/v1/stores/{storeId}/giftcards/{giftCardId}" \
-H "Authorization: APIKey TOKEN"import { createManagementClient } from "@paynow-gg/typescript-sdk";
const paynow = createManagementClient({
apiKey: "API_KEY",
storeId: "STORE_ID",
});
const result = await paynow.giftcards.deleteGiftCard("411486491630370816");import requests
headers = {"Authorization": "APIKey TOKEN"}
response = requests.delete("https://api.paynow.gg/v1/stores/{storeId}/giftcards/{giftCardId}", headers=headers)Response200
{
"balance": 2500,
"code": "GIFT-2024-ABCD1234",
"enabled": true,
"id": "411486491630370816",
"starting_balance": 5000,
"store_id": "411486491630370816",
"usable_at": "2024-01-01T00:00:00Z",
"note": "string",
"expires_at": "2024-01-01T00:00:00Z",
"created_at": "2024-01-01T00:00:00Z",
"created_by": {
"type": "anonymous",
"id": "411486491630370816"
},
"updated_at": "2024-01-01T00:00:00Z",
"updated_by": {
"type": "anonymous",
"id": "411486491630370816"
},
"canceled_at": "2024-01-01T00:00:00Z",
"canceled_by": {
"type": "anonymous",
"id": "411486491630370816"
}
}