Skip to main content
Vindicia Knowledge Center

Create a subscription

Create a subscription

Creates a new Subscription object.

Route (URL) Parameters

None.

Query Parameters

Parameter Default Description Required
dryrun False Indicates whether to commit changes or return results without execution No

Accepts

JSON A full Subscription object.

Returns

JSON A full Subscription object.

  • cURL
  • Java
Example Request
curl -X POST \
 -u acaff38d462f9430d5cbcbaf:a575771fc679b9de \
 -d ' {
    "object": "Subscription",
    "id": "sub_1234",
    "account": {
       "object": "Account",
       "id": "cust_1234"
    },
    "billing_plan": {
       "object": "BillingPlan",
       "id": "plan_1234"
    },
    "payment_method": {
       "object": "PaymentMethod",
       "id": "paym_1234"
    },
    "currency": "USD",
    "description": "Subscription_1234",
    "starts": "2016-05-27T05:52:02-07:00",
    "items": [
       {
          "object": "SubscriptionItem",
          "id": "sub_1234.1",
          "product": {
             "object": "Product",
             "id": "prod_1234"
          }
       },
       {
          "object": "SubscriptionItem",
          "id": "sub_1234.2",
          "product": {
             "object": "Product",
             "id": "prod_1235"
          }
       }
    ],
    "minimum_commitment": 0,
    "policy": {
       "ignore_cvn_policy": 1,
       "ignore_avs_policy": 1,
       "min_chargeback_probability": 99,
       "immediate_auth_failure_policy": "doNotSaveAutoBill",
       "validate_for_future_payment": 0
    }
 }' "https://api.prodtest.vindicia.com/subscriptions"
The above command returns JSON structured like this:
{
    "object": "Subscription",
    "id": "sub_1234x",
    "vid": "796db5f7f7a1dea312f6c7e1393aebec1f1ecf1b",
    "account": {`...`},
    "billing_plan": {`...`},
    "payment_method": {`...`},
    "currency": "USD",
    "description": "Subscription_1234",
    "status": "Active",
    "billing_state": "Good Standing",
    "starts": "2016-05-27T05:52:02-07:00",
    "items": {
        "object": "List",
        "data": [
            {
                "object": "SubscriptionItem",
                "id": "sub_1234.1",
                "index": 0,
                "product": {`...`},
                "quantity": 1,
                "created": "2016-05-27T05:52:02-07:00",
                "starts": "2016-05-27T00:00:00-07:00"
            },
            {
                "object": "SubscriptionItem",
                "id": "sub_1234.2",
                "index": 1,
                "product": {`...`},
                "quantity": 1,
                "created": "2016-05-27T05:52:02-07:00",
                "starts": "2016-05-27T00:00:00-07:00"
            }
        ],
        "total_count": 2
    },
    "minimum_commitment": 0,
    "notify_on_transition": false,
    "initial_billing": {`...`}
}
import com.vindicia.client.CashBox;
CashBox.apiKey = "acaff38d462f9430d5cbcbafa575771fc679b9de";
Map<string,> params = new HashMap<string,>();
params.put("name",  "Charlie Brown");
params.put("email", "charlie.brown@peanuts.com");
params.put("id",    "sub_1234");
Subscription.create(params);
            
The above command returns JSON structured like this:
{
    "object": "Subscription",
    "id": "sub_1234x",
    "vid": "796db5f7f7a1dea312f6c7e1393aebec1f1ecf1b",
    "account": {`...`},
    "billing_plan": {`...`},
    "payment_method": {`...`},
    "currency": "USD",
    "description": "Subscription_1234",
    "status": "Active",
    "billing_state": "Good Standing",
    "starts": "2016-05-27T05:52:02-07:00",
    "items": {
        "object": "List",
        "data": [
            {
                "object": "SubscriptionItem",
                "id": "sub_1234.1",
                "index": 0,
                "product": {`...`},
                "quantity": 1,
                "created": "2016-05-27T05:52:02-07:00",
                "starts": "2016-05-27T00:00:00-07:00"
            },
            {
                "object": "SubscriptionItem",
                "id": "sub_1234.2",
                "index": 1,
                "product": {`...`},
                "quantity": 1,
                "created": "2016-05-27T05:52:02-07:00",
                "starts": "2016-05-27T00:00:00-07:00"
            }
        ],
        "total_count": 2
    },
    "minimum_commitment": 0,
    "notify_on_transition": false,
    "initial_billing": {`...`}
}
            

For Users

Learn More
For Users

Cashbox Features

Learn More
Cashbox Features
Back to Top