View Transactions
getUserPurchases
To view historical gift card purchases and virtual cards on your account, use the getUserPurchases
query. The query requires LIST_PURCHASES
scope. This query response can get bulky, so we ask you to provide a pagination input, and an optional filter input:
Pagination Input
The OffsetInput
argument is used to manage pagination in API responses, allowing you to control how many items are returned per page and how many items should be skipped from the beginning of the list.
Fields
limit
(Int): This field specifies the number of items to return per page. The maximum number of items you can request per page is 20. If you do not specify a value for limit, it will default to 20.
offset
(Int): This field specifies the number of items to skip before starting to return the items. If you do not specify a value for offset, it will default to 0, meaning it will start from the first item in the list.
Filter Input
The UserPurchaseFilterInput
argument is used to filter the purchases returned in the response. It allows you to retrieve purchases made by the user associated to your app, or purchases made under the account associated to your app, etc. It is optional. If it is not provided, the response will return purchases made by the user associated to your app, across all accounts.
Fields
scope
(Array of PurchaseScopeFilter
): This field specifies the type of filter to use.
PurchaseScopeFilter
enum
PurchaseScopeFilter
enum- TOKEN_USER: filter based on userId
- TOKEN_ACCOUNT: filter based on accountId
Examples
// QUERY VARIABLES
// returns purchases made by the user across all accounts
{
"filter": {
"scope": ["TOKEN_USER"]
}
}
// QUERY VARIABLES
// returns purchases made under the account across all users
{
"filter": {
"scope": ["TOKEN_ACCOUNT"]
}
}
// QUERY VARIABLES
// returns purchases made by the user and account
{
"filter": {
"scope": ["TOKEN_USER", "TOKEN_ACCOUNT"]
}
}
Response
When you run this query, it will respond with an array of your historical gift card purchases and generated virtual cards.
{
"data": {
"getUserPurchases": [
{
"purchaseId": "255f8245-02c7-4817-901e-15fe265f6968",
"purchaseDisplayId": "1019688",
"purchaseBankCardId": "255f8245-02c7-4817-901e-15fe265f6968",
"bankAccountId": "255f8245-02c7-4817-901e-15fe265f6968",
"purchaseAmount": 987.65,
"fluzpayAmount": 123.45,
"seatRewardValue": 987.65,
"paypalVaultId": "255f8245-02c7-4817-901e-15fe265f6968",
"createdAt": "2007-12-03T10:15:30Z",
"purchaserUserId": "4c42e368-d150-492d-8dec-6cda1b58ffa9",
"accountId": "d67af480-21dc-4c23-93ff-3b7288e52e1a",
"giftCard": {
// GiftCardFragment details
},
"virtualCard": {
// VirtualCardFragment details
}
},
{
"purchaseId": "4f4b3c5d-6f7e-8a9b-0c1d-23e4f5678a90",
"purchaseDisplayId": "1019688",
"purchaseBankCardId": "4f4b3c5d-6f7e-8a9b-0c1d-23e4f5678a90",
"bankAccountId": "4f4b3c5d-6f7e-8a9b-0c1d-23e4f5678a90",
"purchaseAmount": 250.00,
"fluzpayAmount": 50.00,
"seatRewardValue": 10.00,
"paypalVaultId": "4f4b3c5d-6f7e-8a9b-0c1d-23e4f5678a90",
"createdAt": "2024-01-10T08:20:00Z",
"giftCard": {
// GiftCardFragment details
},
"virtualCard": {
// VirtualCardFragment details
}
},
{
"purchaseId": "7e8f9a0b-1c2d-3e4f-5g6h-789i0jklm1no",
"purchaseDisplayId": "1019688",
"purchaseBankCardId": "7e8f9a0b-1c2d-3e4f-5g6h-789i0jklm1no",
"bankAccountId": "7e8f9a0b-1c2d-3e4f-5g6h-789i0jklm1no",
"purchaseAmount": 450.75,
"fluzpayAmount": 75.00,
"seatRewardValue": 30.00,
"paypalVaultId": "7e8f9a0b-1c2d-3e4f-5g6h-789i0jklm1no",
"createdAt": "2024-02-15T14:45:00Z",
"giftCard": {
// GiftCardFragment details
},
"virtualCard": {
// VirtualCardFragment details
}
}
]
}
}
Fields in the UserPurchase Object
Field name | Type | Description |
---|---|---|
purchaseId | String | A unique identifier for the purchase. |
purchaseDisplayId | String | The display ID of the purchase. |
purchaseBankCardId | String | The identifier of the bank card used for the purchase. |
bankAccountId | String | The identifier of the bank account associated with the purchase. |
purchaseAmount | Float | The total amount spent in the purchase. |
fluzpayAmount | Float | The amount of available Fluz balance used in the transaction. |
seatRewardValue | Float | The value of any network seat rewards generated from the purchase. |
paypalVaultId | String | The identifier of the PayPal vault used for the purchase. |
createdAt | DateTime | The timestamp indicating when the purchase was made. |
purchaserUserId | String | The identifier of the user who made the purchase. |
accountId | String | The identifier of the account who made the purchase. |
giftCard | GiftCard | Contains details about any gift card used in the purchase, represented by the GiftCardFragment. |
virtualCard | VirtualCard | Contains details about any virtual card used in the purchase, represented by the VirtualCardFragment. |
Want to learn more? Contact us at [email protected]
Speak with our experts for more info or to request a demo.
Updated 7 days ago