---
page_title: Billing Migration API
product: Juspay Billing
page_source: https://juspay.io/in/docs/juspay-billing/docs/billing/billing-migration-api
openapi: https://juspay.io/in/docs/api/swagger?document=https%3A%2F%2Fjuspay.io%2Fin%2Fdocs%2Fjuspay-billing%2Fdocs%2Fbilling%2Fbilling-migration-api
llms_txt: https://juspay.io/in/docs/llms.txt
product_llms_txt: https://juspay.io/in/docs/juspay-billing/llms.txt
---

## API Version: default

# Billing migration API



Moving merchant-initiated mandates on Juspay to Juspay-initiated recurring payments via the Juspay Billing product.

## Endpoints:
- Sandbox: https://sandbox.juspay.in/billing

- Production: https://api.juspay.in/billing

## Request Type: 
POST

## Content-Type: 
application/json

## Authorization:

#### Basic Auth:
- Value: Basic MUQ2QUxxxxxxxxxxxxU5QTIxQzNFNTQwNkFDMEZCOg==
- Tags: Base64 Encoded Username:Password, Required
## Headers:

#### Content-Type:
- Value: application/x-www-form-urlencoded
- Tags: String
## Sample Code Snippets:

### Sample Request:

#### Migration Request Code Snippet:

```migration request
curl --location 'https://api.juspay.in/billing' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic zzzzzz' \
--data '{
    "command": "migrate",
    "mandate_id": "7766K7DVNrsYpBAatQLUcC",
    "plan_info": {
        "plan_id": "test01",
        "billing_start_date": "1789385729"
    },
    "seq_no": 5
}'
```

### Sample Response:

#### Migration Response:
```plaintext
{
    "command": "migrate",
    "status": "SUCCESS",
    "message": "Mandate migrated to billing successfully.",
    "mandate": {
        "mandate_token": "6e93c19c5c76414a9ae46cc3c78d809b",
        "mandate_type": "EMANDATE",
        "previous_status": "CREATED",
        "next_execution_info": {
            "next_execution_order_id": "3a5j7rtzK6GRHws2",
            "next_execution_amount": 10,
            "next_execution_date": "2026-09-14T11:35:29Z"
        },
        "last_activated_at": "2026-09-10T11:27:14Z",
        "gateway_reference_id": "check_mandate",
        "last_updated": "2026-09-10T11:37:14Z",
        "status": "ACTIVE",
        "start_date": "1789039554",
        "frequency": "ASPRESENTED",
        "revokable_by_customer": true,
        "end_date": "1915269954",
        "block_fund": false,
        "max_amount": 200,
        "amount_rule": "VARIABLE",
        "mandate_debit_token": "tkn_0ebff6ac40254037bf913dece428bef0",
        "payment_info": {
            "upi": {
                "payer_vpa": "success@razorpay"
            },
            "payment_method": "UPI_COLLECT",
            "payment_method_type": "UPI"
        },
        "billing_execution_info": {
            "status": "ACTIVE",
            "plan_info": {
                "plan_rule_value": 1,
                "plan_type": "PRE_DEBIT",
                "is_rule_type_variable": true,
                "plan_amount": 10,
                "plan_updated_at": "2026-02-06 12:06:19",
                "plan_id": "test01",
                "max_amount": 14,
                "plan_created_at": "2026-02-06 12:06:19",
                "is_rule_value_variable": true,
                "plan_model": "FIXED",
                "plan_interval": "WEEKLY",
                "plan_action_on_failure": "REVOKE",
                "plan_name": "test plan for local testing",
                "plan_status": "ACTIVE",
                "plan_rule_type": "AFTER",
                "plan_description": "Fixed plan model + fixed amt",
                "is_plan_amount_variable": false,
                "plan_currency": "INR"
            },
            "source_object": "MANDATE",
            "billing_execution_info_id": "d3afd45d681742889d1981a9c287148f",
            "source_object_id": "1075",
            "amount": 0
        },
        "mandate_id": "7766K7DVNrsYpBAatQLUcC",
        "activated_at": "2026-09-10T11:27:14Z",
        "customer_id": "cth_rPj21roNSjEbumSy",
        "gateway": "RAZORPAY",
        "order_id": "1789039526",
        "currency": "INR"
    }
}
 
 
 	
{
    "command": "migrate",
    "status": "SUCCESS",
    "message": "Mandate migrated to billing successfully.",
    "mandate": {
        "mandate_token": "6e93c19c5c76414a9ae46cc3c78d809b",
        "mandate_type": "EMANDATE",
        "previous_status": "CREATED",
        "next_execution_info": {
            "next_execution_order_id": "3a5j7rtzK6GRHws2",
            "next_execution_amount": 10,
            "next_execution_date": "2026-09-14T11:35:29Z"
        },
        "last_activated_at": "2026-09-10T11:27:14Z",
        "gateway_reference_id": "check_mandate",
        "last_updated": "2026-09-10T11:37:14Z",
        "status": "ACTIVE",
        "start_date": "1789039554",
        "frequency": "ASPRESENTED",
        "revokable_by_customer": true,
        "end_date": "1915269954",
        "block_fund": false,
        "max_amount": 200,
        "amount_rule": "VARIABLE",
        "mandate_debit_token": "tkn_0ebff6ac40254037bf913dece428bef0",
        "payment_info": {
            "upi": {
                "payer_vpa": "success@razorpay"
            },
            "payment_method": "UPI_COLLECT",
            "payment_method_type": "UPI"
        },
        "billing_execution_info": {
            "status": "ACTIVE",
            "plan_info": {
                "plan_rule_value": 1,
                "plan_type": "PRE_DEBIT",
                "is_rule_type_variable": true,
                "plan_amount": 10,
                "plan_updated_at": "2026-02-06 12:06:19",
                "plan_id": "test01",
                "max_amount": 14,
                "plan_created_at": "2026-02-06 12:06:19",
                "is_rule_value_variable": true,
                "plan_model": "FIXED",
                "plan_interval": "WEEKLY",
                "plan_action_on_failure": "REVOKE",
                "plan_name": "test plan for local testing",
                "plan_status": "ACTIVE",
                "plan_rule_type": "AFTER",
                "plan_description": "Fixed plan model + fixed amt",
                "is_plan_amount_variable": false,
                "plan_currency": "INR"
            },
            "source_object": "MANDATE",
            "billing_execution_info_id": "d3afd45d681742889d1981a9c287148f",
            "source_object_id": "1075",
            "amount": 0
        },
        "mandate_id": "7766K7DVNrsYpBAatQLUcC",
        "activated_at": "2026-09-10T11:27:14Z",
        "customer_id": "cth_rPj21roNSjEbumSy",
        "gateway": "RAZORPAY",
        "order_id": "1789039526",
        "currency": "INR"
    }
}
```

