NIN API Docs
  • How to
    • 👨‍💻Getting Started
    • 🔐How to get API Keys?
    • Full API Documentation
    • 💻OpenAPI Reference (Trade)
      • Authentication
      • Instruments
      • Orders
      • Portfolio
      • Margin
      • WebSocket
      • Models
      • Error Handling
      • Limits on API Requests
  • Use Cases
  • Algo Developers
    • Implementing BTC Points
  • Coming Soon
    • Automations Protocol
    • 🧩Widget Integration
      • Widget (Onramp)
      • Widget (Offramp)
      • Request Token
      • Check Token
Powered by GitBook
On this page
  1. How to
  2. OpenAPI Reference (Trade)

Error Handling

Understanding response codes

Ninjapay uses conventional HTTP response codes to indicate the success or failure of an API request. Codes in the 2xxrange indicate success, in the 4xxrange indicate an error that failed given the information provided (usually a required parameter was omitted or incorrectly sent), in the 5xxrange indicate an error with Ninjapay's servers.

Status Code
Meaning
HTTP Response

200 - OK

Everything worked as expected

{ data: { ... } }

201 - OK

Entity created with success

{ data: object }

400 - Bad Request

The request was unacceptable, often due to incorrect or missing required parameter.

{ success: false, message: 'Error details' }

404 - Not Found

The requested resource doesn't exist

{ success: false, message: 'Error details' }

500 - Server Errors

Something went wrong with Ninjapay's servers

{ success: false, message: 'Error details' }

Our official API libraries raise exceptions when errors are thrown. We recommend writing code that gracefully handles all the possible API exceptions.

PreviousModelsNextLimits on API Requests

Last updated 17 days ago

💻