# Retrieve Dispute GET https://global-api-sandbox.afterpay.com/v2/disputes List disputes within a date range based on certain criteria. This endpoint can be used for debugging or synchronizing the disputes from Cash App Afterpay if/when you are unable to use the webhook method. ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Retrieve Dispute version: endpoint_.retrieve-dispute paths: /v2/disputes: get: operationId: retrieve-dispute summary: Retrieve Dispute description: > List disputes within a date range based on certain criteria. This endpoint can be used for debugging or synchronizing the disputes from Cash App Afterpay if/when you are unable to use the webhook method. tags: - [] parameters: - name: order in: query description: Payment or Order token using which you can filter the list. required: false schema: type: integer - name: merchant in: query description: Merchant token using which you can filter the list. required: false schema: type: string - name: status in: query description: Dispute status using which you can filter the list. required: false schema: type: string - name: openedAfter in: query description: >- Filter disputes that were created on or after this timestamp (inclusive). required: false schema: type: string format: date-time - name: openedBefore in: query description: >- Filter disputes that were created on or before this timestamp (inclusive). required: false schema: type: string format: date-time - name: offset in: query description: Offset for the search results. required: false schema: type: integer - name: limit in: query description: >- The maximum number of records that you want returned from this request. required: false schema: type: integer - name: Authorization in: header description: Basic authentication of the form `Basic `. required: true schema: type: string - name: User-Agent in: header required: true schema: type: string - name: Accept in: header required: false schema: type: string responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/retrieve-dispute_Response_200' components: schemas: DisputeReason: type: string enum: - value: product_not_received - value: product_unacceptable - value: credit_not_processed - value: order_canceled - value: duplicate - value: incorrect_amount - value: paid_by_other_means - value: fraudulent - value: fraudulent_merchant DisputeStatus: type: string enum: - value: needs_response - value: under_review - value: won - value: lost - value: merchant_refunded - value: merchant_voided DisputeClosingReason: type: string enum: - value: merchant_accepted - value: evidence_accepted - value: evidence_rejected - value: deadline_expired - value: customer_cancelled meta: type: object properties: transactionAmount: type: string network: type: string networkReferenceId: type: string orderType: type: string required: - transactionAmount - orderType dispute: type: object properties: id: type: string order: type: string amount: type: string reason: $ref: '#/components/schemas/DisputeReason' status: $ref: '#/components/schemas/DisputeStatus' open: type: boolean responseDueBy: type: string createdAt: type: string openingNote: type: string openingNoteAttachments: type: string updatedAt: type: string closingReason: $ref: '#/components/schemas/DisputeClosingReason' closingNote: type: string merchantOrderId: type: string transactionDate: type: string settlementAmount: type: string meta: $ref: '#/components/schemas/meta' required: - id - order - amount - reason - status - open - responseDueBy - createdAt - openingNote - closingReason - merchantOrderId - transactionDate - settlementAmount retrieve-dispute_Response_200: type: object properties: data: type: array items: $ref: '#/components/schemas/dispute' offset: type: integer limit: type: integer total: type: integer ``` ## SDK Code Examples ```python import requests url = "https://global-api-sandbox.afterpay.com/v2/disputes" querystring = {"offset":"0","limit":"10"} headers = { "User-Agent": "User-Agent", "Authorization": "Basic :" } response = requests.get(url, headers=headers, params=querystring) print(response.json()) ``` ```javascript const url = 'https://global-api-sandbox.afterpay.com/v2/disputes?offset=0&limit=10'; const options = { method: 'GET', headers: {'User-Agent': 'User-Agent', Authorization: 'Basic :'} }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://global-api-sandbox.afterpay.com/v2/disputes?offset=0&limit=10" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("User-Agent", "User-Agent") req.Header.Add("Authorization", "Basic :") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://global-api-sandbox.afterpay.com/v2/disputes?offset=0&limit=10") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["User-Agent"] = 'User-Agent' request["Authorization"] = 'Basic :' response = http.request(request) puts response.read_body ``` ```java HttpResponse response = Unirest.get("https://global-api-sandbox.afterpay.com/v2/disputes?offset=0&limit=10") .header("User-Agent", "User-Agent") .header("Authorization", "Basic :") .asString(); ``` ```php request('GET', 'https://global-api-sandbox.afterpay.com/v2/disputes?offset=0&limit=10', [ 'headers' => [ 'Authorization' => 'Basic :', 'User-Agent' => 'User-Agent', ], ]); echo $response->getBody(); ``` ```csharp var client = new RestClient("https://global-api-sandbox.afterpay.com/v2/disputes?offset=0&limit=10"); var request = new RestRequest(Method.GET); request.AddHeader("User-Agent", "User-Agent"); request.AddHeader("Authorization", "Basic :"); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "User-Agent": "User-Agent", "Authorization": "Basic :" ] let request = NSMutableURLRequest(url: NSURL(string: "https://global-api-sandbox.afterpay.com/v2/disputes?offset=0&limit=10")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```