Overview

When sending a request to the Acquired.com API you will always receive a response in JSON format. Within the response you will also receive a HTTP status code, confirming whether the request was successful or not. If the request was not successful, you can tell by the status error_type and title and work out how to resolve the issue.


Attributes

FieldTypeDescriptionExample
statusstringThe status of the response.error
error_typestringThe type of error returned.bad_request unauthorized forbidden conflict internal_server_error
titlestringA human-readable message that provides more detail about the error.'Authentication with the API failed, please check your details and try again.'
instancestringIndicates where the error occurred./v1/login
invalid_parametersobject
parameterstring
reasonstring

Examples of error responses

See below a few examples of errors that you can encounter.

401 - Unauthorized

The below request includes an invalid app_key:

{
  "app_id": "app_id",
  "app_key": "deliberately_incorrect_app_key"
}

Response:

{
  "status": "error",
  "error_type": "unauthorized",
  "title": "Authentication with the API failed, please check your details and try again.",
  "instance": "/v1/login"
}

409 - Conflict

In the next request we are trying to create a new customer record:

{
    "reference": "customer_number_00001",
    "first_name": "Edward",
    "last_name": "Johnson",
    "dob": "1988-10-03",
    "billing": {
        "address": {
            "line_1": "Suite 2 - 4th Floor",
            "line_2": "44 Baker Street",
            "city": "London",
            "state": "",
            "postcode": "W1U 7AL",
            "country_code": "GB"
        }
    }
}

Response:

{
  "status": "error",
  "error_type": "conflict",
  "title": "There was a conflict when trying to complete your request",
  "instance": "/v1/customers",
  "invalid_parameters": [
  {
  "parameter": "reference",
  "description": "A customer already exists using reference customer_number_00001"
  }
  ]
}