HTTP codes and error handling

When you send a request to a PagoNxt APIs, you receive an HTTP code as part of the response. This response code lets you know whether your request has been successful or has failed. This document explains the different HTTP response codes that PagoNxt sends, and how you can react to error situations.

Sucessful response codes

PagoNxt uses the 200, 201, 202, and 204 response codes to indicate a successful request. The following table describes what these codes mean when received in response to a POST, GET, PUT, DELETE, or PATCH request.

HTTP CodeDescriptionCause
200OKPOST: Successful, but the operation is idempotent, and the same request was submitted successfully previously
GET: Requested details were successfully retrieved
PUT: Update was successful
PATCH: Update was successful
201CreatedPOST: New creation was successful
202AcceptedPOST: Successful, but processing has not yet been completed
204No contentPOST: Successful, but there is no response content to be displayed
GET: Request was successful but there is no retrieved data to be displayed
DELETE: Deletion was successful
PATCH: Update was successful

Client error response codes

PagoNxt uses the 4XX response codes to indicate that there's a client-side error. The following table describes what these codes mean when received in response to a POST, GET, PUT, DELETE, or PATCH request.

HTTP CodeDescriptionCause
400Bad requestPagoNxt could not understand the request message. Check that you are not missing any parameters in your request header and that your request body is valid.
401UnauthorizedThere is an authentication error. Check that your access token and any JSON Web Token (JWT) Bearer tokens are valid.
403ForbiddenYou are not authorized to access the requested API.
404Not foundThe data you are trying to retrieve does not exist. Check that any path parameters are correct and make sure that you are sending the request to the correct API endpoint.
405Method not allowedYour request method is not supported by the API endpoint; for example, a GET request was sent to a POST API endpoint. Check your request method.
406Not acceptableRequest content is not acceptable. Check the request content.
409ConflictRequest could not be processed because it conflicts with the current state of the API. Check your request.
413Payload too largeRequest is larger than the API can process. Check the request size.
414URI too longURI is longer than the maximum size allowed by the server. Check the URI length.
415Unsupported media typeThe request has an unsupported format in the request header or body. Check that your request header and body are in the correct format.
422Unprocessable entityRequest was well-formed but could not be followed due to semantic errors. Check the request for semantic errors.
429Too many requestYou have sent too many requests within a set amount of time. Wait before sending your request again.

Server error response codes

PagoNxt uses the 5XX range response codes to indicate that there was a server-side error. The following table describes what these codes mean when received in response to a POST, GET, PUT, DELETE, or PATCH request.

HTTP CodeDescriptionCause
500Internal server errorThere was an error when processing the request.
503Service unavailableThere was an error when processing the request, this may be due to the server being down for maintenance or temporarily offline.
504Gateway timeoutWe haven't sent a response in a timely manner.

PagoNxt Emoney EDE, S.L. is an electronic money company that operates under the supervision of the Bank of Spain in accordance with the provisions of Law 21/2011, of July 26, on electronic money ("Electronic Money Law") a company with registered offices in Av. Cantabria s/n. 28660, Boadilla del Monte (Madrid) and holding tax no. B- 05284831. PagoNxt is registered in the register of the Bank of Spain with the number 6722 and in the Mercantile Registry of Madrid, volume 41.692, page 130, sheet M-738.547, 1st inscription). PagoNxt Payments UK Ltd. is authorised by the Financial Conduct Authority (FCA) under the Electronic Money Regulations 2011 and Payment Service Regulations 2017 (Firm Reference Number 989454) for the issuing of electronic money and provision of payment services. PagoNxt Payments UK Ltd. is registered in England and Wales (No. 12057109) with registered office at 2 Triton Square, Regent's Place, London, NW1 3AN, United Kingdom