Skip to main content
Posts a message on the dispute thread as the merchant, with up to 5 files. It appears on dhmad.tn → Support like a reply from your team, and the payer is told: a payer with a DHMAD account gets a notification, a guest payer gets an email with a link to the payment’s protect page. DHMAD sees it too. :id is the dispute id or its ticket number. Needs an API key with Disputes access (Read & reply). See Permissions.

What a message changes

  • When DHMAD asked for your side (deadlines.merchantReplyBy is set), your first message, text or files, is your side: it stops the automatic refund, and deadlines.merchantRepliedAt records when it arrived. DHMAD then decides.
  • Otherwise a message moves no deadline. The 20 days of a charge dispute keep running (deadlines.closesAt).
  • A resolved thread opens again when you write on it. Once DHMAD has closed the thread, messages are refused with 409 DISPUTE_CLOSED. actions.reply tells you which.

Request body

Send JSON with message, or multipart/form-data with message and one files field per file. A message needs text, files, or both.
string
The text, up to 5,000 characters.
file[]
Multipart only. Up to 5 files, 20 MB each: images (PNG, JPEG, GIF, WebP, HEIC), PDF, Word (.doc, .docx), Excel (.xls, .xlsx), text (.txt) or zip. DHMAD checks that each file’s content matches its type.

Idempotency

Send an Idempotency-Key header (up to 255 characters), for example your helpdesk’s reply id. A retry with the same key on the same dispute returns the message it created with 200 and "idempotentReplay": true: nothing is posted twice and the files are not stored again. A JSON retry with the same key but a different message answers 409 IDEMPOTENCY_KEY_REUSED. A multipart retry is answered before its files are read, so its body is not compared: use a new key for each new message.

Path Parameters

string
required
The dispute id, or its ticket number (for example DH-2026-00042).

Response

201 with message (the message object; author.type is merchant and source is api) and dispute (the dispute object without messages). An idempotent replay returns 200 with the same fields and "idempotentReplay": true. Your message also comes back in the dispute.message.created webhook, with source: "api".

Errors

Errors carry the code in error and code, with a readable message:
Other upload problems return 400 UPLOAD_INCOMPLETE (the upload was cut off), 400 FILE_VALIDATION_FAILED (a file’s content does not match its type) or 503 FILE_STORAGE_UNAVAILABLE. Send the request again with the same Idempotency-Key.