LetsBot Menu
Bắt đầu Tiếng Việt Ngôn ngữ

Đối tác kinh doanh của Meta Công ty đăng ký tại Vương quốc Anh

Ngôn ngữ

CRM · Endpoint API

POST /api/v1/crm/deals Mới

Create a deal

Creates a deal. Without stage_id it starts in the first open stage of pipeline_id (the default pipeline when omitted).

Creates a deal. Without stage_id it starts in the first open stage of pipeline_id (the default pipeline when omitted). Scope: crm.

Required: title. Optional: pipeline_id, stage_id (see List pipelines and stages), amount, currency (3 letters), contact_id, company_id, owner_user_id, expected_close_date (YYYY-MM-DD).

Nội dung JSON

{
  "title": "Epoxy kit order — 40 units",
  "pipeline_id": 1,
  "amount": 12000,
  "currency": "SAR",
  "contact_id": 42,
  "company_id": 7,
  "expected_close_date": "2026-10-31"
}

Ví dụ yêu cầu

curl -X POST "https://your-workspace.letsbot.net/api/v1/crm/deals" \
  -H "X-Zapier-Api-Key: YOUR_WORKSPACE_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
  "title": "Epoxy kit order — 40 units",
  "pipeline_id": 1,
  "amount": 12000,
  "currency": "SAR",
  "contact_id": 42,
  "company_id": 7,
  "expected_close_date": "2026-10-31"
}'
const response = await fetch("https://your-workspace.letsbot.net/api/v1/crm/deals", {
  method: "POST",
  headers: {
    "X-Zapier-Api-Key": "YOUR_WORKSPACE_API_KEY",
    "Accept": "application/json",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "title": "Epoxy kit order — 40 units",
    "pipeline_id": 1,
    "amount": 12000,
    "currency": "SAR",
    "contact_id": 42,
    "company_id": 7,
    "expected_close_date": "2026-10-31"
  }),
});

const data = await response.json();
console.log(data);
<?php

$ch = curl_init('https://your-workspace.letsbot.net/api/v1/crm/deals');

curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'X-Zapier-Api-Key: YOUR_WORKSPACE_API_KEY',
        'Accept: application/json',
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => <<<'JSON'
    {
        "title": "Epoxy kit order — 40 units",
        "pipeline_id": 1,
        "amount": 12000,
        "currency": "SAR",
        "contact_id": 42,
        "company_id": 7,
        "expected_close_date": "2026-10-31"
    }
    JSON,
]);

$data = json_decode(curl_exec($ch), true);
curl_close($ch);

print_r($data);
import requests

response = requests.request(
    "POST",
    "https://your-workspace.letsbot.net/api/v1/crm/deals",
    headers={
        "X-Zapier-Api-Key": "YOUR_WORKSPACE_API_KEY",
        "Accept": "application/json",
        "Content-Type": "application/json",
    },
    json={
        "title": "Epoxy kit order — 40 units",
        "pipeline_id": 1,
        "amount": 12000,
        "currency": "SAR",
        "contact_id": 42,
        "company_id": 7,
        "expected_close_date": "2026-10-31",
    },
)

print(response.json())

Phản hồi

Created201
{
  "success": true,
  "data": {
    "id": 15,
    "title": "Epoxy kit order — 40 units",
    "amount": 12000,
    "currency": "SAR",
    "pipeline_id": 1,
    "stage": {
      "id": 11,
      "name": "New"
    },
    "status": "open",
    "expected_close_date": "2026-10-31",
    "contact": {
      "id": 42,
      "name": "Ahmed Ali",
      "phone": "966500000000"
    },
    "company_id": 7,
    "owner": {
      "id": 3,
      "name": "Sara Ahmed"
    },
    "lost_reason_id": null,
    "lost_note": null,
    "won_at": null,
    "lost_at": null,
    "custom_fields": {},
    "created_at": "2026-10-02T10:00:00+03:00",
    "updated_at": "2026-10-08T09:30:00+03:00",
    "url": "https://your-workspace.letsbot.net/panel/v2/deals?deal=15&pipeline=1"
  }
}
Validation failed422
{
  "success": false,
  "error": "The title field is required.",
  "code": "validation_failed",
  "errors": {
    "title": [
      "The title field is required."
    ]
  }
}

Sẵn sàng khi bạn sẵn sàng

Dùng thử endpoint này với số của bạn

API hoạt động trong thời gian dùng thử miễn phí. Tạo tài khoản, kết nối số WhatsApp và sao chép khóa của bạn tại API → Dữ liệu xác thực.