The Chargeback Management API lets merchants programmatically retrieve, manage, and respond to chargebacks. It replaces manual workflows (email or the chargeback portal) so you can integrate chargeback handling directly into your own internal systems.
To automate chargeback handling in real time, subscribe to chargeback webhooks to be notified whenever a chargeback is created or changes status, and then call the Chargeback Management API to fetch full chargeback details and submit your response.
This guide covers:
- Receiving chargeback notifications with webhooks (
chargeback_request.*events) and retrieving full details via the API GET /api/v1/chargeback_requests— list chargeback requestsGET /api/v1/chargeback_requests/{id}— get a chargeback request's detailsPOST /api/v1/chargeback_requests/{id}/accept— accept a chargebackPOST /api/v1/chargeback_requests/{id}/defend— defend a chargeback
Feature gate
All chargeback endpoints and chargeback_request.* webhook events are guarded by chargeback feature enablement for your merchant account. If the feature is not enabled, the API endpoints return 404 Not Found and chargeback webhook events are not available in the dashboard. Contact KOMOJU support to enable it.
Authentication
Use your merchant secret key with Authentication. Send the secret key as the HTTP Basic Auth username and leave the password blank. You can find your secret key on the API key page of your merchant dashboard.
curl -u YOUR_SECRET_KEY: \
https://komoju.com/api/v1/chargeback_requestsCommon behavior
- Date/time inputs must be ISO 8601
date-timestrings (for example2026-05-01T00:00:00Z). - List endpoints use the standard pagination format:
resource,total,page,per_page,last_page,data. per_pagedefaults to10, with a maximum of100.
Chargeback statuses
| Status | Description |
|---|---|
pending | Awaiting your response (accept or defend). |
accepted | You accepted the chargeback. |
defended | You submitted a defense. |
cancelled | The chargeback was cancelled. |
expired | The response window passed without a response. |
lost | The chargeback was decided against you. |
Receiving chargeback notifications with webhooks
Instead of polling the API for new disputes, use Webhooks to receive real-time notifications when a chargeback request is created or transitions to a new status.
Because webhook deliveries contain a summary of the chargeback request (the same fields returned by List chargeback requests), the recommended integration flow is:
- Subscribe to chargeback webhook events in your KOMOJU Merchant Dashboard.
- Receive and verify the webhook on your server, check
type(orX-Komoju-Event), extract the chargeback request ID (data.id), and respond with200 OK. - Retrieve full chargeback details by calling
GET /api/v1/chargeback_requests/{id}withdata.idto obtain the complete record (timeline, detailedpaymentinformation,customerdetails,last_updated_at, and anydefensedata). - Respond to the chargeback (for
pendingchargebacks beforedue_date) using Accept a chargeback request or Defend a chargeback request.
Setting up chargeback webhooks
- Open your KOMOJU Merchant Dashboard and go to Manage → Webhooks.
- Create a new webhook (or edit an existing one) with your HTTPS endpoint URL and a secret token for signature verification.
- Under the Chargeback Request event group, enable the events you want to receive (at minimum
chargeback_request.pendingfor newly created chargebacks). - Save the webhook. KOMOJU sends a
pingevent so you can verify connectivity.
Availability
- The Chargeback Request webhook event group only appears when Chargeback Management is enabled for your merchant account.
- Chargeback events are not supported for per-payment webhooks or Platform Model (Platform merchant / Account Group parent) webhooks.
- Deadline reminders (sent 24 hours before
due_date) are delivered by email only and do not emit a webhook event.
Chargeback webhook events
| Event | Description |
|---|---|
chargeback_request.pending | A chargeback request has been created and is awaiting your response. |
chargeback_request.accepted | A chargeback request has been accepted. |
chargeback_request.defended | A defense has been submitted for a chargeback request. |
chargeback_request.cancelled | A chargeback request has been cancelled. |
chargeback_request.expired | A chargeback request has expired without a response before its due date. |
chargeback_request.lost | A defended chargeback request has been decided against you. |
Example webhook delivery
When a chargeback event occurs, KOMOJU sends an HTTP POST request to your webhook URL. For full details on headers, signature verification, and retry behavior, see the Webhooks guide.
HTTP headers
| Header | Description |
|---|---|
X-Komoju-ID | Unique ID of the webhook delivery. |
X-Komoju-Signature | SHA-256 HMAC hex digest of the raw request body computed using your webhook secret token. |
X-Komoju-Event | Event name (for example chargeback_request.pending). |
User-Agent | Komoju-Webhook |
Content-Type | application/json |
Example request
POST /webhooks/komoju HTTP/1.1
Host: example.com
X-Komoju-ID: 6cul2yma626autvvxz2xre1qr
X-Komoju-Signature: 75e653443e6543ee4c4b0665c73a4818216c9464f4a3ac959bff5ebafc105693
X-Komoju-Event: chargeback_request.pending
User-Agent: Komoju-Webhook
Content-Type: application/json
{
"id": "dv7ywuavew3n2meqsllj5bbob",
"type": "chargeback_request.pending",
"resource": "event",
"data": {
"id": "igqcsinacgl9iwz7ii3bknwpr",
"payment_id": "enj2pugqquwjlb1slvk3pikr8",
"amount": 1000,
"currency": "JPY",
"payment_method": {
"type": "credit_card",
"brand": "visa",
"last_four_digits": "4242"
},
"reason_code": "CB_Fraud",
"reason": "Fraud",
"created_at": "2026-05-06T02:49:18Z",
"due_date": "2026-05-22T02:49:18Z",
"status": "pending"
},
"created_at": "2026-05-06T02:49:18Z",
"reason": null
}Retrieving chargeback details after receiving a webhook
The webhook's data object gives you the key summary attributes (id, payment_id, amount, currency, payment_method, reason_code, reason, created_at, due_date, status), which is enough to identify the dispute and alert your system.
To inspect the complete chargeback record — including last_updated_at, timeline, full payment details (created_at, captured_at, masked_card_number), customer contact information, and any submitted defense details — verify the webhook signature and pass data.id to Get a chargeback request:
1. Verify the webhook and extract data.id
Verify X-Komoju-Signature against the raw, unmodified request body before trusting the payload, then enqueue background processing with data.id and return 200 OK:
require "json"
require "openssl"
require "sinatra"
WEBHOOK_SECRET_TOKEN = ENV.fetch("KOMOJU_WEBHOOK_SECRET_TOKEN")
post "/webhooks/komoju" do
raw_body = request.body.read
expected_signature = OpenSSL::HMAC.hexdigest("sha256", WEBHOOK_SECRET_TOKEN, raw_body)
received_signature = request.env["HTTP_X_KOMOJU_SIGNATURE"].to_s
halt 400 unless Rack::Utils.secure_compare(expected_signature, received_signature)
event = JSON.parse(raw_body)
if event["type"].start_with?("chargeback_request.")
chargeback_id = event.dig("data", "id")
# Enqueue an async job to fetch full details via GET /api/v1/chargeback_requests/{id}
SyncChargebackJob.perform_later(chargeback_id: chargeback_id, event_id: event["id"])
end
status 200
end2. Fetch full chargeback details from the API
Using the chargeback_id (data.id, for example igqcsinacgl9iwz7ii3bknwpr) extracted from the webhook payload, call GET /api/v1/chargeback_requests/{id} with your merchant secret key:
curl -X GET "https://komoju.com/api/v1/chargeback_requests/igqcsinacgl9iwz7ii3bknwpr" \
-u YOUR_SECRET_KEY: \
-H "Content-Type: application/json"This returns the full chargeback detail object (see Get a chargeback request for the complete response schema), reflecting the latest status on KOMOJU even if multiple webhook events were delivered out of order.
Webhook best practices
- Respond quickly and fetch asynchronously: KOMOJU enforces a 5-second timeout on webhook deliveries. Acknowledge the webhook with a
2xxstatus as soon as the signature is verified and enqueue the API call in a background job. - Handle retries idempotently: If your endpoint does not return a
2xxstatus or times out, KOMOJU retries delivery up to 25 times over 25 days. Deduplicate using the eventidorX-Komoju-IDheader. - Reconcile with the list endpoint if needed: As a safety net for missed notifications or downtime, you can periodically query
GET /api/v1/chargeback_requests?status=pendingto check for open chargebacks requiring action.
List chargeback requests
Retrieves a paginated list of chargeback requests for the authenticated merchant.
| Authentication | Method | Endpoint |
|---|---|---|
| Secret key | GET | https://komoju.com/api/v1/chargeback_requests |
Returns 200 OK on success.
| Query Parameter | Type | Description |
|---|---|---|
status | string | Filter by status. One of pending, accepted, cancelled, expired, defended, lost. |
payment_id | string | Filter by the associated payment ID. |
start_time | string date-time | Lower bound (inclusive) on the chargeback's created time. |
end_time | string date-time | Upper bound (inclusive) on the chargeback's created time. |
due_date_start | string date-time | Lower bound (inclusive) on the chargeback's due date. |
due_date_end | string date-time | Upper bound (inclusive) on the chargeback's due date. |
per_page | integer | Results per page. Defaults to 10, max 100. |
page | integer | Page number. Defaults to 1. |
Ordering
Results are returned with pending chargebacks first, followed by non-pending chargebacks. There is no request sort parameter.
Example request
curl -X GET "https://komoju.com/api/v1/chargeback_requests?status=pending&start_time=2026-05-01T00:00:00Z&end_time=2026-05-31T23:59:59Z&per_page=10&page=1" \
-u YOUR_SECRET_KEY: \
-H "Content-Type: application/json"Example response
{
"resource": "list",
"total": 2,
"page": 1,
"per_page": 10,
"last_page": 1,
"data": [
{
"id": "igqcsinacgl9iwz7ii3bknwpr",
"payment_id": "enj2pugqquwjlb1slvk3pikr8",
"amount": 1000,
"currency": "JPY",
"payment_method": {
"type": "credit_card",
"brand": "visa",
"last_four_digits": "4242"
},
"reason_code": "CB_Fraud",
"reason": "Fraud",
"created_at": "2026-05-06T02:49:18Z",
"due_date": "2026-05-22T02:49:18Z",
"status": "pending"
}
]
}Get a chargeback request
Retrieves the details of a single chargeback request, including its timeline, payment, customer, and defense (if one exists).
| Authentication | Method | Endpoint |
|---|---|---|
| Secret key | GET | https://komoju.com/api/v1/chargeback_requests/{id} |
Returns 200 OK on success.
| Path Parameter | Type | Description |
|---|---|---|
id | string | The chargeback request UUID. |
Example request
curl -X GET "https://komoju.com/api/v1/chargeback_requests/igqcsinacgl9iwz7ii3bknwpr" \
-u YOUR_SECRET_KEY: \
-H "Content-Type: application/json"Example response
{
"id": "2sqtcy1hpq0y3f3sos0l1zrww",
"status": "defended",
"reason_code": "CB_Fraud",
"reason": "Fraud / Unauthorized Transaction",
"created_at": "2026-05-28T04:21:21Z",
"due_date": "2026-06-07T14:59:59Z",
"last_updated_at": "2026-05-28T04:59:18Z",
"timeline": [
{
"type": "created",
"occurred_at": "2026-05-28T04:21:21Z"
},
{
"type": "defended",
"occurred_at": "2026-05-28T04:59:18Z"
},
{
"type": "response_due",
"occurred_at": "2026-06-07T14:59:59Z"
}
],
"payment": {
"id": "7zk4ecpe4xbzzoyhyzd5hszus",
"amount": 1864,
"currency": "JPY",
"created_at": "2026-04-23T02:18:57Z",
"captured_at": "2026-04-23T02:18:57Z",
"payment_method": {
"type": "web_money",
"brand": null,
"last_four_digits": null
},
"masked_card_number": null
},
"customer": {
"name": "freeman gordon",
"email": "gordon@example.com"
},
"defense": {
"product_name": "Premium Plan",
"reason": "Customer received the product as agreed.",
"shipping_info": {
"company_name": "DHL",
"shipping_date": "2026-05-20",
"tracking_number": "TRACK-12345",
"shipping_address": "1-2-3 Tokyo"
},
"recipient_info": {
"name": "Jane Doe",
"phone": "090-1234-5678",
"email": "jane@example.com"
},
"documents": [
{
"file_name": "evidence.pdf",
"content_type": "application/pdf",
"file_size": 63,
"uploaded_at": "2026-05-28T04:59:18Z",
"url": "https://example-uploads.s3.ap-northeast-1.amazonaws.com/chargeback_defense/...pdf"
}
]
}
}When a defense exists, the defense object contains:
| Attribute | Description |
|---|---|
product_name | Name of the product or service. |
reason | The merchant's defense reason. |
shipping_info | company_name, shipping_date, tracking_number, shipping_address. |
recipient_info | name, phone, email. |
documents | Array of file_name, content_type, file_size, uploaded_at, url. |
Accept a chargeback request
Accepts a chargeback, agreeing to the dispute. This endpoint takes no request body and returns 204 No Content (empty body) on success.
| Authentication | Method | Endpoint |
|---|---|---|
| Secret key | POST | https://komoju.com/api/v1/chargeback_requests/{id}/accept |
Rules
- You can only accept a chargeback while its status is
pending. - If the due date has passed, the request returns an error.
- Accepting an already-accepted chargeback returns
204(idempotent).
Example request
curl -X POST "https://komoju.com/api/v1/chargeback_requests/igqcsinacgl9iwz7ii3bknwpr/accept" \
-u YOUR_SECRET_KEY: \
-H "Content-Type: application/json"Defend a chargeback request
Submits a defense against a chargeback, including supporting documentation. Returns 204 No Content (empty body) on success.
| Authentication | Method | Endpoint |
|---|---|---|
| Secret key | POST | https://komoju.com/api/v1/chargeback_requests/{id}/defend |
* = required
| Request Attribute | Type | Description |
|---|---|---|
description * | string | Explanation of your defense. |
document * | object | Supporting document. See below. |
product_name | string | Name of the product or service. |
shipping_info | object | company_name, shipping_date (e.g. 2026-05-20), tracking_number, shipping_address. |
recipient_info | object | name, phone, email. |
The document object:
| Request Attribute | Type | Description |
|---|---|---|
document_base64 * | string | Base64-encoded file contents. |
filename | string | Original file name. |
content_type | string | MIME type of the file. |
Document requirements
- The base64 payload must be 15 MB or less.
- Supported types: PDF, JPG/JPEG, PNG, GIF.
- The file type is inferred from the file's bytes, not the filename. Other types are rejected with a validation error.
Example request
curl -X POST "https://komoju.com/api/v1/chargeback_requests/igqcsinacgl9iwz7ii3bknwpr/defend" \
-u YOUR_SECRET_KEY: \
-H "Content-Type: application/json" \
-d '{
"product_name": "Premium Plan",
"description": "Customer received the product as agreed.",
"document": {
"document_base64": "JVBERi0xLjQKMSAwIG9iago8PCAvVHlwZSAvQ2F0YWxvZyAvUGFnZXMgMiAwIFIgPj4KZW5kb2JqCiUlRU9G",
"filename": "evidence.pdf",
"content_type": "application/pdf"
},
"shipping_info": {
"company_name": "DHL",
"shipping_date": "2026-05-20",
"tracking_number": "TRACK-12345",
"shipping_address": "1-2-3 Tokyo"
},
"recipient_info": {
"name": "Jane Doe",
"phone": "090-1234-5678",
"email": "jane@example.com"
}
}'Rules
- You can only defend a chargeback while its status is
pending. - If the due date has passed, the request returns an error.
- Defending an already-defended chargeback returns
204(idempotent). - Duplicate defenses are prevented; only one defense can be created per chargeback request.
Errors
Chargeback endpoints return standard API error objects. Common cases:
| Status | When |
|---|---|
401 Unauthorized | The secret key is missing or invalid. |
404 Not Found | The feature is disabled for your merchant, or the chargeback ID does not exist for the authenticated merchant. |
400 Bad Request | Only pending chargebacks can be accepted. / Only pending chargebacks can be defended. / Chargeback due date has passed and can no longer be responded to. / invalid or oversized base64 document payload. |
422 Unprocessable Entity | Missing required defend parameters (for example description or document), or invalid date-time format in query params. |
Error body shape
{
"error": {
"code": "bad_request",
"message": "Only pending chargebacks can be defended.",
"param": null,
"details": {}
}
}