Skip to main content

What is Processor Raw Response?

The processor raw response is the complete, unprocessed response from the payment processor (WorldPay, Adyen, Nuvei, etc.). It contains detailed information that’s not included in Revolv3’s simplified response, including:
  • Processor-specific transaction IDs
  • Detailed fraud check results
  • AVS (Address Verification System) results
  • Processor-specific error codes
  • Additional metadata and flags
When to use it:
  • Debugging: Understanding exactly what the processor returned
  • Auditing: Keeping detailed records of processor responses
  • Processor-specific logic: When you need processor-specific codes or data
  • Support: Providing detailed information when contacting support
  • Reconciliation: Matching with processor reports using processor transaction IDs
Note: Raw responses are optional and increase response size. Only request them when you need the detailed information.

Important: Raw Response Format

The rawResponse is returned as an escaped JSON string, not a JSON object. This means it looks “ugly” with backslashes:
"rawResponse": "{\"cnpTxnId\":84083493722313344,\"orderId\":\"319214\",\"response\":\"000\"...}"
You must parse it in your code to use it effectively.

Enabling Raw Processor Responses

To include the raw processor response, add this parameter to your request:
{
  "includeRawProcessorResponse": true
}

In Payment Requests

Add it to payment-related endpoints:
  • POST {{Api Root}}/api/payments/sale
  • POST {{Api Root}}/api/payments/sale/{paymentMethodId}
  • POST {{Api Root}}/api/payments/authorization
  • POST {{Api Root}}/api/payments/capture/{paymentMethodAuthorizationId}

In Invoice Retrieval

Add it as a query parameter:
GET {{Api Root}}/api/Invoices/{invoiceId}?includeRawProcessorResponse=true
Replace {{Api Root}} with api.revolv3.com (production) or api-sandbox.revolv3.com (sandbox).

Example: Payment with Raw Response

Request

{
  "includeRawProcessorResponse": true,
  "NetworkProcessing": {
    "processingType": "initialInstallment",
    "originalNetworkTransactionId": null
  },
  "CustomerId": null,
  "PaymentMethod": {
    "BillingAddress": {
      "AddressLine1": "100 Main St",
      "City": "Los Angeles",
      "State": "CA",
      "PostalCode": "90210",
      "Country": "USA"
    },
    "BillingFirstName": "John",
    "BillingLastName": "Doe",
    "CreditCard": {
      "PaymentAccountNumber": "4444333322221111",
      "ExpirationDate": "1130",
      "SecurityCode": "214"
    }
  },
  "Invoice": {
    "MerchantInvoiceRefId": "ABC12345DProbVs1",
    "Amount": {
      "value": 0.13
    }
  }
}

Response (Success)

The rawResponse field contains the escaped JSON string:
{
  "customerId": null,
  "invoiceId": 319214,
  "merchantInvoiceRefId": "ABC12345DProbVs1",
  "networkTransactionId": "241815930449764",
  "invoiceStatus": "Paid",
  "invoiceAttemptStatus": "Success",
  "message": "Approved",
  "amount": {
    "currency": "USD",
    "value": 0.13
  },
  "paymentMethodId": 12310,
  "rawResponse": "{\"cnpTxnId\":84083493722313344,\"orderId\":\"319214\",\"response\":\"000\",\"responseTime\":\"2024-11-19T19:12:16\",\"message\":\"Approved\",\"cardSuffix\":\"1111\",\"authCode\":\"123457\",\"fraudResult\":{\"avsResult\":\"00\"}...}"
}

Parsing the Raw Response

Before parsing (escaped string):
"rawResponse": "{\"cnpTxnId\":84083493722313344,\"response\":\"000\"...}"
After parsing (structured object):
{
  "cnpTxnId": "84083493722313344",
  "orderId": "319214",
  "response": "000",
  "responseTime": "2024-11-19T19:12:16",
  "message": "Approved",
  "cardSuffix": "1111",
  "authCode": "123457",
  "fraudResult": {
    "avsResult": "00"
  }
}

Response (Failure)

For a failed transaction, the raw response includes the decline reason:
{
  "invoiceStatus": "Noncollectable",
  "invoiceAttemptStatus": "Fail",
  "message": "Insufficient Funds",
  "rawResponse": "{\"cnpTxnId\":83997868055145032,\"orderId\":\"474126\",\"response\":\"110\",\"message\":\"Insufficient Funds\"...}"
}
After parsing, you can see "response": "110" which corresponds to “Insufficient Funds” in WorldPay’s documentation.

How to Parse Raw Responses

JavaScript/Node.js

const response = await makePaymentRequest();
const rawResponse = JSON.parse(response.rawResponse);
console.log(rawResponse.response); // "000"
console.log(rawResponse.message); // "Approved"

Python

import json

response = make_payment_request()
raw_response = json.loads(response['rawResponse'])
print(raw_response['response'])  # "000"
print(raw_response['message'])  # "Approved"

C#

var response = await MakePaymentRequest();
var rawResponse = JsonSerializer.Deserialize<JObject>(response.RawResponse);
var responseCode = rawResponse["response"].ToString(); // "000"

Understanding Processor Response Fields

Processor-specific: Each processor has its own field names and codes. Refer to your processor’s documentation for specific meanings.

When to Use Raw Responses

Use Raw Responses When:

  • Debugging payment issues: Need to see exactly what the processor returned
  • Processor-specific logic: Building logic based on processor codes
  • Detailed auditing: Need complete records for compliance
  • Reconciliation: Matching with processor reports using processor transaction IDs
  • Support requests: Providing detailed information to Revolv3 support

Don’t Use Raw Responses When:

  • Simple integrations: Revolv3’s simplified response is usually enough
  • Performance sensitive: Raw responses increase response size
  • You don’t need the details: If invoiceAttemptStatus are sufficient

Best Practices

  1. Always parse: Treat rawResponse as a string and parse it—don’t try to use it as an object
  2. Handle parsing errors: Wrap parsing in try/catch—malformed JSON can break your code
  3. Use sparingly: Only request when needed—it increases response size
  4. Fallback to simplified: If parsing fails, use Revolv3’s fields as a fallback

Processor-Specific Codes

Each processor has its own response codes. Common examples:

WorldPay

  • "000": Approved
  • "110": Insufficient Funds
  • "200": Generic Decline

Adyen

  • "Authorised": Approved
  • "Refused": Declined
  • Various refusal reasons
Refer to your processor’s documentation for complete code lists and meanings.

Common Questions

Q: Do I have to parse the raw response? A: Yes, it’s returned as an escaped JSON string. You must parse it to use the data. Q: What if parsing fails? A: Log the raw string and use Revolv3’s fields as a fallback. Check processor documentation for format changes. Q: Should I always request raw responses? A: No, only when you need the detailed information. It increases response size and processing time. Q: Can I use raw responses for all processors? A: Yes, but the format and fields vary by processor. Check your processor’s documentation for specifics. Q: Is raw response data sensitive? A: It may contain transaction details.

Next Steps