Contract Changes 📑

You can get information about contract changes in two different ways. These ways are shown below.

Information by branding

You can receive information about all contract changes of users of your brand using the /next/contractChanges endpoint.

Authentication

To authenticate against this endpoint you need to set the following header.

  • yoli-brand-authorization: API-key handed out to you in advance

Response

The response you will receive will contain an array of contract changes:

[
    {
        "id": 23192913, // unique id of the contract change
        "userId": "5c1ce67a3e359338580d2d1d", // id of the user that changed contract
        "offerType": "phonePlan", // gas, electricity, dsl, phonePlan, phoneBundle -- identifies what type of contact was changes
        "status" : "confirmed", // status of the change
        "confirmedDate": "2018-12-12T00:00:00.000Z" // when the change was confirmed
    }
]

Note: the field confirmedDate is only defined if the contract change status corresponds to confirmed.

Information by user

You can check the status of each contract change for the current user via the contractChangeStatus query. It returns a field of individual information:

query {
  contractChangeStatus {
    id
    userId
    offerType
    status
    confirmedDate
  }
}
{
  "data": {
    "contractChangeStatus": [{
        "id": 23192913, // unique id of the contract change
        "userId": "5c1ce67a3e359338580d2d1d", // id of the user that changed contract
        "offerType": "phonePlan", // gas, electricity, dsl, phonePlan, phoneBundle -- identifies what type of contact was changes
        "status" : "confirmed", // status of the change
        "confirmedDate": "2018-12-12T00:00:00.000Z" // when the change was confirmed
    }]
  }
}

Note: the field confirmedDate is only defined if the contract change status corresponds to confirmed.