Skip to main content

Errors

Every failure the SDK reports answers one question first: did the request reach the platform? The answer decides whether you may mark the order failed or must query before deciding. Payouts move money, so getting this wrong creates duplicate payouts or orders stuck forever.

Error types​

MeaningGoJavaScriptPythonPHPJava
Client configuration invaliderror from NewClientConfigErrorConfigErrorConfigExceptionDeepaymentException.Config
Rejected before sendingerrors.Is(err, ErrInvalidRequest)RequestErrorRequestErrorRequestExceptionDeepaymentException.Request
No usable responseerrors.Is(err, ErrTransport)TransportErrorTransportErrorTransportExceptionDeepaymentException.Transport
Business error in envelope*APIErrorAPIErrorAPIErrorApiExceptionDeepaymentException.Api
Non-envelope response*ResponseErrorResponseErrorResponseErrorResponseExceptionDeepaymentException.Response
Response over size limiterrors.Is(err, ErrResponseTooLarge)ResponseTooLargeErrorResponseTooLargeErrorResponseTooLargeExceptionDeepaymentException.ResponseTooLarge
Webhook verification failederror from VerifyWebhook / Parse*WebhookErrorWebhookErrorWebhookExceptionDeepaymentException.Webhook

All non-Go types derive from one base (SDKError, SdkException, DeepaymentException), so a single catch covers everything the SDK raises.

Triage​

ErrorWhat happenedDo
Rejected before sendingLocal validation failed, a parameter was bad, or the request could not be encoded or signed. Nothing was sent.Safe to mark failed. Fix the request and retry under the same merchantOrderNo.
No usable responseConnection failure, timeout, interrupted read. The request may have arrived.Outcome unknown. Never mark a payout failed. Query by merchantOrderNo, or resend the identical request under the same number.
Business errorThe platform answered with a well-formed error envelope.Branch on msg, see below.
Non-envelope responseGateway or CDN returned HTML or plain text (a 502 page, for example).Outcome unknown. Query before deciding.
Response over size limitA response arrived but was discarded.Outcome unknown; the order was most likely created. Query before deciding.
Anything elseUnexpected.Assume the request may have arrived. Query before deciding.

Business error fields​

FieldGoJSPythonPHPJava
HTTP statusHTTPStatushttpStatushttp_status$e->httpStatushttpStatus
Numeric codeCodecodecode$e->getCode()code
Machine-readable msgMsgmsgmsg$e->msgmsg
Human-readable messageMessageapiMessagemessage$e->apiMessageapiMessage
Trace idTraceIDtraceIdtrace_id$e->traceIdtraceId
Raw bodyRawBodyrawBodyraw_body$e->rawBodyrawBody

Log the trace id with every failure; support uses it to find the request. Constants for msg are exported in every language (Go MsgOrderNotFound, JS MSG.ORDER_NOT_FOUND, Python MSG_ORDER_NOT_FOUND); PHP and Java compare against the string.

Acting on msg​

The full code table with HTTP statuses is in Error Codes. The cases that need a specific reaction:

msgDo
INVALID_FIELDA format the SDK does not check failed at the gateway. Fix the field; the same merchantOrderNo can be reused.
UNAUTHORIZEDCheck the server clock, the access key, and that the registered public key matches your private key.
IDEMPOTENCY_CONFLICTThe number is taken but the platform could not return its order. Query that number and keep querying; do not switch numbers.
CHANNEL_ERRORThe order may already exist. Query by merchantOrderNo first; reuse the number only once the query returns ORDER_NOT_FOUND.
CHANNEL_BUSYRefused before the order was created. Resend the same number after a back-off; the only channel error that needs no query first.
ORDER_REJECTEDRisk control or a business rule. Do not retry the same request.
INSUFFICIENT_BALANCETop up, then create a new payout.
RATE_LIMITEDBack off and retry the same request.
SERVICE_UNAVAILABLE, INTERNAL_ERRORTreat as outcome unknown for writes: query before resending.

Merchant order number is the safety net​

Everything above rests on one property: a second create with the same merchantOrderNo never creates a second order. Generate the number before the first attempt, persist it, and reuse it for every query and resend until the order reaches a final state. Only allocate a new number for a genuinely new order.