Documentation Index
Fetch the complete documentation index at: https://docs.orsunpay.com/llms.txt
Use this file to discover all available pages before exploring further.
Core Concepts Overview
Before integrating with Orsunpay, it’s essential to understand our core concepts and how they work together to process payments.Key Entities
Merchant
A Merchant represents your business or organization within Orsunpay. Each merchant has:- Unique ID: Generated with
mr_prefix (e.g.,mr_abc123def456) - Domain: Your business domain for validation
- Private Key: Used for webhook signature verification
- Company Association: Links to your company account
Customer
A Customer represents the end user making a payment. Customer data helps with:- Risk assessment and fraud prevention
- Payment method recommendations
- Compliance with local regulations
- Transaction history tracking
The
buyerId is your internal customer identifier, while our id is Orsunpay’s unique identifier.Credential Config
A Credential Config defines how payments are processed for specific payment methods. It includes:- Provider credentials (securely encrypted)
- Payment method configuration
- Fee settings and calculation rules
- Currency and country restrictions
- Amount limits for transactions
Transaction
A Transaction represents a payment attempt and contains:- Payment details (amount, currency, customer)
- Processing state and status history
- Provider information and external IDs
- Metadata for custom business logic
- URLs for redirect flows
Payment Flow
Understanding the typical payment flow helps you integrate Orsunpay effectively:Flow Steps
- Create Transaction: Your backend creates a transaction via our API
- Provider Routing: Our system selects the best provider based on your rules
- Payment Processing: Customer completes payment through provider’s interface
- Webhook Notifications: Both you and we receive status updates
- Status Synchronization: Your system updates order status accordingly
Transaction Statuses
| Status | Description | Final | Next Possible States |
|---|---|---|---|
CREATED | Transaction initiated | No | WAIT_APPROVE, PROCESSING, CANCELED |
WAIT_APPROVE | Awaiting operator approval | No | PROCESSING, DECLINED, CANCELED |
PROCESSING | Payment in progress | No | SUCCESS, DECLINED, EXPIRED, CANCELED |
SUCCESS | Payment completed successfully | Yes | None |
DECLINED | Payment rejected by provider | Yes | None |
EXPIRED | Payment session expired | Yes | None |
CANCELED | Payment canceled by customer | Yes | None |
Transaction Actions
Different transaction types serve various business needs:| Action | Purpose | Description |
|---|---|---|
SALE | Direct payment | Immediate capture of funds |
AUTHORIZE | Pre-authorization | Reserve funds without capture |
PAYOUT | Money transfer | Send money to recipients |
REFUND | Return funds | Reverse a previous transaction |
CHARGEBACK | Dispute resolution | Handle payment disputes |
Payment Methods
Orsunpay supports a wide range of payment methods, categorized as:Cards
- Credit/Debit Cards: Visa, Mastercard, American Express, etc.
- Local Cards: Maestro, Dankort, EFTPOS, etc.
Alternative Payment Methods (APM)
- Digital Wallets: PayPal, Apple Pay, Google Pay, Alipay
- Bank Transfers: SEPA, ACH, Open Banking, PIX
- Buy Now Pay Later: Klarna, Afterpay, Affirm
- Cash: Boleto, OXXO, 7-Eleven
- Cryptocurrencies: Bitcoin, Ethereum, USDC
Webhooks and Callbacks
Webhooks are critical for maintaining payment state synchronization:Webhook Events
Common webhook events you’ll receive:transaction.created- Transaction initiatedtransaction.processing- Payment startedtransaction.succeeded- Payment completedtransaction.failed- Payment declinedtransaction.expired- Payment session timeout
Callback URLs
Configure these URLs in your transaction requests:- Success URL: Where customers go after successful payment
- Failure URL: Where customers go after failed payment
- Return URL: General return URL from payment provider
- Callback URL: Server-to-server webhook endpoint
Best Practices
Security
- Never expose API keys in frontend code
- Always validate webhook signatures
- Use HTTPS for all callback URLs
- Implement idempotency for critical operations
Error Handling
- Check transaction status via webhook and API calls
- Implement retry logic for network failures
- Log all interactions for debugging and compliance
- Handle edge cases gracefully
Performance
- Cache payment methods to reduce API calls
- Use webhooks instead of polling for status updates
- Implement proper timeouts for API requests
- Monitor response times and error rates
Next Steps
Now that you understand the core concepts, let’s set up authentication and make your first API call.Authentication Setup
Configure API keys and security headers for your integration.
Environment Configuration
Understand the differences between sandbox and production environments.

