const disputesApi = client.disputesApi;
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.
async listDisputes(
cursor?: string,
states?: string,
locationId?: string,
requestOptions?: RequestOptions
): Promise<ApiResponse<ListDisputesResponse>>
Parameter | Type | Tags | Description |
---|---|---|---|
cursor |
string | undefined |
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 | undefined |
Query, Optional | The dispute states used to filter the result. If not specified, the endpoint returns all disputes. |
locationId |
string | undefined |
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. |
requestOptions |
RequestOptions | undefined |
Optional | Pass additional request options. |
try {
const { result, ...httpResponse } = await disputesApi.listDisputes();
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch(error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
Returns details about a specific dispute.
async retrieveDispute(
disputeId: string,
requestOptions?: RequestOptions
): Promise<ApiResponse<RetrieveDisputeResponse>>
Parameter | Type | Tags | Description |
---|---|---|---|
disputeId |
string |
Template, Required | The ID of the dispute you want more details about. |
requestOptions |
RequestOptions | undefined |
Optional | Pass additional request options. |
const disputeId = 'dispute_id2';
try {
const { result, ...httpResponse } = await disputesApi.retrieveDispute(disputeId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch(error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
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.
async acceptDispute(
disputeId: string,
requestOptions?: RequestOptions
): Promise<ApiResponse<AcceptDisputeResponse>>
Parameter | Type | Tags | Description |
---|---|---|---|
disputeId |
string |
Template, Required | The ID of the dispute you want to accept. |
requestOptions |
RequestOptions | undefined |
Optional | Pass additional request options. |
const disputeId = 'dispute_id2';
try {
const { result, ...httpResponse } = await disputesApi.acceptDispute(disputeId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch(error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
Returns a list of evidence associated with a dispute.
async listDisputeEvidence(
disputeId: string,
cursor?: string,
requestOptions?: RequestOptions
): Promise<ApiResponse<ListDisputeEvidenceResponse>>
Parameter | Type | Tags | Description |
---|---|---|---|
disputeId |
string |
Template, Required | The ID of the dispute. |
cursor |
string | undefined |
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. |
requestOptions |
RequestOptions | undefined |
Optional | Pass additional request options. |
const disputeId = 'dispute_id2';
try {
const { result, ...httpResponse } = await disputesApi.listDisputeEvidence(disputeId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch(error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
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.
async createDisputeEvidenceFile(
disputeId: string,
request?: CreateDisputeEvidenceFileRequest,
imageFile?: FileWrapper,
requestOptions?: RequestOptions
): Promise<ApiResponse<CreateDisputeEvidenceFileResponse>>
Parameter | Type | Tags | Description |
---|---|---|---|
disputeId |
string |
Template, Required | The ID of the dispute for which you want to upload evidence. |
request |
CreateDisputeEvidenceFileRequest | undefined |
Form (JSON-Encoded), Optional | Defines the parameters for a CreateDisputeEvidenceFile request. |
imageFile |
FileWrapper | undefined |
Form, Optional | - |
requestOptions |
RequestOptions | undefined |
Optional | Pass additional request options. |
CreateDisputeEvidenceFileResponse
const disputeId = 'dispute_id2';
try {
const { result, ...httpResponse } = await disputesApi.createDisputeEvidenceFile(disputeId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch(error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
Uploads text to use as evidence for a dispute challenge.
async createDisputeEvidenceText(
disputeId: string,
body: CreateDisputeEvidenceTextRequest,
requestOptions?: RequestOptions
): Promise<ApiResponse<CreateDisputeEvidenceTextResponse>>
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. |
requestOptions |
RequestOptions | undefined |
Optional | Pass additional request options. |
CreateDisputeEvidenceTextResponse
const disputeId = 'dispute_id2';
const contentType = null;
const bodyEvidenceType: string = {'' : null, '' : null, '' : null, '' : null, '' : null, '' : null, '' : null, '' : null, '' : null, '' : null, '' : null, '' : null, '' : null, '' : null, '' : null } const body: CreateDisputeEvidenceTextRequest = {
idempotencyKey: 'ed3ee3933d946f1514d505d173c82648',
evidenceText: '1Z8888888888888888',
};
body.evidenceType = bodyEvidenceType;
try {
const { result, ...httpResponse } = await disputesApi.createDisputeEvidenceText(disputeId, body);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch(error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
Removes specified evidence from a dispute. Square does not send the bank any evidence that is removed.
async deleteDisputeEvidence(
disputeId: string,
evidenceId: string,
requestOptions?: RequestOptions
): Promise<ApiResponse<DeleteDisputeEvidenceResponse>>
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. |
requestOptions |
RequestOptions | undefined |
Optional | Pass additional request options. |
const disputeId = 'dispute_id2';
const evidenceId = 'evidence_id2';
try {
const { result, ...httpResponse } = await disputesApi.deleteDisputeEvidence(disputeId, evidenceId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch(error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
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.
async retrieveDisputeEvidence(
disputeId: string,
evidenceId: string,
requestOptions?: RequestOptions
): Promise<ApiResponse<RetrieveDisputeEvidenceResponse>>
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. |
requestOptions |
RequestOptions | undefined |
Optional | Pass additional request options. |
RetrieveDisputeEvidenceResponse
const disputeId = 'dispute_id2';
const evidenceId = 'evidence_id2';
try {
const { result, ...httpResponse } = await disputesApi.retrieveDisputeEvidence(disputeId, evidenceId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch(error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
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.
async submitEvidence(
disputeId: string,
requestOptions?: RequestOptions
): Promise<ApiResponse<SubmitEvidenceResponse>>
Parameter | Type | Tags | Description |
---|---|---|---|
disputeId |
string |
Template, Required | The ID of the dispute for which you want to submit evidence. |
requestOptions |
RequestOptions | undefined |
Optional | Pass additional request options. |
const disputeId = 'dispute_id2';
try {
const { result, ...httpResponse } = await disputesApi.submitEvidence(disputeId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch(error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}