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

Capture a charge

Capture a previously authorized charge to complete the payment. Use this for pre-authorization workflows where you authorize first (with capture=false) and capture later.


๐Ÿ”‘API Credentials

Request Parametersโ€‹

Required - 1 fieldRequired Parameters
โ–ผ
`id`STRING(required)
The charge ID to capture. Must be an uncaptured authorized charge (status: successful, authorized: true, capture: false, capturable: true).
Example:"chrg_test_5xuy4w91xqz7d1w9u0t"
Constraints:Must start with chrg_, Must be a valid uncaptured charge, Must be within capture window (7 days)
Additional - 1 fieldAdditional Parameters

Responsesโ€‹

200

Successful capture

Charge captured successfully. Payment now completed and funds transferred.

Key field changes after capture:
  • capture - Changes from false to true
  • paid - Changes from false to true
  • capturable - Changes from true to false
  • refundable - Changes from false to true
  • paid_at - Set to current timestamp

400

Bad request

Invalid parameters provided.

Common causes:
  • Invalid capture_amount (exceeds authorized amount)
  • Invalid charge ID format

401

Unauthorized

Authentication failed. Invalid or missing API key.

Common causes:
  • Missing Authorization header
  • Invalid secret key
  • Using public key instead of secret key

404

Not found

Charge ID does not exist.

Common causes:
  • Incorrect charge ID
  • Charge from different account
  • Using test key for live charge (or vice versa)

422

Unprocessable entity

Charge cannot be captured.

Common causes:
  • Charge already captured
  • Charge not capturable (expired or reversed)
  • Capture amount exceeds authorized amount
  • Authorization expired (beyond 7-day window)

Code samplesโ€‹

curl https://api.omise.co/charges/chrg_test_5xuy4w91xqz7d1w9u0t/capture \
-X POST \
-u skey_test_5xuy4w91xqz7d1w9u0t:

Error and result codesโ€‹

Common Error Codesโ€‹

CodeDescriptionResolution
not_foundCharge ID doesn't existVerify charge ID is correct
already_capturedCharge already capturedCheck charge status before capture
not_capturableCharge cannot be capturedVerify capturable field is true
capture_amount_too_highAmount exceeds authorizationReduce capture_amount
authorization_expiredPre-auth expired (>7 days)Create new charge

Charge Status After Captureโ€‹

FieldBefore CaptureAfter Capture
capturefalsetrue
paidfalsetrue
capturabletruefalse
refundablefalsetrue
paid_atnullISO 8601 timestamp

Try it outโ€‹

Required - 1 fields
โ–ผ
Additional - 1 fields