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 |
str |
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 used to filter the result. If not specified, the endpoint returns all disputes. |
location_id |
str |
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. |
This method returns a ApiResponse
instance. The body
property of this instance returns the response data which is of type List Disputes Response
.
result = disputes_api.list_disputes()
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 |
str |
Template, Required | The ID of the dispute you want more details about. |
This method returns a ApiResponse
instance. The body
property of this instance returns the response data which is of type Retrieve Dispute Response
.
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 |
str |
Template, Required | The ID of the dispute you want to accept. |
This method returns a ApiResponse
instance. The body
property of this instance returns the response data which is of type Accept Dispute Response
.
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 |
str |
Template, Required | The ID of the dispute. |
cursor |
str |
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. |
This method returns a ApiResponse
instance. The body
property of this instance returns the response data which is of type List Dispute Evidence Response
.
dispute_id = 'dispute_id2'
result = disputes_api.list_dispute_evidence(dispute_id)
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 |
str |
Template, Required | The ID of the dispute for which you want to upload evidence. |
request |
Create Dispute Evidence File Request |
Form (JSON-Encoded), Optional | Defines the parameters for a CreateDisputeEvidenceFile request. |
image_file |
typing.BinaryIO |
Form, Optional | - |
This method returns a ApiResponse
instance. The body
property of this instance returns the response data which is of type Create Dispute Evidence File Response
.
dispute_id = 'dispute_id2'
result = disputes_api.create_dispute_evidence_file(dispute_id)
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 |
str |
Template, Required | The ID of the dispute for which you want to upload evidence. |
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. |
This method returns a ApiResponse
instance. The body
property of this instance returns the response data which is of type Create Dispute Evidence Text Response
.
dispute_id = 'dispute_id2'
body = {
'idempotency_key': 'ed3ee3933d946f1514d505d173c82648',
'evidence_text': '1Z8888888888888888',
'evidence_type': 'TRACKING_NUMBER'
}
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.
def delete_dispute_evidence(self,
dispute_id,
evidence_id)
Parameter | Type | Tags | Description |
---|---|---|---|
dispute_id |
str |
Template, Required | The ID of the dispute from which you want to remove evidence. |
evidence_id |
str |
Template, Required | The ID of the evidence you want to remove. |
This method returns a ApiResponse
instance. The body
property of this instance returns the response data which is of type 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 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.
def retrieve_dispute_evidence(self,
dispute_id,
evidence_id)
Parameter | Type | Tags | Description |
---|---|---|---|
dispute_id |
str |
Template, Required | The ID of the dispute from which you want to retrieve evidence metadata. |
evidence_id |
str |
Template, Required | The ID of the evidence to retrieve. |
This method returns a ApiResponse
instance. The body
property of this instance returns the response data which is of type 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.
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.
def submit_evidence(self,
dispute_id)
Parameter | Type | Tags | Description |
---|---|---|---|
dispute_id |
str |
Template, Required | The ID of the dispute for which you want to submit evidence. |
This method returns a ApiResponse
instance. The body
property of this instance returns the response data which is of type Submit Evidence Response
.
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)