Errors

Gigapay uses HTTP response codes to indicate whether an API request was successful. Codes in the 2XXrange indicate success; codes in the 4XXrange indicate that the request failed, given the information provided; codes in the 5XXrange indicate an error with Gigapay's servers. Response codes in the 400-range generally indicate a client error and will as such include a key detail in the body describing the cause of the error. For example, the following request:

curl https://api.gigapay.se/v2/payouts/123/ \
-X "DELETE" \
-H "Authorization: Token 1vjv20ksxwvlpp3peize74ievjmx3e" \
-H "Integration-ID: 650fd73ff5"

Will receive an error response indicating that the DELETE method is not allowed on that resource:

HTTP/2 405
allow: GET, HEAD, OPTIONS
...
{"detail":"Method \"DELETE\" not allowed."}

Validation errors returned on otherwise valid requests are structured differently. They will respond with the status code 400and include the field names as the keys in the response. If the validation error was not specific to a particular field then thenon_field_errors key will be used. A validation error thus might look like:

HTTP/1.1 400 Bad Request
...
{"description": ["This field may not be blank."]}