接口访问需要令牌,具体如何获取令牌请参考:身份认证
查询单个客户下的礼品卡,包括其礼品卡卡号、当前余额、到期时间和当前状态等。
Arguments
customerAccessToken ● String!non-null
客户访问令牌
Return
cardStatus ● CardStatus
礼品卡当前状态
More
code ● String
礼品卡卡号
createdAt ● Date
礼品卡创建时间
currentBalance ● UnsignedInt64
礼品卡当前余额
expiryDate ● Date
礼品卡到期时间
originalValue ● UnsignedInt64
礼品卡面额
错误码
关于更多通用错误码说明,参考:状态码和错误码
Example
查询礼品卡信息
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.pixiu.pcq.storefront.api.CollectionStorefrontQueryService-queryCollectionByProduct": {
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionRatio": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0,
"batchLoadExceptionCount": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.DescriptionQueryService-query": {
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0,
"batchLoadCount": 0,
"batchLoadRatio": 0,
"batchInvokeCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.ProductStorefrontQueryV2Service-images": {
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.ProductStorefrontQueryV2Service-onlineStoreUrl": {
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorRatio": 0,
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"loadErrorCount": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.ProductStorefrontQueryV2Service-publishedAtForLoader": {
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorRatio": 0,
"batchInvokeCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"loadErrorCount": 0,
"batchLoadCount": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.ProductStorefrontQueryV2Service-template": {
"loadErrorCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0,
"loadErrorRatio": 0,
"batchInvokeCount": 0,
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.ProductStorefrontQueryV2Service-variants": {
"batchInvokeCount": 0,
"cacheHitRatio": 0,
"loadErrorRatio": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"loadCount": 0,
"loadErrorCount": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.ProductStorefrontQueryV2Service-variantsForLoader": {
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadErrorRatio": 0,
"batchInvokeCount": 0,
"batchLoadCount": 0,
"loadCount": 0,
"loadErrorCount": 0
},
"LD-com.shopline.merchant.website.openapi.interfaces.OnlineStorefrontApi-commentsQuery": {
"loadErrorCount": 0,
"cacheHitCount": 0,
"loadErrorRatio": 0,
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"batchLoadRatio": 0,
"cacheHitRatio": 0,
"loadCount": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.CollectionStorefrontQueryService-onlineStoreUrl": {
"batchInvokeCount": 0,
"batchLoadCount": 0,
"batchLoadRatio": 0,
"loadCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadErrorCount": 0,
"loadErrorRatio": 0
},
"LD-com.shopline.pixiu.pcq.storefront.api.ProductStorefrontQueryV2Service-options": {
"loadErrorRatio": 0,
"batchInvokeCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadExceptionRatio": 0,
"loadErrorCount": 0,
"batchLoadCount": 0,
"batchLoadRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"loadCount": 0
}
},
"overall-statistics": {
"batchLoadCount": 0,
"batchLoadExceptionRatio": 0,
"cacheHitCount": 0,
"cacheHitRatio": 0,
"batchInvokeCount": 0,
"batchLoadExceptionCount": 0,
"batchLoadRatio": 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": {
"tenant": "ec20",
"executionId": "e5efdfb6-c109-4b40-9e5c-714179e61226",
"rt": 72,
"version": "v20241201",
"appId": "265337",
"fieldCount": 19,
"merchantId": "4200114610",
"ratelimitPermits": 1,
"appKey": "936eda168305ed82cee702c6822354ee6de2e802",
"clientIp": "218.253.130.212",
"includeDeprecatedField": false,
"operation": "QUERY",
"storeId": "1641993455937",
"loaderCount": 0,
"parseRt": 0,
"saleChannel": null,
"countryCode": null,
"customizedClientIp": "218.253.130.212",
"errorFieldsCount": 0,
"ratelimitRemaining": 1,
"startTimeMillis": 1721889373559,
"storePlus": false,
"traceId": "683d3d9e0d263633bd7acb7654fc6de8",
"deepLevel": 2,
"endParseTimeMillis": 1721889373560,
"startParseTimeMillis": 1721889373560,
"languageCode": null,
"includeQuery": false,
"namespace": "storefront",
"successType": "SUCCESS"
}
},
"tracing": {
"duration": 71484876,
"endTime": "2024-07-25T06:36:13.631Z",
"execution": {
"resolvers": [
{
"duration": 68779632,
"fieldName": "giftCardInfo",
"parentType": "Query",
"path": [
"giftCardInfo"
],
"returnType": "[GiftCardInfo]",
"startOffset": 2218402
},
{
"startOffset": 71143376,
"duration": 8407,
"fieldName": "code",
"parentType": "GiftCardInfo",
"path": [
"giftCardInfo",
0,
"code"
],
"returnType": "String"
},
{
"returnType": "Date",
"startOffset": 71172324,
"duration": 2942,
"fieldName": "expiryDate",
"parentType": "GiftCardInfo",
"path": [
"giftCardInfo",
0,
"expiryDate"
]
},
{
"startOffset": 71193590,
"duration": 2782,
"fieldName": "currentBalance",
"parentType": "GiftCardInfo",
"path": [
"giftCardInfo",
0,
"currentBalance"
],
"returnType": "UnsignedInt64"
},
{
"fieldName": "originalValue",
"parentType": "GiftCardInfo",
"path": [
"giftCardInfo",
0,
"originalValue"
],
"returnType": "UnsignedInt64",
"startOffset": 71215556,
"duration": 2486
},
{
"duration": 2183,
"fieldName": "cardStatus",
"parentType": "GiftCardInfo",
"path": [
"giftCardInfo",
0,
"cardStatus"
],
"returnType": "CardStatus",
"startOffset": 71232324
},
{
"parentType": "GiftCardInfo",
"path": [
"giftCardInfo",
0,
"createdAt"
],
"returnType": "Date",
"startOffset": 71249956,
"duration": 2310,
"fieldName": "createdAt"
},
{
"duration": 2328,
"fieldName": "code",
"parentType": "GiftCardInfo",
"path": [
"giftCardInfo",
1,
"code"
],
"returnType": "String",
"startOffset": 71322598
},
{
"returnType": "Date",
"startOffset": 71337392,
"duration": 2275,
"fieldName": "expiryDate",
"parentType": "GiftCardInfo",
"path": [
"giftCardInfo",
1,
"expiryDate"
]
},
{
"returnType": "UnsignedInt64",
"startOffset": 71356131,
"duration": 2286,
"fieldName": "currentBalance",
"parentType": "GiftCardInfo",
"path": [
"giftCardInfo",
1,
"currentBalance"
]
},
{
"returnType": "UnsignedInt64",
"startOffset": 71370724,
"duration": 2158,
"fieldName": "originalValue",
"parentType": "GiftCardInfo",
"path": [
"giftCardInfo",
1,
"originalValue"
]
},
{
"duration": 2144,
"fieldName": "cardStatus",
"parentType": "GiftCardInfo",
"path": [
"giftCardInfo",
1,
"cardStatus"
],
"returnType": "CardStatus",
"startOffset": 71385028
},
{
"parentType": "GiftCardInfo",
"path": [
"giftCardInfo",
1,
"createdAt"
],
"returnType": "Date",
"startOffset": 71399456,
"duration": 2298,
"fieldName": "createdAt"
}
]
},
"parsing": {
"duration": 281955,
"startOffset": 329322
},
"startTime": "2024-07-25T06:36:13.559Z",
"validation": {
"duration": 304732,
"startOffset": 785329
},
"version": 1
}
}
}
这篇文章对你有帮助吗?