A List in an array of values that are stored in the database. The main purpose of a List is its usage in Rules Engine, to provide a way to change a Rule criteria without having to change the Rule itself.

How to Manage Your Lists

To view all of your lists, simply head to Settings ---> Rules Engine and select Value Lists

The Value Lists screen contains a grid with all available Lists. You can search a List by its properties (like ID or Name) by using a Filter field above the grid. You can edit your lists by clicking on the List ID or delete them by using the trash buttons on the right side of the grid.

Notice: you cannot delete a List that is being used in the Rules Engine. You should remove it from there first.

To create a List, click the Add List button on top of the page.

You should specify the name and values for that list. You can upload a CSV file to add or replace values (each value should be placed on a new line, same as it works with an input field on this page).

Each time you edit an existing list, its Version changes. Versions mechanism allows seeing the List revision history. To review this history, click on a Version number in the Value Lists screen.

Version History screen shows a List's current and previous values and a date and time when those were revised. To browse previous versions, click on a version you need in block.

Lists management using an API

You can check the full API Documentation for Lists here - https://rebilly.github.io/RebillyUserAPI/#tag/Lists. This guide highlights most common use cases.

Browsing Lists via API

To get a collection of all available Lists, you need to call

GET https://api.rebilly.com/v2.1/lists

A valid response example:

{
 "id":"testListId",
 "version":1,
 "name":"Test",
 "values":[
 "re",

"bil",

"ly"
 ],
 "createdTime":"2017-02-01T04:56:39Z",
 "updatedTime":"2017-02-01T04:56:39Z",
 "_links":[
 {
 "rel":"self",
 "href":"http://api.rebilly.com/v2.1/lists/testListLid"
 }
 ]
 }

Note that only latest version's values will be shown. To check which values were stored in a particular version, you need to call this endpoint:

GET https://api.rebilly.com/v2.1/lists/{listId}/{versionNumber}

If you want to browse through a List's versions history, you can use a Lists Tracking endpoint:

GET https://api.rebilly.com/v2.1/tracking/lists

Click here for more documentation about Lists Tracking.

Creating or Editing a List via API

To create a List with a pre-defined ID, you need to send a PUT request to this endpoint:

PUT https://api.rebilly.com/v2.1/lists/testListId

An example of a request's body:

{ 
 "name":"Test List",
 "values":[
 "re",
 "bil",
 "ly"
 ]
}

To change an existing list, you need to send a PUT request to this endpoint:

To change an existing list, you need to send a PUT request to this endpoint:

PUT https://api.rebilly.com/v2.1/lists/testListId

An example of a request's body that only changes values for that List.

{ 
 "values":[
 "123",
 "456",
 ]
}

An example of valid response:

An example of valid response:

{ 
 "id":"testListId",
 "version":2,
 "name":"Test List",
 "values":[
 "123",

"456",
 ],
 "createdTime":"2017-02-01T04:56:39Z",
 "updatedTime":"2017-02-01T04:56:39Z",
 "_links":[
 {
 "rel":"self",
 "href":"http://api.rebilly.com/v2.1/lists/testListLid"
 }
 ]
 }

Each time you update a List, it's version auto-increments.

Lists management using a PHP SDK

An example of searching by List's name:

$lists = $client->valuesLists()->search([
    'filter' => 'name:testName',
]);

An example of creating a List with pre-defined ID:

$listForm = new Rebilly\Entities\ValuesList();
$listForm->setName('listName');
$listForm->setValues([
        're',
        'bil',
        'ly'
]);
try {
    $invoice = $client->valuesLists()->create($listForm, 'testListId');
} catch (UnprocessableEntityException $e) {
    echo $e->getMessage();
}
Did this answer your question?