GraphQL objects reference
This section outlines the GraphQL objects related to store credit, detailing their attributes and how they interact with carts and customers.
To download Credit GraphQl collection press this download
Cart object
The Cart
object represents a customer's shopping cart and contains store credit details.
Attribute | Data Type | Description |
---|---|---|
credit | CartCredit | Store credit information associated with the cart |
CartCredit object
The CartCredit
object defines store credit details applied to a cart.
Attribute | Data Type | Description |
---|---|---|
amount | Money | The amount of store credit applied to the cart |
is_applied | Boolean | Indicates whether store credit has been applied |
Customer object
The Customer
object stores customer-related details, including name, address, and store credit information.
Attribute | Data Type | Description |
---|---|---|
credit | Credit | Store credit details associated with the customer |
Credit object
The Credit
object contains store credit information specific to a customer.
Attribute | Data Type | Description |
---|---|---|
balance | CreditBalance | Store credit balance details |
transactions | [CreditTransaction] | List of store credit transactions |
CreditBalance object
The CreditBalance
object provides details about a customer's store credit balance.
Attribute | Data Type | Description |
---|---|---|
amount | Money | Current store credit balance |
currency_code | String | Currency code for the balance |
CreditTransaction object
The CreditTransaction
object defines store credit transaction details.
Attribute | Data Type | Description |
---|---|---|
action | String | Type of store credit transaction (e.g., addition, deduction) |
balance_amount | Money | Store credit balance after the transaction |
balance_delta | Money | Amount added or deducted in the transaction |
created_at | String | Timestamp of the transaction |
currency_code | String | Currency code for the transaction |
is_notified | Boolean | Indicates if the customer was notified of the transaction |
message | String | Description of the transaction |
transaction_id | Int | Unique identifier for the transaction |
Mutation object
The Mutation
object defines operations that modify store credit data.
Attribute | Data Type | Description |
---|---|---|
applyCreditToCart | ApplyCreditToCartOutput | Applies store credit to the cart |
ApplyCreditToCartInput object
The ApplyCreditToCartInput
object specifies the input parameters for the applyCreditToCart
mutation.
Attribute | Data Type | Description |
---|---|---|
amount | Float | Amount of store credit to apply |
cart_id | String! | Unique identifier of the customer's cart |
ApplyCreditToCartOutput object
The ApplyCreditToCartOutput
object defines the response of the applyCreditToCart
mutation.
Attribute | Data Type | Description |
---|---|---|
cart | Cart! | Updated cart details after applying store credit |