Success Response-type

When an API call is successful, the JSend object is used as a simple envelope for the results, using the data key, as in the example below. On the transport level, the Success response-type is combined with a HTTP status code from the Success range (200-299), or the Redirection range (300-399).

Required keys

  • status: Will always be set to “success”.
  • data: Wrapper for any data returned by the API call. If the call returns no data, it will be set to null.

The contents of the data key will vary depending on the returned data. The Model definitions in chapter 8 provide information on the data key contents.

{
  "status": "success",
  "data": {
    "valditBusinessEntity": {
      "_id": "6dbfd244-c736-4fd7-8cca-e67da312efdf",
      "companyName": "SA S.A. SPA MONOPOLE, COMPAGNIE FERMIÈRE DE SPA",
      "vatNumberValidationInfo": {
        "vatCountryCode": "BE",
        "vatNumber": "0420834005",
        "lastCheckResult": "valid",
        "lastCheckDate": "2016-07-25T07:23:55.2096812Z",
        "vatRegisteredAddress": "RUE AUGUSTE LAPORTE 34\n4900 SPA",
        "vatNumberFormatValid": true,
        "vatCheckRecurrence": "none"
      },
      "businessAddress": {
        "street": "Rue Auguste Laporte",
        "houseNumber": 34,
        "postalCode": "4900",
        "city": "Spa",
        "countryCode": "BE",
        "formattedAddress": "Rue Auguste Laporte 34, 4900 Spa"
      }
    },
    "vatNumberChecks": [
      {
        "checkResult": "valid",
        "countryCode": "BE",
        "vatNumber": "0420834005",
        "companyName": "SA S.A. SPA MONOPOLE, COMPAGNIE FERMIÈRE DE SPA",
        "companyAddress": "RUE AUGUSTE LAPORTE 34\n4900 SPA",
        "checkDate": "2016-07-25T07:23:55.2096812Z",
        "consultationNumber": "WAPIAAAAVYg8EXul"
      }
    ]
  }
}

Note: while the JSON examples in this document are formatted for readability, the JSON returned by the API does not contain formatting whitespaces. The actual JSON returned in the example above will be:

{“status”:“success”,“data”:{“valditBusinessEntity”:{"_id":“6dbfd244-c736-4fd7-8cca-e67da312efdf”,“companyName”:“SA S.A. SPA MONOPOLE, COMPAGNIE FERMIÈRE DE SPA”,“vatNumberValidationInfo”:{“vatCountryCode”:“BE”,“vatNumber”:“0420834005”,“lastCheckResult”:“valid”,“lastCheckDate”:“2016-07-25T07:23:55.2096812Z”,“vatRegisteredAddress”:“RUE AUGUSTE LAPORTE 34\n4900 SPA”,“vatNumberFormatValid”:true,“vatCheckRecurrence”:“none”},“businessAddress”:{“street”:“Rue Auguste Laporte”,“houseNumber”:34,“postalCode”:“4900”,“city”:“Spa”,“countryCode”:“BE”,“formattedAddress”:“Rue Auguste Laporte 34, 4900 Spa”}},“vatNumberChecks”:[{“checkResult”:“valid”,“countryCode”:“BE”,“vatNumber”:“0420834005”,“companyName”:“SA S.A. SPA MONOPOLE, COMPAGNIE FERMIÈRE DE SPA”,“companyAddress”:“RUE AUGUSTE LAPORTE 34\n4900 SPA”,“checkDate”:“2016-07-25T07:23:55.2096812Z”,“consultationNumber”:“WAPIAAAAVYg8EXul”}]}}