Skip to main content
Version: 2019-05-29 (Current)

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โ€‹

ServerURLPurpose
API Serverhttps://api.omise.coCharges, customers, transfers, and account operations
Vault Serverhttps://vault.omise.coToken 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)
Keep Your Secret Key Safe

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

๐Ÿ’ฐ Balance

Check your available and pending balance across all currencies.

GET /balance

๐Ÿ“Š 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โ€‹

  1. Client-side: Create a token with card data

    POST https://vault.omise.co/tokens
  2. Server-side: Create a charge with the token

    POST https://api.omise.co/charges

View Complete Guide โ†’

Accept PromptPay QR Paymentโ€‹

  1. Server-side: Create a PromptPay source

    POST https://api.omise.co/sources
  2. Display QR code to customer

  3. Receive webhook when payment completes

View Complete Guide โ†’

Save Card for Future Chargesโ€‹

  1. Create a customer

    POST https://api.omise.co/customers
  2. Attach card token to customer

    PATCH https://api.omise.co/customers/:id
  3. Charge the customer's default card

    POST https://api.omise.co/charges

View Complete Guide โ†’


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

View Test Cards โ†’


Client Librariesโ€‹

Official libraries for popular programming languages:


Getting Helpโ€‹

Documentationโ€‹

Supportโ€‹

Communityโ€‹


Next Stepsโ€‹


Ready to build? Start with Authentication or jump straight to Creating a Charge.