Sales

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

Upload sales

POST /sales

Upload bulk sales to Dripcel.

  • 🔐 Permissions: ["sale.create"]

Request

Body

type Sales = {
  /** The campaign_id the sale was made */
  campaign_id: string;
  /** The _id of the click that lead to the sale */
  click_id?: string;
  /** The cell number of the contact who converted the sale. Can be in local or international format (if local, the country of the corresponding campaign will be used) */
  cell: 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 */
  soldAt?: string;
  /** The value of the sale. If blank, the `defaultSaleValue` of the corresponding campaign will be used */
  saleValue?: number;
}[];

Example

[
  {
    "cell": "0111111111",
    "campaign_id": "639978184d735c88ed8bbd68"
  },
  {
    "saleValue": 100,
    "cell": "0111111112",
    "soldAt": "2023-02-14",
    "campaign_id": "639978184d735c88ed8bbd68",
    "click_id": "639978184d735c88ed8bbd69"
  }
]

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 as an existing sale
  error: "Duplicate sale";
}