$disputesApi = $client->getDisputesApi();
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.
function listDisputes(?string $cursor = null, ?string $states = null, ?string $locationId = null): ApiResponse
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 (DisputeState) |
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 ). |
locationId |
?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 = Models\DisputeState::EVIDENCE_REQUIRED;
$locationId = 'location_id4';
$apiResponse = $disputesApi->listDisputes($cursor, $states, $locationId);
if ($apiResponse->isSuccess()) {
$listDisputesResponse = $apiResponse->getResult();
} else {
$errors = $apiResponse->getErrors();
}
// Get more response info...
// $statusCode = $apiResponse->getStatusCode();
// $headers = $apiResponse->getHeaders();
Returns details about a specific dispute.
function retrieveDispute(string $disputeId): ApiResponse
Parameter | Type | Tags | Description |
---|---|---|---|
disputeId |
string |
Template, Required | The ID of the dispute you want more details about. |
$disputeId = 'dispute_id2';
$apiResponse = $disputesApi->retrieveDispute($disputeId);
if ($apiResponse->isSuccess()) {
$retrieveDisputeResponse = $apiResponse->getResult();
} else {
$errors = $apiResponse->getErrors();
}
// Get more response info...
// $statusCode = $apiResponse->getStatusCode();
// $headers = $apiResponse->getHeaders();
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.
function acceptDispute(string $disputeId): ApiResponse
Parameter | Type | Tags | Description |
---|---|---|---|
disputeId |
string |
Template, Required | The ID of the dispute you want to accept. |
$disputeId = 'dispute_id2';
$apiResponse = $disputesApi->acceptDispute($disputeId);
if ($apiResponse->isSuccess()) {
$acceptDisputeResponse = $apiResponse->getResult();
} else {
$errors = $apiResponse->getErrors();
}
// Get more response info...
// $statusCode = $apiResponse->getStatusCode();
// $headers = $apiResponse->getHeaders();
Returns a list of evidence associated with a dispute.
function listDisputeEvidence(string $disputeId, ?string $cursor = null): ApiResponse
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. |
$disputeId = 'dispute_id2';
$cursor = 'cursor6';
$apiResponse = $disputesApi->listDisputeEvidence($disputeId, $cursor);
if ($apiResponse->isSuccess()) {
$listDisputeEvidenceResponse = $apiResponse->getResult();
} else {
$errors = $apiResponse->getErrors();
}
// Get more response info...
// $statusCode = $apiResponse->getStatusCode();
// $headers = $apiResponse->getHeaders();
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.
function createDisputeEvidenceFile(
string $disputeId,
?CreateDisputeEvidenceFileRequest $request = null,
?\Square\Utils\FileWrapper $imageFile = null
): ApiResponse
Parameter | Type | Tags | Description |
---|---|---|---|
disputeId |
string |
Template, Required | The ID of the dispute you want to upload evidence for. |
request |
?CreateDisputeEvidenceFileRequest |
Form, Optional | Defines the parameters for a CreateDisputeEvidenceFile request. |
imageFile |
?\Square\Utils\FileWrapper |
Form, Optional | - |
CreateDisputeEvidenceFileResponse
$disputeId = 'dispute_id2';
$request_idempotencyKey = 'idempotency_key2';
$request = new Models\CreateDisputeEvidenceFileRequest(
$request_idempotencyKey
);
$request->setEvidenceType(Models\DisputeEvidenceType::REBUTTAL_EXPLANATION);
$request->setContentType('content_type0');
$imageFile = 'dummy_file';
$apiResponse = $disputesApi->createDisputeEvidenceFile($disputeId, $request, $imageFile);
if ($apiResponse->isSuccess()) {
$createDisputeEvidenceFileResponse = $apiResponse->getResult();
} else {
$errors = $apiResponse->getErrors();
}
// Get more response info...
// $statusCode = $apiResponse->getStatusCode();
// $headers = $apiResponse->getHeaders();
Uploads text to use as evidence for a dispute challenge.
function createDisputeEvidenceText(string $disputeId, CreateDisputeEvidenceTextRequest $body): ApiResponse
Parameter | Type | Tags | Description |
---|---|---|---|
disputeId |
string |
Template, Required | The ID of the dispute you want to upload evidence for. |
body |
CreateDisputeEvidenceTextRequest |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
CreateDisputeEvidenceTextResponse
$disputeId = 'dispute_id2';
$body_idempotencyKey = 'ed3ee3933d946f1514d505d173c82648';
$body_evidenceText = '1Z8888888888888888';
$body = new Models\CreateDisputeEvidenceTextRequest(
$body_idempotencyKey,
$body_evidenceText
);
$body->setEvidenceType(Models\DisputeEvidenceType::TRACKING_NUMBER);
$apiResponse = $disputesApi->createDisputeEvidenceText($disputeId, $body);
if ($apiResponse->isSuccess()) {
$createDisputeEvidenceTextResponse = $apiResponse->getResult();
} else {
$errors = $apiResponse->getErrors();
}
// Get more response info...
// $statusCode = $apiResponse->getStatusCode();
// $headers = $apiResponse->getHeaders();
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.
function deleteDisputeEvidence(string $disputeId, string $evidenceId): ApiResponse
Parameter | Type | Tags | Description |
---|---|---|---|
disputeId |
string |
Template, Required | The ID of the dispute you want to remove evidence from. |
evidenceId |
string |
Template, Required | The ID of the evidence you want to remove. |
$disputeId = 'dispute_id2';
$evidenceId = 'evidence_id2';
$apiResponse = $disputesApi->deleteDisputeEvidence($disputeId, $evidenceId);
if ($apiResponse->isSuccess()) {
$deleteDisputeEvidenceResponse = $apiResponse->getResult();
} else {
$errors = $apiResponse->getErrors();
}
// Get more response info...
// $statusCode = $apiResponse->getStatusCode();
// $headers = $apiResponse->getHeaders();
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.
function retrieveDisputeEvidence(string $disputeId, string $evidenceId): ApiResponse
Parameter | Type | Tags | Description |
---|---|---|---|
disputeId |
string |
Template, Required | The ID of the dispute that you want to retrieve evidence from. |
evidenceId |
string |
Template, Required | The ID of the evidence to retrieve. |
RetrieveDisputeEvidenceResponse
$disputeId = 'dispute_id2';
$evidenceId = 'evidence_id2';
$apiResponse = $disputesApi->retrieveDisputeEvidence($disputeId, $evidenceId);
if ($apiResponse->isSuccess()) {
$retrieveDisputeEvidenceResponse = $apiResponse->getResult();
} else {
$errors = $apiResponse->getErrors();
}
// Get more response info...
// $statusCode = $apiResponse->getStatusCode();
// $headers = $apiResponse->getHeaders();
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.
function submitEvidence(string $disputeId): ApiResponse
Parameter | Type | Tags | Description |
---|---|---|---|
disputeId |
string |
Template, Required | The ID of the dispute that you want to submit evidence for. |
$disputeId = 'dispute_id2';
$apiResponse = $disputesApi->submitEvidence($disputeId);
if ($apiResponse->isSuccess()) {
$submitEvidenceResponse = $apiResponse->getResult();
} else {
$errors = $apiResponse->getErrors();
}
// Get more response info...
// $statusCode = $apiResponse->getStatusCode();
// $headers = $apiResponse->getHeaders();