⚡ 5-Minute Quickstart
5-Minute Quickstart
What You’ll Build
Create a simple PAYIN order to accept a payment from a customer. This quickstart gets you up and running without diving into complex concepts.
By the end of this guide, you’ll be able to:
- Authenticate with the Koywe API
- Create a payment order
- Track the payment status
Prerequisites
Before you begin, make sure you have:
- API Key and Secret (contact soporte@koywe.com if you don’t have these)
- Organization ID
- Merchant ID
- A tool to make HTTP requests (cURL, Postman, or your preferred programming language)
This quickstart uses the sandbox environment. All payments are simulated and no real money is involved.
Step 1: Authenticate
First, obtain an access token using your API credentials:
Response:
Store this token securely. You’ll need to include it in all subsequent requests as:
Authorization: Bearer YOUR_TOKEN
The token expires after 1 hour. In production, implement token refresh logic.
Step 2: Create a Contact (Optional)
While optional, creating a contact helps you track which customer made the payment:
Step 3: Get a Quote
Get an exchange rate quote for the payment (optional but recommended for transparency):
Step 4: Create Your First PAYIN Order
Now create the payment order. This generates a payment URL where your customer can complete the payment:
Response:
Success! You’ve created your first payment order. The paymentUrl is where you should redirect your customer to complete the payment.
Step 5: Track the Order Status
You can check the order status at any time:
Order Status Flow:
- PENDING: Order created, waiting for customer payment
- PROCESSING: Payment is being processed
- PAID: Payment confirmed
- COMPLETED: Funds credited to your virtual balance
Complete End-to-End Example
Here’s a complete working example that puts it all together:
What’s Next?
Congratulations! You’ve successfully created your first payment order. Here’s what to explore next:
Understand organizations, merchants, virtual accounts, and order types
Full production-ready integration with webhooks and error handling
Test different payment scenarios in the sandbox environment
Get real-time notifications when payments complete
Need Help?
- 📧 Email: soporte@koywe.com
- 📚 API Reference
- 🐛 Troubleshooting Guide