Charge API
The Charge API allows you to create and manage payment charges for all payment methods supported by Omise.
Endpointsโ
- Create Charge - Create a new charge
- Retrieve Charge - Get details of a specific charge
- Update Charge - Update charge information
- List Charges - List all charges
- Search Charges - Search for specific charges
- Capture Charge - Capture a pre-authorized charge
- Reverse Charge - Reverse an uncaptured charge
- Expire Charge - Manually expire a charge
- Mark Charge as Paid - Mark a charge as paid (test mode only)
- Mark Charge as Failed - Mark a charge as failed (test mode only)
Common Use Casesโ
- One-time payments: Create charges for immediate payment
- Pre-authorization: Authorize funds and capture later
- Recurring billing: Create charges for saved payment methods
- Multi-currency: Process charges in different currencies
Charge Failure Codesโ
When a charge fails, the failure_code attribute indicates the reason. Here are all possible failure codes:
Payment Failure Codesโ
| Code | Message | Description |
|---|---|---|
confirmed_amount_mismatch | "final amount from payment channel does not match original amount charged" | Amount mismatch with payment provider |
expired_card | "card is expired" | Card has expired |
failed_fraud_check | "fraud check failed" | Card flagged as fraudulent |
failed_processing | "processing failed" | General payment processing failure |
insufficient_balance | "insufficient balance" | Insufficient funds in account |
insufficient_fund | "insufficient funds" | Card has reached credit limit or insufficient funds |
invalid_account | "invalid account" | Valid account for payment method not found |
invalid_account_number | "invalid account number" | Account number is invalid |
invalid_security_code | "invalid security code" | CVV/CVC code is incorrect |
payment_cancelled | "payment cancelled" | Payment cancelled by payer |
payment_rejected | "payment rejected" | Payment rejected by issuer |
stolen_or_lost_card | "stolen or lost card" | Card reported stolen or lost |
timeout | "timeout" | Payment provider did not respond in time |
Operation Failure Codesโ
| Code | Message | Description |
|---|---|---|
failed_capture | "capture failed" | Charge capture unsuccessful |
failed_void | "void failed" | Charge void operation unsuccessful |
failed_reverse | "reverse failed" | Charge reversal unsuccessful |
failed_refund | "refund failed" | Refund processing error |
expired_charge | "charge expired" | Authorization window exceeded |
3D Secure Failure Codesโ
| Code | Message | Description |
|---|---|---|
3ds_authentication_failed | "3D Secure authentication failed" | Customer failed 3D Secure verification |
3ds_rejected | "3D Secure rejected" | 3D Secure rejected by issuer |
Charge Status Valuesโ
| Status | Description |
|---|---|
successful | Payment completed successfully |
pending | Awaiting customer action (e.g., scan QR code, complete 3DS) |
failed | Payment failed (check failure_code for reason) |
reversed | Uncaptured charge reversed |
expired | Charge expired before completion |
Related Resourcesโ
- Tokens - Tokenize payment methods before creating charges
- Sources - Alternative payment methods
- Customers - Save payment methods for recurring charges
- Refunds - Refund charged amounts
- Error Handling - Complete API error reference