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
Field | Type | Required | Description |
---|---|---|---|
campaign_id | string | ✅ | The campaign_id the sale was made. Use the /campaigns endpoint to see a list of all campaigns and their _ids |
cell | string | ✅ | The cell number of the contact who converted the sale |
soldAt | string | ❌ | The 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. |
saleValue | number | ❌ | The 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";
}