Skip to content

Latest commit

 

History

History
365 lines (247 loc) · 10.1 KB

disputes.md

File metadata and controls

365 lines (247 loc) · 10.1 KB

Disputes

disputes_api = client.disputes

Class Name

DisputesApi

Methods

List Disputes

Returns a list of disputes associated with a particular account.

def list_disputes(self,
                 cursor=None,
                 states=None,
                 location_id=None)

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 str (Dispute State) Query, Optional The dispute states to filter the result.
If not specified, the endpoint returns all open disputes (the dispute status is not INQUIRY_CLOSED, WON,
or LOST).
location_id 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 (the dispute status is not INQUIRY_CLOSED, WON, or LOST) associated with all locations.

Response Type

List Disputes Response

Example Usage

cursor = 'cursor6'
states = 'EVIDENCE_REQUIRED'
location_id = 'location_id4'

result = disputes_api.list_disputes(cursor, states, location_id)

if result.is_success():
    print(result.body)
elif result.is_error():
    print(result.errors)

Retrieve Dispute

Returns details about a specific dispute.

def retrieve_dispute(self,
                    dispute_id)

Parameters

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

Response Type

Retrieve Dispute Response

Example Usage

dispute_id = 'dispute_id2'

result = disputes_api.retrieve_dispute(dispute_id)

if result.is_success():
    print(result.body)
elif result.is_error():
    print(result.errors)

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.

def accept_dispute(self,
                  dispute_id)

Parameters

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

Response Type

Accept Dispute Response

Example Usage

dispute_id = 'dispute_id2'

result = disputes_api.accept_dispute(dispute_id)

if result.is_success():
    print(result.body)
elif result.is_error():
    print(result.errors)

List Dispute Evidence

Returns a list of evidence associated with a dispute.

def list_dispute_evidence(self,
                         dispute_id,
                         cursor=None)

Parameters

Parameter Type Tags Description
dispute_id 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

List Dispute Evidence Response

Example Usage

dispute_id = 'dispute_id2'
cursor = 'cursor6'

result = disputes_api.list_dispute_evidence(dispute_id, cursor)

if result.is_success():
    print(result.body)
elif result.is_error():
    print(result.errors)

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.

def create_dispute_evidence_file(self,
                                dispute_id,
                                request=None,
                                image_file=None)

Parameters

Parameter Type Tags Description
dispute_id string Template, Required The ID of the dispute you want to upload evidence for.
request Create Dispute Evidence File Request Form, Optional Defines the parameters for a CreateDisputeEvidenceFile request.
image_file typing.BinaryIO Form, Optional -

Response Type

Create Dispute Evidence File Response

Example Usage

dispute_id = 'dispute_id2'
request = {}
request['idempotency_key'] = 'idempotency_key2'
request['evidence_type'] = 'REBUTTAL_EXPLANATION'
request['content_type'] = 'content_type0'
image_file = FileWrapper(open('dummy_file', 'rb'), 'optional-content-type')

result = disputes_api.create_dispute_evidence_file(dispute_id, request, image_file)

if result.is_success():
    print(result.body)
elif result.is_error():
    print(result.errors)

Create Dispute Evidence Text

Uploads text to use as evidence for a dispute challenge.

def create_dispute_evidence_text(self,
                                dispute_id,
                                body)

Parameters

Parameter Type Tags Description
dispute_id string Template, Required The ID of the dispute you want to upload evidence for.
body Create Dispute Evidence Text Request Body, Required An object containing the fields to POST for the request.

See the corresponding object definition for field details.

Response Type

Create Dispute Evidence Text Response

Example Usage

dispute_id = 'dispute_id2'
body = {}
body['idempotency_key'] = 'ed3ee3933d946f1514d505d173c82648'
body['evidence_type'] = 'TRACKING_NUMBER'
body['evidence_text'] = '1Z8888888888888888'

result = disputes_api.create_dispute_evidence_text(dispute_id, body)

if result.is_success():
    print(result.body)
elif result.is_error():
    print(result.errors)

Delete 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.

def delete_dispute_evidence(self,
                           dispute_id,
                           evidence_id)

Parameters

Parameter Type Tags Description
dispute_id string Template, Required The ID of the dispute you want to remove evidence from.
evidence_id string Template, Required The ID of the evidence you want to remove.

Response Type

Delete Dispute Evidence Response

Example Usage

dispute_id = 'dispute_id2'
evidence_id = 'evidence_id2'

result = disputes_api.delete_dispute_evidence(dispute_id, evidence_id)

if result.is_success():
    print(result.body)
elif result.is_error():
    print(result.errors)

Retrieve Dispute Evidence

Returns the evidence metadata specified by the evidence ID in the request URL path

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.

def retrieve_dispute_evidence(self,
                             dispute_id,
                             evidence_id)

Parameters

Parameter Type Tags Description
dispute_id string Template, Required The ID of the dispute that you want to retrieve evidence from.
evidence_id string Template, Required The ID of the evidence to retrieve.

Response Type

Retrieve Dispute Evidence Response

Example Usage

dispute_id = 'dispute_id2'
evidence_id = 'evidence_id2'

result = disputes_api.retrieve_dispute_evidence(dispute_id, evidence_id)

if result.is_success():
    print(result.body)
elif result.is_error():
    print(result.errors)

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.

def submit_evidence(self,
                   dispute_id)

Parameters

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

Response Type

Submit Evidence Response

Example Usage

dispute_id = 'dispute_id2'

result = disputes_api.submit_evidence(dispute_id)

if result.is_success():
    print(result.body)
elif result.is_error():
    print(result.errors)