# Loyal Spark - Earn Points

> Loyal Spark - Earn Points is a paid API for AI agents from api.loyalspark.online, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-13).

Awards onchain ERC-20 loyalty points to a user wallet on Base L2 as part of the Loyal Spark loyalty protocol.

## Facts

- Endpoint: POST https://api.loyalspark.online/x402-gateway/mcp-tools/earn_points
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/loyal-spark-earn-points-d29ebdf5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_G5T2NQWVx0aBKNWft3MH1

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability loyal-spark-earn-points-d29ebdf5 -d '<json body>'
```

Example prompt: Award 50 loyalty points to wallet 0xAbC...123 on Loyal Spark for completing a purchase in the 'CoffeeBrew' rewards program.

## When to prefer this

Use this endpoint when you need to programmatically award onchain ERC-20 loyalty points to a specific wallet address on Base L2 as part of the Loyal Spark protocol. Prefer this over traditional loyalty APIs when the program requires verifiable onchain token records, P2P tradability of rewards, or AI agent automation via MCP.

## Known failure modes

- Invalid or missing wallet address returns an error response
- Insufficient USDC payment ($0.01) causes x402 payment failure
- Unknown loyalty program ID results in a not-found error
- Blockchain congestion or Base L2 outage may delay confirmation
- Duplicate activity reference may trigger idempotency rejection
- Malformed request body returns a validation error

## How this service works

Onchain loyalty protocol on Base L2. Launch B20 rewards, earn and redeem tokens, trade P2P, automate with AI agents via REST and MCP.

## Output

Returns a JSON confirmation including the transaction hash on Base L2, the number of points credited, the recipient wallet address, and the updated points balance for the user in the specified loyalty program.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "toolName",
    "inputSchema"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "mcp"
    },
    "example": {
     "type": "object"
    },
    "toolName": {
     "type": "string"
    },
    "transport": {
     "enum": [
      "streamable-http",
      "sse"
     ],
     "type": "string"
    },
    "description": {
     "type": "string"
    },
    "inputSchema": {
     "type": "object"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {}
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/loyal-spark-earn-points-d29ebdf5/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.loyalspark.online](https://www.zero.xyz/host/api.loyalspark.online/llms.txt)
