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

Create a Dispute

Create a new dispute for a specific charge. This initiates the chargeback process for the associated transaction.


Request Parametersโ€‹

Required - 1 fieldRequired Parameters
โ–ผ
`id`STRING(required)
Charge ID to create a dispute for (path parameter). The charge must be in a disputable state. Format: chrg_test_ or chrg_live_ followed by alphanumeric string.
Example:"chrg_test_5xuy4w91xqz7d1w9u0t"

Responsesโ€‹

200

Successful creation

Returns the newly created dispute object with initial status set to "open".

Response includes:
  • id - Dispute ID (dspt_test_ or dspt_live_ prefix)
  • object - "dispute"
  • livemode - Whether this is a live mode dispute
  • status - Initial status (open)
  • amount - Disputed amount in smallest currency unit
  • currency - Three-letter ISO currency code
  • reason_code - Reason for dispute
  • reason_message - Human-readable reason description
  • charge - Associated charge ID
  • message - Response message (null initially)
  • documents - List of evidence documents (empty initially)
  • created_at - When dispute was created
  • closed_at - When dispute was closed (null for open disputes)

400

Bad request

Request validation failed. Check the error message for details.

Common causes:
  • Invalid charge ID format
  • Missing required parameters
  • Malformed request body

401

Unauthorized

Authentication failed. Invalid or missing API key.

Common causes:
  • Missing Authorization header
  • Invalid secret key
  • Using public key instead of secret key
  • Incorrect HTTP Basic Auth format

404

Not found

Charge not found.

Common causes:
  • Incorrect charge ID
  • Charge belongs to different account
  • ID typo or formatting error

422

Unprocessable entity

Dispute cannot be created for this charge.

Common causes:
  • Charge already has an existing dispute
  • Charge is not in a disputable state
  • Charge has been refunded
  • Charge is too old to dispute

5xx

Server error

Server-side error occurred. These are rare but should be handled gracefully.

How to handle:

Code samplesโ€‹

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

Error and result codesโ€‹

Common Error Codesโ€‹

CodeDescriptionResolution
bad_requestInvalid parametersCheck charge ID format
authentication_failureInvalid API keyVerify your secret key is correct
not_foundCharge not foundCheck charge ID is correct
invalid_charge_idCharge ID format invalidUse valid chrg_ format
dispute_already_existsCharge already has a disputeCannot create duplicate disputes
charge_not_disputableCharge cannot be disputedVerify charge status and age

Dispute Status Valuesโ€‹

StatusDescription
openNewly initiated, awaiting your response
pendingUnder review with merchant response submitted
wonMerchant won the dispute
lostMerchant lost the dispute

Reason Codesโ€‹

CodeDescription
fraudulentCustomer claims unauthorized transaction
unrecognizedCustomer doesn't recognize the charge
duplicateCustomer claims duplicate charge
goods_or_services_not_providedProduct/service not received
not_as_describedProduct significantly different from description
credit_not_processedRefund promised but not received
generalOther reasons

๐Ÿ”‘API Credentials

Try it outโ€‹

Required - 1 fields
โ–ผ
Your IP: ...Loading...