> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# GetTipChoice

# Package: tips

# Namespace: TipsService

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/other-services/tips/tips/get-tip-choice?apiView=SDK.md

## Permission Scopes:
Manage Bookings: SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS

## Introduction

Retrieves the tip choice that's currently selected by the customer for a specific eCommerce checkout ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction.md)).
If the customer hasn't yet selected a tip choice, the response is empty.

Please refer to the Sample Flows for more information.

---

## REST API

### Schema

```
 Method: getTipChoice
 Description: Retrieves the tip choice that's currently selected by the customer for a specific eCommerce checkout ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction.md)). If the customer hasn't yet selected a tip choice, the response is empty.  Please refer to the Sample Flows for more information.
 URL: https://www.wixapis.com/tips/v1/tips/choice/{purchaseFlowId}
 Method: GET
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  purchaseFlowId
 Method parameters: 
   param name: purchaseFlowId | type:   none | required: true 
 Return type: GetTipChoiceResponse
  - name: tipChoice | type: TipChoice | description: Tip choice that's currently selected for the given purchase flow.  
     - name: value | type: string | description: Value of the tip choice.  | validation: format DECIMAL_VALUE, decimalValue {"gte":"0","maxScale":2}
     - name: tipType | type: TipType | description: Type of the tip choice.  
         - enum:
         -     UNKNOWN_TIP_TYPE: There is no information about the tip type.
         -     PERCENTAGE: The tip is calculated as a percentage of the subtotal of associated line items.
         -     AMOUNT: The tip is a fixed value, pre-configured from the relevant settings presets.
         -     CUSTOM: The customer, or the business on behalf of the customer, manually set a tip amount, which may not match any preset values.

 Possible Errors:
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: PERSON_IDENTITY_NOT_FOUND | Description: Couldn't find the person identity.


```

### Examples

### Get tip choice
```curl
curl -X GET \
'https://www.wixapis.com/tips-service/v1/tips/choice/{purchase_flow_id}' \
-H 'Authorization: <AUTH>
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.ecom.tips.getTipChoice(purchaseFlowId)
 Description: Retrieves the tip choice that's currently selected by the customer for a specific eCommerce checkout ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction.md)). If the customer hasn't yet selected a tip choice, the response is empty.  Please refer to the Sample Flows for more information.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  purchaseFlowId
 Method parameters: 
   param name: purchaseFlowId | type: string | description: GUID of the purchase flow that's associated with the eCommerce order ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/order-object.md)).  The purchase flow GUID is a persistent GUID that correlates between the various eCommerce elements: cart, checkout, and order. | required: true | validation: format GUID
 Return type: PROMISE<GetTipChoiceResponse>
  - name: tipChoice | type: TipChoice | description: Tip choice that's currently selected for the given purchase flow.  
     - name: value | type: string | description: Value of the tip choice.  | validation: format DECIMAL_VALUE, decimalValue {"gte":"0","maxScale":2}
     - name: tipType | type: TipType | description: Type of the tip choice.  
         - enum:
         -     UNKNOWN_TIP_TYPE: There is no information about the tip type.
         -     PERCENTAGE: The tip is calculated as a percentage of the subtotal of associated line items.
         -     AMOUNT: The tip is a fixed value, pre-configured from the relevant settings presets.
         -     CUSTOM: The customer, or the business on behalf of the customer, manually set a tip amount, which may not match any preset values.

 Possible Errors:
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: PERSON_IDENTITY_NOT_FOUND | Description: Couldn't find the person identity.


```

### Examples

### getTipChoice
```javascript
import { tips } from '@wix/ecom';

async function getTipChoice(purchaseFlowId) {
  const response = await tips.getTipChoice(purchaseFlowId);
};
```

### getTipChoice (with elevated permissions)
```javascript
import { tips } from '@wix/ecom';
import { auth } from '@wix/essentials';

async function myGetTipChoiceMethod(purchaseFlowId) {
  const elevatedGetTipChoice = auth.elevate(tips.getTipChoice);
  const response = await elevatedGetTipChoice(purchaseFlowId);
}
```

### getTipChoice (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { tips } from '@wix/ecom';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { tips },
  // Include the auth strategy and host as relevant
});


async function getTipChoice(purchaseFlowId) {
  const response = await myWixClient.tips.getTipChoice(purchaseFlowId);
};
```

---