> ## Documentation Index
> Fetch the complete documentation index at: https://www.marqeta.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Reward Rules Management

> Use the `/credit/rewards/rules` endpoint to manage and monitor the rules configurations for a reward program.

export const EndpointCard = ({method = "API", title, children, href, arrow = true}) => {
  const METHOD_STYLES = {
    GET: {
      bg: "mint-bg-green-400/20 dark:mint-bg-green-400/20",
      text: "mint-text-green-700 dark:mint-text-green-400",
      border: "mint-border-green-300 dark:mint-border-green-700"
    },
    POST: {
      bg: "mint-bg-blue-400/20 dark:mint-bg-blue-400/20",
      text: "mint-text-blue-700 dark:mint-text-blue-400"
    },
    PUT: {
      bg: "mint-bg-yellow-400/20 dark:mint-bg-yellow-400/20",
      text: "mint-text-yellow-700 dark:mint-text-yellow-400"
    },
    PATCH: {
      bg: "mint-bg-orange-400/20 dark:mint-bg-orange-400/20",
      text: "mint-text-orange-700 dark:mint-text-orange-400"
    },
    DELETE: {
      bg: "mint-bg-red-400/20 dark:mint-bg-red-400/20",
      text: "mint-text-red-700 dark:mint-text-red-400"
    },
    API: {
      bg: "mint-bg-black",
      text: "mint-text-white"
    }
  };
  const MethodBadge = ({method}) => {
    const style = METHOD_STYLES[method?.toUpperCase()] ?? METHOD_STYLES.GET;
    return <span className={`
          method-pill rounded-lg font-semibold px-1.5 py-0.5 text-xs leading-5 ${style.bg} ${style.text}`}>
        {method?.toUpperCase()}
      </span>;
  };
  const content = <div className="group flex items-center gap-4 border border-gray-200 dark:border-gray-700 rounded-xl p-5 hover:border-gray-400 dark:hover:border-gray-500 hover:shadow-md transition-all cursor-pointer">
      {}
      <div className="shrink-0">
        <MethodBadge method={method} />
      </div>
      {}
      <div className="flex-1 min-w-0">
        <p className="font-semibold text-gray-900 dark:text-white text-sm leading-snug">{title}</p>
        {children && <p className="mt-1 text-sm text-gray-500 dark:text-gray-400 line-clamp-2">{children}</p>}
      </div>
    </div>;
  if (!href) return content;
  return <a href={href} className="block no-underline border-b-0 mb-2">
      {content}
    </a>;
};

<Note>
  **Note**\
  This feature is currently in beta and subject to change. To learn more about the Beta program for this feature, contact your Marqeta representative.
</Note>

Use the `/credit/rewards/rules` endpoint to manage and monitor the rules configurations for a reward program. The configurations for global rules for a reward account are defined in the reward policy on the reward account’s associated bundle.

<h2 id="post_rules">
  Create new program rule
</h2>

**Action:** `POST`\
**Endpoint:** `/credit/rewards/rules`

Create a new rule for a reward program short code.

<h3 id="_request_body">
  Request body
</h3>

