Skip to main content

Sales

The /sales endpoint allows you to view, and upload sales to Dripcel.

Upload a single sale

POST /sales

Upload a single sale to Dripcel.

  • 🔐 Permissions: ["sale.create"]

Request

Body

FieldTypeRequiredDescription
campaign_idstringThe campaign_id the sale was made. Use the /campaigns endpoint to see a list of all campaigns and their _ids
cellstringThe cell number of the contact who converted the sale
soldAtstringThe date the sale was made. Must be in ISO format (YYYY-MM-DD), and doesn't have to include time. If blank, the current datetime is used.
saleValuenumberThe value of the sale. If blank, the defaultSaleValue of the corresponding campaign will be used

Example

{
"saleValue": 100,
"campaign_id": "639978184d735c88ed8bbd68",
"cell": "0111111111",
"soldAt": "2023-02-14"
}

Response

Success

200
{
ok: true;
}

Error

404
{
ok: false;
error: "Campaign not found";
}
409
{
ok: false;
// A sale is considered a duplicate if it has the same cell number, campaign_id, and soldAt date
error: "Duplicate sale";
}