Listing deals

GET /deals.xml

Returns a paginated list of deals.


Parameter Type Description
project_id integer/string get deals from the project with the given id
assigned_to_id integer get deals assigned to the user with the given id
status_id integer get deals with the given status id
search string get deals with the given search string


GET /deals.xml 
GET /deals.xml?project_id=2 
GET /deals.xml?assigned_to_id=1&status_id=1
GET /deals.xml?search=tom 

Paging example: 
GET /deals.xml?project_id=testproject&page=1
GET /deals.xml?project_id=testproject&page=2


<deals total_count="5" offset="0" limit="25" type="array">
    1C:Enterprise 8 system of programs is intended for automation of everyday enterprise activities: various business tasks of economic and management activity, such as management accounting, business accounting, HR management, CRM, SRM, MRP, MRP, etc.
    <project id="4" name="Redmine CRM plugin demo"/>
    <status id="1" name="New"/>
    <category id="3" name="Integration"/>
    <author id="4" name="Smith Paul"/>
    <contact id="7" name="LLC "Selection""/>
    <assigned_to id="4" name="Smith Paul"/>
    <related_contacts type="array">
      <contact id="46" name="Ballmer, Steven"/>
      <contact id="44" name="Gates, Bill"/>
    <custom_fields type="array">
      <custom_field id="14" name="Deal custom field">

Showing a deal

GET /deals/[id].xml


GET /deals/2.xml
GET /deals/2.json

Creating a deal

POST /deals.[format]


  • deal - A hash of the deal attributes:
    • project_id
    • name
    • contact_id - Company name string
    • price
    • currency
    • probability
    • due_date
    • background
    • status_id
    • category_id
    • assigned_to_id - ID of the user to assign the deal to (currently no mechanism to assign by name)
    • custom_fields - See Custom fields


POST /deals.xml
<?xml version="1.0"?>
  <name>New deal</name>
POST /deals.json
  "deal": {
    "project_id": 1,
    "name": "New deal",
    "contact_id": 1

Curl examples

Update deal

curl -v -H “Accept: application/json” -H "Content-Type: application/json" -X PUT http://localhost:3000/deals/1 -u admin:admin -d "{\"deal\": {\"name\":\"Updated via API deal\"}}" 

Create deal

curl -v -H "Content-Type: application/xml" -X POST -d "<deal><name>Created via API deal</name><contact_id>1</contact_id><project_id>support</project_id></deal>" -u admin:admin http://localhost:3000/deals.xml
Was this article helpful? Yes  No
199 from 238 found this helpful