HTTP Status and Error Codes

The PayTrace JSON API uses the standard HTTP response codes. JSON will be returned in all responses from the API, including errors.

Successful Request

Failed Request

Successful requests return HTTP status codes in the 2xx range. Successful responses usually include a JSON document in the response body.

An HTTP status code in the 2xx range does not indicate that a transaction is approved. You will want to verify the success and response_code attributes that are returned for the method you are submitting.

RESPONSE:

{
"success": true,
"response_code": 101,
"status_message": "Your transaction was successfully approved.",
"transaction_id": 79194853,
"approval_code": "TAS688",
"approval_message": " ZIP MATCH - Approved and completed",
"avs_response": "Zip Match Only",
"csc_response": "Match",
"external_transaction_id": "",
"masked_card_number": "xxxxxxxxxxxx1111"
}

Failed requests return status codes in the 4xx and 5xx ranges. Error responses usually include a JSON document in the response body, which contains information about the error.

RESPONSE:

{
  "success": false,
  "response_code": 1,
  "status_message": "One or more errors has occurred.",
  "errors": {
    "35": [
      "Please provide a valid Credit Card Number."
    ]
  },
  "external_transaction_id": "",
  "masked_card_number": "xxxxxxxxxxx1111"
}