## Body Parameters:
### Basic Parameters:

#### command:
- Description: Command needed to migrate the merchant managed mandates on Juspay to Juspay initiated mandates
- Value: migrate
- Tags: String, Required

#### mandate_id:
- Description: Juspay provided mandate id
- Value: 7766K7DVNrsYpBAatQLUcC
- Tags: String, Required

#### plan_info:
- Description: Attaching the mandates to a plan
- Value:
  - **Plan_id**:
    - Description: Plan_id that is needed to be attached ( from Juspay dashboard)
    - Tags: String, Mandatory
  - **Billing_start_date**:
    - Description: When we wanted the billing to start from.
    - Tags: String
- Tags: Json

#### seq_num:
- Description: To identify the billing cycle . If not passed Juspay is going to default it at 2 { which is the first mandate execution on billing }
- Value: UPI_COLLECT
- Tags: String
## API Responses:

### 200 : Success:

#### payment:
- Value:
  - **Authentication**:
    - Value:
      - **Method**:
        - Value: GET
        - Tags: String
      - **Url**:
        - Value: https://sandbox.juspay.in/v2/pay/start/eulerqa_sandbox/mozFS1mNCmY96k3aHHp?cardIssuerBankName%3DUPI_COLLECT%26cardType%3DUPI%26paymentMethod%3DUPI_COLLECT%26paymentMethodType%3DUPI
        - Tags: String
    - Tags: Object
- Tags: Object

#### status:
- Value: PENDING_VBV
- Tags: String

#### txn_uuid:
- Value: mozFS1mNCmY96k3aHHp
- Tags: String

#### offer_details:
- Value:
  - **Offers**:
    - Tags: Array
- Tags: Object

#### order_id:
- Value: Ord_1765191076
- Tags: String

#### txn_id:
- Value: suc-Ord_1765191076-1
- Tags: String


---

## See Also

- [Mandate Register](https://juspay.io/in/docs/juspay-billing/docs/billing/mandate-register)
- [Order Status](https://juspay.io/in/docs/juspay-billing/docs/billing/order-status)