| Fields                                                             | Description                                                                                                                                                                                                                                                                                                               |
| ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| token<br /><br />string<br /><br />Optional                        | Unique identifier of the rule.<br /><br />**Allowable Values:**<br /><br />36 char max                                                                                                                                                                                                                                    |
| description<br /><br />string<br /><br />Required                  | Description of the rule.<br /><br />**Allowable Values:**<br /><br />255 char max                                                                                                                                                                                                                                         |
| type<br /><br />string<br /><br />Required                         | Type of rule.<br /><br />- `MULTIPLIER_PER_TRANSACTION` - Defined multiplier is applied to every eligible transaction: for example, 1X every transaction (\$5 transaction receives five reward points).<br /><br />**Allowable Values:**<br /><br />`MULTIPLIER_PER_TRANSACTION`                                          |
| calculation\_type<br /><br />string<br /><br />Optional            | Type of calculation to use to evaluate if a rule has been satisfied.<br /><br />- `PER_TRANSACTION` - Rule is applied to all transactions, regardless of cumulative spend: for example, earn 1x on all transactions, regardless of category or spend total.<br /><br />**Allowable Values:**<br /><br />`PER_TRANSACTION` |
| multiplier<br /><br />decimal<br /><br />Optional                  | Reward multiplier to apply the transaction, where '1' means 1x the transaction amount.<br /><br />**Allowable Values:**<br /><br />Any integer                                                                                                                                                                            |
| amount<br /><br />decimal<br /><br />Optional                      | Static amount to reward if rule conditions are met.<br /><br />**Allowable Values:**<br /><br />Any integer                                                                                                                                                                                                               |
| attributes<br /><br />object<br /><br />Optional                   | Attributes are additional properties for which the rule can used to determine reward accrual eligibility for a transaction.<br /><br />**Allowable Values:**<br /><br />`mcc`, `mid`                                                                                                                                      |
| attributes.**mcc**<br /><br />array of strings<br /><br />Optional | List of merchant category codes (MCCs). Must be a four-digit number, or a range of two four-digit numbers separated by a hyphen.<br /><br />**Allowable Values:**<br /><br />One or more four-digit merchant category codes<br /><br />**Example Values:**`0001-1499`, `1500`                                             |
| attributes.**mid**<br /><br />string<br /><br />Optional           | Merchant ID for the rule.<br /><br />**Allowable Values:**<br /><br />255 char max<br /><br />**Example Value:**`my_merchant_identifier`                                                                                                                                                                                  |
| start\_time<br /><br />datetime<br /><br />Optional                | Start date and time when the rule becomes active, in UTC.<br /><br />**Allowable Values:**<br /><br />Format: yyyy-MM-ddThh:mm:ssZ                                                                                                                                                                                        |
| end\_time<br /><br />datetime<br /><br />Optional                  | End date and time when the rule becomes active, in UTC.<br /><br />**Allowable Values:**<br /><br />Format: yyyy-MM-ddThh:mm:ssZ                                                                                                                                                                                          |
| is\_active<br /><br />boolean<br /><br />Optional                  | A value of `true` indicates that the rule is active.<br /><br />**Allowable Values:**<br /><br />`true`, `false`<br /><br />**Default value:**`true`                                                                                                                                                                      |

<h3 id="_sample_request_body">
  Sample request body
</h3>

```json JSON lines wrap theme={null}
{
  "token": "00fb5637-2dab-4833-aa12-0463e7cf8cbb",
  "description": "Earn 1x on all purchases.",
  "type": "MULTIPLIER_PER_TRANSACTION",
  "calculation_type": "PER_TRANSACTION",
  "multiplier": 1,
  "start_time": "2024-01-05T20:37:11Z",
  "is_active": true
}
```

<h3 id="_response_body">
  Response body
</h3>

