An access token is required to call this API. Refer to Authorization for more information about how to obtain the token.
Query a single customer's gift cards, including their gift card number, current balance, expiration date, and current status.
Arguments
customerAccessToken ● String!non-null
customer Access Token
Returns
cardStatus ● CardStatus
Current status of gift card
code ● String
Gift card code
createdAt ● Date
Time to create this record
currentBalance ● UnsignedInt64
Current balance of gift card
expiryDate ● Date
Gift card expiration time
originalValue ● UnsignedInt64
The original value of gift card
Error Code
For more information about common error codes, refer to Status and error codes.
Example
query giftCard Info
query {
giftCardInfo(customerAccessToken: "#A01#SID0000107BFtXMBlyur1bUgz8HQ7Vi9lQOkT4kXELZOkxlc67dSOPxelgAPrqJh6ksFYHK2D59u9Rk87uTVEY06k4wsOtqd5qxpM8LQ8rcz9RkKQv3aSVwcBzDbhohwVN0sHHLP/3IhqZLhQEQ099BsUc/isnWOUFu9mufoeOIuJFADGqBLnqomPq6osfQsGev0VLZpD6Aw") {
code
expiryDate
currentBalance
originalValue
cardStatus
createdAt
}
}
Response
{
"data": {
"giftCardInfo": [
{
"cardStatus": "ACTIVE",
"code": "gid://shopline/GiftCard/c94dc01491670a26",
"createdAt": "2024-07-25T05:25:12Z",
"currentBalance": "5000",
"expiryDate": null,
"originalValue": "5000"
},
{
"cardStatus": "ACTIVE",
"code": "gid://shopline/GiftCard/e47ec17f34f11dad",
"createdAt": "2024-07-25T05:25:12Z",
"currentBalance": "5000",
"expiryDate": null,
"originalValue": "5000"
}
]
},
"extensions": {
"dataloader": {
"individual-statistics": {
"LD-com.shopline.merchant.website.openapi.interfaces.OnlineStorefrontApi-commentsQuery": {
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.CollectionStorefrontQueryService-onlineStoreUrl": {
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.CollectionStorefrontQueryService-queryCollectionByProduct": {
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.DescriptionQueryService-query": {
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.ProductStorefrontQueryV2Service-images": {
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.ProductStorefrontQueryV2Service-onlineStoreUrl": {
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.ProductStorefrontQueryV2Service-options": {
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.ProductStorefrontQueryV2Service-publishedAtForLoader": {
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.ProductStorefrontQueryV2Service-template": {
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.ProductStorefrontQueryV2Service-variants": {
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.ProductStorefrontQueryV2Service-variantsForLoader": {
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0
}
},
"overall-statistics": {
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0
}
},
"metrics": {
"dataFetcherMetrics": [
{
"dfErrorCode": null,
"dfProtocol": "dubbo",
"dfRootCoordinate": "/giftCardInfo",
"dfRt": 68,
"dfServiceIdentity": "com.shopline.ec.openapi.interfaces.MemberStoreFrontApi@giftCardList",
"dfStartTime": 1721889373562
}
],
"graphQLMetrics": {
"appId": "265337",
"appKey": "936eda168305ed82cee702c6822354ee6de2e802",
"clientIp": "218.253.130.212",
"countryCode": null,
"customizedClientIp": "218.253.130.212",
"deepLevel": 2,
"endParseTimeMillis": 1721889373560,
"errorFieldsCount": 0,
"executionId": "e5efdfb6-c109-4b40-9e5c-714179e61226",
"fieldCount": 19,
"includeDeprecatedField": false,
"includeQuery": false,
"languageCode": null,
"loaderCount": 0,
"merchantId": "4200114610",
"namespace": "storefront",
"operation": "QUERY",
"parseRt": 0,
"ratelimitPermits": 1,
"ratelimitRemaining": 1,
"rt": 72,
"saleChannel": null,
"startParseTimeMillis": 1721889373560,
"startTimeMillis": 1721889373559,
"storeId": "1641993455937",
"storePlus": false,
"successType": "SUCCESS",
"tenant": "ec20",
"traceId": "683d3d9e0d263633bd7acb7654fc6de8",
"version": "v20241201"
}
},
"tracing": {
"duration": 71484876,
"endTime": "2024-07-25T06:36:13.631Z",
"execution": {
"resolvers": [
{
"duration": 68779632,
"fieldName": "giftCardInfo",
"parentType": "Query",
"path": [
"giftCardInfo"
],
"returnType": "[GiftCardInfo]",
"startOffset": 2218402
},
{
"duration": 8407,
"fieldName": "code",
"parentType": "GiftCardInfo",
"path": [
"giftCardInfo",
0,
"code"
],
"returnType": "String",
"startOffset": 71143376
},
{
"duration": 2942,
"fieldName": "expiryDate",
"parentType": "GiftCardInfo",
"path": [
"giftCardInfo",
0,
"expiryDate"
],
"returnType": "Date",
"startOffset": 71172324
},
{
"duration": 2782,
"fieldName": "currentBalance",
"parentType": "GiftCardInfo",
"path": [
"giftCardInfo",
0,
"currentBalance"
],
"returnType": "UnsignedInt64",
"startOffset": 71193590
},
{
"duration": 2486,
"fieldName": "originalValue",
"parentType": "GiftCardInfo",
"path": [
"giftCardInfo",
0,
"originalValue"
],
"returnType": "UnsignedInt64",
"startOffset": 71215556
},
{
"duration": 2183,
"fieldName": "cardStatus",
"parentType": "GiftCardInfo",
"path": [
"giftCardInfo",
0,
"cardStatus"
],
"returnType": "CardStatus",
"startOffset": 71232324
},
{
"duration": 2310,
"fieldName": "createdAt",
"parentType": "GiftCardInfo",
"path": [
"giftCardInfo",
0,
"createdAt"
],
"returnType": "Date",
"startOffset": 71249956
},
{
"duration": 2328,
"fieldName": "code",
"parentType": "GiftCardInfo",
"path": [
"giftCardInfo",
1,
"code"
],
"returnType": "String",
"startOffset": 71322598
},
{
"duration": 2275,
"fieldName": "expiryDate",
"parentType": "GiftCardInfo",
"path": [
"giftCardInfo",
1,
"expiryDate"
],
"returnType": "Date",
"startOffset": 71337392
},
{
"duration": 2286,
"fieldName": "currentBalance",
"parentType": "GiftCardInfo",
"path": [
"giftCardInfo",
1,
"currentBalance"
],
"returnType": "UnsignedInt64",
"startOffset": 71356131
},
{
"duration": 2158,
"fieldName": "originalValue",
"parentType": "GiftCardInfo",
"path": [
"giftCardInfo",
1,
"originalValue"
],
"returnType": "UnsignedInt64",
"startOffset": 71370724
},
{
"duration": 2144,
"fieldName": "cardStatus",
"parentType": "GiftCardInfo",
"path": [
"giftCardInfo",
1,
"cardStatus"
],
"returnType": "CardStatus",
"startOffset": 71385028
},
{
"duration": 2298,
"fieldName": "createdAt",
"parentType": "GiftCardInfo",
"path": [
"giftCardInfo",
1,
"createdAt"
],
"returnType": "Date",
"startOffset": 71399456
}
]
},
"parsing": {
"duration": 281955,
"startOffset": 329322
},
"startTime": "2024-07-25T06:36:13.559Z",
"validation": {
"duration": 304732,
"startOffset": 785329
},
"version": 1
}
}
}
Was this article helpful to you?