Deal Sources

The Deal Sources API provides a simple interface to manage deal sources. The API allows you to create, delete and update your sources. You can retrieve a single source as well as list of all sources.

Properties

Attribute Description
id number readonly

Unique identifier of the deal source.

creator_id number readonly

Unique identifier of the user that created the source.

name string

Name of the source.

resource_type string

Type name of the resource the source is attached to.

Possible values:

  • deal
created_at string readonly

Date and time of creation in UTC (ISO 8601 format).

updated_at string readonly

Date and time of the last update in UTC (ISO 8601 format).


Endpoints


Retrieve all sources

Returns all deal sources available to the user according to the parameters provided.

Parameters

Attribute Description
page number optional

Page number to start from. Page numbering starts at 1, and omitting the page parameter will return the first page.

e.g. ?page=2
per_page number optional

Number of records to return per page. The default limit is 25 and the maximum number that can be returned is 100.

e.g. ?per_page=20
sort_by string optional

A field to sort by. The default ordering is ascending. If you want to change the sort order to descending, append :desc to the field e.g. sort_by=name:desc.

Possible values:

  • id
  • name
  • updated_at
  • created_at
e.g. ?sort_by=created_at
ids string optional

Comma-separated list of deal source IDs to be returned in a request.

e.g. ?ids=1,2,3
name string optional

Name of the source to search for. This parameter is used in a strict sense.

e.g. ?name=Word%20of%20mouth

Create a source

Creates a new source.

Source’s name must be unique.

Parameters

Attribute Description
name string required

Must be unique.

e.g. "name": "Tom"
resource_type string optional
e.g. "resource_type": "deal"

Retrieve a single source

Returns a single source available to the user by the provided id. If a source with the supplied unique identifier does not exist it returns an error.

Parameters

Attribute Description
id number required

Unique identifier of the source.


Update a source

Updates source information. If the specified source does not exist, the request will return an error.

If you want to update a source, you must make sure source’s name is unique.

Parameters

Attribute Description
id number required

Source ID.

name string optional

Must be unique.

e.g. "name": "Tom referral"
resource_type string optional
e.g. "resource_type": "deal"

Delete a source

Delete an existing source. If the specified source does not exist, the request will return an error. This operation cannot be undone.

Parameters

Attribute Description
id number required

Unique identifier of the source.