Omise API Reference
Build powerful payment integrations with the Omise RESTful API. Process payments across 40+ payment methods in Southeast Asia and Japan.
Overviewโ
The Omise API is organized around REST principles with predictable resource-oriented URLs, JSON-encoded requests and responses, and standard HTTP response codes and verbs.
Base URLsโ
| Server | URL | Purpose |
|---|---|---|
| API Server | https://api.omise.co | Charges, customers, transfers, and account operations |
| Vault Server | https://vault.omise.co | Token creation (secure card data handling) |
Current API Versionโ
Version: 2019-05-29
Specify the API version using the Omise-Version header (optional, defaults to your account's API version):
Omise-Version: 2019-05-29
Quick Startโ
1. Get Your API Keysโ
Find your API keys in the Omise Dashboard:
- Public Key (
pkey_*) - For client-side operations (tokens, sources) - Secret Key (
skey_*) - For server-side operations (charges, customers)
Never expose your secret key in client-side code, GitHub repositories, or public places. Use environment variables and server-side code only.
2. Authenticate Requestsโ
Omise uses HTTP Basic Authentication:
- Username: Your API key
- Password: Leave blank (empty string)
# Using secret key
curl https://api.omise.co/charges \
-u skey_test_YOUR_SECRET_KEY:
# Using public key
curl https://vault.omise.co/tokens \
-u pkey_test_YOUR_PUBLIC_KEY:
3. Make Your First Requestโ
Create a test charge:
curl https://api.omise.co/charges \
-X POST \
-u skey_test_YOUR_SECRET_KEY: \
-d "amount=100000" \
-d "currency=thb" \
-d "card=tokn_test_no1t4tnemucod0e51mo"
Response:
{
"object": "charge",
"id": "chrg_test_5xuy4w91xqz7d1w9u0t",
"amount": 100000,
"currency": "thb",
"status": "successful",
"authorized": true,
"captured": true,
...
}
API Resourcesโ
Core Payment Processingโ
๐ณ Charges
Create, capture, and manage payment charges across all supported payment methods.
POST /charges โข GET /charges/:id โข PATCH /charges/:id
๐ Tokens
Securely tokenize credit card information without PCI compliance burden.
POST /tokens โข GET /tokens/:id
๐ฑ Sources
Create payment sources for alternative payment methods like PromptPay, mobile banking, and QR codes.
POST /sources โข GET /sources/:id
โฉ๏ธ Refunds
Issue full or partial refunds for completed charges.
POST /charges/:id/refunds โข GET /refunds/:id
Customer Managementโ
๐ค Customers
Store customer information and saved payment methods for recurring charges.
POST /customers โข GET /customers/:id โข PATCH /customers/:id
๐ณ Cards
Manage saved credit/debit cards attached to customers.
GET /customers/:id/cards โข DELETE /customers/:id/cards/:card_id
Money Managementโ
๐ธ Transfers
Transfer funds to bank accounts and manage automatic transfer schedules.
POST /transfers โข GET /transfers/:id โข GET /transfers/schedules
๐ฆ Recipients
Create and verify bank account recipients for transfers.
POST /recipients โข GET /recipients/:id โข POST /recipients/:id/verify
๐ Transactions
View detailed transaction history for accounting and reconciliation.
GET /transactions โข GET /transactions/:id
Additional Resourcesโ
โ๏ธ Disputes
Manage chargebacks and disputes.
๐ข Events
Access event logs for webhooks.
๐ Schedules
Set up recurring charges and transfers.
๐ Payment Links
Create shareable payment links.
๐ Search
Search across all resources.
โ๏ธ Account
View and update account settings.
Essential Guidesโ
Before diving into specific endpoints, familiarize yourself with these core concepts:
๐ Authenticationโ
Learn how to authenticate API requests using public and secret keys, handle API versioning, and secure your integration.
โ Error Handlingโ
Understand error response formats, common error codes, and best practices for handling failures gracefully.
๐ Paginationโ
Navigate large result sets efficiently with offset and limit parameters.
๐ Idempotencyโ
Safely retry requests without duplicating operations using idempotency keys.
๐ท๏ธ API Versioningโ
Manage API version changes and maintain backward compatibility.
โฑ๏ธ Rate Limitingโ
Stay within API rate limits and handle rate limit errors.
Common Workflowsโ
Accept a Credit Card Paymentโ
-
Client-side: Create a token with card data
POST https://vault.omise.co/tokens -
Server-side: Create a charge with the token
POST https://api.omise.co/charges
Accept PromptPay QR Paymentโ
-
Server-side: Create a PromptPay source
POST https://api.omise.co/sources -
Display QR code to customer
-
Receive webhook when payment completes
Save Card for Future Chargesโ
-
Create a customer
POST https://api.omise.co/customers -
Attach card token to customer
PATCH https://api.omise.co/customers/:id -
Charge the customer's default card
POST https://api.omise.co/charges
Response Formatโ
All API responses are JSON-encoded objects with an object field indicating the resource type:
{
"object": "charge",
"id": "chrg_test_5xuy4w91xqz7d1w9u0t",
"livemode": false,
"amount": 100000,
"currency": "thb",
...
}
List Objectsโ
List endpoints return paginated results:
{
"object": "list",
"data": [
{ "object": "charge", "id": "chrg_..." },
{ "object": "charge", "id": "chrg_..." }
],
"limit": 20,
"offset": 0,
"total": 142,
"from": "2025-01-01T00:00:00Z",
"to": "2025-02-07T23:59:59Z"
}
Testingโ
Use test API keys (containing _test_) for development:
- Test Public Key:
pkey_test_... - Test Secret Key:
skey_test_...
Test keys:
- โ Don't process real payments
- โ Accept test card numbers
- โ Return realistic responses
- โ Trigger webhooks to test endpoints
Client Librariesโ
Official libraries for popular programming languages:
Getting Helpโ
Documentationโ
- API Reference: You're here!
- Payment Guides: Accept Payments
- Webhooks: Webhooks Guide
- Testing: Testing Guide
Supportโ
- Dashboard: https://dashboard.omise.co
- Support Email: support@omise.co
- Status Page: https://status.omise.co
Communityโ
- GitHub: https://github.com/omise
- Stack Overflow: Tag
omise
Next Stepsโ
๐ Authentication Guide
Learn how to authenticate your API requests and secure your integration.
Get Started โ
๐ณ Charges API
Start accepting payments by creating your first charge.
View Charges API โ
Ready to build? Start with Authentication or jump straight to Creating a Charge.