Skip to content

Latest commit

 

History

History
373 lines (268 loc) · 11.8 KB

disputes.md

File metadata and controls

373 lines (268 loc) · 11.8 KB

Disputes

DisputesApi disputesApi = client.getDisputesApi();

Class Name

DisputesApi

Methods

List Disputes

Returns a list of disputes associated with a particular account.

Access dispute information: https://developer.squareup.com/docs/disputes-api/process-disputes#access-dispute-information

CompletableFuture<ListDisputesResponse> listDisputesAsync(
    final String cursor,
    final String states,
    final String locationId)

Parameters

Parameter Type Tags Description
cursor String Query, Optional A pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for the original query.
For more information, see Paginating.
states String Query, Optional The dispute states to filter the result.
If not specified, the endpoint
returns all open disputes (dispute status is not
INQUIRY_CLOSED, WON, or LOST).
locationId String Query, Optional The ID of the location for which to return
a list of disputes. If not specified,
the endpoint returns all open disputes
(dispute status is not INQUIRY_CLOSED, WON, or
LOST) associated with all locations.

Response Type

ListDisputesResponse

Example Usage

String cursor = "cursor6";
String states = "EVIDENCE_REQUIRED";
String locationId = "location_id4";

disputesApi.listDisputesAsync(cursor, states, locationId).thenAccept(result -> {
    // TODO success callback handler
}).exceptionally(exception -> {
    // TODO failure callback handler
    return null;
});

Retrieve Dispute

Returns details of a specific dispute.

CompletableFuture<RetrieveDisputeResponse> retrieveDisputeAsync(
    final String disputeId)

Parameters

Parameter Type Tags Description
disputeId String Template, Required The ID of the dispute you want more details about.

Response Type

RetrieveDisputeResponse

Example Usage

String disputeId = "dispute_id2";

disputesApi.retrieveDisputeAsync(disputeId).thenAccept(result -> {
    // TODO success callback handler
}).exceptionally(exception -> {
    // TODO failure callback handler
    return null;
});

Accept Dispute

Accepts loss on a dispute. Square returns the disputed amount to the cardholder and updates the dispute state to ACCEPTED.

Square debits the disputed amount from the seller’s Square account. If the Square account balance does not have sufficient funds, Square debits the associated bank account.

Accept a dispute: https://developer.squareup.com/docs/disputes-api/process-disputes#accept-a-dispute

CompletableFuture<AcceptDisputeResponse> acceptDisputeAsync(
    final String disputeId)

Parameters

Parameter Type Tags Description
disputeId String Template, Required ID of the dispute you want to accept.

Response Type

AcceptDisputeResponse

Example Usage

String disputeId = "dispute_id2";

disputesApi.acceptDisputeAsync(disputeId).thenAccept(result -> {
    // TODO success callback handler
}).exceptionally(exception -> {
    // TODO failure callback handler
    return null;
});

List Dispute Evidence

Returns a list of evidence associated with a dispute.

CompletableFuture<ListDisputeEvidenceResponse> listDisputeEvidenceAsync(
    final String disputeId)

Parameters

Parameter Type Tags Description
disputeId String Template, Required The ID of the dispute.

Response Type

ListDisputeEvidenceResponse

Example Usage

String disputeId = "dispute_id2";

disputesApi.listDisputeEvidenceAsync(disputeId).thenAccept(result -> {
    // TODO success callback handler
}).exceptionally(exception -> {
    // TODO failure callback handler
    return null;
});

Remove Dispute Evidence

Removes specified evidence from a dispute.

Square does not send the bank any evidence that is removed. Also, you cannot remove evidence after submitting it to the bank using SubmitEvidence.

CompletableFuture<RemoveDisputeEvidenceResponse> removeDisputeEvidenceAsync(
    final String disputeId,
    final String evidenceId)

Parameters

Parameter Type Tags Description
disputeId String Template, Required The ID of the dispute you want to remove evidence from.
evidenceId String Template, Required The ID of the evidence you want to remove.

Response Type

RemoveDisputeEvidenceResponse

Example Usage

String disputeId = "dispute_id2";
String evidenceId = "evidence_id2";

disputesApi.removeDisputeEvidenceAsync(disputeId, evidenceId).thenAccept(result -> {
    // TODO success callback handler
}).exceptionally(exception -> {
    // TODO failure callback handler
    return null;
});

Retrieve Dispute Evidence

Returns the specific evidence metadata associated with a specific dispute.