| Fields                                                                                   | Description                                                                                                                                                                                                                                                                                                               |
| ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| data<br /><br />array of objects<br /><br />Returned                                     | List of rule objects.<br /><br />**Allowable Values:**<br /><br />Valid array of one or more rule objects                                                                                                                                                                                                                 |
| data\[].**token**<br /><br />string<br /><br />Returned                                  | Unique identifier of the rule.<br /><br />**Allowable Values:**<br /><br />36 char max                                                                                                                                                                                                                                    |
| data\[].**description**<br /><br />string<br /><br />Returned                            | Description of the rule.<br /><br />**Allowable Values:**<br /><br />255 char max                                                                                                                                                                                                                                         |
| data\[].**type**<br /><br />string<br /><br />Returned                                   | Type of rule.<br /><br />- `MULTIPLIER_PER_TRANSACTION` - Defined multiplier is applied to every eligible transaction: for example, 1X every transaction (\$5 transaction receives five reward points).<br /><br />**Allowable Values:**<br /><br />`MULTIPLIER_PER_TRANSACTION`                                          |
| data\[].**calculation\_type**<br /><br />string<br /><br />Conditionally returned        | Type of calculation to use to evaluate if a rule has been satisfied.<br /><br />- `PER_TRANSACTION` - Rule is applied to all transactions, regardless of cumulative spend: for example, earn 1x on all transactions, regardless of category or spend total.<br /><br />**Allowable Values:**<br /><br />`PER_TRANSACTION` |
| data\[].**multiplier**<br /><br />decimal<br /><br />Conditionally returned              | Reward multiplier to apply the transaction, where `1` means 1x the transaction amount.<br /><br />**Allowable Values:**<br /><br />Any integer                                                                                                                                                                            |
| data\[].**amount**<br /><br />decimal<br /><br />Conditionally returned                  | Static amount to reward if rule conditions are met.<br /><br />**Allowable Values:**<br /><br />Any integer                                                                                                                                                                                                               |
| data\[].**attributes**<br /><br />object<br /><br />Conditionally returned               | Attributes are additional properties for which the rule can used to determine reward accrual eligibility for a transaction.<br /><br />**Allowable Values:**<br /><br />`mcc`, `mid`                                                                                                                                      |
| data\[].attributes.**mcc**<br /><br />array of strings<br /><br />Conditionally returned | List of merchant category codes (MCCs). Must be a four-digit number, or a range of two four-digit numbers separated by a hyphen.<br /><br />**Allowable Values:**<br /><br />One or more four-digit merchant category codes<br /><br />**Example Values:**`0001-1499`, `1500`                                             |
| data\[].attributes.**mid**<br /><br />string<br /><br />Conditionally returned           | Merchant ID for the rule.<br /><br />**Allowable Values:**<br /><br />255 char max<br /><br />**Example Value:**`my_merchant_identifier`                                                                                                                                                                                  |
| data\[].**start\_time**<br /><br />datetime<br /><br />Conditionally returned            | Start date and time when the rule should become active, in UTC.<br /><br />**Allowable Values:**<br /><br />Format: yyyy-MM-ddThh:mm:ssZ                                                                                                                                                                                  |
| data\[].**end\_time**<br /><br />datetime<br /><br />Conditionally returned              | End date and time when the active rule should become inactive, in UTC.<br /><br />**Allowable Values:**<br /><br />Format: yyyy-MM-ddThh:mm:ssZ                                                                                                                                                                           |
| data\[].**is\_active**<br /><br />boolean<br /><br />Conditionally returned              | A value of `true` indicates that the rule is active.<br /><br />**Allowable Values:**<br /><br />`true`, `false`<br /><br />**Default value:**`true`                                                                                                                                                                      |
| data\[].**created\_time**<br /><br />datetime<br /><br />Conditionally returned          | Date and time when the rule was created on the Marqeta platform, in UTC.<br /><br />**Allowable Values:**<br /><br />Format: yyyy-MM-ddThh:mm:ssZ                                                                                                                                                                         |
| data\[].**updated\_time**<br /><br />datetime<br /><br />Conditionally returned          | Date and time when the rule was last updated on the Marqeta platform, in UTC.<br /><br />**Allowable Values:**<br /><br />Format: yyyy-MM-ddThh:mm:ssZ                                                                                                                                                                    |

<h3 id="_sample_response_body">
  Sample response body
</h3>

```json JSON lines wrap theme={null}
{
  "data": [
    {
      "token": "00fb5637-2dab-4833-aa12-0463e7cf8cbb",
      "description": "Earn 1x on all purchases.",
      "type": "MULTIPLIER_PER_TRANSACTION",
      "calculation_type": "PER_TRANSACTION",
      "multiplier": 1,
      "start_time": "2024-01-05T20:37:11Z",
      "is_active": true,
      "created_time": "2024-01-05T20:37:11Z",
      "updated_time": "2024-01-05T20:37:11Z"
    }
  ]
}
```

<h2 id="retrieve_rules">
  List reward program rules
</h2>

**Action:** `GET`\
**Endpoint:** `/credit/rewards/rules`

Retrieve an array of rules for a reward program.

<h3 id="_url_query_parameters">
  URL query parameters
</h3>

