APISamples_Chargeback - POPRecarga/PartnerAPI GitHub Wiki

#Chargeback

Method Resource Notes
GET /chargebacks/{transactionId} Performs the transaction chargeback.
PUT /chargebacks/{transactionId}/partial Performs a partial chargeback

Requests

Valid GET request at /chargebacks/{transaction}:

GET /chargebacks/c3d6f7e5-1623-45b0-a581-c1f47f201816 HTTP/1.1
Host: api.sandbox.inpdv.com.br 
Content-Type: application/json;
Authorization: Bearer BNACateSkXmuLt5wKCp2PktcYYMRH5zZtugL0L4WeCpu1079Am…
Content-Length: 2


Valid PUT request at /chargebacks/{transaction}/partial:

PUT /chargebacks/144988a1-15d6-46c3-acd5-b1f3b6f35ce9/partial HTTP/1.1
Host: api.sandbox.inpdv.com.br
content-type: application/json;charset=utf-8
Authorization: Bearer U_H5WZbAjoF5nFLIn5SvZff7Dumk_-m_fiAPDA7PsVp

"10.50"

10.50 is the value of the partial chargeback

Responses

Success GET response from /chargebacks/{transaction} or Success PUT response from /chargebacks/{transaction}/partial:

HTTP/1.1 200 OK
Content-Length: 91
Content-Type: application/json; charset=utf-8

{
    "id":"9d497c60-e185-11e5-9405-00155dc23834",
    "status":"Finished",
    "amount":10.00,
    "links":[]
}

OBS: The response id is the chargeback transactionId.


**PUT response from /chargebacks/{transaction}/partial when the sum of chargebacks is higher than the original transaction or when you try to fully chargeback the same transaction again:** ``` HTTP/1.1 400 Bad Request Content-Length: 160 Content-Type: application/json; charset=utf-8

{ "code":4, "codeDescription":"InvalidTransaction", "extendedProperties": { "mS_LoggedBy":[{}] }, "message":"The chargeback exceeds the transaction available amount." }

> OBS: This error happens when you try to chargeback a transaction that was already chargebacked or when the transaction you tried to chargeback isn't finished.

<br/>

**GET response from /chargebacks/{transaction} when its over the chargeback time limit:**

HTTP/1.1 400 Bad Request Content-Length: 140 Content-Type: application/json; charset=utf-8

{ "code":4, "codeDescription":"InvalidTransaction", "extendedProperties":{"mS_LoggedBy":[{}]}, "message":"The transaction can't receive a chargeback because its time limit is expired." }

> OBS: This error happens when you try to chargeback a transaction that was already chargebacked or when the transaction you tried to chargeback isn't finished.

<br/>
⚠️ **GitHub.com Fallback** ⚠️