# POST /mrrsubscription/ — Create Monthly Recurring Revenue Status

> Product: **Pabbly Subscription Billing** (v1)
> Base URL: `https://payments.pabbly.com/api/v1`
> Auth: Basic via `Authorization` header
> Canonical: `/subscription-billing/reports/create-monthly-recurring-revenue-status`

A POST request API in which you will add the Product Id and the days interval in the form data. In response you will get the details of all the customer whose recurring billing is going to occur in the selected interval.

**Body parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| product_id | string | Yes | Get the stats product wise or for all products. |
| interval | string | Yes | Fill the interval for States like last_30_days, this_week and so on. |

**Example request body:**

```json
{
"product_id":"5e3a95143c92e44b424b6d47",
"interval":"last_30_days"
}
```

**Response (200)** — Create Monthly Recurring Revenue Status:

```json
[
    {
        "created_at": "2020-03-04T06:53:24.022Z",
        "status": "live",
        "first_name": "Roman",
        "last_name": "Race",
        "email_id": "rrcroman@gmail.com",
        "total_amount": 200
    },
    {
        "created_at": "2020-03-04T05:02:04.447Z",
        "status": "live",
        "first_name": "john",
        "last_name": "smith",
        "email_id": "jhonsmith@xxxxx.com",
        "total_amount": 180
    },
    {
        "created_at": "2020-03-03T10:24:13.258Z",
        "status": "live",
        "first_name": "Lance",
        "last_name": "Crews",
        "email_id": "katielee@gmail.com",
        "total_amount": 200
    },
    {
        "created_at": "2020-03-03T10:07:30.453Z",
        "status": "live",
        "first_name": "Tamara",
        "last_name": "Ethridge",
        "email_id": "ethridgertamara@gmail.com",
        "total_amount": 200
    },
    {
        "created_at": "2020-02-28T12:03:58.104Z",
        "status": "live",
        "first_name": "Maynk",
        "last_name": "Dhiman",
        "email_id": "mayank.dhiman03+cptest@gmail.com",
        "total_amount": 200
    },
    {
        "created_at": "2020-02-20T06:45:23.622Z",
        "status": "live",
        "first_name": "Mayank",
        "last_name": "Dhiman",
        "email_id": "mayank.dhiman03+zapier3@gmail.com",
        "total_amount": 200
    },
    {
        "created_at": "2020-02-20T06:40:19.797Z",
        "status": "live",
        "first_name": "Mayank",
        "last_name": "Dhiman",
        "email_id": "mayank.dhiman03+zapier2@gmail.com",
        "total_amount": 200
    },
    {
        "created_at": "2020-02-20T06:34:36.832Z",
        "status": "live",
        "first_name": "Mayank",
        "last_name": "Dhiman",
        "email_id": "mayank.dhiman03+zapier@gmail.com",
        "total_amount": 200
    },
    {
        "created_at": "2020-02-20T06:20:25.584Z",
        "status": "live",
        "first_name": "Mayank",
        "last_name": "Dhiman",
        "email_id": "mayank.dhiman03+shopifycustomer@gmail.com",
        "total_amount": 200
    },
    {
        "created_at": "2020-02-19T10:26:51.598Z",
        "status": "live",
        "first_name": "Mayank",
        "last_name": "Dhim",
        "email_id": "mayank.dhiman03+0987@gmail.com",
        "total_amount": 200
    },
    {
        "created_at": "2020-02-19T10:26:01.621Z",
        "status": "live",
        "first_name": "test",
        "last_name": "plan",
        "email_id": "mayanktidke+testplan@gmail.com",
        "total_amount": 200
    },
    {
        "created_at": "2020-02-17T07:33:21.819Z",
        "status": "live",
        "first_name": "Mayank",
        "last_name": "Dhiman",
        "email_id": "mayank.dhiman03+email@gmail.com",
        "total_amount": 10
    },
    {
        "created_at": "2020-02-12T11:32:38.709Z",
        "status": "live",
        "first_name": "Mayank",
        "last_name": "Dhiman",
        "email_id": "mayank.dhiman03+qbt2@gmail.com",
        "total_amount": 200
    },
    {
        "created_at": "2020-02-12T11:26:06.476Z",
        "status": "live",
        "first_name": "Mayank",
        "last_name": "Dhiman",
        "email_id": "mayank.dhiman03+testwebhook@gmail.com",
        "total_amount": 200
    },
    {
        "created_at": "2020-02-11T11:34:39.976Z",
        "status": "live",
        "first_name": "Mayank",
        "last_name": "Dhiman",
        "email_id": "mayank.dhiman03+68@gmail.com",
        "total_amount": 500
    },
    {
        "created_at": "2020-02-11T11:33:53.762Z",
        "status": "live",
        "first_name": "Mayank",
        "last_name": "Dhiman",
        "email_id": "mayank.dhiman03+67@gmail.com",
        "total_amount": 2250
    },
    {
        "created_at": "2020-02-11T05:48:08.657Z",
        "status": "live",
        "first_name": "Mayank",
        "last_name": "Dhiman",
        "email_id": "mayank.dhiman@gmail.com",
        "total_amount": 500
    },
    {
        "created_at": "2020-02-07T07:58:07.526Z",
        "status": "live",
        "first_name": "Mayank",
        "last_name": "Dhiman",
        "email_id": "mayank.dhiman03+20@gmail.com",
        "total_amount": 200
    },
    {
        "created_at": "2020-02-07T07:51:20.990Z",
        "status": "live",
        "first_name": "Mayank",
        "last_name": "Dhiman",
        "email_id": "mayank.dhiman03+19@gmail.com",
        "total_amount": 200
    },
    {
        "created_at": "2020-02-07T07:08:02.891Z",
        "status": "live",
        "first_name": "Mayank",
        "last_name": "Dhiman",
        "email_id": "mayank.dhiman03+17@gmail.com",
        "total_amount": 200
    },
    {
        "created_at": "2020-02-07T07:07:01.335Z",
        "status": "live",
        "first_name": "Mayank",
        "last_name": "Dhiman",
        "email_id": "mayank.dhiman03@gmail.com",
        "total_amount": 200
    },
    {
        "created_at": "2020-02-06T11:30:33.425Z",
        "status": "live",
        "first_name": "Mayank",
        "last_name": "Dhiman",
        "email_id": "mayank.dhiman03+16@gmail.com",
        "total_amount": 229.17000000000002
    },
    {
        "created_at": "2020-02-06T11:00:03.477Z",
        "status": "live",
        "first_name": "Mayank",
        "last_name": "Dhiman",
        "email_id": "mayank.dhiman03+13@gmail.com",
        "total_amount": 50
    },
    {
        "created_at": "2020-02-06T10:34:59.788Z",
        "status": "live",
        "first_name": "Mayank",
        "last_name": "Dhiman",
        "email_id": "mayank.dhiman03+11@gmail.com",
        "total_amount": 131
    },
    {
        "created_at": "2020-02-06T10:20:32.316Z",
        "status": "live",
        "first_name": "Mayank",
        "last_name": "Dhiman",
        "email_id": "mayank.dhiman03+9@gmail.com",
        "total_amount": 200
    },
    {
        "created_at": "2020-02-05T12:04:41.129Z",
        "status": "live",
        "first_name": "Mayank",
        "last_name": "Dhiman",
        "email_id": "mayank.dhiman03+8@gmail.com",
        "total_amount": 175.26999999999998
    },
    {
        "created_at": "2020-02-05T11:23:19.316Z",
        "status": "live",
        "first_name": "Mayank",
        "last_name": "Dhiman",
        "email_id": "mayank.dhiman03+6@gmail.com",
        "total_amount": 50
    },
    {
        "created_at": "2020-02-05T10:37:09.776Z",
        "status": "live",
        "first_name": "Mayank",
        "last_name": "Dhiman",
        "email_id": "mayank.dhiman03+4@gmail.com",
        "total_amount": 45
    },
    {
        "created_at": "2020-02-05T10:27:21.597Z",
        "status": "live",
        "first_name": "Mayank",
        "last_name": "Dhiman",
        "email_id": "mayank.dhiman03+2@gmail.com",
        "total_amount": 50
    },
    {
        "created_at": "2020-02-05T10:18:40.292Z",
        "status": "live",
        "first_name": "Mayank",
        "last_name": "Dhiman",
        "email_id": "mayank.dhiman03+1@gmail.com",
        "total_amount": 50
    }
]
```

