Flag Chargeback

Flag Chargeback is essential for calibrating the accuracy of our risk analysis.

Flag Chargeback

Flag Chargeback is essential for calibrating the accuracy of our risk analysis.

Flag Chargeback

Request Example

POST {ENDPOINT}/v1/chargeback

REQUEST HEADER
Content-Type: application/json
Authorization: Bearer {TOKEN}
X-Api-Version: v2

REQUEST BODY (see field descriptions)
{
"code": "{Order code}",
"message": "Example message",
"chargebackStatus": 1,
"chargebackDateUTC": "{Chargeback notification date by the acquirer}",
"reasonCode": "{Chargeback request reason code}",
"disputeReason": 1,
"bin": "123456",
"pan": "123456",
"cardBrandId": "3",
"cardBrand": "VISA",
"disputeValue": 100.00,
"cardOwnerName": "{Credit Card Holder's Name}",
"shippingStatus": 0,
"nsu": "{Sale operation identification number}",
"tid": "{Transaction ID of the sale}",
"psp": "{Dispute identification number}"
}

Response Example

RESPONSE HEADER

Content-Type: application/json
Request-ID: {"REQUEST_ID_OF_THE_REQUEST"}

RESPONSE BODY
{
"code": "{MY_ORDER_CODE}",
"status": "Chargeback done",
"errors": null
}

Table of Codes and Descriptions

Credit Card Brand (cardBrandId and cardBrand)

CodeDescription
1Diners
2MasterCard
3Visa
4Others
5American Express
6HiperCard
7Aura Card
10Elo Card

JSON Field Descriptions for Flag Chargeback

PropertyDescriptionTypeSizeRequired
codeOrder ID (same value previously sent in the "transactionId" or "code" property of the order risk analysis JSON, depending on the API endpoint used for this submission).String50S
messageMessage
chargebackStatus0 - for "Pre-Chargeback", 1 - for "Chargeback Debit" (default value)IntegerN
chargebackDateUTCChargeback notification date by the acquirerDatetimeS
reasonCodeChargeback request reason codeString100N
disputeReasonDispute Reason: 0 - for "Commercial Disagreement", 1 - for "Fraud", 2 - for "Processing Error"IntegerN
binFirst 6 digits of the credit cardString50N
panAlternative field to the card bin, which has this name in some cases. First 6 digits of the card.String50N
cardBrandIdCredit card brand IDIntegerN
cardBrandDescription of the credit card brandString50N
disputeValueChargeback ValueDecimal20,4N
cardOwnerNameCredit Card Holder's NameString200N
shippingStatusPurchase delivery status: 0 - for "Delivered", 1 - for "Delivery Blocked", 2 - for "In route for Return"IntegerN
nsuSale operation identification numberString200N
tidTransaction ID of the saleString200N
pspDispute identification numberString100N

API Error Returns for Flag Chargeback

Invalid or expired token

HTTPCode: 401 Unauthorized

Body: {Empty}

Request without the "code" property

HTTPCode: 400 Bad Request

Body:
{
  "code": "{Order code}",
  "status": "Fail",
  "errors": [
    "Code: Required field"
  ]
}

Request without the "chargebackDateUTC" property

HTTPCode: 400 Bad Request

Body:
{
  "code": "{Order code}",
  "status": "Fail",
  "errors": [
    "ChargebackDateUTC: Required field"
  ]
}

Value of the "code" property exceeded the character limit

HTTPCode: 400 Bad Request

Body:
{
  "code": "{Order code}",
  "status": "Fail",
  "errors": [
    "Code: Exceeded maximum size of 50 characters."
  ]
}

Value of the "message" property exceeded the character limit

HTTPCode: 400 Bad Request

Body:
{
  "code": "{Order code}",
  "status": "Fail",
  "errors": [
    "Message: Exceeded maximum size of 100 characters."
  ]
}

Value of the "reasonCode" property exceeded the character limit

HTTPCode: 400 Bad Request

Body:
{
  "code": "{Order code}",
  "status": "Fail",
  "errors": [
    "ReasonCode: Exceeded maximum size of 100 characters."
  ]
}

Value of the "bin" property exceeded the character limit

HTTPCode: 400 Bad Request

Body:
{
  "code": "{Order code}",
  "status": "Fail",
  "errors": [
    "Bin: Exceeded maximum size of 50 characters."
  ]
}

Value of the "pan" property exceeded the character limit

HTTPCode: 400 Bad Request

Body:
{
  "code": "{Order code}",
  "status": "Fail",
  "errors": [
    "Pan: Exceeded maximum size of 50 characters."
  ]
}

Value of the "cardBrand" property exceeded the character limit

HTTPCode: 400 Bad Request

Body:
{
  "code": "{Order code}",
  "status": "Fail",
  "errors": [
    "cardBrand: Exceeded maximum size of 200 characters."
  ]
}

Value of the "disputeValue" property exceeded the character limit

HTTPCode: 400 Bad Request

Body:
{
  "code": "{Order code}",
  "status": "Fail",
  "errors": [
    "DisputeValue: Must be greater than or equal to 0."
  ]
}

Value of the "nsu" property exceeded the character limit

HTTPCode: 400 Bad Request

Body:
{
  "code": "{Order code}",
  "status": "Fail",
  "errors": [
    "NSU: Exceeded maximum size of 200 characters."
  ]
}

Value of the "tid" property exceeded the character limit

HTTPCode: 400 Bad Request

Body:
{
  "code": "{Order code}",
  "status": "Fail",
  "errors": [
    "TID: Exceeded maximum size of 200 characters."
  ]
}

Value of the "psp" property exceeded the character limit

HTTPCode: 400 Bad Request

Body:
{
  "code": "{Order code}",
  "status": "Fail",
  "errors": [
    "PSP: Exceeded maximum size of 200 characters."
  ]
}

Invalid "shippingStatus" value

HTTPCode: 400 Bad Request

Body:
{
  "code": "{Order code}",
  "status": "Fail",
  "errors": [
    "ShippingStatus: Not a valid ShippingStatus."
  ]
}

Order status in ClearSale does not allow chargeback marking at the moment

HTTPCode: 422 Unprocessable Entity

Body:
{
  "code": "{Order code}",
  "status": "Fail",
  "errors": [
    "Cannot mark the chargeback, please check its status."
  ]
}

Request with empty body

HTTPCode: 500 Internal Server Error

Body:
{Empty}

Error with unmapped cause (ClearSale analysis required)

HTTPCode: 500 Internal Server Error

Body:
{
  "code": "{Order code}",
  "status": "Fail",
  "errors": [
    "An error occurred while trying to mark the Chargeback."
  ]
}

Duplicate chargeback marking for the same order within less than 1 minute difference

HTTPCode: 202 Accepted

Body:
{
"code": "{Order code}",
"status": "Chargeback is being processed.",
"errors": null
}