> For the complete documentation index, see [llms.txt](https://docs.received.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.received.ai/subscription-billing/the-subscription-billing-process/sync-and-track-subscriptions.md).

# Sync & Track Subscriptions

## Step 1: Automatically Sync Customers and Subscriptions

Once you have embedded the custom URLs into your website, Received's platform is ready to **automatically 'catch' user information** and create new customers and subscriptions. \
\
Using APIs, we can access the subscription data from your website to create the following:&#x20;

1. **New Customer**\
   \
   Using a specific API, a new customer is automatically created in **Customers > Subscriptions**.\
   Our API looks like this:&#x20;

```
// POST/api/customers
```

#### **Request body**

Example Value &#x20;

```json
{
  "name": "Received",
  "legal_name": "Received ltd.",
  "email": "admin1@company.com, admin2@company.com",
  "ein": "12-3456789",
  "phone": {
    "countryCode": "1",
    "phone": "2121234567"
  },
  "country": "United States",
  "city": "New York",
  "zip_code": "string",
  "billing_address": "643 Mundy St, Watertown, New York(NY), 13601",
  "shipping_address": "643 Mundy St, Watertown, New York(NY), 13601",
  "country_state": "NY",
  "currency": "USD",
  "tax": 17,
  "entity_ref": "693122c3-54e0-4acd-aeb8-7de4686cea3e",
  "entity_name": "Acme Inc",
  "net_terms": 30,
  "settings": {
    "attach_usage_logs_csv": false,
    "attach_usage_logs_pdf": true
  },
  "icon_data": "string"
}
```

#### Responses

Example Value

```
{
  "customer_ref": "dcaff9c0-4a9c-4d01-b2dc-0da7efcc616c"
}
```

2. **New Subscription** \
   \
   Using a specific API, a new subscription is automatically created in **Contracts > Subscriptions**.\
   Our API looks like this:&#x20;

```
// POST/api/contracts/subscriptions
```

#### **Request body**

Example Value

```json
{
  "customer_ref": "19ed1ce4-082b-4cea-8dfb-c7e673f88224",
  "entity_ref": "cec40f99-a2e1-4bd7-805d-9c1a3c2e69a1",
  "po_number": "string",
  "billing_start_date": "2024-02-01T12:05:23.613Z",
  "billing_end_date": "2024-02-01T12:05:23.613Z",
  "issue_day": "2023-07-13",
  "payment_time": "AFTER_USE",
  "tax": 17,
  "discount": 0,
  "net_terms": "DUE_UPON_RECEIPT",
  "note": "string",
  "billing_online_payment_details": {
    "auto_charge": true,
    "payment_gateway_id": "string",
    "payment_gateway_card_id": "string"
  },
  "products": [
    {
      "product_pricing_ref": "string",
      "line_items": [
        {
          "line_item_id": "string"
        }
      ]
    }
  ]
}
```

#### Responses

Example Value

```
{
  "subscription_ref": "32c320bb-431b-488f-bcd4-729e495a33ad"
}
```

## Step 2: Track Subscriptions Data&#x20;

Navigate to **Customers>Subscribers** to see all subscriptions data.\
On this screen you can view the number of subscribers, subscriptions ARR and MRR, payment status, churn rate and more.\
\
Received offers an error handling mechanism, which quickly identifies failed payments and automatically sends a new payment link to the customer.

<figure><img src="/files/9npVx7bPPDqVv5j4T3R0" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.received.ai/subscription-billing/the-subscription-billing-process/sync-and-track-subscriptions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
