Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

GraphQL: Update customer/cart/store config queries to include reward points #7655

Merged
merged 2 commits into from
Aug 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/_includes/graphql/cart-object-24.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Attribute | Data Type | Description
`applied_coupon` | [`AppliedCoupon`][AppliedCoupon] | Deprecated. Use `applied_coupons` instead
`applied_coupons` | [[`AppliedCoupon`]][AppliedCoupon] | An array of `AppliedCoupon` objects. Each object contains the `code` text attribute, which specifies the coupon code
`applied_gift_cards` | [[`AppliedGiftCard`]][AppliedGiftCard] | An array of `AppliedGiftCard` objects. An `AppliedGiftCard` object contains the `code` text attribute, which specifies the gift card code. `applied_gift_cards` is a Commerce-only attribute, defined in the GiftCardAccountGraphQl module
`applied_reward_points`| [`RewardPointsAmount`][RewardPointsAmount] | The amount of reward points applied to the cart
`applied_store_credit` | [`AppliedStoreCredit`][AppliedStoreCredit] | Contains store credit information applied to the cart. `applied_store_credit` is a Commerce-only attribute, defined in the CustomerBalanceGraphQl module
`available_payment_methods` | [[AvailablePaymentMethod]][AvailablePaymentMethod] | Available payment methods
`billing_address` | [BillingCartAddress][BillingCartAddress] | Contains the billing address specified in the customer's cart
Expand All @@ -24,5 +25,6 @@ Attribute | Data Type | Description
[CartItemInterface]: {{page.baseurl}}/graphql/queries/cart.html#CartItemInterface
[CartPrices]: {{page.baseurl}}/graphql/queries/cart.html#CartPrices
[GiftMessage]: {{page.baseurl}}/graphql/queries/cart.html#GiftMessage
[RewardPointsAmount]: {{page.baseurl}}/graphql/queries/cart.html#RewardPointsAmount
[SelectedPaymentMethod]: {{page.baseurl}}/graphql/queries/cart.html#SelectedPaymentMethod
[ShippingCartAddress]: {{page.baseurl}}/graphql/queries/cart.html#ShippingCartAddress
58 changes: 58 additions & 0 deletions src/_includes/graphql/customer-orders-output.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,64 @@ Attribute | Data type | Description
`name` | String! | The label that describes the payment method
`type` | String! | The payment method code that indicates how the order was paid for

#### RewardPoints attributes {#RewardPoints}

The `RewardPoints` object provides details about the customer's reward points balance, history, and related information.

