On This Page

{#jumplink-list}  
[Markdown](/docs/cybs/en-us/recurring-billing/developer/all/rest/recurring-billing-dev/recur-bill-subscriptions/rb-cre-subs-w-exist-plan.md)  
Filter  
FILTER BY TAG

Creating a Subscription with an Existing Plan {#rb-cre-subs-w-exist-plan}
=========================================================================

Basic Steps {#rb-cre-subs-w-exist-plan_section_ghg_vxq_fdc}
-----------------------------------------------------------

Follow these steps to create a subscription:

1. Create the request with the required API fields.
2. Send the request to one of these endpoints:
   * **Production:** `POST https://api.cybersource.com/rbs/v1/subscriptions`
   * **Test:** `POST https://apitest.cybersource.test.com/rbs/v1/subscriptions`
3. Verify the response messages to make sure that the request was successful. A 200-level HTTP response code indicates success. See [Transaction Response Codes](https://developer.cybersource.com/api/reference/response-codes.md "").

Required Fields {#rb-cre-subs-w-exist-plan-reqd-fields}
=======================================================

These fields are required for creating a subscription with an existing plan:

paymentInformation.customer.id
:

subscriptionInformation.name
:

subscriptionInformation.planId
:
Required when you are using a standard plan.

subscriptionInformation.startDate
:

Optional Field
--------------

These fields are optional:

subscriptionInformation.originalTransactionId
:
Including this field ensures better authorization rates and Strong Customer Authentication (SCA) compliance where necessary.

subscriptionInformation.code
:

clientReferenceInformation.code
:
Merchant reference number.

Related Information
-------------------

* [API field reference guide for the REST API](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/rest-api-fields-intro.md "")

REST Example: Creating a Subscription with an Existing Plan {#rb-cre-subs-w-exist-plan-ex}
==========================================================================================

This example shows how to create a subscription with an existing plan.  
Request

```
{
    "clientReferenceInformation":{
      "code":"ORDER123"
    },
    "subscriptionInformation": {
        "planId":"1619214515",
        "name": "Daily Gym Subscription",
        "startDate": "2023-04-15T17:01:42Z",
        "originalTransactionId”: “016153570198200"
    },
    "paymentInformation": {
        "customer": {
            "id": "C09F227C54F94951E0533F36CF0A3D91"
        }
    }
}
```

Response to a Successful Request

```
{
    "_links": {
        "self": {
            "href": "/rbs/v1/subscriptions/1619214690",
            "method": "GET"
        },
        "update": {
            "href": "/rbs/v1/subscriptions/1619214690",
            "method": "PATCH"
        },
        "cancel": {
            "href": "/rbs/v1/subscriptions/1619214690/cancel",
            "method": "POST"
        }
    },
    "id": "1619214690",
    "status": "COMPLETED",
    "subscriptionInformation": {
        "code": "AWC-47",
        "status": "PENDING"
    }
}
```

Response to a Failed Request

```
{
    "status": "INVALID_REQUEST",
    "reason": "INVALID_DATA",
    "message": "One or more fields in the request contains invalid data.",
    "details": [
        {
            "field": "subscriptionInformation.startDate",
            "reason": "INVALID_DATA"
        }
    ]
}
```

RELATED TO THIS PAGE