You must maintain a copy of the evidence you upload if you want to reference it later. You cannot download the evidence after you upload it.

CompletableFuture<RetrieveDisputeEvidenceResponse> retrieveDisputeEvidenceAsync(
    final String disputeId,
    final String evidenceId)

Parameters

Parameter Type Tags Description
disputeId String Template, Required The ID of the dispute that you want to retrieve evidence from.
evidenceId String Template, Required The ID of the evidence to retrieve.

Response Type

RetrieveDisputeEvidenceResponse

Example Usage

String disputeId = "dispute_id2";
String evidenceId = "evidence_id2";

disputesApi.retrieveDisputeEvidenceAsync(disputeId, evidenceId).thenAccept(result -> {
    // TODO success callback handler
}).exceptionally(exception -> {
    // TODO failure callback handler
    return null;
});

Create Dispute Evidence File

Uploads a file to use as evidence in a dispute challenge. The endpoint accepts HTTP multipart/form-data file uploads in HEIC, HEIF, JPEG, PDF, PNG, and TIFF formats.

Challenge a dispute: https://developer.squareup.com/docs/disputes-api/process-disputes#challenge-a-dispute

CompletableFuture<CreateDisputeEvidenceFileResponse> createDisputeEvidenceFileAsync(
    final String disputeId,
    final CreateDisputeEvidenceFileRequest request,
    final FileWrapper imageFile)

Parameters

Parameter Type Tags Description
disputeId String Template, Required ID of the dispute you want to upload evidence for.
request CreateDisputeEvidenceFileRequest Form, Optional Defines parameters for a CreateDisputeEvidenceFile request.
imageFile FileWrapper Form, Optional -

Response Type

CreateDisputeEvidenceFileResponse

Example Usage

String disputeId = "dispute_id2";
CreateDisputeEvidenceFileRequest request = new CreateDisputeEvidenceFileRequest.Builder(
        "idempotency_key2")
    .evidenceType("REBUTTAL_EXPLANATION")
    .contentType("content_type0")
    .build();
FileWrapper imageFile = new FileWrapper(new File("dummy_file"), "optional-content-type");

disputesApi.createDisputeEvidenceFileAsync(disputeId, request, imageFile).thenAccept(result -> {
    // TODO success callback handler
}).exceptionally(exception -> {
    // TODO failure callback handler
    return null;
});

Create Dispute Evidence Text

Uploads text to use as evidence for a dispute challenge.

Challenge a dispute: https://developer.squareup.com/docs/disputes-api/process-disputes#challenge-a-dispute

CompletableFuture<CreateDisputeEvidenceTextResponse> createDisputeEvidenceTextAsync(
    final String disputeId,
    final CreateDisputeEvidenceTextRequest body)

Parameters

Parameter Type Tags Description
disputeId String Template, Required The ID of the dispute you want to upload evidence for.
body CreateDisputeEvidenceTextRequest Body, Required An object containing the fields to POST for the request.

See the corresponding object definition for field details.

Response Type

CreateDisputeEvidenceTextResponse

Example Usage

String disputeId = "dispute_id2";
CreateDisputeEvidenceTextRequest body = new CreateDisputeEvidenceTextRequest.Builder(
        "ed3ee3933d946f1514d505d173c82648",
        "1Z8888888888888888")
    .evidenceType("TRACKING_NUMBER")
    .build();

disputesApi.createDisputeEvidenceTextAsync(disputeId, body).thenAccept(result -> {
    // TODO success callback handler
}).exceptionally(exception -> {
    // TODO failure callback handler
    return null;
});

Submit Evidence

Submits evidence to the cardholder's bank.

Before submitting evidence, Square compiles all available evidence. This includes evidence uploaded using the CreateDisputeEvidenceFile and CreateDisputeEvidenceText endpoints, and evidence automatically provided by Square, when available.

Challenge a dispute: https://developer.squareup.com/docs/disputes-api/process-disputes#challenge-a-dispute

CompletableFuture<SubmitEvidenceResponse> submitEvidenceAsync(
    final String disputeId)

Parameters

Parameter Type Tags Description
disputeId String Template, Required The ID of the dispute you want to submit evidence for.

Response Type

SubmitEvidenceResponse

Example Usage

String disputeId = "dispute_id2";

disputesApi.submitEvidenceAsync(disputeId).thenAccept(result -> {
    // TODO success callback handler
}).exceptionally(exception -> {
    // TODO failure callback handler
    return null;
});