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

Mark charge as failed

Mark a test charge as failed. This endpoint is primarily used for testing and reconciliation purposes with limited support for specific payment methods.


๐Ÿ”‘API Credentials

Request Parametersโ€‹

Required - 1 fieldRequired Parameters
โ–ผ
`id`STRING(required)
The charge ID to mark as failed. Must be a test charge that is eligible for manual status updates.
Example:"chrg_test_5xuy4w91xqz7d1w9u0t"
Constraints:Must start with chrg_test_, Charge must be in eligible status, Limited support per payment method

Responsesโ€‹

200

Successfully marked as failed

Charge status updated to failed.

Key field changes:
  • status - Changes to failed
  • failure_code - Set to appropriate failure code
  • failure_message - Descriptive failure message

400

Bad request

Request validation failed.

Common causes:
  • Invalid charge ID format
  • Charge not eligible for manual failure
  • Using live charge (only test charges supported)

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)

Code samplesโ€‹

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

Error and result codesโ€‹

Common Error Codesโ€‹

CodeDescriptionResolution
not_foundCharge ID doesn't existVerify charge ID is correct
not_eligibleCharge cannot be marked as failedCheck charge status and payment method
already_failedCharge already failedNo action needed
not_test_chargeOnly test charges supportedUse test key and test charge

Try it outโ€‹

Required - 1 fields
โ–ผ