Disputes#

A Dispute occurs when a tenant questions a charge with their bank. CasaPay notifies you and provides tools to submit evidence.

The Dispute object#

AttributeTypeDescription
idstringUnique identifier with dp_ prefix
objectstringAlways "dispute"
chargestringDisputed Charge ID
payment_intentstringAssociated PaymentIntent ID
amountintegerDisputed amount
currencystringISO 4217 currency code
statusenumwarning_needs_response, warning_under_review, warning_closed, needs_response, under_review, won, lost
reasonenumduplicate, fraudulent, general, product_not_received, product_unacceptable, subscription_canceled, unrecognized
evidenceobjectEvidence submitted
evidence_due_bytimestampDeadline to submit evidence
metadatahashKey-value pairs
createdtimestampTime at which the object was created
{
  "id": "dp_xyz789",
  "object": "dispute",
  "charge": "ch_abc123",
  "payment_intent": "pi_1a2b3c4d",
  "amount": 120000,
  "currency": "eur",
  "status": "needs_response",
  "reason": "unrecognized",
  "evidence": {},
  "evidence_due_by": 1707350400,
  "created": 1706140800
}

Retrieve a Dispute#

GET /v1/disputes/:id

curl https://api.casapay.com/v1/disputes/dp_xyz789 \
  -H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc"

Update a Dispute (Submit Evidence)#

POST /v1/disputes/:id

ParameterTypeDescription
evidenceobjectEvidence to submit
evidence.customer_namestringCustomer's name
evidence.customer_emailstringCustomer's email
evidence.billing_addressstringBilling address
evidence.receiptstringFile ID of receipt
evidence.service_documentationstringFile ID of lease/contract
submitbooleanWhether to submit evidence (cannot be undone)
curl https://api.casapay.com/v1/disputes/dp_xyz789 \
  -H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc" \
  -H "Content-Type: application/json" \
  -d '{
    "evidence": {
      "customer_name": "Jane Doe",
      "customer_email": "jane@example.com",
      "service_documentation": "file_lease_001"
    },
    "submit": true
  }'

Close a Dispute#

Accept the dispute and refund the tenant.

POST /v1/disputes/:id/close

curl -X POST https://api.casapay.com/v1/disputes/dp_xyz789/close \
  -H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc"

List Disputes#

GET /v1/disputes

ParameterTypeDescription
chargestringFilter by charge
payment_intentstringFilter by PaymentIntent
statusstringFilter by status
curl "https://api.casapay.com/v1/disputes?status=needs_response" \
  -H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc"