---
title: "Preview invoice_now"
description: "What invoice_now would raise for the same body, one invoice_estimate per subscription, writing nothing."
canonical_url: "https://twominutebilling.com/help/developers/api-reference/subscriptions/preview-invoice-now"
---
# Preview invoice_now

> What invoice_now would raise for the same body, one invoice_estimate per subscription, writing nothing.

<api-operation method="POST" path="/v1/businesses/{biz}/unbilled_charges/invoice_now_estimate">
<template v-slot:docs="">

What `invoice_now` would raise for the same body, one `invoice_estimate` per subscription, writing nothing. Money fields follow the invoice document: `promotional_discount_minor` is drawn pre-tax, `credits_applied_minor` is refundable + excess drawn post-tax, `total_minor` is net of the promotional discount, `amount_due_minor` is what collection would attempt. Successive estimates draw on what the previous ones left.

## Path parameters

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        biz
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <strong>
        yes
      </strong>
    </td>
    
    <td>
      Business id (biz_…)
    </td>
  </tr>
</tbody>
</table>

## Body

The request body is **required**.

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        subscription
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Invoice only this subscription's unbilled charges (sub_…).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        customer
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Invoice this customer's unbilled charges (cus_…).
    </td>
  </tr>
</tbody>
</table>

## Response

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The object type; always <code>
        estimate
      </code>
      
      . One of <code>
        estimate
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        invoice_estimates
      </code>
    </td>
    
    <td>
      <code>
        array of object
      </code>
    </td>
    
    <td>
      One invoice estimate for each subscription.
    </td>
  </tr>
</tbody>
</table>

## Status codes

<table>
<thead>
  <tr>
    <th>
      Status
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        200
      </code>
    </td>
    
    <td>
      estimate with invoice_estimates<span>
        
      </span>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        400
      </code>
    </td>
    
    <td>
      Provide exactly one of subscription or customer
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        404
      </code>
    </td>
    
    <td>
      No such subscription/customer
    </td>
  </tr>
</tbody>
</table>
</template>

<template v-slot:request="">

```bash [Request]
curl -X POST "$TMBILLING_URL/v1/businesses/biz_XXXXXXXXXXXX01/unbilled_charges/invoice_now_estimate" \
  -H "Authorization: Bearer $TMBILLING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "subscription": "sub_XXXXXXXXXXXX01",
    "customer": "cus_XXXXXXXXXXXX01"
  }'
```

</template>

<template v-slot:response="">
<code-group>

```json [200 OK]
{
  "object": "estimate",
  "invoice_estimates": [
    {
      "object": "invoice_estimate",
      "subscription": "sub_XXXXXXXXXXXX01",
      "currency": "USD",
      "lines": [
        {
          "unbilled_charge": "uch_XXXXXXXXXXXX01",
          "description": "Onboarding",
          "quantity": 1,
          "amount_minor": 20000
        }
      ],
      "subtotal_minor": 2900,
      "promotional_discount_minor": 0
    }
  ]
}
```

```json [400 Bad Request]
{
  "error": {
    "type": "invalid_request_error",
    "message": "Provide exactly one of subscription or customer"
  }
}
```

```json [404 Not Found]
{
  "error": {
    "type": "invalid_request_error",
    "message": "No such subscription/customer"
  }
}
```

</code-group>
</template>
</api-operation>


## Sitemap

See the full [sitemap](https://twominutebilling.com/sitemap.md) for all pages.
