# Create Lease

<mark style="color:orange;">`POST`</mark> /v3/leases

## Request

The details below help you form your HTTP requests to this endpoint.

### Headers

You may need to provide specific headers.

<table><thead><tr><th>Name</th><th>Type</th><th data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td>customer-token</td><td>string</td><td>true</td><td>Customer's authentication token</td></tr><tr><td>x-version-override</td><td>string</td><td>false</td><td>N/A</td></tr><tr><td>x-consumer-custom-id</td><td>string</td><td>true</td><td>Consumer data with the format "channel:vendorId"</td></tr></tbody></table>

### Query

You may provide query parameters to filter the output.

<table><thead><tr><th>Name</th><th>Type</th><th data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td>asPdf</td><td>boolean</td><td>false</td><td>Flag to determine if contract will be in PDF format</td></tr><tr><td>sendLink</td><td>boolean</td><td>false</td><td>Flag to determine if a link will be sent</td></tr><tr><td>withToken</td><td>boolean</td><td>false</td><td>Flag to determine if an agreement token will be returned</td></tr></tbody></table>

### Body

You must provide a JSON payload.

<table><thead><tr><th>Name</th><th>Type</th><th data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td>transactionId</td><td>string</td><td>true</td><td>A transaction ID to uniquely identify this transaction</td></tr><tr><td>orderId</td><td>string</td><td>false</td><td>The reference to the external order ID</td></tr><tr><td>items</td><td>array</td><td>true</td><td>N/A</td></tr><tr><td>items[].brand</td><td>string</td><td>true</td><td>The item's brand.</td></tr><tr><td>items[].sku</td><td>string</td><td>true</td><td>The item's SKU (can be vendor-specific).</td></tr><tr><td>items[].productId</td><td>string</td><td>false</td><td>Product Id</td></tr><tr><td>items[].description</td><td>string</td><td>true</td><td>The item's description</td></tr><tr><td>items[].cost</td><td>number</td><td>true</td><td>The item's cost.</td></tr><tr><td>items[].condition</td><td>string</td><td>true</td><td>The item's condition</td></tr><tr><td>items[].quantity</td><td>number</td><td>true</td><td>The quantity of this item to add to the lease.</td></tr><tr><td>items[].mpn</td><td>string</td><td>false</td><td>The item's Manufacturer Part Number.</td></tr><tr><td>items[].gtin</td><td>string</td><td>false</td><td>The item's Global Trade Item Number.</td></tr><tr><td>shipping</td><td>object</td><td>false</td><td>N/A</td></tr><tr><td>shipping.cost</td><td>number</td><td>true</td><td>The shipping and handling fee, if any.</td></tr><tr><td>shipping.date</td><td>string</td><td>false</td><td>The shipping date, if any.</td></tr><tr><td>shipping.method</td><td>string</td><td>true</td><td>The shipping method</td></tr><tr><td>shipping.store</td><td>any</td><td>false</td><td>N/A</td></tr><tr><td>payTomorrowTaxTotal</td><td>number</td><td>false</td><td>The total tax amount send over by PayTomorrow</td></tr><tr><td>totalDiscount</td><td>number</td><td>false</td><td>The total discount amount to be applied proportionally across items</td></tr></tbody></table>

## Response

The details below help you understand the responses you could get from this endpoint.

### Samples

Below are samples of responses, with tabs corresponding to returned status code.

{% tabs %}
{% tab title="200" %}

```javascript
{
    "data": {
        "leaseId": "\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1YTk...",
        "contract": "...base64 html contract",
        "frequency": "weekly",
        "term": 52,
        "payment": 17.28,
        "cashPrice": 400,
        "costOfRental": 440,
        "payTomorrowTaxTotal": 12.34
    }
}
```

{% endtab %}

{% tab title="400" %}

```javascript
{
    "error": {
        "statusCode": 400,
        "code": "UserAlreadyExists",
        "message": "User already exists with email ex@example.com",
        "data": {}
    }
}
```

{% endtab %}
{% endtabs %}

### Schema

The response's schema is outlined below.

<table><thead><tr><th>Name</th><th>Type</th><th data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td>data</td><td>object</td><td>false</td><td>N/A</td></tr><tr><td>data.leaseId</td><td>string</td><td>true</td><td>A unique identifier for the generated lease</td></tr><tr><td>data.contract</td><td>string</td><td>true</td><td>The lease contract, expressed as base64-encoded HTML</td></tr><tr><td>data.frequency</td><td>string</td><td>true</td><td>Frequency of lease payments</td></tr><tr><td>data.term</td><td>number</td><td>true</td><td>Term of the lease</td></tr><tr><td>data.payment</td><td>number</td><td>true</td><td>Periodic payment with tax</td></tr><tr><td>data.cashPrice</td><td>number</td><td>false</td><td>Cash price of the lease</td></tr><tr><td>data.costOfRental</td><td>number</td><td>true</td><td>Cost of the lease</td></tr><tr><td>data.payTomorrowTaxTotal</td><td>number</td><td>false</td><td>The total tax amount send over by PayTomorrow</td></tr></tbody></table>
