Skip to main content

Sales / Deals API

The Sales API lets you manage deals (opportunities) in the pipeline programmatically. Create deals, update values, move them between stages, and mark them as won or lost.

Endpoints

MethodEndpointDescription
GET/v1/dealsList all deals
GET/v1/deals/:idGet a single deal
POST/v1/dealsCreate a new deal
PATCH/v1/deals/:idUpdate a deal
DELETE/v1/deals/:idDelete a deal
POST/v1/deals/:id/moveMove a deal to a different stage
POST/v1/deals/:id/closeClose a deal as won or lost
GET/v1/stagesList pipeline stages

List Deals

GET /v1/deals

Query Parameters

ParameterTypeDescription
pageintegerPage number (default: 1)
per_pageintegerResults per page (default: 25, max: 100)
sortstringSort field (value, created_at, expected_close_date, -value for descending)
stage_idUUIDFilter by pipeline stage
owner_idUUIDFilter by assigned user
team_idUUIDFilter by team
statusstringopen, won, lost
min_valuenumberMinimum deal value
max_valuenumberMaximum deal value
close_date_afterISO dateExpected close date after
close_date_beforeISO dateExpected close date before
searchstringSearch across deal name and contact

Example Request

curl -X GET "https://api.play2sell.com/v1/deals?status=open&sort=-value&per_page=20" \
  -H "Authorization: Bearer YOUR_TOKEN"

Example Response

{
  "data": [
    {
      "id": "880e8400-e29b-41d4-a716-446655440000",
      "name": "Tech Corp - Enterprise License",
      "value": 75000.00,
      "stage": {
        "id": "990e8400-e29b-41d4-a716-446655440001",
        "name": "Proposal",
        "probability": 50
      },
      "status": "open",
      "contact_name": "Maria Santos",
      "contact_email": "maria@techcorp.com",
      "company": "Tech Corp",
      "owner_id": "660e8400-e29b-41d4-a716-446655440001",
      "expected_close_date": "2026-04-15",
      "priority": "high",
      "lead_id": "550e8400-e29b-41d4-a716-446655440000",
      "custom_fields": {
        "contract_type": "annual",
        "decision_maker": "CTO"
      },
      "tags": ["enterprise", "priority"],
      "created_at": "2026-02-20T10:00:00Z",
      "updated_at": "2026-03-14T16:45:00Z"
    }
  ],
  "meta": {
    "total": 89,
    "page": 1,
    "per_page": 20,
    "total_pages": 5
  }
}

Create a Deal

POST /v1/deals

Request Body

FieldTypeRequiredDescription
namestringYesDeal name
valuenumberYesDeal value
stage_idUUIDNoInitial stage (defaults to first stage)
contact_namestringNoPrimary contact name
contact_emailstringNoPrimary contact email
companystringNoCompany name
owner_idUUIDNoAssigned sales rep
expected_close_dateISO dateNoExpected closing date
prioritystringNohigh, medium, low (default: medium)
lead_idUUIDNoLink to source lead
custom_fieldsobjectNoCustom field values
tagsarrayNoList of tags

Example

curl -X POST "https://api.play2sell.com/v1/deals" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "StartupXYZ - Pro Plan",
    "value": 12000,
    "contact_name": "Carlos Silva",
    "contact_email": "carlos@startupxyz.com",
    "company": "StartupXYZ",
    "expected_close_date": "2026-05-01",
    "priority": "medium"
  }'

Update a Deal

PATCH /v1/deals/:id
Send only the fields to update.
curl -X PATCH "https://api.play2sell.com/v1/deals/880e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "value": 85000,
    "priority": "high"
  }'

Move a Deal

Move a deal to a different pipeline stage:
POST /v1/deals/:id/move

Request Body

FieldTypeRequiredDescription
stage_idUUIDYesTarget stage ID
notestringNoOptional note about the move
curl -X POST "https://api.play2sell.com/v1/deals/880e8400-e29b-41d4-a716-446655440000/move" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "stage_id": "990e8400-e29b-41d4-a716-446655440002",
    "note": "Client approved the proposal, moving to negotiation"
  }'
Moving a deal via the API triggers the same gamification points and workflow automations as moving it in the UI.

Close a Deal

POST /v1/deals/:id/close

Request Body

FieldTypeRequiredDescription
resultstringYeswon or lost
final_valuenumberNoFinal deal value (for won deals)
loss_reasonstringConditionalRequired when result is lost
notestringNoClosing note

Close as Won

curl -X POST "https://api.play2sell.com/v1/deals/880e8400-e29b-41d4-a716-446655440000/close" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "result": "won",
    "final_value": 82000,
    "note": "Signed 12-month contract"
  }'

Close as Lost

curl -X POST "https://api.play2sell.com/v1/deals/880e8400-e29b-41d4-a716-446655440000/close" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "result": "lost",
    "loss_reason": "Lost to competitor",
    "note": "Chose CompetitorX due to lower pricing"
  }'

List Pipeline Stages

GET /v1/stages
Returns all configured pipeline stages in order:
{
  "data": [
    { "id": "...", "name": "Prospecting", "position": 1, "probability": 10 },
    { "id": "...", "name": "Qualification", "position": 2, "probability": 25 },
    { "id": "...", "name": "Proposal", "position": 3, "probability": 50 },
    { "id": "...", "name": "Negotiation", "position": 4, "probability": 75 },
    { "id": "...", "name": "Closed Won", "position": 5, "probability": 100 },
    { "id": "...", "name": "Closed Lost", "position": 6, "probability": 0 }
  ]
}

Delete a Deal

DELETE /v1/deals/:id
Returns 204 No Content on success.
Deleting a deal is permanent. The deal history, notes, and attachments are all removed. Consider closing as lost instead to preserve the data.

Next Steps