{"_id":"59a45d2cd12e81000f842f17","category":{"_id":"59a45d2bd12e81000f842eed","version":"59a45d2bd12e81000f842ee2","project":"57336fd5a6a9c40e00e13a0b","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-10-15T16:21:09.840Z","from_sync":false,"order":10,"slug":"errors","title":"Errors"},"parentDoc":null,"user":"560d5913af97231900938124","project":"57336fd5a6a9c40e00e13a0b","version":{"_id":"59a45d2bd12e81000f842ee2","project":"57336fd5a6a9c40e00e13a0b","__v":1,"createdAt":"2017-08-28T18:12:59.168Z","releaseDate":"2017-08-28T18:12:59.168Z","categories":["59a45d2bd12e81000f842ee3","59a45d2bd12e81000f842ee4","59a45d2bd12e81000f842ee5","59a45d2bd12e81000f842ee6","59a45d2bd12e81000f842ee7","59a45d2bd12e81000f842ee8","59a45d2bd12e81000f842ee9","59a45d2bd12e81000f842eea","59a45d2bd12e81000f842eeb","59a45d2bd12e81000f842eec","59a45d2bd12e81000f842eed","59a45d2bd12e81000f842eee","59a45d2bd12e81000f842eef","59a45d2bd12e81000f842ef0","59a45d2bd12e81000f842ef1"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"3.22.1","version_clean":"8976.0.0-JSON","version":"8976-JSON"},"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-12-28T14:33:32.694Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":36,"body":"If the API request and response are successful, the Payment API will return one of the following HTTP status codes:\n  * **200**: when a new resource is created and returned in the body of the response\n  * **201**: when a new resource is created and the URL to it is returned in the header (typically as a “Location\" parameter)\n  * **204**: when an update resource is successful but nothing is returned in the body or header\n\n</br> \nOtherwise, the API will return one of the following error types:\n\n###HTTP 500 errors\nIf an unexpected error occurs in the BlueSnap system, the API will send an error with HTTP 500 status code. Please contact BlueSnap merchant support at [merchants:::at:::bluesnap.com](mailto:merchants@bluesnap.com) if you need further assistance or information regarding an HTTP 500 error.\n\n###HTTP 403 error\nWhen an API user does not have the required role (authorization) to perform a specific operation, the API returns an error with HTTP 403 status code. API user roles depend on your SAQ level, as described in [PCI compliance](/v1.0/docs/pci-compliance). HTTP 403 is also returned if a merchant tries to access a resource (shopper, transaction or other) that does not exist. \n\n###HTTP 400 errors\nIf the request contains invalid data or the acquirer/processor has an issue with processing the transaction, the API will send an error with HTTP 400 status code, and an error message in XML format in the body of the response. In most cases, these errors are formatted as follows:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"message\\\": [\\n  {\\n    \\\"errorName\\\": \\\"ERROR_NAME\\\",\\n    \\\"code\\\": BLUESNAP_ERROR_CODE,\\n    \\\"description\\\": \\\"GENERAL_DESCRIPTION_OF_THE_ERROR\\\"\\n  },\\n  {\\n    \\\"errorName\\\": \\\"ERROR_NAME2\\\",\\n    \\\"code\\\": BLUESNAP_ERROR_CODE2,\\n    \\\"description\\\": \\\"GENERAL_DESCRIPTION_OF_THE_ERROR2\\\"\\n  }\\n ]\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Error message format\"\n    }\n  ]\n}\n[/block]\nFor reference, see the following error lists:\n  * [Fraud Errors](doc:fraud-errors)\n  * [Card Transaction Errors](doc:card-transaction-errors)\n  * [Alt Transaction Errors](doc:alt-transaction-errors) \n  * [Batch Transaction Errors](doc:batch-errors)\n  * [Subscription & Billing Plan Errors](doc:subscription-billing-plan-errors) \n  * [Refund Errors](doc:refund-errors) \n  * [Hosted Payment Field Errors](/v4.0/docs/hosted-payment-field-errors)\n  * [Wallet Errors](/v4.0/docs/wallet-errors)","excerpt":"","slug":"error-handling-overview","type":"basic","title":"Error Handling Overview"}

Error Handling Overview


If the API request and response are successful, the Payment API will return one of the following HTTP status codes:

  • 200: when a new resource is created and returned in the body of the response
  • 201: when a new resource is created and the URL to it is returned in the header (typically as a “Location" parameter)
  • 204: when an update resource is successful but nothing is returned in the body or header



Otherwise, the API will return one of the following error types:

HTTP 500 errors

If an unexpected error occurs in the BlueSnap system, the API will send an error with HTTP 500 status code. Please contact BlueSnap merchant support at merchants@bluesnap.com if you need further assistance or information regarding an HTTP 500 error.

HTTP 403 error

When an API user does not have the required role (authorization) to perform a specific operation, the API returns an error with HTTP 403 status code. API user roles depend on your SAQ level, as described in PCI compliance. HTTP 403 is also returned if a merchant tries to access a resource (shopper, transaction or other) that does not exist.

HTTP 400 errors

If the request contains invalid data or the acquirer/processor has an issue with processing the transaction, the API will send an error with HTTP 400 status code, and an error message in XML format in the body of the response. In most cases, these errors are formatted as follows:

{
  "message": [
  {
    "errorName": "ERROR_NAME",
    "code": BLUESNAP_ERROR_CODE,
    "description": "GENERAL_DESCRIPTION_OF_THE_ERROR"
  },
  {
    "errorName": "ERROR_NAME2",
    "code": BLUESNAP_ERROR_CODE2,
    "description": "GENERAL_DESCRIPTION_OF_THE_ERROR2"
  }
 ]
}