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{
"items": [
{
"merchant_account_id": "<string>",
"bin": "<string>",
"sub_bin": "<string>",
"last4": "<string>",
"type": "gift-card",
"id": "356d56e5-fe16-42ae-97ee-8d55d846ae2e",
"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."
}
]
}Fetch the balances for one or more gift cards.
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{
"items": [
{
"merchant_account_id": "<string>",
"bin": "<string>",
"sub_bin": "<string>",
"last4": "<string>",
"type": "gift-card",
"id": "356d56e5-fe16-42ae-97ee-8d55d846ae2e",
"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."
}
]
}gift-cards.read scope.Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The ID of the merchant account to use for this request.
"default"
A list of gift cards to request a balance for.
The number and pin for a gift card to fetch a balance for.
Show child attributes
Successful Response
A list of items returned for this request.
Show child attributes