Skip to main content

AI Playbook

The Smart Glocal API comes with two AI-powered resources that work best together:

  • Skills — structured knowledge files (SKILL.md) that teach an AI assistant how a specific scenario works: the exact flow, parameters, curl examples, and webhooks. Load a skill once, and the AI understands that scenario end-to-end.
  • Prompts — ready-made questions that trigger the AI to use its skill knowledge and produce working code, curl commands, or explanations.

Skills at a Glance

SkillPurpose
API methodsShared methods: session/status, token, idempotency, errors, v1 vs v2
Delayed captureTwo-phase hold + capture
Getting startedInitial setup: RSA keys, auth, first request, sandbox testing
Go-live checklistProduction cutover: credentials, environment, webhook config
Local paymentsLocal cards, Pix, UPI, e-wallet
One-time paymentCard payment with open parameters or manual flow
Payment widgetFrontend widget integration for card data collection
RecurringCIT / MIT recurring payments with token management
RefundsFull / partial refunds and chargeback
ReportsDaily payment and payout reports, reconciliation
Telegram paymentsBot payments via sendInvoice, PreCheckoutQuery
WebhooksAll 5 webhook types, signature verification, retry logic

How it works

For OpenCode: unzip the archive to your project root and add "skills": {"paths": ["./skills"]} to opencode.json — all skills load automatically.

For Claude / ChatGPT: open a skill link below, copy its content into the assistant's instructions or project knowledge, then use the prompts alongside.

Alternatively, you can download all the skills at once: smart-glocal-skills-v1.zip

Prompts

Getting started

Load the getting-started skill first.

Set up API access

I'm a new Smart Glocal merchant. Walk me through generating RSA keys, setting up authentication headers, and making my first session/create request in the demo environment. Show me the curl command with all required headers.

Test the connection

I have my RSA keys and Project ID shop1. Help me send a test session/create request to the demo environment. What should the response look like?

Test card numbers

Give me a set of test card numbers and their expected outcomes for the Smart Glocal demo environment. How do I simulate a successful payment, a failed payment, and a 3D Secure challenge?

Test environment

What is the demo server URL and what test data is available? How do I test API calls without involving live data?

Go-live checklist

Load the go-live-checklist skill first.

Preparing for production

I've tested everything in sandbox. Walk me through the full go-live procedure — what credentials do I need, what URL changes, and how do I configure webhooks for production?

Rollback plan

We found an issue after going live. How do I safely roll back to the sandbox environment while we fix it?

One-time payments

Load the one-time-payment skill first.

Full flow (open parameters)

Explain the full flow for a one-time card payment without the widget: from session/create through session/start/payment, ready_to_confirm webhook, session/confirm, and payment_finished webhook. Include curl commands for each step.

Create a payment session

Show me the full session/create request for a payment of 50 USD with card payment details and customer reference user_456. Include all required headers and the request body in curl format.

3D Secure handling

How do I handle a 3D Secure challenge during a one-time payment? What webhook do I receive and how do I redirect the buyer?

Payment widget

Load the payment-widget skill first.

Widget integration

Show me how to accept a one-time payment using the Smart Glocal payment widget. What parameters do I pass to the widget, and how do I handle action_required and ready_to_confirm webhooks?

Token generation

How do I generate a public token for the widget? What's the API call and what do I do with the response?

Widget for tokenization

Can I use the widget to collect card data for recurring payments without charging immediately?

Delayed capture

Load the delayed-capture skill first.

Two-phase flow

Explain the two-phase delayed capture flow. How do I place a hold on funds using session/create and session/start/payment, then capture later with session/capture? What's the hold period?

Partial capture

I placed a hold of 100 USD on session ps_xxx. Now I want to capture only 70 USD and release the remaining 30. Show me the curl commands.

Recurring payments

Load the recurring skill first.

CIT recurring payments

I need to set up recurring payments where the customer initiates the first transaction (CIT). Walk me through creating a session with recurrent flag, getting a token, and charging the customer again using that token.

MIT recurring payments

Explain MIT (Merchant Initiated Transaction) recurring payments. How do I charge a customer using a saved token without involving them in 3DS verification?

Token management

I have a recurring token a1b2c3.... How do I check its status, and how do I disable it if a customer unsubscribes?

Local payments

Load the local-payments skill first.

Pix payments in Brazil

How do I accept Pix payments in Brazil? What are the required sender parameters, and how does the flow differ from standard card payments?

Instant transfers in India

Show me how to accept UPI-based payments in India using QR codes or UPI IDs. What parameters do I need for INR and USD payments?

Country-specific card parameters

What sender parameters do I need to pass for a card payment to a customer in Brazil? Include the required document types, CPF format, and address fields.

Telegram payments

Load the telegram-payments skill first.

Connect a Telegram bot

Walk me through connecting my Telegram bot to Smart Glocal via BotFather. What do I configure on Telegram's side, and what API methods does my bot call to process a payment?

Accept payments in Telegram

How do I accept payments using my Telegram bot? Show the payment flow from the user clicking "Pay" to receiving the payment_finished webhook.

Reports

Load the reports skill first.

Daily payments report

How do I retrieve yesterday's payment report? What fields does the CSV include and how do I reconcile it with my system?

Payout report fields

Explain the payout daily report fields. What's the difference between grossLocalAmount, paymentLocalAmount, and feesLocalAmount?

Refunds

Load the refunds skill first.

Full and partial refunds

A customer wants a refund for a successful payment with session ID ps_12345. How do I process a full refund using session/refund? What if I only want to refund part of the amount?

Chargeback handling

I received a chargeback notification. What does it mean and how is it different from a merchant-initiated refund?

Webhooks

Load the webhooks skill first.

Webhook reference

List all Smart Glocal webhook types and explain what each one means. When do I receive action_required vs ready_to_confirm? How should my server respond to each webhook?

Verifying webhook signatures

How do I verify the signature of incoming webhooks from Smart Glocal? Show me code examples for validating the RSA SHA-256 signature using Smart Glocal's public key.

Secure webhook endpoint

What security best practices should I follow for my webhook endpoint? How do I handle IP allowlisting and async processing?

API methods

Load the api-methods skill first.

Check session status

After starting a payment, how do I check the current status using session/status? What are the possible statuses and what do they mean?

Generate a public token

How do I generate a public token using the token method? When would I use it in my integration?

Idempotency key explained

Explain idempotency keys in Smart Glocal API. Which methods support them, how long are they valid, and what errors should I handle?

Error handling

Debugging an error

I received this error:

{
"error": {
"code": "error code",
"description": "error description"
},
"status": "error"
}

What does it mean and how do I resolve it?