The error response contains code
, description
, field
, source
, step
, reason
and metadata
parameters that help diagnose and solve the error.
In this sample code, see the description
, source
, step
and reason
, indicating that the API failed due to authentication failure for incorrect OTP.
You can notify your customer and ask them to retry the payment with the correct OTP at Curlec Checkout.
{"error": {"code": "BAD_REQUEST_ERROR","description": "Authentication failed due to incorrect otp","field": null,"source": "customer","step": "payment_authentication","reason": "invalid_otp","metadata": {"payment_id": "pay_EDNBKIP31Y4jl8","order_id": "order_DBJKIP31Y4jl8"}}}
error
object
The error object.
code
string
Type of the error.
description
string
Descriptive text about the error.
field
string
Name of the parameter in the API request that caused the error.
source
step
reason
string
The exact error reason. It can be handled programmatically.
metadata
object
Contains additional information about the request.
payment_id
string
Unique identifier of the payment.
order_id
string
Unique identifier of the order associated with the payment.