The `PurchaseTypeCard` component allows users to select whether the shipping rates are applied to one time purchases or recurring purchases.
This component is used when creating a shipping discount.
## Example code
```jsx?title:'MyApp.jsx'
import React, { useState } from "react";
import {
PurchaseTypeCard,
PurchaseType,
} from "@shopify/discount-app-components";
function MyApp() {
const [purchaseType, setPurchaseType] = useState(
PurchaseType.OneTimePurchase
);
return (
);
}
```
## Properties
|Name|Type|Description|Required|
|---|---|---|---|
|purchaseType|`Field`|The selected purchase type.|Yes|
## PurchaseType
|Name|Value|Description|
|---|---|---|
|`OneTimePurchase`|`ONE_TIME_PURCHASE`|For one time purchases only.|
|`Subscription`|`SUBSCRIPTION`|For subscription purchases only.|
|`Both`|`BOTH`|Eligible for both one time purchase and subscription purchases.|