# Add response to dispute POST https://api-sandbox.payabli.com/api/ChargeBacks/response/{Id} Content-Type: application/json Add a response to a chargeback or ACH return. Reference: https://docs.payabli.com/developers/api-reference/chargebacks/add-response-to-chargeback-or-return ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Add response to chargeback or return version: endpoint_chargeBacks.AddResponse paths: /ChargeBacks/response/{Id}: post: operationId: add-response summary: Add response to chargeback or return description: Add a response to a chargeback or ACH return. tags: - - subpackage_chargeBacks parameters: - name: Id in: path description: ID of the chargeback or return record. required: true schema: type: integer format: int64 - name: requestToken in: header required: true schema: type: string - name: idempotencyKey in: header required: false schema: $ref: '#/components/schemas/type_:IdempotencyKey' responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/type_chargeBacks:AddResponseResponse' '400': description: Bad request/ invalid data content: {} '401': description: Unauthorized request. content: {} '500': description: Internal API Error content: {} '503': description: Database connection error content: {} requestBody: content: application/json: schema: type: object properties: attachments: $ref: '#/components/schemas/type_:Attachments' description: Array of attached files to response. contactEmail: $ref: '#/components/schemas/type_:Email' description: Email of response submitter. contactName: type: string description: Name of response submitter notes: type: string description: Response notes components: schemas: type_:IdempotencyKey: type: string type_:FileContentFtype: type: string enum: - value: pdf - value: doc - value: docx - value: jpg - value: jpeg - value: png - value: gif - value: txt type_:FileContent: type: object properties: fContent: type: string description: >- Content of file, Base64-encoded. Ignored if furl is specified. Max upload size is 30 MB. filename: type: string description: The name of the attached file. ftype: $ref: '#/components/schemas/type_:FileContentFtype' description: The MIME type of the file (if content is provided) furl: type: string description: Optional URL provided to show or download the file remotely type_:Attachments: type: array items: $ref: '#/components/schemas/type_:FileContent' type_:Email: type: string format: email type_:IsSuccess: type: boolean type_:ResponseText: type: string type_chargeBacks:AddResponseResponse: type: object properties: isSuccess: $ref: '#/components/schemas/type_:IsSuccess' responseText: $ref: '#/components/schemas/type_:ResponseText' responseData: type: integer description: >- If `isSuccess` = true, this contains the chargeback identifier. If `isSuccess` = false, this contains the reason for the error. required: - responseText ``` ## SDK Code Examples ```python General success response example for chargebacks. from payabli import payabli client = payabli( api_key="YOUR_API_KEY", ) client.charge_backs.add_response( id=1000000, idempotency_key="6B29FC40-CA47-1067-B31D-00DD010662DA", ) ``` ```typescript General success response example for chargebacks. import { PayabliClient } from "@payabli/sdk-node"; const client = new PayabliClient({ apiKey: "YOUR_API_KEY" }); await client.chargeBacks.addResponse(1000000, { idempotencyKey: "6B29FC40-CA47-1067-B31D-00DD010662DA" }); ``` ```go General success response example for chargebacks. import ( context "context" option "github.com/payabli/sdk-go/option" sdkgo "github.com/payabli/sdk-go" sdkgoclient "github.com/payabli/sdk-go/client" ) client := sdkgoclient.NewClient( option.WithApiKey( "", ), ) response, err := client.ChargeBacks.AddResponse( context.TODO(), 1000000, &sdkgo.ResponseChargeBack{ IdempotencyKey: sdkgo.String( "6B29FC40-CA47-1067-B31D-00DD010662DA", ), }, ) ``` ```csharp General success response example for chargebacks. using PayabliApi; var client = new PayabliApiClient("API_KEY"); await client.ChargeBacks.AddResponseAsync( 1000000, new ResponseChargeBack { IdempotencyKey = "6B29FC40-CA47-1067-B31D-00DD010662DA" } ); ``` ```ruby General success response example for chargebacks. require 'uri' require 'net/http' url = URI("https://api-sandbox.payabli.com/api/ChargeBacks/response/1000000") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["idempotencyKey"] = '6B29FC40-CA47-1067-B31D-00DD010662DA' request["requestToken"] = '' request["Content-Type"] = 'application/json' request.body = "{}" response = http.request(request) puts response.read_body ``` ```java General success response example for chargebacks. HttpResponse response = Unirest.post("https://api-sandbox.payabli.com/api/ChargeBacks/response/1000000") .header("idempotencyKey", "6B29FC40-CA47-1067-B31D-00DD010662DA") .header("requestToken", "") .header("Content-Type", "application/json") .body("{}") .asString(); ``` ```php General success response example for chargebacks. request('POST', 'https://api-sandbox.payabli.com/api/ChargeBacks/response/1000000', [ 'body' => '{}', 'headers' => [ 'Content-Type' => 'application/json', 'idempotencyKey' => '6B29FC40-CA47-1067-B31D-00DD010662DA', 'requestToken' => '', ], ]); echo $response->getBody(); ``` ```swift General success response example for chargebacks. import Foundation let headers = [ "idempotencyKey": "6B29FC40-CA47-1067-B31D-00DD010662DA", "requestToken": "", "Content-Type": "application/json" ] let parameters = [] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/ChargeBacks/response/1000000")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data 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() ```