> ## Documentation Index
> Fetch the complete documentation index at: https://alguna.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Send credits to your CRM

> Step by step: show a subscription's credits in Salesforce or HubSpot, on each product's line item or as one record per credit

This walkthrough gets a subscription's [credits](https://alguna.com/docs/credits/overview.md) into Salesforce or HubSpot. It takes a few minutes in your CRM and in Alguna. For every field and rule, see [Send credits to your CRM](https://alguna.com/docs/integrations/crm/field-mapping.md#send-credits-to-your-crm) in the field mapping reference.

**Before you start**

* Your CRM is connected to Alguna.
* Your subscriptions already go to your CRM through [field mapping](https://alguna.com/docs/integrations/crm/field-mapping.md#map-another-object). For option 1, your subscription line items do too.
* You have the **Integration manage** permission in Alguna.

## Choose where credits show

| Option | Best when | You get |
| - | - | - |
| **1. On each line item** | You already send subscription products to line items | Each line shows the credit for its product |
| **2. One record per credit** | You want a list of credits, or a product has more than one credit | A separate CRM record for every credit |

You can use both.

## Option 1: on each line item

**1. Add fields in your CRM**

On your line item object, add a field for each detail you want to see. A good start:

* **Credit name** (text)
* **Credit amount** (number)
* **Credit duration type** (text)
* **Credit start date** (date)
* **Credit end date** (date)

**2. Open field mappings in Alguna**

Go to **Settings → Connections → Integrations → CRM** and open the **Field mappings** tab.

**3. Map the fields**

Click your line item card, which is the one written from **Phase item**. Click **Add mapping**, choose the Alguna field on the left, such as **Credit amount**, and the CRM field you just made on the right. Repeat for each field.

**4. Save**

Click **Save field mappings**.

A line shows a credit only when the credit is set up for that line's product. A credit for all products isn't shown on line items: use option 2 for those.

If a product has more than one credit, the single-credit fields stay empty. Map **Credits summary** to a long text field to list them all, or use option 2.

## Option 2: one record per credit

**1. Create a credit object in your CRM**

Create a custom object for credits, with fields for the details you want. In Salesforce, give it a lookup field to your subscription object. In HubSpot, Alguna can create the association for you in step 4.

**2. Open field mappings in Alguna**

Go to **Settings → Connections → Integrations → CRM** and open the **Field mappings** tab.

**3. Add the object**

Click **Map an object**. For **Alguna record**, choose **Credit**. For **CRM object**, choose the object you created.

**4. Link it to the subscription**

For **Parent mapped object**, choose your subscription object. In Salesforce, pick the lookup field from step 1. In HubSpot, type a name for the association.

**5. Map the fields and save**

Click **Add mapping** for each field, then click **Save field mappings**. Map **Credit product names** so each record says which product it's for.

## When credits show up

Alguna writes credits whenever an active subscription changes. A subscription that hasn't changed since you set this up updates the next time it does. If you need one sent sooner, contact Alguna support.

## Which field do I need?

| Question | Field |
| - | - |
| How much is the credit? | **Credit amount**. Use **Credit monetary amount** for a CRM currency field; it's empty for unit credits. |
| Is it one-time or repeating? | **Credit duration type**: `once` (one-time), `fixed` (repeats a set number of times) or `until_phase_end` (repeats until the subscription phase ends) |
| How long does it repeat? | **Credit duration value** and **Credit duration unit**, such as `12` and `months`. Only set for `fixed` credits. |
| When is it valid? | **Credit start date** and **Credit end date**. A one-time credit has no end date. |
| Which product is it for? | **Credit product names**, or **Credit product SKUs**. Empty for a credit that applies to all products. |
| What are all the credits on this subscription? | **Credits summary**, on your subscription object |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.