Skip to content
This repository has been archived by the owner on Apr 23, 2021. It is now read-only.

Latest commit

 

History

History
422 lines (280 loc) · 14.6 KB

DisputesApi.md

File metadata and controls

422 lines (280 loc) · 14.6 KB

SquareConnect.DisputesApi

All URIs are relative to https://connect.squareup.com

Method HTTP request Description
acceptDispute POST /v2/disputes/{dispute_id}/accept AcceptDispute
createDisputeEvidenceText POST /v2/disputes/{dispute_id}/evidence_text CreateDisputeEvidenceText
listDisputeEvidence GET /v2/disputes/{dispute_id}/evidence ListDisputeEvidence
listDisputes GET /v2/disputes ListDisputes
removeDisputeEvidence DELETE /v2/disputes/{dispute_id}/evidence/{evidence_id} RemoveDisputeEvidence
retrieveDispute GET /v2/disputes/{dispute_id} RetrieveDispute
retrieveDisputeEvidence GET /v2/disputes/{dispute_id}/evidence/{evidence_id} RetrieveDisputeEvidence
submitEvidence POST /v2/disputes/{dispute_id}/submit-evidence SubmitEvidence

acceptDispute

Note: This endpoint is in beta.

AcceptDisputeResponse acceptDispute(disputeId)

AcceptDispute

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.

Example

var SquareConnect = require('square-connect');
var defaultClient = SquareConnect.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new SquareConnect.DisputesApi();

var disputeId = SquareConnect.DisputesApi.constructFromObject({}); // String | The ID of the dispute you want to accept.

apiInstance.acceptDispute(disputeId).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
disputeId String The ID of the dispute you want to accept.

Return type

AcceptDisputeResponse

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

createDisputeEvidenceText

Note: This endpoint is in beta.

CreateDisputeEvidenceTextResponse createDisputeEvidenceText(disputeId, body)

CreateDisputeEvidenceText

Uploads text to use as evidence for a dispute challenge.

Example

var SquareConnect = require('square-connect');
var defaultClient = SquareConnect.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new SquareConnect.DisputesApi();

var disputeId = SquareConnect.DisputesApi.constructFromObject({}); // String | The ID of the dispute you want to upload evidence for.

var body = SquareConnect.DisputesApi.constructFromObject({}); // CreateDisputeEvidenceTextRequest | An object containing the fields to POST for the request.  See the corresponding object definition for field details.

apiInstance.createDisputeEvidenceText(disputeId, body).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
disputeId String The ID of the dispute you want to upload evidence for.
body CreateDisputeEvidenceTextRequest An object containing the fields to POST for the request. See the corresponding object definition for field details.

Return type

CreateDisputeEvidenceTextResponse

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

listDisputeEvidence

Note: This endpoint is in beta.

ListDisputeEvidenceResponse listDisputeEvidence(disputeId)

ListDisputeEvidence

Returns a list of evidence associated with a dispute.

Example

var SquareConnect = require('square-connect');
var defaultClient = SquareConnect.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new SquareConnect.DisputesApi();

var disputeId = SquareConnect.DisputesApi.constructFromObject({}); // String | The ID of the dispute.

apiInstance.listDisputeEvidence(disputeId).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
disputeId String The ID of the dispute.

Return type

ListDisputeEvidenceResponse

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

listDisputes

Note: This endpoint is in beta.

ListDisputesResponse listDisputes(opts)

ListDisputes

Returns a list of disputes associated with a particular account.

Example

var SquareConnect = require('square-connect');
var defaultClient = SquareConnect.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new SquareConnect.DisputesApi();

var opts = { 
  'cursor': SquareConnect.DisputesApi.constructFromObject({});, // String | 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](https://developer.squareup.com/docs/basics/api101/pagination).
  'states': SquareConnect.DisputesApi.constructFromObject({});, // String | 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': SquareConnect.DisputesApi.constructFromObject({}); // String | 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.
};
apiInstance.listDisputes(opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
cursor String 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. [optional]
states String 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`). [optional]
locationId String 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. [optional]

Return type

ListDisputesResponse

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

removeDisputeEvidence

Note: This endpoint is in beta.

RemoveDisputeEvidenceResponse removeDisputeEvidence(disputeId, evidenceId)

RemoveDisputeEvidence

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.

Example

var SquareConnect = require('square-connect');
var defaultClient = SquareConnect.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new SquareConnect.DisputesApi();

var disputeId = SquareConnect.DisputesApi.constructFromObject({}); // String | The ID of the dispute you want to remove evidence from.

var evidenceId = SquareConnect.DisputesApi.constructFromObject({}); // String | The ID of the evidence you want to remove.

apiInstance.removeDisputeEvidence(disputeId, evidenceId).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
disputeId String The ID of the dispute you want to remove evidence from.
evidenceId String The ID of the evidence you want to remove.

Return type

RemoveDisputeEvidenceResponse

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

retrieveDispute

Note: This endpoint is in beta.

RetrieveDisputeResponse retrieveDispute(disputeId)

RetrieveDispute

Returns details about a specific dispute.

Example

var SquareConnect = require('square-connect');
var defaultClient = SquareConnect.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new SquareConnect.DisputesApi();

var disputeId = SquareConnect.DisputesApi.constructFromObject({}); // String | The ID of the dispute you want more details about.

apiInstance.retrieveDispute(disputeId).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
disputeId String The ID of the dispute you want more details about.

Return type

RetrieveDisputeResponse

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

retrieveDisputeEvidence

Note: This endpoint is in beta.

RetrieveDisputeEvidenceResponse retrieveDisputeEvidence(disputeId, evidenceId)

RetrieveDisputeEvidence

Returns the specific evidence metadata associated with a specific dispute. 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.

Example

var SquareConnect = require('square-connect');
var defaultClient = SquareConnect.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new SquareConnect.DisputesApi();

var disputeId = SquareConnect.DisputesApi.constructFromObject({}); // String | The ID of the dispute that you want to retrieve evidence from.

var evidenceId = SquareConnect.DisputesApi.constructFromObject({}); // String | The ID of the evidence to retrieve.

apiInstance.retrieveDisputeEvidence(disputeId, evidenceId).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
disputeId String The ID of the dispute that you want to retrieve evidence from.
evidenceId String The ID of the evidence to retrieve.

Return type

RetrieveDisputeEvidenceResponse

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

submitEvidence

Note: This endpoint is in beta.

SubmitEvidenceResponse submitEvidence(disputeId)

SubmitEvidence

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.

Example

var SquareConnect = require('square-connect');
var defaultClient = SquareConnect.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new SquareConnect.DisputesApi();

var disputeId = SquareConnect.DisputesApi.constructFromObject({}); // String | The ID of the dispute that you want to submit evidence for.

apiInstance.submitEvidence(disputeId).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
disputeId String The ID of the dispute that you want to submit evidence for.

Return type

SubmitEvidenceResponse

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json