Querying the /v1/disputes endpoint

Hey All,

When querying the dispute-api (/v1/disputes) to list all disputes, how do I get payment and/or customer information included in the JSON reply ?

I’ve tried guessing at adding “&payment”, “&payment=true”, “customer”, “&customer=true” to the query string but that didn’t yield anything.

When I query for a payment & the payment is disputed the dispute JSON contains “original_transaction_id”: “payment_xxxxxx”, however when I list disputes the “original_transaction_id” field is not present.

Thanks,

Cheers
Richard

Hi Richard,
Welcome to the Rapyd developer community!
Please try this:

First, list the all the disputes via the
Get {base_uri}/disputes request.

In the response look for the dispute you are interested in, and copy its token. This is the value that begins with the string dispute_.

Then, retrieve specific information on the dispute via the Retrieve Dispute request:
Get {base_uri}/dispute/{dispute}.

Example for retrieving information on a specific dispute:
Request URL: GET https://sandboxapi.rapyd.net/v1/dispute/dispute_be1aaf8405b21c26fd054bf25a8bcd5b

{
    "status": {
        "error_code": "",
        "status": "SUCCESS",
        "message": "",
        "response_code": "",
        "operation_id": "7b934132-227e-458e-b204-1e6992f9038f"
    },
    "data": {
        "id": "1d4c092e-6cef-4126-b3d8-8794456799d1",
        "token": "dispute_be1aaf8405b21c26fd054bf25a8bcd5b",
        "status": "ACT",
        "amount": 26.53,
        "currency": "USD",
        "dispute_category": "Cardholder Dispute",
        "dispute_reason_description": "Credit not processed",
        "original_transaction_currency": "USD",
        "original_transaction_amount": 26.53,
        "original_dispute_amount": 26.53,
        "original_dispute_currency": "USD",
        "original_transaction_id": "payment_b6b3915ceaaa37ec00531cd3baa36c53",
        "ewallet_id": null,
        "central_processing_date": null,
        "created_at": 1633004268,
        "updated_at": 1633004268,
        "due_date": 1633781868.962,
        "payment_method": {
            "id": "card_c80ce71bd02d6f0ed7d4f4363dee0e62",
            "type": "fr_visa_card",
            "category": "card",
            "metadata": null,
            "image": "",
            "webhook_url": "",
            "supporting_documentation": "",
            "next_action": "not_applicable",
            "name": "John Doe",
            "last4": "9043",
            "acs_check": "unchecked",
            "cvv_check": "unchecked",
            "bin_details": {
                "type": null,
                "brand": null,
                "country": null,
                "bin_number": "537450"
            },
            "expiration_year": "21",
            "expiration_month": "11",
            "fingerprint_token": "ocfp_069d543df19c1a9234462660967bc5b9"
        },
        "rate": 1,
        "evidence": null
    }
}

If necessary, use the Retrieve Payment request to get more information on the payment (The ID of the payment can be found in the value of the original_transaction_id field.)

Hope this helps.

2 Likes

Hey @Legato,

Fantastic. All working. Thanks heaps. :slight_smile: :+1:

One more question - Does the /v1/disputes endpoint also support starting_after&ending_before query params to fetch the next set of disputes ?

I’ve tried https://sandboxapi.rapyd.net:443/v1/disputes?limit=3&ending_before=token (dispute_12873…) and https://sandboxapi.rapyd.net:443/v1/disputes?limit=3&ending_before=id (UUID) and neither seems to fetch the next set as it does for customers and payments. It just fetches the same initial set again.

Thanks.

Cheers
Richard

Great! Glad to hear it worked out!
Regarding filtering options for listing disputes, this is currently not available, but it is being planned for a future release.

Thanks

Hey @Legato - Great. Thanks for the info. Does the {base_uri}/disputes query simply return a list of all disputes then ?

Cheers
Richard

1 Like

Hi @Richard,
Yes, the response lists the disputes in chronological order.
You can also use the sandbox to simulate the creation of additional disputes. See this link. The newly created disputes will then appear in the response of ‘List Disputes’.

Thanks

1 Like

Awesome. Thanks so much for the info @Legato :slight_smile: :+1:

2 Likes

Please note that the updated endpoint for the request to retrieve specific information on the dispute is:
Get {base_uri}/disputes/{dispute}

Thanks

2 Likes