# Sales

The `/sales` endpoint allows you to view, and upload [sales](https://docs.dripcel.com/concepts/sales) to Dripcel.

## **Upload sales**

`POST /sales`

Upload bulk sales to Dripcel.

* 🔐 Permissions: `["sale.create"]`

### **Request**

**Body**

```javascript
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**

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

### **Response**


:::success
**Success**

:::

**200**

```javascript
{
  ok: true;
}
```


:::warning
**Error**

:::

**404**

```javascript
{
  ok: false;
  error: "Campaign not found";
}
```

**409**

```javascript
{
  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";
}
```