disputes_api = client.disputes
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.
def list_disputes(self,
cursor=None,
states=None,
location_id=None)
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. |
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)
Returns details about a specific dispute.
def retrieve_dispute(self,
dispute_id)
Parameter | Type | Tags | Description |
---|---|---|---|
dispute_id |
string |
Template, Required | The ID of the dispute you want more details about. |
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)
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)
Parameter | Type | Tags | Description |
---|---|---|---|
dispute_id |
string |
Template, Required | The ID of the dispute you want to accept. |
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)
Returns a list of evidence associated with a dispute.
def list_dispute_evidence(self,
dispute_id,
cursor=None)
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. |
List Dispute Evidence Response
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)
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)
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 | - |
Create Dispute Evidence File Response
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)
Uploads text to use as evidence for a dispute challenge.
def create_dispute_evidence_text(self,
dispute_id,
body)
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. |
Create Dispute Evidence Text Response
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)
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)
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. |
Delete Dispute Evidence Response
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)
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)
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. |
Retrieve Dispute Evidence Response
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)
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)
Parameter | Type | Tags | Description |
---|---|---|---|
dispute_id |
string |
Template, Required | The ID of the dispute that you want to submit evidence for. |
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)