---
title: "Give credit"
description: "category: promotional (the default) books the credit at once."
canonical_url: "https://twominutebilling.com/help/developers/api-reference/credits/give-credit"
---
# Give credit

> category: promotional (the default) books the credit at once.

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

`category: promotional` (the default) books the credit at once. `category: paid` also needs `invoices:manage`: it creates an invoice for `price_minor` (the net price, which is the cost basis) taxed by `tax_treatment`, and a `pending` grant that becomes `active` when the invoice is paid. With `mark_paid` the invoice is recorded as paid in the same request, so the response shows `active`. Paid credit never exists without an invoice. Needs `credits:manage`.

## 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>
      The business's id (biz_…).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        cus
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <strong>
        yes
      </strong>
    </td>
    
    <td>
      The customer's id (cus_…).
    </td>
  </tr>
</tbody>
</table>

## Headers

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

<tbody>
  <tr>
    <td>
      <code>
        Idempotency-Key
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Safely retry writes — repeats return the original response. If a write FAILED after it had already taken effect, that failure is what repeats: the key is spent, and a new attempt needs a new key.
    </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>
        category
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Default <code>
        promotional
      </code>
      
      . One of <code>
        promotional
      </code>
      
      , <code>
        paid
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        unit
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      A credit unit's id. Null or absent = money.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        currency
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Money grants only. Default: the customer's currency.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        amount
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      <strong>
        yes
      </strong>
    </td>
    
    <td>
      In the unit's smallest step (money: minor units).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        priority
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      0 to 100. Default 50.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        effective_at
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Promotional only. Default now. Unix seconds, or an ISO 8601 date-time with an offset.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        expires_at
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Default: no expiry. Unix seconds, or an ISO 8601 date-time with an offset.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        applicability
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Default: every usage line (<code>
        metered
      </code>
      
      ).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        applicability.kind
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <strong>
        yes
      </strong>
    </td>
    
    <td>
      The applicability's kind. One of <code>
        metered
      </code>
      
      , <code>
        prices
      </code>
      
      , <code>
        meters
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        applicability.prices
      </code>
    </td>
    
    <td>
      <code>
        array of string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      The applicability's prices.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        applicability.meters
      </code>
    </td>
    
    <td>
      <code>
        array of string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      The applicability's meters.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        on_exhausted
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      What happens when the credit is used up, for a business with blocking on. Null = not set here. One of <code>
        block
      </code>
      
      , <code>
        bill
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        metadata
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Key-value pairs you attach to the credit grant.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        price_minor
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Paid only: the net price, without tax. It is the cost basis.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        tax_treatment
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Paid only, required. <code>
        taxed_at_use
      </code>
      
       is for money credit only. One of <code>
        taxed_at_purchase
      </code>
      
      , <code>
        taxed_at_use
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        mark_paid
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Paid only: record the invoice as paid now, so the credit is active at once.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        mark_paid.method
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <strong>
        yes
      </strong>
    </td>
    
    <td>
      cash | check | bank_transfer | other
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        mark_paid.reference
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Your reference for the payment.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        mark_paid.paid_at
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Default now. Unix seconds, or an ISO 8601 date-time with an offset.
    </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>
        credit_grant
      </code>
      
      . One of <code>
        credit_grant
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      cgr_…
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        customer
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      cus_…
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        currency
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      ISO 4217.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        unit
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The credit unit's id. Null = money.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        amount
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      Units at grant, in the unit's smallest step (money: minor units).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        amount_decimal
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <code>
        amount
      </code>
      
       in whole units, as a decimal string.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        face_minor
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      The money value at grant. Fixed for life.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        cost_basis_minor
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      Paid: the net money received for it. Promotional: 0.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        category
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The credit grant's category. One of <code>
        paid
      </code>
      
      , <code>
        promotional
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        priority
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      0 to 100. Lower draws first.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        effective_at
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      The effective time (ISO-8601 UTC).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        expires_at
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      When the credit grant expires (ISO-8601 UTC).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        applicability
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      Which invoice lines the grant may pay: <code>
        {"kind":"metered"}
      </code>
      
       (every usage line, the default), <code>
        {"kind":"prices","prices":["…"]}
      </code>
      
      , or <code>
        {"kind":"meters","meters":["…"]}
      </code>
      
       (meter keys: the usage lines of every price that bills the meter when the grant draws). A <code>
        metered
      </code>
      
       grant takes the business's <code>
        credit_config.credit_scope
      </code>
      
       when one is set.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        source
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Where the credit grant comes from. One of <code>
        purchase
      </code>
      
      , <code>
        plan_cycle
      </code>
      
      , <code>
        manual
      </code>
      
      , <code>
        restore
      </code>
      
      , <code>
        auto_top_up
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        tax_treatment
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The credit grant's tax treatment. One of <code>
        taxed_at_purchase
      </code>
      
      , <code>
        taxed_at_use
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        on_exhausted
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      What happens when the credit is used up, for a business with blocking on. Null = not set here. One of <code>
        block
      </code>
      
      , <code>
        bill
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        status
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The credit grant's status. One of <code>
        pending
      </code>
      
      , <code>
        active
      </code>
      
      , <code>
        expired
      </code>
      
      , <code>
        voided
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        invoice
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The invoice that sold it (paid grants).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        restored_from
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The expired grant this one restores.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        auto_top_up_run
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      atur_…: the automatic top-up run that sold it.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        remaining
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      What is left: the sum of the grant's movements.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        metadata
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      Key-value pairs you attach to the credit grant.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        created_at
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      When the credit grant was created (ISO-8601 UTC).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        updated_at
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      When the credit grant was last changed (ISO-8601 UTC).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        resource_version
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      A number that goes up on every change.
    </td>
  </tr>