| Fields                                                  | Description                                                                                                                                                                                                                                                                                                                                                                                 |
| ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| is\_active<br /><br />boolean<br /><br />Optional       | A value of `true` returns active resources. A value of `false` returns inactive resources.<br /><br />**Allowable Values:**<br /><br />`true`, `false`                                                                                                                                                                                                                                      |
| count<br /><br />integer<br /><br />Optional            | Number of resources to retrieve.<br /><br />**Allowable Values:**<br /><br />1–100                                                                                                                                                                                                                                                                                                          |
| start\_index<br /><br />integer<br /><br />Optional     | Sort order index of the first resource in the returned array.<br /><br />**Allowable Values:**<br /><br />0 min                                                                                                                                                                                                                                                                             |
| sort\_by\_updated<br /><br />string<br /><br />Optional | Field on which to sort. Prefix the field name with a hyphen (`-`) to sort in descending order. Omit the hyphen to sort in ascending order.<br /><br />**NOTE**: You must sort using system field names, such as `updatedTime`. Do not sort by field names that appear in response bodies, such as `updated_time`.<br /><br />**Allowable Values:**<br /><br />`updatedTime`, `-updatedTime` |

<h3 id="_response_body_2">
  Response body
</h3>

| Fields                                                                                   | Description                                                                                                                                                                                                                                                                                                               |
| ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| count<br /><br />integer<br /><br />Returned                                             | Number of resources returned.<br /><br />**Allowable Values:**<br /><br />1–100                                                                                                                                                                                                                                           |
| start\_index<br /><br />integer<br /><br />Returned                                      | Sort order index of the first resource in the returned array.<br /><br />**Allowable Values:**<br /><br />Any integer                                                                                                                                                                                                     |
| end\_index<br /><br />integer<br /><br />Returned                                        | Sort order index of the last resource in the returned array.<br /><br />**Allowable Values:**<br /><br />Any integer                                                                                                                                                                                                      |
| is\_more<br /><br />boolean<br /><br />Returned                                          | A value of `true` indicates that more unreturned resources exist.<br /><br />**Allowable Values:**<br /><br />`true`, `false`                                                                                                                                                                                             |
| data<br /><br />array of objects<br /><br />Returned                                     | List of rule objects.<br /><br />**Allowable Values:**<br /><br />Valid array of one or more rule objects                                                                                                                                                                                                                 |
| data\[].**token**<br /><br />string<br /><br />Returned                                  | Unique identifier of the rule.<br /><br />**Allowable Values:**<br /><br />36 char max                                                                                                                                                                                                                                    |
| data\[].**description**<br /><br />string<br /><br />Returned                            | Description of the rule.<br /><br />**Allowable Values:**<br /><br />255 char max                                                                                                                                                                                                                                         |
| data\[].**type**<br /><br />string<br /><br />Returned                                   | Type of rule.<br /><br />- `MULTIPLIER_PER_TRANSACTION` - Defined multiplier is applied to every eligible transaction: for example, 1X every transaction (\$5 transaction receives five reward points).<br /><br />**Allowable Values:**<br /><br />`MULTIPLIER_PER_TRANSACTION`                                          |
| data\[].**calculation\_type**<br /><br />string<br /><br />Conditionally returned        | Type of calculation to use to evaluate if a rule has been satisfied.<br /><br />- `PER_TRANSACTION` - Rule is applied to all transactions, regardless of cumulative spend: for example, earn 1x on all transactions, regardless of category or spend total.<br /><br />**Allowable Values:**<br /><br />`PER_TRANSACTION` |
| data\[].**multiplier**<br /><br />decimal<br /><br />Conditionally returned              | Reward multiplier to apply the transaction, where `1` means 1x the transaction amount.<br /><br />**Allowable Values:**<br /><br />Any integer                                                                                                                                                                            |
| data\[].**amount**<br /><br />decimal<br /><br />Conditionally returned                  | Static amount to reward if rule conditions are met.<br /><br />**Allowable Values:**<br /><br />Any integer                                                                                                                                                                                                               |
| data\[].**attributes**<br /><br />object<br /><br />Conditionally returned               | Attributes are additional properties for which the rule can used to determine reward accrual eligibility for a transaction.<br /><br />**Allowable Values:**<br /><br />`mcc`, `mid`                                                                                                                                      |
| data\[].attributes.**mcc**<br /><br />array of strings<br /><br />Conditionally returned | List of merchant category codes (MCCs). Must be a four-digit number, or a range of two four-digit numbers separated by a hyphen.<br /><br />**Allowable Values:**<br /><br />One or more four-digit merchant category codes<br /><br />**Example Values:**`0001-1499`, `1500`                                             |
| data\[].attributes.**mid**<br /><br />string<br /><br />Conditionally returned           | Merchant ID for the rule.<br /><br />**Allowable Values:**<br /><br />255 char max<br /><br />**Example Value:**`my_merchant_identifier`                                                                                                                                                                                  |
| data\[].**start\_time**<br /><br />datetime<br /><br />Conditionally returned            | Start date and time when the rule should become active, in UTC.<br /><br />**Allowable Values:**<br /><br />Format: yyyy-MM-ddThh:mm:ssZ                                                                                                                                                                                  |
| data\[].**end\_time**<br /><br />datetime<br /><br />Conditionally returned              | End date and time when the active rule should become inactive, in UTC.<br /><br />**Allowable Values:**<br /><br />Format: yyyy-MM-ddThh:mm:ssZ                                                                                                                                                                           |
| data\[].**is\_active**<br /><br />boolean<br /><br />Conditionally returned              | A value of `true` indicates that the rule is active.<br /><br />**Allowable Values:**<br /><br />`true`, `false`<br /><br />**Default value:**`true`                                                                                                                                                                      |
| data\[].**created\_time**<br /><br />datetime<br /><br />Conditionally returned          | Date and time when the rule was created on the Marqeta platform, in UTC.<br /><br />**Allowable Values:**<br /><br />Format: yyyy-MM-ddThh:mm:ssZ                                                                                                                                                                         |
| data\[].**updated\_time**<br /><br />datetime<br /><br />Conditionally returned          | Date and time when the rule was last updated on the Marqeta platform, in UTC.<br /><br />**Allowable Values:**<br /><br />Format: yyyy-MM-ddThh:mm:ssZ                                                                                                                                                                    |

