Close Dispute
Close a dispute after resolution. This endpoint finalizes a dispute that has been resolved, either through successful defense or after the review process is complete.
Request Parametersโ
Required - 1 fieldRequired Parameters
`id`STRING(required)
Dispute ID to close (path parameter). The dispute must be in a state that allows closure.
Additional - 1 fieldAdditional Parameters
Responsesโ
200
Dispute closedDispute closed successfully. The dispute is now finalized and no further actions can be taken.
After closing:
status- Set to final status (won or lost)closed_at- Set to current timestamp- If won: Disputed funds are retained by merchant
- If lost: Disputed funds are returned to customer
- No further updates can be made to this dispute
400
Bad requestRequest validation failed. Check the error message for details.
Common causes:
- Invalid dispute ID format
- Invalid status value
- Missing dispute ID
401
UnauthorizedAuthentication 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 foundDispute not found.
Common causes:
- Incorrect dispute ID
- Dispute belongs to different account
- ID typo or formatting error
422
Unprocessable entityDispute cannot be closed.
Common causes:
- Dispute is already closed
- Dispute status does not allow closure
- Dispute is still under review and cannot be manually closed
5xx
Server errorServer-side error occurred. These are rare but should be handled gracefully.
How to handle:
- Retry the request with exponential backoff
- Check status.omise.co for service incidents
- See Error Handling for detailed guidance
Code samplesโ
- cURL
- Ruby
- Python
- Node.js
- PHP
- Java
- C#
- Go
curl https://api.omise.co/disputes/dspt_test_5xuy4w91xqz7d1w9u0t/close \
-X POST \
-u skey_test_5xuy4w91xqz7d1w9u0t: \
-d "status=won"
require 'omise'
Omise.api_key = 'skey_test_5xuy4w91xqz7d1w9u0t'
dispute = Omise::Dispute.close('dspt_test_5xuy4w91xqz7d1w9u0t', {
status: 'won'
})
import omise
omise.api_secret = 'skey_test_5xuy4w91xqz7d1w9u0t'
dispute = omise.Dispute.close('dspt_test_5xuy4w91xqz7d1w9u0t', status='won')
const omise = require('omise')({
secretKey: 'skey_test_5xuy4w91xqz7d1w9u0t'
});
const dispute = await omise.disputes.close('dspt_test_5xuy4w91xqz7d1w9u0t', {
status: 'won'
});
<?php
define('OMISE_SECRET_KEY', 'skey_test_5xuy4w91xqz7d1w9u0t');
$dispute = OmiseDispute::close('dspt_test_5xuy4w91xqz7d1w9u0t', [
'status' => 'won'
]);
Client client = new Client.Builder()
.secretKey("skey_test_5xuy4w91xqz7d1w9u0t")
.build();
Dispute dispute = client.disputes().close("dspt_test_5xuy4w91xqz7d1w9u0t")
.status("won")
.send();
var client = new Client("skey_test_5xuy4w91xqz7d1w9u0t");
var dispute = await client.Disputes.Close("dspt_test_5xuy4w91xqz7d1w9u0t", new CloseDisputeRequest
{
Status = "won"
});
client, _ := omise.NewClient(
"pkey_test_5xuy4w91xqz7d1w9u0t",
"skey_test_5xuy4w91xqz7d1w9u0t",
)
dispute, _ := client.CloseDispute("dspt_test_5xuy4w91xqz7d1w9u0t", &operations.CloseDispute{
Status: "won",
})
Error and result codesโ
Common Error Codesโ
| Code | Description | Resolution |
|---|---|---|
authentication_failure | Invalid API key | Verify your secret key is correct |
not_found | Dispute not found | Check dispute ID is correct |
dispute_already_closed | Dispute is already closed | Cannot close an already closed dispute |
invalid_dispute_status | Dispute status invalid | Dispute must be in a closeable state |
Final Status Valuesโ
| Status | Description | Financial Impact |
|---|---|---|
won | Merchant won the dispute | Funds retained by merchant |
lost | Merchant lost the dispute | Funds returned to customer |
Dispute Resolution Timelineโ
| Stage | Description |
|---|---|
| Open | Dispute created, awaiting merchant response |
| Pending | Response submitted, under bank review |
| Closed (Won/Lost) | Final decision made |
API Credentials
Try it outโ
Required - 1 fields
Additional - 1 fields
Your IP:
...Loading...