Skip to content

Latest commit

 

History

History
384 lines (284 loc) · 10.1 KB

disputes.md

File metadata and controls

384 lines (284 loc) · 10.1 KB

Disputes

IDisputesApi disputesApi = client.DisputesApi;

Class Name

DisputesApi

Methods

List Disputes

Returns a list of disputes associated with a particular account.

ListDisputesAsync(
    string cursor = null,
    string states = null,
    string locationId = null)

Parameters

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.

Response Type

Task<Models.ListDisputesResponse>

Example Usage

try
{
    ListDisputesResponse result = await disputesApi.ListDisputesAsync();
}
catch (ApiException e)
{
    // TODO: Handle exception here
    Console.WriteLine(e.Message);
}

Retrieve Dispute

Returns details about a specific dispute.

RetrieveDisputeAsync(
    string disputeId)

Parameters

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

Response Type

Task<Models.RetrieveDisputeResponse>

Example Usage

string disputeId = "dispute_id2";
try
{
    RetrieveDisputeResponse result = await disputesApi.RetrieveDisputeAsync(disputeId);
}
catch (ApiException e)
{
    // TODO: Handle exception here
    Console.WriteLine(e.Message);
}

Accept Dispute

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.

AcceptDisputeAsync(
    string disputeId)

Parameters

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

Response Type

Task<Models.AcceptDisputeResponse>

Example Usage

string disputeId = "dispute_id2";
try
{
    AcceptDisputeResponse result = await disputesApi.AcceptDisputeAsync(disputeId);
}
catch (ApiException e)
{
    // TODO: Handle exception here
    Console.WriteLine(e.Message);
}

List Dispute Evidence

Returns a list of evidence associated with a dispute.

ListDisputeEvidenceAsync(
    string disputeId,
    string cursor = null)

Parameters

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.

Response Type

Task<Models.ListDisputeEvidenceResponse>

Example Usage

string disputeId = "dispute_id2";
try
{
    ListDisputeEvidenceResponse result = await disputesApi.ListDisputeEvidenceAsync(disputeId);
}
catch (ApiException e)
{
    // TODO: Handle exception here
    Console.WriteLine(e.Message);
}

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.

CreateDisputeEvidenceFileAsync(
    string disputeId,
    Models.CreateDisputeEvidenceFileRequest request = null,
    FileStreamInfo imageFile = null)

Parameters

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 FileStreamInfo Form, Optional -

Response Type

Task<Models.CreateDisputeEvidenceFileResponse>

Example Usage

string disputeId = "dispute_id2";
try
{
    CreateDisputeEvidenceFileResponse result = await disputesApi.CreateDisputeEvidenceFileAsync(disputeId);
}
catch (ApiException e)
{
    // TODO: Handle exception here
    Console.WriteLine(e.Message);
}

Create Dispute Evidence Text

Uploads text to use as evidence for a dispute challenge.

CreateDisputeEvidenceTextAsync(
    string disputeId,
    Models.CreateDisputeEvidenceTextRequest body)

Parameters

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.

Response Type

Task<Models.CreateDisputeEvidenceTextResponse>

Example Usage

string disputeId = "dispute_id2";
CreateDisputeEvidenceTextRequest body = new CreateDisputeEvidenceTextRequest.Builder(
    "ed3ee3933d946f1514d505d173c82648",
    "1Z8888888888888888"
)
.EvidenceType("TRACKING_NUMBER")
.Build();

try
{
    CreateDisputeEvidenceTextResponse result = await disputesApi.CreateDisputeEvidenceTextAsync(
        disputeId,
        body
    );
}
catch (ApiException e)
{
    // TODO: Handle exception here
    Console.WriteLine(e.Message);
}

Delete Dispute Evidence

Removes specified evidence from a dispute. Square does not send the bank any evidence that is removed.

DeleteDisputeEvidenceAsync(
    string disputeId,
    string evidenceId)

Parameters

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.

Response Type

Task<Models.DeleteDisputeEvidenceResponse>

Example Usage

string disputeId = "dispute_id2";
string evidenceId = "evidence_id2";
try
{
    DeleteDisputeEvidenceResponse result = await disputesApi.DeleteDisputeEvidenceAsync(
        disputeId,
        evidenceId
    );
}
catch (ApiException e)
{
    // TODO: Handle exception here
    Console.WriteLine(e.Message);
}

Retrieve Dispute Evidence

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.

RetrieveDisputeEvidenceAsync(
    string disputeId,
    string evidenceId)

Parameters

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.

Response Type

Task<Models.RetrieveDisputeEvidenceResponse>

Example Usage

string disputeId = "dispute_id2";
string evidenceId = "evidence_id2";
try
{
    RetrieveDisputeEvidenceResponse result = await disputesApi.RetrieveDisputeEvidenceAsync(
        disputeId,
        evidenceId
    );
}
catch (ApiException e)
{
    // TODO: Handle exception here
    Console.WriteLine(e.Message);
}

Submit Evidence

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.

SubmitEvidenceAsync(
    string disputeId)

Parameters

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

Response Type

Task<Models.SubmitEvidenceResponse>

Example Usage

string disputeId = "dispute_id2";
try
{
    SubmitEvidenceResponse result = await disputesApi.SubmitEvidenceAsync(disputeId);
}
catch (ApiException e)
{
    // TODO: Handle exception here
    Console.WriteLine(e.Message);
}