skills$openclaw/mayar-payment
ahsanatha5.2kā˜…

by ahsanatha

mayar-payment – OpenClaw Skill

mayar-payment is an OpenClaw Skills integration for coding workflows. Mayar.id payment integration for generating invoices, payment links, and tracking transactions via MCP. Use when needing to: (1) Create payment invoices/links for customers, (2) Track payment status and transactions, (3) Generate WhatsApp-friendly payment messages, (4) Handle Indonesian payment methods (bank transfer, e-wallet, QRIS), (5) Manage subscriptions/memberships, or (6) Automate payment workflows for e-commerce, services, or digital products.

5.2k stars6.0k forksSecurity L1
Updated Feb 7, 2026Created Feb 7, 2026coding

Skill Snapshot

namemayar-payment
descriptionMayar.id payment integration for generating invoices, payment links, and tracking transactions via MCP. Use when needing to: (1) Create payment invoices/links for customers, (2) Track payment status and transactions, (3) Generate WhatsApp-friendly payment messages, (4) Handle Indonesian payment methods (bank transfer, e-wallet, QRIS), (5) Manage subscriptions/memberships, or (6) Automate payment workflows for e-commerce, services, or digital products. OpenClaw Skills integration.
ownerahsanatha
repositoryahsanatha/mayar-payment-skill
languageMarkdown
licenseMIT
topics
securityL1
installopenclaw add @ahsanatha/mayar-payment-skill
last updatedFeb 7, 2026

Maintainer

ahsanatha

ahsanatha

Maintains mayar-payment in the OpenClaw Skills directory.

View GitHub profile
File Explorer
7 files
.
references
api-reference.md
7.9 KB
integration-examples.md
11.9 KB
mcp-tools.md
6.5 KB
_meta.json
290 B
README.md
7.6 KB
SKILL.md
5.5 KB
SKILL.md

name: mayar-payment description: Mayar.id payment integration for generating invoices, payment links, and tracking transactions via MCP. Use when needing to: (1) Create payment invoices/links for customers, (2) Track payment status and transactions, (3) Generate WhatsApp-friendly payment messages, (4) Handle Indonesian payment methods (bank transfer, e-wallet, QRIS), (5) Manage subscriptions/memberships, or (6) Automate payment workflows for e-commerce, services, or digital products.

Mayar Payment Integration

Integrate Mayar.id payment platform via MCP (Model Context Protocol) for Indonesian payment processing.

Prerequisites

  1. Mayar.id account - Sign up at https://mayar.id
  2. API Key - Generate from https://web.mayar.id/api-keys
  3. mcporter configured - MCP must be set up in Clawdbot

Setup

1. Store API Credentials

mkdir -p ~/.config/mayar
cat > ~/.config/mayar/credentials << EOF
MAYAR_API_TOKEN="your-jwt-token-here"
EOF
chmod 600 ~/.config/mayar/credentials

2. Configure MCP Server

Add to config/mcporter.json:

{
  "mcpServers": {
    "mayar": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp.mayar.id/sse",
        "--header",
        "Authorization:YOUR_API_TOKEN_HERE"
      ]
    }
  }
}

Replace YOUR_API_TOKEN_HERE with actual token.

3. Test Connection

mcporter list mayar

Should show 15+ available tools.

Create Invoice with Payment Link

Most common use case: Generate payment link for customer.

mcporter call mayar.create_invoice \
  name="Customer Name" \
  email="email@example.com" \
  mobile="\"628xxx\"" \
  description="Order description" \
  redirectURL="https://yoursite.com/thanks" \
  expiredAt="2026-12-31T23:59:59+07:00" \
  items='[{"quantity":1,"rate":500000,"description":"Product A"}]'

Returns:

{
  "id": "uuid",
  "transactionId": "uuid", 
  "link": "https://subdomain.myr.id/invoices/slug",
  "expiredAt": 1234567890
}

Key fields:

  • mobile - MUST be string with quotes: "\"628xxx\""
  • expiredAt - ISO 8601 format with timezone
  • items - Array of {quantity, rate, description}
  • redirectURL - Where customer goes after payment

WhatsApp Integration Pattern

// 1. Create invoice
const invoice = /* mcporter call mayar.create_invoice */;

// 2. Format message
const message = `
āœ… *Order Confirmed!*

*Items:*
• Product Name
  Rp ${amount.toLocaleString('id-ID')}

*TOTAL: Rp ${total.toLocaleString('id-ID')}*

šŸ’³ *Pembayaran:*
${invoice.data.link}

ā° Berlaku sampai: ${expiryDate}

Terima kasih! šŸ™
`.trim();

// 3. Send via WhatsApp
message({
  action: 'send',
  channel: 'whatsapp',
  target: customerPhone,
  message: message
});

Check Payment Status

