Skip to main content
TroopyDocs
Open Troopy
Troopy

API reference / Disputes

Send the usage of the customer for a dispute

Gives Troopy what your own records show of the customer of one dispute: the account, a summary, the events and pictures. Troopy puts them in the evidence as the records of the business. Call it from your backend when the payment provider tells you of the dispute (charge.dispute.created in Stripe, dispute.opened in Dodo Payments), with the provider's id of the dispute. When Troopy does not know the dispute yet, it reads it from the provider at once. A new call replaces the usage of the dispute. At most 20 summary lines, 500 events and 4 pictures (JPEG or PNG, 300 KB each). Send only what is true: the bank reads it.

post/api/v1/disputes/{id}/usage

Authorization

HeaderAuthorization: Bearer <API key>
Or the headerX-API-Key: <API key>
API keyMake one in Troopy under Settings > API keys. It acts as you, in its workspace.

Other ways to call it

CLItroopy disputes usage
MCP toolNone. Call it over REST or with the CLI.
Rate limit60 calls in 60 seconds, for each key
RetriesSend an Idempotency-Key header. A retry with the same key gets the first answer back, and the operation runs one time.

Path parameters

id*string

The id of the dispute in Troopy, or its id at its payment provider, like du_1MtJUT2eZvKYlo2C in Stripe

At least 1 characters · At most 80 characters

Body

application/json
customerobject

Default {}

4 properties
idstring

The id of the account in your product

At most 120 characters

emailstring

At most 254 characters · email

namestring

At most 120 characters

createdAtstring

When the account was made

date-time

summaryarray<object>

Totals in your own words, like { "label": "Videos made", "value": "38" }

Default [] · At most 20 items

2 properties
label*string

At least 1 characters · At most 80 characters

value*string

At least 1 characters · At most 300 characters

eventsarray<object>

Default [] · At most 500 items

5 properties
at*string

date-time

action*string

What the customer did, like Signed in or Video made

At least 1 characters · At most 80 characters

detailstring

At most 300 characters

ipstring

The address that the customer came from

devicestring

The device or browser, like Chrome on Windows

At most 120 characters

picturesarray<object>

What the customer made or got, like a thumbnail

Default [] · At most 4 items

2 properties
captionstring

Default "" · At most 200 characters

content*string

A JPEG or a PNG, base64-encoded

At most 400004 characters · base64

Response

200 · application/json
data*object
3 properties
dispute*object
18 properties
id*string

A 24-character id

provider*enum<string>

The payment provider of the disputed payment. stripe: Troopy sends the evidence. dodopayments: a person uploads the evidence in the dashboard of Dodo Payments. paddle: Paddle answers by itself, and takes no evidence

stripedodopaymentspaddle

providerId*string

The id of the dispute at its provider. For Paddle, the id of the disputed transaction

live*boolean

false: a dispute of the test mode of the provider

amount*number

The disputed amount, in the units of its currency

currency*string
reason*string

The reason, in the words of Stripe: fraudulent, subscription_canceled or general, for example

status*string

The status, in the words of Stripe for each provider: needs_response, under_review, won, lost, prevented, or one of the warning_ statuses of an inquiry

customer*object
3 properties
id*string | null
email*string | null
name*string | null
filedAt*string

ISO 8601 date and time

dueBy*string | null

When the provider stops taking an answer

stage*enum<string>

Where Troopy is with it. preparing: it collects the evidence. waiting: the evidence waits for a person. submitting: it goes now. unknown: nobody knows if it went, and Troopy reads the dispute again. submitted: it went. let_go: a person decided not to answer. none: the provider takes no answer

preparingwaitingsubmittingunknownsubmittedlet_gonone

why*string | null

Why it waits for a person, or what went wrong

usage*enum<string>

The usage that the backend of the business sends. wanted: Troopy waits for it

nonewantedreceived

submittedAt*string | null
submittedBy*object | null

Who submitted the evidence, or said that it went. Under a grant: the person who granted it

3 properties
type*enum<string>

personagentapi

id*string
name*string
auto*boolean

Whether the evidence went under a grant, without a person

url*string

The dispute, or its payment, in the dashboard of its provider

events*integer
pictures*integer

Errors

400 invalid_inputFix the field named in detail. Each operation's schema is in /api/v1/openapi.json.
401 unauthorizedSend an API key as `Authorization: Bearer tr_live_...`. Create one in Troopy under Settings.
403 forbiddenThe key lacks a scope this operation needs, or its owner lacks the role. detail says which; create a key with the scope, or ask an organization owner or admin.
404 not_foundCheck the path and any id in it. Every operation is listed in /api/v1/openapi.json.
409 conflictThis Idempotency-Key was used for a different request, or that request is still running. Use a new key for a new request.
429 rate_limitedWait the number of seconds in Retry-After, then retry.