Developer Center

Build AI-native payment infrastructure into your autonomous agents. Full API access, sandbox testing, and production-ready endpoints.

Quick Start

1. Get Your Sandbox API Key

Start by registering in our sandbox environment. Sandbox API operates independently from production and uses simulated data.

POST /sandbox/auth/register

2. Create Your First Card

Generate a virtual card with custom limits for your AI agent. Card numbers are shown once for security.

POST /v1/cards

3. Process Payments

Charge the card to pay for services. Real-time balance updates and webhook notifications.

POST /v1/payments

4. Go Live

Switch from sandbox to production endpoints. Contact us for production API access.

https://api.newgen.hk/v1

Code Examples

Quick Start - Create a Card

# 1. Login to get your token
curl -X POST https://api.newgen.hk/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email":"your@email.com","password":"yourpassword"}'

# 2. Use the token to create a card
curl -X POST https://api.newgen.hk/v1/cards \
  -H "Authorization: Bearer YOUR_TOKEN_HERE" \
  -H "Content-Type: application/json" \
  -d '{"currency":"USD","limit":1000,"description":"AI Agent Card"}'

Process a Payment

curl -X POST https://api.newgen.hk/v1/payments \
  -H "Authorization: Bearer YOUR_TOKEN_HERE" \
  -H "Content-Type: application/json" \
  -d '{
    "cardId": "card_uuid_here",
    "amount": 50.00,
    "currency": "USD",
    "merchantName": "AWS Services",
    "merchantCategory": "cloud_computing"
  }'

Webhook Setup

# Create a webhook to receive payment notifications
curl -X POST https://api.newgen.hk/v1/webhooks \
  -H "Authorization: Bearer YOUR_TOKEN_HERE" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://your-server.com/webhooks/newgen",
    "events": ["payment.success", "payment.failed"]
  }'

SDKs & Libraries

Official SDKs for easy integration. All SDKs support both sandbox and production environments.

Python
Coming Soon
Node.js
Coming Soon
Go
Coming Soon
Java
Coming Soon
Ruby
Coming Soon
PHP
Coming Soon

API Base URLs

Production

Live
https://api.newgen.hk/v1

Process real payments. Requires approved API keys.

Sandbox

Testing
https://sandbox.newgen.hk/v1

Test with simulated data. No real transactions.