---
title: "customRulesPointGrant"
description: >
  Grant custom points to the customer. When a merchant sets up a custom points earning rule that requires customers to complete a specific action to earn points in the Member System, use this interface to grant the configured points to those customers who successfully complete the action.
doc_type: graphql
doc_category: storefront
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/storefront-api/member-system/mutations/custom-rules-point-grant'
  md: 'https://developer.shopline.com/docs/storefront-api/member-system/mutations/custom-rules-point-grant.md'
---
# customRulesPointGrant

Grant custom points to the customer. When a merchant sets up a custom points earning rule that requires customers to complete a specific action to earn points in the Member System, use this interface to grant the configured points to those customers who successfully complete the action.

- **API Version:** v20270301
- **API Type:** Storefront
- **API Protocol:** GraphQL
- **Operation Type:** Mutation

## Arguments

* `customerAccessToken`

  [String!](https://developer.shopline.com/docs/storefront-api/common/scalars/string.md)

  The customer access token.

* `earnId`

  [String!](https://developer.shopline.com/docs/storefront-api/common/scalars/string.md)

  The points earning rule ID. The ID displayed on the rule details page after configuring the custom rule in the Member System.

## Returns

* `memberUserErrors`

  [MemberUserError!](https://developer.shopline.com/docs/storefront-api/member-system/objects/member-user-error.md)

  Error message for the custom rule point grant.

## Examples

### Grant custom rule points

When a merchant configures a custom points earning rule in the Member System and sets the rule to require customers to complete an action before points are distributed, the number of points configured in the rule will be distributed to the customer.


**Request:**

```json
mutation {
  customRulesPointGrant (
    customerAccessToken: "#A01#SID0000143BNMX5+Ex9bIEkY6dzAwHwTOGkwWRBIF2/7FTbx4GTnvY+f42T7Z5dRvV/y3GSP1IqLe3Q5+gwe76CCmcsJK452Bv1/PuU1tOFvuzMKO6vyXhbhvOBgQI4wLVeC5zpgsOvWKVtp8LPrTzfR+A/4JhVVqH2k14OH5Z23TCvd0YMtCpvqR+zGLJKxtNwKcUEWGCDA",
    earnId: "BAC7308764297261753346"
   ) {
    memberUserErrors {
      code
    }
    
  }
}
```

**Response:**

```json
{
  "data": {
    "data": {
      "customRulesPointGrant": {
        "memberUserErrors": {
          "code": "success"
        }
      }
    }
  }
}
```

## Error Handling

For detailed information about common codes, see [Status and error codes](https://developer.shopline.com/docs/apps/api-instructions-for-use/storefront-api/overview.md#status-and-error-codes).