</tbody>
</table>

## Status codes

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

<tbody>
  <tr>
    <td>
      <code>
        201
      </code>
    </td>
    
    <td>
      The credit grant.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        400
      </code>
    </td>
    
    <td>
      The body is not correct, or a rule refuses the grant.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        403
      </code>
    </td>
    
    <td>
      A paid grant needs <code>
        invoices:manage
      </code>
      
       too.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        404
      </code>
    </td>
    
    <td>
      No such customer or credit unit.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        409
      </code>
    </td>
    
    <td>
      Idempotency-Key conflict — the key is already in flight, or was reused with a different request payload.
    </td>
  </tr>
</tbody>
</table>
</template>

<template v-slot:request="">

```bash [Request]
curl -X POST "$TMBILLING_URL/v1/businesses/biz_XXXXXXXXXXXX01/customers/cus_XXXXXXXXXXXX01/credit_grants" \
  -H "Authorization: Bearer $TMBILLING_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "currency": "USD",
    "amount": 2900
  }'
```

</template>

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

```json [201 Created]
{
  "object": "credit_grant",
  "id": "cgr_XXXXXXXXXXXX01",
  "customer": "cus_XXXXXXXXXXXX01",
  "currency": "USD",
  "unit": "seat",
  "amount": 2900,
  "amount_decimal": "Amount decimal",
  "face_minor": 2900,
  "cost_basis_minor": 2900,
  "category": "paid",
  "priority": 1,
  "effective_at": "2026-03-14T09:30:00Z",
  "expires_at": "2026-04-14T09:30:00Z",
  "applicability": {
    "kind": "metered",
    "prices": [
      "pro-monthly-usd"
    ],
    "meters": [
      "Meter"
    ]
  },
  "source": "purchase",
  "tax_treatment": "taxed_at_purchase",
  "on_exhausted": "block",
  "status": "active",
  "invoice": "inv_XXXXXXXXXXXX01",
  "restored_from": "Restored from",
  "auto_top_up_run": "atur_XXXXXXXXXXXX01",
  "remaining": {
    "units": 1,
    "units_decimal": "Units decimal",
    "face_minor": 2900,
    "cost_minor": 2900
  },
  "metadata": {
    "crm_id": "acct-1001"
  },
  "created_at": "2026-03-14T09:30:00Z",
  "updated_at": "2026-03-14T09:30:00Z",
  "resource_version": 1
}
```

```json [400 Bad Request]
{
  "error": {
    "type": "invalid_request_error",
    "message": "The body is not correct, or a rule refuses the grant."
  }
}
```

```json [403 Forbidden]
{
  "error": {
    "type": "permission_error",
    "message": "A paid grant needs invoices:manage too."
  }
}
```

```json [404 Not Found]
{
  "error": {
    "type": "invalid_request_error",
    "message": "No such customer or credit unit."
  }
}
```

```json [409 Conflict]
{
  "error": {
    "type": "idempotency_error",
    "message": "Idempotency-Key conflict — the key is already in flight, or was reused with a different request payload."
  }
}
```

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


## Sitemap

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