Orders & Order Types
Orders & Order Types
Orders are the core transaction entities in Koywe Payments. Each order type serves a specific purpose in your payment operations.
Order Types Overview
Koywe Payments supports six distinct order types:
Order Status Lifecycle
All orders follow a similar status progression:
Status Descriptions:
PAYIN - Accept Customer Payments
Accept payments from customers into your virtual balance.
When to Use
- E-commerce checkout
- Service payments
- Subscription billing
- Invoice payments
- Donation collection
Flow Diagram
Required Fields
Optional Fields
Example
Complete PAYIN Integration Guide โ
PAYOUT - Pay Providers
Send payments from your virtual balance to external bank accounts.
When to Use
- Vendor payments
- Contractor payouts
- Refunds to customers
- Affiliate commissions
- Partner settlements
Flow Diagram
Required Fields
Optional Fields
Example
Important: Always check your virtual account balance before creating PAYOUT orders. The order will fail if you have insufficient funds.
Complete PAYOUT Integration Guide โ
BALANCE_TRANSFER - Currency Exchange
Transfer funds between different currency virtual accounts (instant currency exchange).
When to Use
- Convert COP to USD for international payments
- Rebalance currency holdings
- Lock in exchange rates
- Prepare funds for specific currency payouts
Flow Diagram
Required Fields
Example
Instant Settlement: BALANCE_TRANSFER orders complete instantly. No waiting for external confirmations.
Complete Balance Transfer Guide โ
ONRAMP - Buy Cryptocurrency
Convert fiat currency to cryptocurrency.
Uses Deals Endpoint: ONRAMP operations use the /deals endpoint. Deals can be paid in full or partially, with each payment creating orders that execute the crypto purchase.
When to Use
- Buy crypto for treasury
- Offer crypto purchases to users
- Hedge with stablecoins
- Pay crypto-native providers
Supported Cryptocurrencies
Required Fields for Quote
Required Fields for Deal
Simplified: Deals only need the destination account and quote ID. The amounts and currencies come from the quote.
Example
Partial Payments: ONRAMP deals can be paid in multiple installments. Each payment creates an order that purchases the proportional amount of crypto. Great for dollar-cost averaging!
Balance Required: By default, sufficient balance in your virtual account is required to close an ONRAMP deal. Deals execute automatically when funds are credited to your account. Pre-approved merchants can operate without upfront balance.
OFFRAMP - Sell Cryptocurrency
Convert cryptocurrency to fiat currency.
Uses Deals Endpoint: OFFRAMP operations use the /deals endpoint. Unlike ONRAMP, OFFRAMP deals must be paid completely (no partial payments). The deal creates orders when fully funded.
When to Use
- Sell crypto holdings
- Convert crypto payments to fiat
- Realize crypto gains
- Prepare fiat for operations
Required Fields for Quote
Required Fields for Deal
Complete Payment Only: OFFRAMP deals must be funded completely. Partial payments are not supported.
Example
Complete Funding: After creating the deal, you must send the full crypto amount to the provided deposit address. Once received, the deal creates orders and credits your virtual account with fiat.
PAYMENT_LINK - Payment Links
Generate shareable payment links with a complete Koywe-branded checkout flow - no contact or payment method needed upfront!
What Makes PAYMENT_LINK Special?
Customer enters their own information in the checkout
Customer selects their preferred payment method
Beautiful, secure checkout hosted by Koywe
Send via email, WhatsApp, SMS, or QR code
When to Use
- E-commerce checkout: Simple payment collection without complex integration
- Invoice payments: Send payment link for issued invoices
- Email/WhatsApp: Share payment requests directly
- QR code payments: Generate QR for in-person payments
- One-time collections: Quick payment requests without storing customer data
How It Works
Differences from PAYIN
Minimal Required Fields
Thatโs it! No contact, no payment method, no customer details needed. Just amount and description.
Optional Fields
Complete Example
Response:
Customer Experience: When customers open the payment link, theyโll see a Koywe-branded checkout where they can:
- Review payment details
- Enter their personal information
- Select their preferred payment method (PSE, PIX, Nequi, etc.)
- Complete the payment
Order Metadata and External IDs
External ID (Idempotency)
Use externalId to ensure idempotent order creation:
Benefits:
- Safe to retry failed requests
- Prevents duplicate orders
- Links to your internal systems
Metadata
Store custom data with orders:
Use cases:
- Track order source
- Store campaign information
- Link to internal systems
- Custom reporting fields