using Gr4vy;
using Gr4vy.Models.Components;
var sdk = new Gr4vySDK(
id: "example",
server: SDKConfig.Server.Sandbox,
bearerAuthSource: Auth.WithToken(privateKey),
merchantAccountId: "default"
);
var res = await sdk.Buyers.GiftCards.ListAsync();
// 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."
}
]
}List all the stored gift cards for a specific buyer.
using Gr4vy;
using Gr4vy.Models.Components;
var sdk = new Gr4vySDK(
id: "example",
server: SDKConfig.Server.Sandbox,
bearerAuthSource: Auth.WithToken(privateKey),
merchantAccountId: "default"
);
var res = await sdk.Buyers.GiftCards.ListAsync();
// 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 or embed 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. The ID of the merchant account to use for this request.
"default"
Successful Response
A list of items returned for this request.
Show child attributes
The ID of the merchant account this buyer belongs to.
The first 6 digits of the full gift card number.
The 3 digits after the bin of the full gift card number.
The last 4 digits for the gift card.
Always gift-card.
"gift-card"The ID for the gift card.
"356d56e5-fe16-42ae-97ee-8d55d846ae2e"
The ISO-4217 currency code that this gift card has a balance for.
"AUD"
The date and time when this gift card expires. This is a full date/time and may be more accurate than the actual expiry date received by the gift card service.
"2013-07-16T19:23:00.000+00:00"
The amount remaining on the balance for this gift card according to the gift card service. This may be null if the balance could not be fetched.
1299
If the last balance update failed, this will contain the internal code for this error.
invalid_gift_card, expired_card, inactive_card, invalid_service_credentials, invalid_amount, incorrect_currency, insufficient_funds, invalid_service_configuration, operation_canceled, service_error, service_network_error, unknown_error, max_gift_cards_reached "incorrect_currency"
If the last balance update failed, this will contain the the raw error code received from the gift card provider.
"10363"
If the last balance update failed, this will contain the the raw error message received from the gift card provider.
"This currency is not supported by the merchant."
Was this page helpful?