POST
/api/public/v1/deals

Create a deal

Opens a deal. Omit `stageId` and it lands in the pipeline’s first column; omit `ownerId` and it belongs to whoever the token acts as. A location with no pipeline yet gets the default one created for it rather than the call failing.

Required scope

The access token must carry this scope. A token missing it gets 403 Forbidden. Grant them to an API client under Settings → Company → API, and to a teammate under Employee → Permissions.

deals:write

Request Body

PropertyTypeDescription
locationIdstringThe location.
titlestringWhat the deal is.
stageIdstringFrom the pipeline endpoint. Defaults to the first column.
accountIdstringThe customer it belongs to.
ownerIdstringDefaults to the token’s own employee.
valuenumberCents.
currencystringThree letters. Defaults to USD.
probabilitynumber0–100. Overrides the stage default when set.
expectedCloseDatestringISO 8601.
POSTExample request
curl
curl -X POST "https://www.pxb.app/api/public/v1/deals" \
  -H "Authorization: Bearer your_access_token" \
  -H "Content-Type: application/json" \
  -d '{
    "locationId": "loc_abc123",
    "title": "Northwind — annual contract",
    "value": 4800000,
    "accountId": "acc_7712"
  }'
200Example response
json
{
  "message": "Deal created successfully!",
  "content": {
    "deal": {
      "id": "del_8830",
      "referenceId": 214,
      "locationId": "loc_abc123",
      "pipelineId": "pip_01",
      "stageId": "stg_02",
      "accountId": "acc_7712",
      "ownerId": "emp_44f1",
      "title": "Northwind — annual contract",
      "value": 4800000,
      "currency": "USD",
      "status": "OPEN",
      "probability": 60,
      "expectedCloseDate": "2026-10-15T00:00:00.000Z",
      "sortOrder": 0,
      "wonLostReason": null,
      "closedAt": null,
      "stageMovedAt": "2026-08-25T10:00:00.000Z",
      "createdAt": "2026-08-10T09:00:00.000Z",
      "updatedAt": "2026-08-25T10:00:00.000Z"
    }
  }
}

In the console

The same thing done by hand, for anyone comparing the API against the screen they already use.

xRM → Pipeline
/xrm/pipeline
  1. Open the Pipeline.
  2. Add a deal to a column.