**Code examples:**

_cURL_

```curl
curl -X POST https://payments.pabbly.com/api/v1/mrrsubscription/ \
  -u {{YOUR_API_KEY}}:{{YOUR_SECRET_KEY}} \
  -H "Content-Type: application/json" \
  -d '{
    "product_id": "5e3a95143c92e44b424b6d47",
    "interval": "last_30_days"
  }'
```

_Ruby_

```ruby
require 'net/http'
require 'json'

uri = URI('https://payments.pabbly.com/api/v1/mrrsubscription/')
request = Net::HTTP::Post.new(uri)
request.basic_auth '{{YOUR_API_KEY}}', '{{YOUR_SECRET_KEY}}'
request['Content-Type'] = 'application/json'
request.body = "{\"product_id\":\"5e3a95143c92e44b424b6d47\",\"interval\":\"last_30_days\"}"

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(request)
end

data = JSON.parse(response.body)
```

_Python_

```python
import requests
from requests.auth import HTTPBasicAuth

response = requests.post(
    'https://payments.pabbly.com/api/v1/mrrsubscription/',
    auth=HTTPBasicAuth('{{YOUR_API_KEY}}', '{{YOUR_SECRET_KEY}}'),
    json={
    'product_id': '5e3a95143c92e44b424b6d47',
    'interval': 'last_30_days'
},
)

data = response.json()
```

