---
updatedAt: 2026-10-29T11:54:48.000Z
agentTools:
  projectIndex: https://docs.yotpo.com/llms.txt
---

# Record Loyalty Customer Action

This endpoint records an action performed by a customer. It will apply the action to all active custom action campaigns and award the necessary points and/or discounts.

This endpoint records an action performed by a customer. It will apply the action to all active custom action earning rules and award the necessary points and/or discounts.

> 📘 Please note:
>
> * The "created\_at" parameter will be used in the [Retrieve Loyalty Customer Details by Email](https://docs.yotpo.com/reference/retrieve-loyalty-customer-details-by-email) response when you send `with_history: true`.

> 📘 Before you record an action
>
> * Wrap the fields in a `custom_actions` object, as in the example on the right.
> * `action_name` has to match the name of a Custom Action campaign in the merchant's loyalty program. Otherwise the call returns `422` with `action_name must match the name set for one of the Custom Action Campaigns`.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "App partners API",
    "description": "Endpoints for apps that Yotpo merchants install. The app-level webhook is defined separately, in webhooks.json.",
    "version": "2"
  },
  "servers": [
    {
      "url": "https://developers.yotpo.com"
    }
  ],
  "security": [
    {
      "X-Yotpo-Token": []
    }
  ],
  "x-readme": {
    "headers": [],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "paths": {
    "/loyalty/v3/stores/{store_id}/custom_actions": {
      "post": {
        "summary": "Record Loyalty Customer Action",
        "description": "This endpoint records an action performed by a customer. It will apply the action to all active custom action campaigns and award the necessary points and/or discounts.",
        "operationId": "record-loyalty-customer-action",
        "parameters": [
          {
            "name": "store_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your Store ID (app key)."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "custom_actions"
                ],
                "properties": {
                  "custom_actions": {
                    "type": "object",
                    "required": [
                      "type",
                      "customer_email",
                      "action_name"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": "The type of action. Almost always set this to `CustomAction`",
                        "default": "CustomAction"
                      },
                      "customer_email": {
                        "type": "string",
                        "description": "The email address used to identify the customer who performed the action. Required if no customer_id is passed."
                      },
                      "customer_id": {
                        "type": "string",
                        "description": "The unique identifier of the customer who performed the action in your system. Required if no customer_email is passed."
                      },
                      "action_name": {
                        "type": "string",
                        "description": "The name of the action that was performed. This must match the name set for one of your Custom Action Campaigns."
                      },
                      "ip_address": {
                        "type": "string",
                        "description": "The ip address of the user when the action was performed. This is required if this action completes a referral program requirement."
                      },
                      "user_agent": {
                        "type": "string",
                        "description": "The browser user agent of the user when the action was performed. This is strongly recommended if this action completes a referral program requirements."
                      },
                      "created_at": {
                        "type": "string",
                        "description": "The time the action was performed. This will default to the current time. Use this if you need to back date an action."
                      },
                      "reward_points": {
                        "type": "integer",
                        "description": "Use this to override the normal amount of points awarded for performing the action. Will default to the rules of the campaign otherwise.",
                        "format": "int32"
                      },
                      "history_title": {
                        "type": "string",
                        "description": "Use this to override the normal description shown to the user in their history. Will default to the campaign settings otherwise."
                      }
                    },
                    "description": "The action the customer performed."
                  }
                }
              },
              "examples": {
                "Body params": {
                  "value": {
                    "custom_actions": {
                      "type": "CustomAction",
                      "customer_email": "name@example.com",
                      "action_name": "ShoppingGives",
                      "ip_address": "127.0.0.1",
                      "created_at": "2022-08-03T09:41:13.000Z",
                      "history_title": "donation"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid access token. Send a valid token in the `X-Yotpo-Token` header.",
            "content": {
              "application/json": {
                "examples": {
                  "Missing token": {
                    "summary": "No token sent (or sent as Authorization: Bearer)",
                    "value": {
                      "error": "invalid_request",
                      "error_description": "The access token is missing"
                    }
                  },
                  "Invalid token": {
                    "summary": "Token unknown, revoked or for another app",
                    "value": {
                      "error": "invalid_token",
                      "error_description": "The access token is invalid or has expired"
                    }
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "OAuth error code: `invalid_request` when no token was sent, `invalid_token` when the token is unknown, revoked or expired.",
                      "enum": [
                        "invalid_request",
                        "invalid_token"
                      ]
                    },
                    "error_description": {
                      "type": "string",
                      "description": "Human-readable reason for the error."
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "The request was read but can't be applied, for example because `action_name` doesn't match a Custom Action campaign in the store.",
            "content": {
              "application/json": {
                "examples": {
                  "Unknown action_name": {
                    "value": {
                      "errors": [
                        {
                          "message": "action_name must match the name set for one of the Custom Action Campaigns"
                        }
                      ]
                    }
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "errors": {
                      "type": "array",
                      "description": "What went wrong.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "message": {
                            "type": "string",
                            "description": "The error message."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "components": {
    "securitySchemes": {
      "X-Yotpo-Token": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Yotpo-Token",
        "description": "Send your app's access token for the merchant's store in the `X-Yotpo-Token` header of every request. To get a token, see [Generate Access Token](ref:generate-a-token). The API also reads the token from an `access_token` query parameter, but that isn't recommended: URLs end up in server and proxy logs. `Authorization: Bearer` is not supported."
      }
    }
  }
}
```

# Sibling pages

* [Retrieve Earning Rules](https://docs.yotpo.com/reference/retrieve-earning-rules.md)
* [Adjust Loyalty Customer Points](https://docs.yotpo.com/reference/adjust-loyalty-customer-points.md)