DisputesApi disputesApi = client.getDisputesApi();
DisputesApi
- List Disputes
- Retrieve Dispute
- Accept Dispute
- List Dispute Evidence
- Create Dispute Evidence File
- Create Dispute Evidence Text
- Delete Dispute Evidence
- Retrieve Dispute Evidence
- Submit Evidence
Returns a list of disputes associated with a particular account.
CompletableFuture<ListDisputesResponse> listDisputesAsync(
final String cursor,
final String states,
final String locationId)
Parameter | Type | Tags | Description |
---|---|---|---|
cursor |
String |
Query, Optional | A pagination cursor returned by a previous call to this endpoint. Provide this cursor to retrieve the next set of results for the original query. For more information, see Pagination. |
states |
String |
Query, Optional | The dispute states used to filter the result. If not specified, the endpoint returns all disputes. |
locationId |
String |
Query, Optional | The ID of the location for which to return a list of disputes. If not specified, the endpoint returns disputes associated with all locations. |
disputesApi.listDisputesAsync(null, null, null).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
Returns details about a specific dispute.
CompletableFuture<RetrieveDisputeResponse> retrieveDisputeAsync(
final String disputeId)
Parameter | Type | Tags | Description |
---|---|---|---|
disputeId |
String |
Template, Required | The ID of the dispute you want more details about. |
String disputeId = "dispute_id2";
disputesApi.retrieveDisputeAsync(disputeId).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
Accepts the 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 does not have sufficient funds, Square debits the associated bank account.
CompletableFuture<AcceptDisputeResponse> acceptDisputeAsync(
final String disputeId)
Parameter | Type | Tags | Description |
---|---|---|---|
disputeId |
String |
Template, Required | The ID of the dispute you want to accept. |
String disputeId = "dispute_id2";
disputesApi.acceptDisputeAsync(disputeId).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
Returns a list of evidence associated with a dispute.
CompletableFuture<ListDisputeEvidenceResponse> listDisputeEvidenceAsync(
final String disputeId,
final String cursor)
Parameter | Type | Tags | Description |
---|---|---|---|
disputeId |
String |
Template, Required | The ID of the dispute. |
cursor |
String |
Query, Optional | A pagination cursor returned by a previous call to this endpoint. Provide this cursor to retrieve the next set of results for the original query. For more information, see Pagination. |
String disputeId = "dispute_id2";
disputesApi.listDisputeEvidenceAsync(disputeId, null).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
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.
CompletableFuture<CreateDisputeEvidenceFileResponse> createDisputeEvidenceFileAsync(
final String disputeId,
final CreateDisputeEvidenceFileRequest request,
final FileWrapper imageFile)
Parameter | Type | Tags | Description |
---|---|---|---|
disputeId |
String |
Template, Required | The ID of the dispute for which you want to upload evidence. |
request |
CreateDisputeEvidenceFileRequest |
Form (JSON-Encoded), Optional | Defines the parameters for a CreateDisputeEvidenceFile request. |
imageFile |
FileWrapper |
Form, Optional | - |
CreateDisputeEvidenceFileResponse
String disputeId = "dispute_id2";
disputesApi.createDisputeEvidenceFileAsync(disputeId, null, null).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
Uploads text to use as evidence for a dispute challenge.
CompletableFuture<CreateDisputeEvidenceTextResponse> createDisputeEvidenceTextAsync(
final String disputeId,
final CreateDisputeEvidenceTextRequest body)
Parameter | Type | Tags | Description |
---|---|---|---|
disputeId |
String |
Template, Required | The ID of the dispute for which you want to upload evidence. |
body |
CreateDisputeEvidenceTextRequest |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
CreateDisputeEvidenceTextResponse
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
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
Removes specified evidence from a dispute. Square does not send the bank any evidence that is removed.
CompletableFuture<DeleteDisputeEvidenceResponse> deleteDisputeEvidenceAsync(
final String disputeId,
final String evidenceId)
Parameter | Type | Tags | Description |
---|---|---|---|
disputeId |
String |
Template, Required | The ID of the dispute from which you want to remove evidence. |
evidenceId |
String |
Template, Required | The ID of the evidence you want to remove. |
String disputeId = "dispute_id2";
String evidenceId = "evidence_id2";
disputesApi.deleteDisputeEvidenceAsync(disputeId, evidenceId).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
Returns the metadata for the evidence specified in the request URL path.
You must maintain a copy of any evidence uploaded if you want to reference it later. Evidence cannot be downloaded after you upload it.
CompletableFuture<RetrieveDisputeEvidenceResponse> retrieveDisputeEvidenceAsync(
final String disputeId,
final String evidenceId)
Parameter | Type | Tags | Description |
---|---|---|---|
disputeId |
String |
Template, Required | The ID of the dispute from which you want to retrieve evidence metadata. |
evidenceId |
String |
Template, Required | The ID of the evidence to retrieve. |
RetrieveDisputeEvidenceResponse
String disputeId = "dispute_id2";
String evidenceId = "evidence_id2";
disputesApi.retrieveDisputeEvidenceAsync(disputeId, evidenceId).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
Submits evidence to the cardholder's bank.
The evidence submitted by this endpoint includes evidence uploaded using the CreateDisputeEvidenceFile and CreateDisputeEvidenceText endpoints and evidence automatically provided by Square, when available. Evidence cannot be removed from a dispute after submission.
CompletableFuture<SubmitEvidenceResponse> submitEvidenceAsync(
final String disputeId)
Parameter | Type | Tags | Description |
---|---|---|---|
disputeId |
String |
Template, Required | The ID of the dispute for which you want to submit evidence. |
String disputeId = "dispute_id2";
disputesApi.submitEvidenceAsync(disputeId).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});