<h3 id="_sample_response_body_2">
  Sample response body
</h3>

```json JSON expandable lines wrap theme={null}
{
  "count": 2,
  "start_index": 0,
  "end_index": 0,
  "is_more": false,
  "data": [
    {
      "token": "00fb5637-2dab-4833-aa12-0463e7cf8cbb",
      "description": "Earn 3x on agricultural services, contracted services, and purchases at Target.",
      "type": "MULTIPLIER_PER_TRANSACTION",
      "calculation_type": "PER_TRANSACTION",
      "multiplier": 3,
      "attributes": {
        "mcc": [
          "0001-1499",
          "1500-2999"
        ]
      },
      "start_time": "2024-01-05T20:37:11Z",
      "is_active": true,
      "created_time": "2024-01-05T20:37:11Z",
      "updated_time": "2024-01-05T20:37:11Z"
    },
    {
      "token": "4b3f70e5-b90a-497f-9d50-20445644c3ae",
      "description": "Earn 1 point on all transactions.",
      "type": "MULTIPLIER_PER_TRANSACTION",
      "calculation_type": "PER_TRANSACTION",
      "multiplier": 1,
      "start_time": "2024-01-05T20:37:11Z",
      "is_active": true,
      "created_time": "2024-01-05T20:37:11Z",
      "updated_time": "2024-01-05T20:37:11Z"
    }
  ]
}
```


## Related topics

- [Reward Conversions Management](/docs/core-api/credit-reward-conversions-management.md)
- [About Reward Accounts](/docs/developer-guides/about-credit-reward-accounts.md)
- [Reward Accounts](/docs/core-api/credit-reward-accounts.md)
- [Account Rewards](/docs/core-api/credit-account-rewards.md)
- [Reward Global Configurations](/docs/core-api/credit-reward-global-configurations.md)