# Get latest transactions (check if paid)
mcporter call mayar.get_latest_transactions page:1 pageSize:10

# Get unpaid invoices
mcporter call mayar.get_latest_unpaid_transactions page:1 pageSize:10

Filter by status: "created" (unpaid) → "paid" (success).

Other Operations

# Check account balance
mcporter call mayar.get_balance

# Get customer details
mcporter call mayar.get_customer_detail \
  customerName="Name" \
  customerEmail="email@example.com" \
  page:1 pageSize:10

# Filter by time period
mcporter call mayar.get_transactions_by_time_period \
  page:1 pageSize:10 \
  period:"this_month" \
  sortField:"createdAt" \
  sortOrder:"DESC"

Common Patterns

Multi-Item Invoice

items='[
  {"quantity":2,"rate":500000,"description":"Product A"},
  {"quantity":1,"rate":1000000,"description":"Product B"}
]'
// Total: 2M (2Ɨ500K + 1Ɨ1M)

Subscription/Recurring

Use membership tools:

mcporter call mayar.get_membership_customer_by_specific_product \
  productName:"Premium Membership" \
  productLink:"your-product-link" \
  productId:"product-uuid" \
  page:1 pageSize:10 \
  memberStatus:"active"

Payment Confirmation Flow

Option A: Webhook (Real-time)

  • Register webhook URL with Mayar
  • Receive instant payment notifications
  • Best for production

Option B: Polling (Simpler)

  • Poll get_latest_transactions every 30-60s
  • Check for new payments
  • Best for MVP/testing

Troubleshooting

404 on payment link:

  • Link format: https://your-subdomain.myr.id/invoices/slug
  • Check dashboard for correct subdomain
  • Default may be account name

Invalid mobile number:

  • Mobile MUST be string: "\"628xxx\"" (with escaped quotes)
  • Format: 628xxxxxxxxxx (no + or spaces)

Expired invoice:

  • Default expiry is expiredAt timestamp
  • Customer can't pay after expiration
  • Create new invoice if needed

Reference Documentation

Production Checklist

  • Use production API key (not sandbox)
  • Setup webhook for payment notifications
  • Error handling for failed invoice creation
  • Store invoice IDs for tracking
  • Handle payment expiration
  • Customer database integration
  • Receipt/confirmation automation

Environments

Production:

Sandbox (Testing):

README.md

Mayar Payment Integration - Clawdbot Skill

License: MIT Version

Complete Mayar.id payment integration for Clawdbot. Enable your AI agent to generate invoices, payment links, and track transactions via Indonesian payment platform.

šŸŽÆ Features

  • āœ… Create payment invoices with itemized billing
  • āœ… Generate payment links for customers
  • āœ… Track transactions & payment status
  • āœ… Support ALL Indonesian payment methods (bank transfer, e-wallet, QRIS)
  • āœ… WhatsApp/Telegram/Discord payment workflows
  • āœ… Membership/subscription management
  • āœ… Complete MCP (Model Context Protocol) integration
  • āœ… 15 ready-to-use MCP tools

šŸš€ Quick Start

Prerequisites

  • Clawdbot instance with mcporter installed
  • Mayar.id account (free signup at mayar.id)
  • Node.js (for mcporter)

Installation

1. Clone this repository

cd ~/.clawdbot/skills  # or your Clawdbot skills directory
git clone https://github.com/ahsanatha/mayar-payment-skill.git mayar-payment

2. Get Mayar API Key

For testing, use sandbox:

3. Configure Credentials

mkdir -p ~/.config/mayar
cat > ~/.config/mayar/credentials << EOF
MAYAR_API_TOKEN="your-jwt-token-here"
EOF
chmod 600 ~/.config/mayar/credentials

4. Configure MCP Server

Add to your config/mcporter.json:

{
  "mcpServers": {
    "mayar": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp.mayar.id/sse",
        "--header",
        "Authorization:YOUR_API_TOKEN_HERE"
      ]
    }
  }
}

Replace YOUR_API_TOKEN_HERE with your actual JWT token.

5. Test Installation

# List available tools
mcporter list mayar

# Test balance check
mcporter call mayar.get_balance

If you see 15 available tools → Installation successful! āœ…

šŸ’” Usage Examples

Create Payment Invoice

mcporter call mayar.create_invoice \
  name="Customer Name" \
  email="customer@email.com" \
  mobile="\"628xxxxxxxxxx\"" \
  description="Order description" \
  redirectURL="https://yoursite.com/success" \
  expiredAt="2026-12-31T23:59:59+07:00" \
  items='[
    {"quantity":1,"rate":500000,"description":"Product A"},
    {"quantity":2,"rate":100000,"description":"Product B"}
  ]'

Returns payment link: https://subdomain.myr.id/invoices/xxxxx

// Create invoice
const invoice = /* mcporter call mayar.create_invoice ... */;

