cancel
Showing results for 
Search instead for 
Did you mean: 

"message": "Invalid Json Request" in postman response

I'm trying to do a POST request from Postman to cybersource url: https://apitest.cybersource.com/pts/v2/payments

and I'm getting the below error message

{
    "submitTimeUtc": "2023-01-18T21:52:02.539Z",
    "status": "DECLINED",
    "errorInformation": {
        "reason": "INVALID_DATA",
        "message": "Invalid Json Request"
    }
}

this is my body request

{
  "clientReferenceInformation": {
    "code": "TC50171_3"
  },
  "paymentInformation": {
    "card": {
      "number": "4111111111111111",
      "expirationMonth": "12",
      "expirationYear": "2031"
    }
  },
  "orderInformation": {
    "amountDetails": {
      "totalAmount": "102.21",
      "currency": "USD"
    },
    "billTo": {
      "firstName": "John",
      "lastName": "Doe",
      "address1": "1 Market St",
      "locality": "san francisco",
      "administrativeArea": "CA",
      "postalCode": "94105",
      "country": "US",
      "email": "test@cybs.com",
      "phoneNumber": "4158880000"
    }
  }
}

and this are my Header

https://imgur.com/43THHPI

what am I doing wrong here?

can anyone help me?

 

Pitaj
Member
2 REPLIES 2

It looks like you're receiving an error message indicating that the JSON request is invalid. One potential issue could be that the JSON is not properly formatted or that a required field is missing. I would recommend checking the API documentation for the CyberSource endpoint you're trying to reach and verifying that the request body and headers match the specified requirements. Additionally, double-checking the JSON formatting and making sure all required fields are present in the request body might be helpful. If the problem persists, you might want to consider reaching out to CyberSource support for further assistance.

ShawnHill
Member

The TransientTokenJwt field may be the cause of the problem. According to the CyberSource documentation, the Transient Token JWT must be included in the API request's Authorization  header. It could be worthwhile to double-check that the request headers contain the JWT and that it is being transmitted in the appropriate manner.

jhon45633
Member