Bỏ qua để tới nội dung chính
Đăng nhập
Apus Platform
Mục lục tài liệu
crm

Sales & CRM · crm

The sell side, end to end — sales orders and their fulfilment plus the CRM pipeline that feeds them: leads, opportunities and quotations. A confirmed order reserves stock and hands off to distribution and finance; a converted quotation or lead flows straight into an order. Sync a CRM, an e-commerce front end or an order-management system against these endpoints.

GET/v1/crm/quotationsScope: crm:read

List quotations

Returns a cursor-paginated list of quotations. Filter by status or customer.

Query parameters
limitoptionalintegerPage size, 1–200 (default 50).
cursoroptionalstringPagination cursor from a previous response.
statusoptionalstringFilter by status: draft, sent, accepted, declined or expired.
customer_idoptionalstringFilter by customer (partner id).
Request
curl "https://api.apusplatform.com/v1/crm/quotations" \
  -H "Authorization: Bearer $APUS_TOKEN"
Response
{
  "data": [
    {
      "id": "qtn_3c4d",
      "number": "QT-2026-000087",
      "customer_id": "prt_1a2b",
      "status": "sent",
      "total": {
        "amount": 1250000,
        "currency": "VND"
      },
      "valid_until": "2026-08-15",
      "created_at": "2026-07-16T08:00:00Z"
    }
  ],
  "has_more": false,
  "next_cursor": null
}
POST/v1/crm/quotationsScope: crm:write

Create a quotation

Creates a quotation in draft status. Convert it to a sales order once the customer accepts.

Body
customer_idrequiredstringCustomer (partner id).
linesrequiredarrayQuote lines: array of { sku, quantity, unit_price? }.
valid_untiloptionalstringExpiry date (YYYY-MM-DD).
Request
curl -X POST "https://api.apusplatform.com/v1/crm/quotations" \
  -H "Authorization: Bearer $APUS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": "prt_1a2b",
    "valid_until": "2026-08-15",
    "lines": [
      {
        "sku": "STEEL-BRKT-08",
        "quantity": 100,
        "unit_price": {
          "amount": 12500,
          "currency": "VND"
        }
      }
    ]
  }'
Response
{
  "id": "qtn_3c4d",
  "number": "QT-2026-000087",
  "status": "draft",
  "created_at": "2026-07-20T02:20:00Z"
}
POST/v1/crm/quotations/{id}/convertScope: crm:write

Convert a quotation

Converts an accepted quotation into a draft sales order, carrying over its lines and prices.

Path parameters
idrequiredstringQuotation id.
Request
curl -X POST "https://api.apusplatform.com/v1/crm/quotations/qtn_3c4d/convert" \
  -H "Authorization: Bearer $APUS_TOKEN"
Response
{
  "id": "qtn_3c4d",
  "status": "accepted",
  "sales_order_id": "so_1a2b",
  "converted_at": "2026-07-20T02:22:00Z"
}
GET/v1/crm/leadsScope: crm:read

List leads

Returns a cursor-paginated list of leads. Filter by pipeline stage or acquisition source.

Query parameters
limitoptionalintegerPage size, 1–200 (default 50).
cursoroptionalstringPagination cursor from a previous response.
stageoptionalstringFilter by stage: new, contacted, qualified or unqualified.
sourceoptionalstringFilter by source: website, referral, event or import.
Request
curl "https://api.apusplatform.com/v1/crm/leads" \
  -H "Authorization: Bearer $APUS_TOKEN"
Response
{
  "data": [
    {
      "id": "lead_5e6f",
      "name": "Nguyen Van An",
      "email": "an.nguyen@example.com",
      "company": "Cong ty CP Dai Phat",
      "stage": "new",
      "source": "website",
      "owner_id": "usr_7a",
      "created_at": "2026-07-19T09:30:00Z"
    }
  ],
  "has_more": false,
  "next_cursor": null
}
POST/v1/crm/leadsScope: crm:write

Create a lead

Creates a lead in the new stage. Convert a qualified lead into an opportunity later.

Body
namerequiredstringContact's full name.
emailoptionalstringContact email address.
companyoptionalstringCompany or organization name.
sourceoptionalstringAcquisition source: website, referral, event or import.
Request
curl -X POST "https://api.apusplatform.com/v1/crm/leads" \
  -H "Authorization: Bearer $APUS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Nguyen Van An",
    "email": "an.nguyen@example.com",
    "company": "Cong ty CP Dai Phat",
    "source": "website"
  }'
Response
{
  "id": "lead_5e6f",
  "stage": "new",
  "created_at": "2026-07-20T02:25:00Z"
}
POST/v1/crm/leads/{id}/convertScope: crm:write

Convert a lead

Converts a qualified lead into an opportunity and, when company details are present, a customer partner.

Path parameters
idrequiredstringLead id.
Request
curl -X POST "https://api.apusplatform.com/v1/crm/leads/lead_5e6f/convert" \
  -H "Authorization: Bearer $APUS_TOKEN"
Response
{
  "id": "lead_5e6f",
  "stage": "qualified",
  "opportunity_id": "opp_9a10",
  "partner_id": "prt_2b3c",
  "converted_at": "2026-07-20T02:28:00Z"
}
GET/v1/crm/opportunitiesScope: crm:read

List opportunities

Returns a cursor-paginated list of opportunities. Filter by pipeline stage or owner.

Query parameters
limitoptionalintegerPage size, 1–200 (default 50).
cursoroptionalstringPagination cursor from a previous response.
stageoptionalstringFilter by stage: prospecting, qualification, proposal, negotiation, won or lost.
owner_idoptionalstringFilter by the sales rep who owns the opportunity.
Request
curl "https://api.apusplatform.com/v1/crm/opportunities" \
  -H "Authorization: Bearer $APUS_TOKEN"
Response
{
  "data": [
    {
      "id": "opp_9a10",
      "name": "Dai Phat — ERP rollout",
      "customer_id": "prt_2b3c",
      "stage": "proposal",
      "amount": {
        "amount": 480000000,
        "currency": "VND"
      },
      "owner_id": "usr_7a",
      "expected_close": "2026-09-30",
      "created_at": "2026-07-19T10:00:00Z"
    }
  ],
  "has_more": false,
  "next_cursor": null
}
PATCH/v1/crm/opportunities/{id}Scope: crm:write

Update an opportunity

Updates mutable fields of an opportunity — typically to advance its stage or revise the deal amount. Only supplied fields change.

Path parameters
idrequiredstringOpportunity id.
Body
stageoptionalstringPipeline stage: prospecting, qualification, proposal, negotiation, won or lost.
amountoptionalobject{ amount (minor units), currency }.
Request
curl -X PATCH "https://api.apusplatform.com/v1/crm/opportunities/opp_9a10" \
  -H "Authorization: Bearer $APUS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "stage": "negotiation",
    "amount": {
      "amount": 520000000,
      "currency": "VND"
    }
  }'
Response
{
  "id": "opp_9a10",
  "stage": "negotiation",
  "amount": {
    "amount": 520000000,
    "currency": "VND"
  },
  "updated_at": "2026-07-20T02:30:00Z"
}

Sẵn sàng tích hợp?

Tạo API client trong Account Console để lấy thông tin xác thực, hoặc trao đổi với kỹ sư tích hợp về bài toán của bạn.

noindex