_PHP_

```php
<?php
$ch = curl_init('https://payments.pabbly.com/api/v1/mrrsubscription/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_USERPWD, '{{YOUR_API_KEY}}:{{YOUR_SECRET_KEY}}');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"product_id":"5e3a95143c92e44b424b6d47","interval":"last_30_days"}');

$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
```

_Java_

```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.Base64;

String credentials = Base64.getEncoder().encodeToString("{{YOUR_API_KEY}}:{{YOUR_SECRET_KEY}}".getBytes());

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder()
    .uri(URI.create("https://payments.pabbly.com/api/v1/mrrsubscription/"))
    .header("Authorization", "Basic " + credentials)
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\"product_id\":\"5e3a95143c92e44b424b6d47\",\"interval\":\"last_30_days\"}"));

HttpRequest request = builder.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

_Node.js_

```node
const credentials = Buffer.from('{{YOUR_API_KEY}}:{{YOUR_SECRET_KEY}}').toString('base64');

const response = await fetch('https://payments.pabbly.com/api/v1/mrrsubscription/', {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${credentials}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "product_id": "5e3a95143c92e44b424b6d47",
    "interval": "last_30_days"
  }),
});

const data = await response.json();
```

_Go_

```go
package main

import (
    "fmt"
    "io"
    "net/http"
    "strings"
)

func main() {
    payload := strings.NewReader("{\"product_id\":\"5e3a95143c92e44b424b6d47\",\"interval\":\"last_30_days\"}")
    req, _ := http.NewRequest("POST", "https://payments.pabbly.com/api/v1/mrrsubscription/", payload)
    req.Header.Set("Content-Type", "application/json")
    req.SetBasicAuth("{{YOUR_API_KEY}}", "{{YOUR_SECRET_KEY}}")

    res, _ := http.DefaultClient.Do(req)
    defer res.Body.Close()
    body, _ := io.ReadAll(res.Body)
    fmt.Println(string(body))
}
```

_.NET_

```dotnet
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;

var credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes("{{YOUR_API_KEY}}:{{YOUR_SECRET_KEY}}"));

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://payments.pabbly.com/api/v1/mrrsubscription/");
request.Headers.TryAddWithoutValidation("Authorization", $"Basic {credentials}");
request.Content = new StringContent("{\"product_id\":\"5e3a95143c92e44b424b6d47\",\"interval\":\"last_30_days\"}");
request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");

var response = await client.SendAsync(request);
var data = await response.Content.ReadAsStringAsync();
Console.WriteLine(data);
```

---

**Other endpoints in Reports:**

- [POST /revenuetransaction/ — Create Net-Revenue Status](/subscription-billing/reports/create-net-revenue-status)

