# Loyal Spark - Create Gift Certificate

> Loyal Spark - Create Gift Certificate 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-16).

Creates an onchain gift certificate backed by ERC-20 loyalty tokens on Base L2 via the Loyal Spark protocol

## Facts

- Endpoint: POST https://api.loyalspark.online/x402-gateway/mcp-tools/create_gift_certificate
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-16
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/loyal-spark-create-gift-certificate-5d9d225f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_PxVegbNsChJ-HqBxVJayy

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-create-gift-certificate-5d9d225f -d '<json body>'
```

Example prompt: Create a gift certificate on Loyal Spark worth 500 loyalty tokens for wallet address 0xABC...123 in my 'CoffeeRewards' program, valid for 90 days.

## When to prefer this

Use this endpoint when you need to programmatically issue onchain gift certificates backed by ERC-20 loyalty tokens on the Base L2 network, especially when integrating AI agent workflows, automating customer reward distribution, or building P2P tradeable gift voucher functionality. Prefer this over off-chain gift card systems when you want verifiable, tradeable, and transparent loyalty rewards.

## Known failure modes

- Insufficient loyalty token balance — 402 payment required or insufficient program funds
- Invalid recipient wallet address — malformed Ethereum address returns 400 error
- Program not found — loyalty program identifier does not exist returns 404
- Onchain transaction failure — Base L2 network congestion or gas issues returns 500
- Payment not included — missing x402 USDC micropayment header returns 402
- Invalid expiry parameters — past or malformed date returns 400

## 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 object containing the newly created gift certificate's ID, onchain transaction hash, redemption details, token amount, expiry date, and recipient wallet information on Base L2.

## Example request

```json
{
 "id": 1,
 "method": "tools/call",
 "params": {
  "name": "get_platform_info",
  "arguments": {}
 },
 "jsonrpc": "2.0"
}
```

## 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-create-gift-certificate-5d9d225f/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)
