Errors & Status Code

Handle API errors consistently and safely.

Applications integrating with external APIs must be prepared for validation errors, authorization failures, network problems, and temporary service interruptions.

This guide explains common HTTP error-handling principles.

HTTP status codes

StatusMeaningRecommended action
200OKProcess the successful response
201CreatedHandle the newly created resource
202AcceptedCheck the documented operation lifecycle
204No ContentDo not expect a response body
400Bad RequestReview request structure and parameters
401UnauthorizedCheck authentication credentials
403ForbiddenCheck authorization and permissions
404Not FoundVerify the requested resource
409ConflictInvestigate the conflicting operation or resource state
422Unprocessable ContentReview semantic validation requirements
429Too Many RequestsFollow documented throttling and retry guidance
500Internal Server ErrorInvestigate or retry only when safe
502Bad GatewayTreat as a possible upstream failure
503Service UnavailableFollow documented availability and retry guidance
504Gateway TimeoutDetermine whether the operation may have completed

These are standard HTTP interpretations. Specific Senmo endpoints may use only a subset.

Error response bodies

Some APIs provide structured error information.

An illustrative response might look like:

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "The request contains invalid data."
  }
}

This is not a guaranteed Senmo error schema. Actual response fields are defined in the product API reference.

Network failures

A network timeout does not necessarily mean that the requested operation failed.

The server may have received and processed the request before the connection was interrupted.

For financial transactions, digital asset transfers, or voucher redemption, blindly repeating an operation can produce unintended duplicate effects.

Recommended error-handling approach

  1. Capture the HTTP status and documented error details.
  2. Distinguish validation failures from temporary infrastructure failures.
  3. Record relevant request identifiers where available.
  4. Avoid logging credentials or sensitive personal information.
  5. Determine whether retrying is safe.
  6. Reconcile uncertain operation outcomes before attempting another state-changing request.

Troubleshooting

When investigating an issue, record the affected platform, environment, operation, timestamp, and sanitized error response.

Consult the product-specific API reference for exact error codes and recovery procedures.


Did this page help you?