Attribute | Data type | Description
--- | --- | ---
`balance`| [RewardPointsAmount](#RewardPointsAmount) | The current balance of reward points
`balance_history` | [[RewardPointsBalanceHistoryItem]](#RewardPointsBalanceHistoryItem) | The balance history of reward points. If the ability for customers to view the balance history has been disabled in the Admin, this field will be set to null
`exchange_rates`| [RewardPointsExchangeRates](#RewardPointsExchangeRates) | The current exchange rates for reward points
`subscription_status` | [RewardPointsSubscriptionStatus](#RewardPointsSubscriptionStatus) | The subscription status of emails related to reward points

#### RewardPointsAmount attributes {#RewardPointsAmount}

The `RewardPointsAmount` object lists the customer's current reward points balance.

Attribute | Data type | Description
--- | --- | ---
`money` | Money! | The amount of reward points, expressed in the currency of the store
`points` | Float! | The amount of reward points, expressed in points

#### RewardPointsBalanceHistoryItem {#RewardPointsBalanceHistoryItem}

The `RewardPointsBalanceHistoryItem` object contains details about individual events in which the customer earned or redeemed reward points.

Attribute | Data type | Description
--- | --- | ---
`balance` | [RewardPointsAmount](#RewardPointsAmount) | Reward points balance after the completion of the transaction
`change_reason` | String! | The reason the balance changed
`date` | String! | Transaction date
`points_change` | Float! | The number of points added or deducted in the transaction

#### RewardPointsExchangeRates attributes {#RewardPointsExchangeRates}

The `RewardPointsExchangeRates` object contains information needed to exchange reward points into the store's currency. Exchange rates depend on the customer group.

Attribute | Data type | Description
--- | --- | ---
`earning` | [RewardPointsRate](#RewardPointsRate) | The number of points earned for the amount spent
`redemption` | [RewardPointsRate](#RewardPointsRate) | The number points must be redeemed to get a currency discount at checkout

#### RewardPointsRate attributes {#RewardPointsRate}

The `RewardPointsRate` object contains details about reward points exchange rates.

Attribute | Data type | Description
--- | --- | ---
`currency_amount` | Float! | The monetary value of the exchange rate. For earnings, this is amount spent to earn the specified points. For redemptions, this is the amount of money the number of points represents
`points` | Float! | The number of points for the exchange rate. For earnings, this is the number of points earned. For redemptions, this is the number of points needed for to redeem points

#### RewardPointsSubscriptionStatus attributes {#RewardPointsSubscriptionStatus}

The `RewardPointsSubscriptionStatus` object indicates whether the customer is subscribed to newsletters that provide reward points balances and expiration notifications. The possible values of these attribtutes are `NOT SUBSCRIBED` and `SUBSCRIBED`.

Attribute | Data type | Description
--- | --- | ---
`balance_updates` | RewardPointsSubscriptionStatusesEnum! | Customer subscription status to 'Reward points balance updates' emails
`points_expiration_notifications` | RewardPointsSubscriptionStatusesEnum! | Customer subscription status to 'Reward points expiration notifications' emails

#### SalesItemOption attributes {#SalesItemOption}

The `SalesItemOption` data type contains the ID and value for the selected or entered options.
Expand Down
1 change: 1 addition & 0 deletions src/_includes/graphql/customer-output-24.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Attribute | Data Type | Description
`middlename` |String | The customer's middle name
`orders(<FilterCriteria>)` | {{ customeroutput_text }} | A list of the customer's placed orders{{ crossref_text }}
`prefix` | String | An honorific, such as Dr., Mr., or Mrs.
`reward_points` | RewardPoints | Details about the customer's reward points
`suffix` | String | A value such as Sr., Jr., or III
`taxvat` | String | The customer's Tax/VAT number (for corporate customers)
`wishlist` | Wishlist! | Contains the contents of the customer's wish lists
9 changes: 9 additions & 0 deletions src/guides/v2.4/graphql/queries/cart.md
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,15 @@ Attribute | Data Type | Description
`message` | String! | The gift message text
`to` | String! | Identifies the recipient

### RewardPointsAmount {#RewardPointsAmount}

The `RewardPointsAmount` object must contain the following attributes.

Attribute | Data Type | Description
--- | --- | ---
`points` | Float! | The amount of reward points, in points
`money` | Money! | The amount of reward points, in the store's currency

### SelectedPaymentMethod object {#SelectedPaymentMethod}

The `SelectedPaymentMethod` object can contain the following attributes.
Expand Down
20 changes: 19 additions & 1 deletion src/guides/v2.4/graphql/queries/store-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ Attribute | Data Type | Description | Example
`catalog_default_sort_by` | String | The default sort order of the search results list | `position`
`category_url_suffix` | String | The suffix applied to category pages, such as `.htm` or `.html` | `.html`
`grid_per_page` | Int | The default number of products per page in Grid View | `9`
`grid_per_page_values` | A list of numbers that define how many products can be displayed in List View | `9,15,30`
`grid_per_page_values` | String | A list of numbers that define how many products can be displayed in List View | `9,15,30`
`list_mode` | String | The format of the search results list | `grid-list`
`list_per_page` | Int | The default number of products per page in List View | `10`
`list_per_page_values` | String | A list of numbers that define how many products can be displayed in List View | `5,10,15,20,25`
Expand All @@ -340,6 +340,24 @@ Attribute | Data Type | Description | Configuration path | Default Value
`allow_order` | String | Allows gift messages at the order level. Possible values: 1 (Yes) and 0 (No). | sales/gift_options/allow_order | 0
`allow_items` | String | Allows gift messages for order items. Possible values: 1 (Yes) and 0 (No). | sales/gift_options/allow_items | 0

### Supported reward points attributes

Attribute | Data Type | Description | Default Value
--- | --- | ---
`magento_reward_general_is_enabled` | String | Indicates whether reward points are enabled. | `1` (enabled)
`magento_reward_general_is_enabled_on_front` | String | Indicates whether reward points functionality is enabled on the storefront | `1` (enabled)
`magento_reward_general_min_points_balance` | String | The minimum point balance customers must have before they can redeem them. A null value indicates no minimum | null
`magento_reward_general_publish_history` | String | When enabled, customers can see a detailed history of their reward points | `1` (enabled)
`magento_reward_points_invitation_customer` | String | The number of points for a referral when the invitee registers on the site | null
`magento_reward_points_invitation_customer_limit` | String | The maximum number of registration referrals that qualify for rewards. A null value indicates no limit | null
`magento_reward_points_invitation_order` | String | The number of points for a referral when the invitee places their first order on the site | null
`magento_reward_points_invitation_order_limit` | String | The number of order conversions that can earn points for the customer who sends the invitation. A null value indicates no limit | null
`magento_reward_points_newsletter` | String | The number of points earned by registered customers who subscribe to a newsletter | null
`magento_reward_points_order` | String | Indicates whether customers earn points for shopping according to the reward point exchange rate. In Luma, this also controls whether to show a message in the shopping cart about the rewards points earned for the purchase, as well as the customer’s current reward point balance | null
`magento_reward_points_register` | String | The number of points a customer gets for registering | null
`magento_reward_points_review` | String | The number of points for writing a review | null
`magento_reward_points_review_limit` | String | The maximum number of reviews that qualify for rewards. A null value indicates no limit | null

### Supported WEEE (fixed product tax) attributes

The **Stores** > Settings > **Configuration** > **Sales** > **Tax** > **Fixed Product Taxes** panel contains several fields that determine how to display fixed product tax (FPT) values and descriptions. Use the following attributes to determine the values of the **Fixed Product Taxes** fields. These attributes are defined in the `WeeeGraphQl` module.
Expand Down