Divendo API 2.0

We’ve rebuilt our API from the ground up to be easier than ever to integrate our platform with your favourite software

Contacts

The Contacts endpoint contains all of the resources you need to configure and manage your customer database.

Lookup a specific contact

GET/contacts/{id}

Gets information about a specific contact within your store.

Parameters id The unique id for the contact

Example response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "id": "5643eff487bb38127c11e624",
  "created": "2015-04-10T17:00:00+01:00",
  "emails": [
    "[email protected]"
  ],
  "name": {
    "title": "Mr",
    "firstname": "Test",
    "surname": "Customer"
  },
  "address": {
    "addressline1": "20-22 Wenlock Road",
    "addressline2": "",
    "addressline3": "",
    "towncity": "London",
    "stateprovince": "London",
    "postalcode": "N1 7GU",
    "country": "GB"
  },
  "contactnumbers": [
    "02030869860"
  ],
  "customernumber": "10141246",
  "accountnumber": "",
  "preferences": {
    "email": {
      "optoutreason": null,
      "optoutdate": null
    },
    "post": {
      "optoutreason": null,
      "optoutdate": null
    },
    "sms": {
      "optoutreason": "optout",
      "optoutdate": "2017-06-15T00:00:00+01:00"
    },
    "phone": {
      "optoutreason": null,
      "optoutdate": null
    }
  }
}

Create a new contact

POST/contacts

Creates a new contact within your store.

Request body Contact

Example request

Content-Type: application/json; charset=utf-8

{
  "emails": [
    "[email protected]"
  ],
  "name": {
    "title": "Mr",
    "firstname": "Testing",
    "surname": "Customer"
  },
  "address": {
    "addressline1": "20-22 Wenlock Road",
    "addressline2": "",
    "addressline3": "",
    "towncity": "London",
    "stateprovince": "London",
    "postalcode": "N1 7GU",
    "country": "GB"
  },
  "contactnumbers": [],
  "customernumber": "12345678",
  "accountnumber": "",
  "preferences": {
    "email": {
      "optoutreason": null
    },
    "post": {
      "optoutreason": null
    },
    "sms": {
      "optoutreason": "optout"
    },
    "phone": {
      "optoutreason": null
    }
  }
}

Example response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "id": "5abd47ff9b04b3079c25baa2",
  "created": "2018-03-29T21:09:37.0060207+01:00",
  "emails": [
    "[email protected]"
  ],
  "name": {
    "title": "Mr",
    "firstname": "Testing",
    "surname": "Customer"
  },
  "address": {
    "addressline1": "20-22 Wenlock Road",
    "addressline2": "",
    "addressline3": "",
    "towncity": "London",
    "stateprovince": "London",
    "postalcode": "N1 7GU",
    "country": "GB"
  },
  "contactnumbers": [
  ],
  "customernumber": "12345678",
  "accountnumber": "",
  "preferences": {
    "email": {
      "optoutreason": null,
      "optoutdate": null
    },
    "post": {
      "optoutreason": null,
      "optoutdate": null
    },
    "sms": {
      "optoutreason": "optout",
      "optoutdate": null
    },
    "phone": {
      "optoutreason": null,
      "optoutdate": null
    }
  }
}

Update a contact

PUT/contacts/{id}

Updates the record of a specific contact.

Parameters id The unique id for the contact
Request body Contact

Example request

Content-Type: application/json; charset=utf-8

{
  "emails": [
    "[email protected]"
  ],
  "name": {
    "title": "Mr",
    "firstname": "Testing",
    "surname": "Customer"
  },
  "address": {
    "addressline1": "20-22 Wenlock Road",
    "addressline2": "",
    "addressline3": "",
    "towncity": "London",
    "stateprovince": "London",
    "postalcode": "N1 7GU",
    "country": "GB"
  },
  "contactnumbers": [
    "02030869860"
  ],
  "customernumber": "12345678",
  "accountnumber": "",
  "preferences": {
    "email": {
      "optoutreason": null,
      "optoutdate": null
    },
    "post": {
      "optoutreason": null,
      "optoutdate": null
    },
    "sms": {
      "optoutreason": "optout",
      "optoutdate": null
    },
    "phone": {
      "optoutreason": null,
      "optoutdate": null
    }
  }
}

Example response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "id": "5abd47ff9b04b3079c25baa2",
  "created": "2018-03-29T22:23:11.0692722+01:00",
  "emails": [
    "[email protected]"
  ],
  "name": {
    "title": "Mr",
    "firstname": "Testing",
    "surname": "Customer"
  },
  "address": {
    "addressline1": "20-22 Wenlock Road",
    "addressline2": "",
    "addressline3": "",
    "towncity": "London",
    "stateprovince": "London",
    "postalcode": "N1 7GU",
    "country": "GB"
  },
  "contactnumbers": [
    "02030869860"
  ],
  "customernumber": "12345678",
  "accountnumber": "",
  "preferences": {
    "email": {
      "optoutreason": null,
      "optoutdate": null
    },
    "post": {
      "optoutreason": null,
      "optoutdate": null
    },
    "sms": {
      "optoutreason": "optout",
      "optoutdate": null
    },
    "phone": {
      "optoutreason": null,
      "optoutdate": null
    }
  }
}

Delete a contact

DELETE/contacts/{id}

Deletes a contact record from your store.

Parameters id The unique id for the contact

Example response

HTTP/1.1 204 No Content
Content-Type: application/json; charset=utf-8