Introduction
Transactions
Buyers
Checkout Sessions
Payment links
Payment options
Refunds
Instruments
- Card schemes
- Card details
- Digital wallets
- Gift cards
- Payment methods
- Payment method definitions
Vault
- Account updater
- Network tokens
- Payment service tokens
- Vault Forward
- Vault Forward endpoints
- Vault Forward authentication
Connections
- All services
- Payment services
- Digital wallets
- Anti-fraud services
Other
- Flow
- Reports
- Report executions
- Webhook subscriptions
Verify and get gift card balances
Fetch the balances for one or more gift cards.
POST
/
gift-cards
/
balances
Copy
Ask AI
using Gr4vy;
using Gr4vy.Models.Components;
using System.Collections.Generic;
var sdk = new Gr4vySDK(
id: "example",
server: SDKConfig.Server.Sandbox,
bearerAuthSource: Auth.WithToken(privateKey),
merchantAccountId: "default"
);
var res = await sdk.GiftCards.Balances.ListAsync(giftCardBalanceRequest: new GiftCardBalanceRequest() {
Items = new List<Item>() {
Item.CreateGiftCardStoredRequest(
new GiftCardStoredRequest() {
Id = "356d56e5-fe16-42ae-97ee-8d55d846ae2e",
}
),
},
});
// handle response
Copy
Ask AI
{
"items": [
{
"type": "gift-card",
"id": "356d56e5-fe16-42ae-97ee-8d55d846ae2e",
"merchant_account_id": "default",
"bin": "412345",
"sub_bin": "554",
"last4": "1234",
"currency": "AUD",
"expiration_date": "2013-07-16T19:23:00.000+00:00",
"balance": 1299,
"balance_error_code": "incorrect_currency",
"balance_raw_error_code": "10363",
"balance_raw_error_message": "This currency is not supported by the merchant."
}
]
}
This endpoint requires the gift-cards.read
scope.
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Headers
The ID of the merchant account to use for this request.
Examples:
"default"
Body
application/json
Response
200
application/json
Successful Response
The response is of type object
.
Was this page helpful?
Copy
Ask AI
using Gr4vy;
using Gr4vy.Models.Components;
using System.Collections.Generic;
var sdk = new Gr4vySDK(
id: "example",
server: SDKConfig.Server.Sandbox,
bearerAuthSource: Auth.WithToken(privateKey),
merchantAccountId: "default"
);
var res = await sdk.GiftCards.Balances.ListAsync(giftCardBalanceRequest: new GiftCardBalanceRequest() {
Items = new List<Item>() {
Item.CreateGiftCardStoredRequest(
new GiftCardStoredRequest() {
Id = "356d56e5-fe16-42ae-97ee-8d55d846ae2e",
}
),
},
});
// handle response
Copy
Ask AI
{
"items": [
{
"type": "gift-card",
"id": "356d56e5-fe16-42ae-97ee-8d55d846ae2e",
"merchant_account_id": "default",
"bin": "412345",
"sub_bin": "554",
"last4": "1234",
"currency": "AUD",
"expiration_date": "2013-07-16T19:23:00.000+00:00",
"balance": 1299,
"balance_error_code": "incorrect_currency",
"balance_raw_error_code": "10363",
"balance_raw_error_message": "This currency is not supported by the merchant."
}
]
}
Assistant
Responses are generated using AI and may contain mistakes.