# Add Entitlement Credit

`POST https://api.suger.cloud/org/{orgId}/entitlement/{entitlementId}/addCredit`

Add the credit amount to the given Entitlement. The credit amount is accumulated & saved in the current Entitlement Term of the given Entitlement.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `orgId` | path | string | yes | Organization ID |
| `entitlementId` | path | string | yes | Entitlement ID |

## Request Body

Required.

Content-Type: `application/json` · Schema: `AddEntitlementCreditParams`

**`AddEntitlementCreditParams`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `creditAmountIncrement` | number | yes | The amount to be added to the credit amount. |
| `entitlementID` | string | yes |  |
| `entitlementTermID` | string | no | This is optional. If it is empty, the credit will be added to the default entitlement term of the entitlement. |
| `organizationID` | string | yes |  |

## Responses

### 200 — OK

Content-Type: `application/json` · Schema: `AddEntitlementCreditResponse`

**`AddEntitlementCreditResponse`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `creditAmountIncrement` | number | no | The amount to be added to the credit amount. |
| `entitlementID` | string | no |  |
| `entitlementTermID` | string | no |  |
| `newCreditAmount` | number | no | The new credit amount after the increment. |
| `organizationID` | string | no |  |

### 400 — Bad Request Error

Content-Type: `application/json`

### 500 — Internal Server Error

Content-Type: `application/json`

## Example

_Generated from this operation's schema. Values are placeholders — substitute your own ids, and set `SUGER_TOKEN` to a bearer token from the [OAuth client-credentials exchange](https://doc.suger.io/get-started/oauth-app/)._

### Request

```bash
curl -X POST 'https://api.suger.cloud/org/{orgId}/entitlement/{entitlementId}/addCredit' \
  -H 'Authorization: Bearer $SUGER_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "creditAmountIncrement": 100,
  "entitlementID": "01H0000000000000000000",
  "organizationID": "01H0000000000000000000"
}'
```

### Response — 200

```json
{
  "creditAmountIncrement": 100,
  "entitlementID": "01H0000000000000000000",
  "entitlementTermID": "01H0000000000000000000",
  "newCreditAmount": 100,
  "organizationID": "01H0000000000000000000"
}
```

### Error — 400

```json
"string"
```

---

Interactive API reference: https://doc.suger.io/api/