// Format message
const message = `
āœ… *Order Confirmed!*

*Total: Rp ${total.toLocaleString('id-ID')}*

šŸ’³ Pembayaran:
${invoice.data.link}

ā° Berlaku sampai: ${expiryDate}
`.trim();

// Send via WhatsApp
message({
  action: 'send',
  channel: 'whatsapp',
  target: customerPhone,
  message: message
});

Check Transactions

# Latest transactions
mcporter call mayar.get_latest_transactions page:1 pageSize:10

# Unpaid invoices
mcporter call mayar.get_latest_unpaid_transactions page:1 pageSize:10

# Today's revenue
mcporter call mayar.get_transactions_by_time_period \
  page:1 pageSize:100 \
  period:"today" \
  sortField:"amount" \
  sortOrder:"DESC"

šŸ“š Documentation

šŸŽÆ Use Cases

  • E-commerce bots - Automated order processing via WhatsApp/Telegram
  • Service marketplace - Sell services with instant payment links
  • Course platforms - Sell courses with auto-access after payment
  • Membership sites - Subscription & tier management
  • Event ticketing - Generate tickets after payment
  • Donation platforms - Accept donations with tracking
  • Wedding services - Sell templates/packages
  • Freelance payments - Professional invoicing

šŸ”§ Available MCP Tools

Payment Generation

  • create_invoice - Create itemized invoice with payment link
  • send_portal_link - Send customer portal access
  • get_balance - Check account balance

Transaction Queries

  • get_latest_transactions - Recent paid transactions
  • get_latest_unpaid_transactions - Pending payments
  • get_customer_detail - Customer transaction history
  • get_transactions_by_time_period - Filter by period
  • get_transactions_by_time_range - Custom date range
  • Plus 7 more filtering/query tools...

Membership Management

  • get_membership_customer_by_specific_product
  • get_membership_customer_by_specific_product_and_tier

See full tool reference →

šŸŒ Payment Methods Supported

Mayar.id supports all major Indonesian payment methods:

Bank Transfer: BCA, Mandiri, BNI, BRI, Permata, CIMB Niaga
E-Wallet: GoPay, OVO, DANA, LinkAja, ShopeePay
Others: QRIS, Virtual Account, Credit/Debit Card

šŸ› ļø Troubleshooting

"MCP server not found"

mcporter config list
mcporter list mayar

"Invalid mobile number"

Phone must be:

  • String format: "\"628xxx\""
  • No + symbol, no spaces
  • Country code 62 (Indonesia)

Check your Mayar subdomain in dashboard settings.
Link format: https://subdomain.myr.id/invoices/slug

"Webhook not working"

  1. Register webhook URL:
curl -X POST https://api.mayar.id/hl/v1/webhook/register \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"urlHook":"https://yoursite.com/webhook"}'
  1. Ensure URL is publicly accessible
  2. Must respond with 200 status

šŸ“Š Skill Architecture

mayar-payment/
ā”œā”€ā”€ SKILL.md                      # Main skill documentation
ā”œā”€ā”€ README.md                     # This file (GitHub)
└── references/
    ā”œā”€ā”€ api-reference.md          # REST API docs (8KB)
    ā”œā”€ā”€ mcp-tools.md              # MCP tools reference (6.6KB)
    └── integration-examples.md   # Real-world patterns (12KB)

Following Clawdbot skill best practices:

  • Progressive disclosure (main guide → detailed references)
  • Concise core documentation
  • Real-world examples
  • Production-ready patterns

🌐 Environments

Production:

Sandbox (Testing):

Always test in sandbox first before using production!

šŸ¤ Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/amazing)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing)
  5. Open Pull Request

šŸ“ License

MIT License - Free to use, modify, and distribute.

See LICENSE file for details.

šŸ™ Credits

Created by Samara / TSR Labs for the Clawdbot community.

Based on Mayar.id API and MCP server.

šŸ“ž Support

⭐ Star History

If this skill helps you, please star the repo! ⭐


Made with ā¤ļø for the Clawdbot community

Permissions & Security

Security level L1: Low-risk skills with minimal permissions. Review inputs and outputs before running in production.

Requirements

1. **Mayar.id account** - Sign up at https://mayar.id 2. **API Key** - Generate from https://web.mayar.id/api-keys 3. **mcporter configured** - MCP must be set up in Clawdbot

FAQ

How do I install mayar-payment?

Run openclaw add @ahsanatha/mayar-payment-skill in your terminal. This installs mayar-payment into your OpenClaw Skills catalog.

Does this skill run locally or in the cloud?

OpenClaw Skills execute locally by default. Review the SKILL.md and permissions before running any skill.

Where can I verify the source code?

The source repository is available at https://github.com/openclaw/skills/tree/main/skills/ahsanatha/mayar-payment-skill. Review commits and README documentation before installing.