Accepting Payments - Overview
Accepting Payments (PAYIN)
Learn how to accept payments from customers using local payment methods across Latin America.
What is PAYIN?
PAYIN is the order type used to accept payments from customers into your virtual balance account.
Use Cases
Accept payments for online purchases at checkout
Collect payments for services rendered
Recurring payments for subscriptions
Accept payments for issued invoices
How It Works
High-Level Flow
Detailed Flow Diagram
Supported Countries and Payment Methods
Colombia 🇨🇴
Learn more about Colombian payment methods →
Brazil 🇧🇷
Mexico 🇲🇽
Chile 🇨🇱
Argentina 🇦🇷
Prerequisites
Before integrating PAYIN orders, ensure you have:
Required:
- ✅ API Key and Secret
- ✅ Organization ID
- ✅ Merchant ID
- ✅ Understanding of Core Concepts
Recommended:
- Webhook endpoint configured
- Error handling implemented
- Testing in sandbox environment
Quick Start
Want to jump right in? Follow our step-by-step integration guide:
Or try the quickstart for a faster overview:
Payment Flow Explained
Step-by-Step Process
1. Authentication
Obtain an access token using your API credentials.
2. Get Available Payment Methods
Query which payment methods are available for the customer’s country.
3. Create Contact (Optional but Recommended)
Store customer information for tracking and compliance.
4. Create PAYIN Order
Create the payment order with amount and payment method.
5. Redirect Customer
Send customer to the payment URL to complete payment.
6. Handle Webhooks
Listen for webhook events to know when payment is complete.
Order Status Progression
Understanding order statuses:
Key Concepts
Payment URL
Every PAYIN order returns a paymentUrl:
This URL:
- Is hosted by Koywe
- Provides a secure payment experience
- Handles the payment method UI
- Redirects back to your
successUrlorfailedUrl
Success and Failed URLs
Specify where to redirect customers after payment:
Best Practice: Don’t rely solely on these redirects for order fulfillment. Always use webhooks as the source of truth.
External ID (Idempotency)
Use externalId to link orders to your system and prevent duplicates:
Benefits:
- Safe to retry failed API calls
- Prevents duplicate charges
- Easy reconciliation with your database
Common Integration Patterns
Pattern 1: Simple Checkout
Pattern 2: Payment Method Selection
Pattern 3: Stored Customer
Next Steps
Step-by-step implementation with code examples
Detailed guide to each payment method by country
Common issues and how to resolve them
Test payment flows in sandbox environment