Create and update external disputes
transactionId and disputeId in these examples are placeholders — use real ids from paymentExternalTransactions / paymentExternalDisputes.
Use the paymentExternalDisputeCreate and paymentExternalDisputeUpdate mutations to record and update the disputes of an external payment gateway in OMS.
A dispute is always linked to a transaction, never directly to an order: to find the order a dispute affects, traverse its externalTransaction and, from there, the transaction's order — see From transactions and disputes to the order.
Create an external dispute
Use paymentExternalDisputeCreate mutation to add a new dispute to OMS. The mutation accepts a PaymentExternalDisputeCreateInput object — its reference lists all the available fields.
Use it when the payment provider opens a chargeback, claim or similar dispute against a payment recorded in OMS.
Field notes:
transactionIdis the disputed transaction;numberis the dispute identifier assigned by the provider.amountis negative.statusis one of the dispute statuses.defenseEndAtis the merchant defense deadline, cleared automatically when the dispute reaches a final status.
mutation createExternalDispute {
paymentExternalDisputeCreate(
input: {
transactionId: "1005"
number: "12345"
amount: -10.1
currency: "EUR"
reason: "Items not delivered"
status: pended
defenseEndAt: "2026-12-03T10:15:30.000Z"
}
) {
id
}
}{
"data": {
"paymentExternalDisputeCreate": {
"id": "12"
}
},
"extensions": {
"queryComplexity": 2,
"bucketBalance": 9998,
"bucketRestoreRate": 100
}
}Update an external dispute
Use paymentExternalDisputeUpdate mutation to update an existing dispute in OMS. The mutation accepts a PaymentExternalDisputeUpdateInput object — its reference lists all the available fields.
It updates the status, the provider reason or the defense deadline of an existing dispute.
Field notes:
statustransitions are validated: an invalid one (including the status the dispute already has) is rejected withInvalid status updateand the error codeBAD_REQUEST. The allowed transitions are listed in Dispute statuses.defenseEndAtcan be updated while the dispute is active; it is cleared when the dispute reaches a final status.
mutation updateExternalDispute {
paymentExternalDisputeUpdate(
disputeId: "12"
input: {
status: closed
reason: "Cancelled"
}
) {
id
}
}{
"data": {
"paymentExternalDisputeUpdate": {
"id": "12"
}
},
"extensions": {
"queryComplexity": 2,
"bucketBalance": 9998,
"bucketRestoreRate": 100
}
}