{"_id":"59df6a533b756800107b2049","category":{"_id":"59df6a523b756800107b2027","version":"59df6a523b756800107b201e","project":"57336fd5a6a9c40e00e13a0b","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-07-27T10:22:06.636Z","from_sync":false,"order":8,"slug":"subscriptions","title":"Subscriptions"},"user":"560d5913af97231900938124","parentDoc":null,"project":"57336fd5a6a9c40e00e13a0b","version":{"_id":"59df6a523b756800107b201e","project":"57336fd5a6a9c40e00e13a0b","__v":1,"createdAt":"2017-10-12T13:12:50.128Z","releaseDate":"2017-10-12T13:12:50.128Z","categories":["59df6a523b756800107b201f","59df6a523b756800107b2020","59df6a523b756800107b2021","59df6a523b756800107b2022","59df6a523b756800107b2023","59df6a523b756800107b2024","59df6a523b756800107b2025","59df6a523b756800107b2026","59df6a523b756800107b2027","59df6a523b756800107b2028","59df6a523b756800107b2029","59df6a523b756800107b202a","59df6a523b756800107b202b","59df6a523b756800107b202c","59df6a523b756800107b202d","59df6a523b756800107b202e"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"3.23 Release","version_clean":"8976.0.0-XML","version":"8976-XML"},"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-07-29T16:13:02.799Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"method":"post","results":{"codes":[{"code":"","language":"text"}]},"settings":"","auth":"optional","params":[],"url":"/recurring/subscriptions"},"isReference":false,"order":4,"body":"The Create Subscription request enables you to set up a subscription, which associates a shopper with a plan to bill on an ongoing basis.\n\nFor more information about working with subscriptions, see the [Subscriptions tutorial](doc:subscription-management#section-tutorial-subscriptions).\n[block:callout]\n{\n  \"type\": \"success\",\n  \"body\": \"After creating a subscription in sandbox, you can simulate a recurring charge event and trigger associated IPNs, emails, and invoices. Visit the [Subscriptions Guide](/v2.0/docs/subscription-management#section-testing-your-subscriptions) to learn how.\",\n  \"title\": \"Testing subscription charges in sandbox\"\n}\n[/block]\n<a class=\"btn btn-success\" href=\"#section-api-explorer\" role=\"button\">Try it in the API Explorer</a>\n\n###Request Content\n`recurring-subscription` *container* &nbsp;&nbsp;&nbsp;<span style=\"color:#F37500\">**required**</span>, contains the following properties (see [recurring-subscription](doc:recurring-subscription)):\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`plan-id` *integer* &nbsp;&nbsp;&nbsp;<span style=\"color:#F37500\">**required**</span>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`vendor-info` *container* &nbsp;&nbsp;&nbsp;<span style=\"color:#F37500\">**required**</span> if using marketplace vendors (see [vendor-info](doc:vendor-info))\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`vaulted-shopper-id` *integer* &nbsp;&nbsp;&nbsp;optional - do not include if sending `payer-info`\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`payer-info` *container* &nbsp;&nbsp;&nbsp;optional - do not include if sending `vaulted-shopper-id` (see [payer-info](doc:payer-info))\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`payment-source` *container* &nbsp;&nbsp;&nbsp;<span style=\"color:#F37500\">**required** for `payer-info`</span>; optional for `vaulted-shopper-id` (see [payment-source](doc:payment-source))\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`quantity` *integer* &nbsp;&nbsp;&nbsp;optional\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`soft-descriptor` *string* &nbsp;&nbsp;&nbsp;optional\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`descriptor-phone-number` *string* &nbsp;&nbsp;&nbsp;optional\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`authorized-by-shopper` &nbsp;&nbsp;&nbsp; *boolean* &nbsp;&nbsp;<span style=\"color:#F37500\">**required**</span> for SEPA Direct Debit&nbsp;&nbsp; value must be **true**\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`override-trial-period-days` *integer* &nbsp;&nbsp;&nbsp;optional\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`override-recurring-charge-amount` *decimal* &nbsp;&nbsp;optional\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`override-initial-charge-amount` *decimal* &nbsp;&nbsp;optional\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`transaction-fraud-info` *container* &nbsp;&nbsp;&nbsp;optional (see [transaction-fraud-info](doc:transaction-fraud-info))\n\n###Response Details\nIf successful, the response HTTP status code is 200 OK.\nThe response body contains the [recurring-subscription](doc:recurring-subscription) resource. \nThe `subscription-id` appears in the response body and the location header (unless payment source was SEPA DD).\n\n<hr>\n\n##Examples\n\n###Request Examples\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/recurring/subscriptions \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<recurring-subscription xmlns=\\\"http://ws.plimus.com\\\">\\n  <plan-id>2283845</plan-id>\\n  <payer-info>\\n    <first-name>John</first-name>\\n    <last-name>Doe</last-name>\\n    <zip>12345</zip>\\n    <phone>1234567890</phone>\\n  </payer-info>\\n  <payment-source>\\n    <credit-card-info>\\n      <credit-card>\\n        <card-number>4111111111111111</card-number>\\n        <security-code>111</security-code>\\n        <expiration-month>07</expiration-month>\\n        <expiration-year>2019</expiration-year>         \\n      </credit-card> \\n    </credit-card-info>\\n  </payment-source>\\n  <transaction-fraud-info>\\n    <fraud-session-id>1234</fraud-session-id>\\n  </transaction-fraud-info>\\n</recurring-subscription>'\",\n      \"language\": \"curl\",\n      \"name\": \"Create Subscription Request: with new shopper\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/recurring/subscriptions \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<recurring-subscription xmlns=\\\"http://ws.plimus.com\\\">\\n  <plan-id>2283845</plan-id>\\n  <vaulted-shopper-id>20769005</vaulted-shopper-id>\\n  <quantity>2</quantity>\\n  <soft-descriptor>Merchant name</soft-descriptor>\\n  <override-trial-period-days>10</override-trial-period-days>\\n  <override-recurring-charge-amount>29.99</override-recurring-charge-amount>\\n  <override-initial-charge-amount>10.5</override-initial-charge-amount>\\n  <transaction-fraud-info>\\n    <fraud-session-id>1234</fraud-session-id>\\n    <shopper-ip-address>123.12.134.1</shopper-ip-address>\\n    <company>Company Name</company>\\n    <shipping-contact-info>\\n      <last-name>John</last-name>\\n      <first-name>Doe</first-name>\\n      <country>US</country>\\n      <state>AK</state>\\n      <city>Juneau</city>\\n      <address1>1 Main St</address1>\\n      <address2>Apt 2</address2>\\n      <zip>12345</zip>\\n    </shipping-contact-info>\\n  </transaction-fraud-info>\\n</recurring-subscription>'\",\n      \"language\": \"curl\",\n      \"name\": \"with vaulted shopper and optional fields\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/recurring/subscriptions \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<recurring-subscription xmlns=\\\"http://ws.plimus.com\\\">\\n  <plan-id>2283845</plan-id>\\n  <vaulted-shopper-id>20769005</vaulted-shopper-id>\\n  <payment-source>\\n    <credit-card-info>\\n      <credit-card>\\n        <card-last-four-digits>9299</card-last-four-digits>\\n        <card-type>VISA</card-type>\\n      </credit-card> \\n    </credit-card-info>\\n  </payment-source>\\n</recurring-subscription>'\",\n      \"language\": \"curl\",\n      \"name\": \"with vaulted shopper and specific payment method\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/recurring/subscriptions \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<recurring-subscription xmlns=\\\"http://ws.plimus.com\\\">\\n     <plan-id>2186278</plan-id>\\n     <payer-info>\\n    <first-name>John</first-name>\\n    <last-name>Doe</last-name>\\n    <zip>12345</zip>\\n    <phone>1234567890</phone>\\n  </payer-info>\\n   <payment-source>\\n      <credit-card-info>\\n            <pf-token>339110a75e2cdbb5f5f2cea8d7cd8af261ad7c89fb0ce1aae_</pf-token>\\n      </credit-card-info>\\n   </payment-source>\\n</recurring-subscription>'\",\n      \"language\": \"curl\",\n      \"name\": \"with new shopper and hosted payment fields\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/recurring/subscriptions \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<recurring-subscription xmlns=\\\"http://ws.plimus.com\\\">\\n  <plan-id>2283845</plan-id>\\n  <vendor-info>\\n    <vendor-id>541425</vendor-id>\\n  </vendor-info>  \\n  <payer-info>\\n    <first-name>John</first-name>\\n    <last-name>Doe</last-name>\\n    <zip>12345</zip>\\n    <phone>1234567890</phone>\\n  </payer-info>\\n  <payment-source>\\n    <credit-card-info>\\n      <credit-card>\\n        <card-number>4111111111111111</card-number>\\n        <security-code>111</security-code>\\n        <expiration-month>07</expiration-month>\\n        <expiration-year>2019</expiration-year>         \\n      </credit-card> \\n    </credit-card-info>\\n  </payment-source>\\n  <transaction-fraud-info>\\n    <fraud-session-id>1234</fraud-session-id>\\n  </transaction-fraud-info>\\n</recurring-subscription>'\",\n      \"language\": \"curl\",\n      \"name\": \"with new shopper and vendor info\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/recurring/subscriptions \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<recurring-subscription xmlns=\\\"http://ws.plimus.com\\\">\\n  <plan-id>2283845</plan-id>\\n  <payment-source>\\n    <wallet>\\n      <apple-pay>\\n        <encoded-payment-token>ImRhdGEiO1AvRitIUy85Im9RbXhCMFd</encoded-payment-token>\\n      </apple-pay>\\n    </wallet>\\n  </payment-source>\\n</recurring-subscription>'\",\n      \"language\": \"curl\",\n      \"name\": \"with Apple Pay\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/recurring/subscriptions \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<recurring-subscription xmlns=\\\"http://ws.plimus.com\\\">\\n   <plan-id>2283845</plan-id>\\n   <authorized-by-shopper>true</authorized-by-shopper>\\n   <payer-info>\\n     <first-name>John</first-name> \\n     <last-name>Doe</last-name>\\n     <zip>12345</zip>\\n     <country>fr</country>\\n     <phone>1234567890</phone>\\n   </payer-info>\\n   <payment-source>\\n     <sepa-direct-debit-info>\\n       <sepa-direct-debit>\\n         <iban>DE09100100101234567893</iban>\\n       </sepa-direct-debit>\\n     </sepa-direct-debit-info>\\n\\t</payment-source>\\n</recurring-subscription>'\",\n      \"language\": \"curl\",\n      \"name\": \"with SEPA Direct Debit \"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n###Response Examples\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"HTTP/ 1.1 200 OK\\n\\n<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\\n<recurring-subscription xmlns=\\\"http://ws.plimus.com\\\">\\n  <subscription-id>8492717</subscription-id>\\n  <plan-id>2283845</plan-id>\\n  <vaulted-shopper-id>21188909</vaulted-shopper-id>\\n  <status>ACTIVE</status>\\n  <quantity>1</quantity>\\n  <soft-descriptor>BLS&#x2a;default_descriptor</soft-descriptor>\\n  <charge-frequency>MONTHLY</charge-frequency>\\n  <trial-period-days>14</trial-period-days>\\n  <recurring-charge-amount>29.99</recurring-charge-amount>\\n  <currency>USD</currency>\\n  <initial-charge-amount>100.00</initial-charge-amount>\\n  <auto-renew>true</auto-renew>\\n  <next-charge-date>2016-08-16</next-charge-date>\\n  <payer-info>\\n    <first-name>John</first-name>\\n    <last-name>Doe</last-name>\\n  </payer-info>\\n  <payment-source>\\n    <credit-card-info>\\n      <billing-contact-info>\\n        <first-name>John</first-name>\\n        <last-name>Doe</last-name>\\n      </billing-contact-info>\\n      <credit-card>\\n        <card-last-four-digits>1111</card-last-four-digits>\\n        <card-type>VISA</card-type>\\n        <card-sub-type>CREDIT</card-sub-type>\\n        <card-category>CLASSIC</card-category>\\n        <expiration-month>07</expiration-month>\\n        <expiration-year>2019</expiration-year>\\n      </credit-card>\\n    </credit-card-info>\\n  </payment-source>\\n  <charge>\\n    <charge-id>12117877</charge-id>\\n    <subscription-id>8492717</subscription-id>\\n    <plan-id>2283845</plan-id>\\n    <vaulted-shopper-id>21188909</vaulted-shopper-id>\\n    <transaction-id>1012463333</transaction-id>\\n    <transaction-date>2016-08-02</transaction-date>\\n    <amount>100.00</amount>\\n    <currency>USD</currency>\\n    <soft-descriptor>BLS&#x2a;default_descriptor</soft-descriptor>\\n    <payment-source>\\n      <credit-card-info>\\n        <credit-card>\\n          <card-last-four-digits>1111</card-last-four-digits>\\n          <card-type>VISA</card-type>\\n          <card-sub-type>CREDIT</card-sub-type>\\n          <expiration-month>07</expiration-month>\\n          <expiration-year>2019</expiration-year>\\n        </credit-card>\\n      </credit-card-info>\\n    </payment-source>\\n    <charge-info>\\n      <from-date>2016-08-02</from-date>\\n      <to-date>2016-08-16</to-date>\\n      <charge-type>INITIAL</charge-type>\\n    </charge-info>\\n  </charge>\\n  <fraud-result-info>\\n    <device-data-collector>Y</device-data-collector>\\n  </fraud-result-info>\\n</recurring-subscription>\",\n      \"language\": \"xml\",\n      \"name\": \"Create Subscription Response: 200 OK\"\n    },\n    {\n      \"code\": \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\\n<recurring-subscription xmlns=\\\"http://ws.plimus.com\\\">\\n    <subscription-id>39565914</subscription-id>\\n    <plan-id>2200594</plan-id>\\n    <vaulted-shopper-id>19608696</vaulted-shopper-id>\\n    <status>ACTIVE</status>\\n    <quantity>1</quantity>\\n    <soft-descriptor>BLS&#x2a;default_descriptor</soft-descriptor>\\n    <charge-frequency>MONTHLY</charge-frequency>\\n    <recurring-charge-amount>29.99</recurring-charge-amount>\\n    <currency>USD</currency>\\n    <auto-renew>true</auto-renew>\\n    <next-charge-date>2017-04-16</next-charge-date>\\n    <payer-info>\\n      <first-name>John</first-name>\\n      <last-name>Doe</last-name>\\n      <zip>12345</zip>\\n      <phone>1234567890</phone>\\n  </payer-info>\\n  <payment-source>\\n    <Wallet>\\n      <billing-contact-info>\\n        <first-name>John</first-name>\\n        <last-name>Doe</last-name>\\n        <address1>South St</address1>\\n        <city>Waltham</city>\\n        <state>MA</state>\\n        <zip>02453</zip>\\n      </billing-contact-info>\\n      <apple-pay>\\n        <card-last-four-digits>0492</card-last-four-digits>\\n        <card-type>VISA</card-type>\\n        <card-sub-type>debit</card-sub-type>\\n        <dpan-last-four-digits>4109</dpan-last-four-digits>\\n        <dpan-expiration-month>11</dpan-expiration-month>\\n        <dpan-expiration-year>25</dpan-expiration-year>\\n      </apple-pay>\\t\\n    </Wallet>\\n  </payment-source>\\n  <charge>\\n    <charge-id>235835</charge-id>\\n    <subscription-id>39565914</subscription-id>\\n    <plan-id>2200594</plan-id>\\n    <vaulted-shopper-id>19608696</vaulted-shopper-id>\\n    <transaction-id>38548964</transaction-id>\\n    <transaction-date>2017-03-16</transaction-date>\\n    <amount>29.99</amount>\\n    <currency>USD</currency>\\n    <soft-descriptor>BLS&#x2a;default_descriptor</soft-descriptor>\\n    <payment-source>\\n      <Wallet>\\n        <billing-contact-info>\\n          <first-name>John</first-name>\\n          <last-name>Doe</last-name>\\n          <address1>South St</address1>\\n          <city>Waltham</city>\\n          <state>MA</state>\\n          <zip>02453</zip>\\n        </billing-contact-info>\\n        <apple-pay>\\n          <card-last-four-digits>0492</card-last-four-digits>\\n          <card-type>VISA</card-type>\\n          <card-sub-type>debit</card-sub-type>\\n          <dpan-last-four-digits>4109</dpan-last-four-digits>\\n          <dpan-expiration-month>11</dpan-expiration-month>\\n          <dpan-expiration-year>25</dpan-expiration-year>\\n        </apple-pay>\\t\\n      </Wallet>\\n    </payment-source>\\n    <charge-info>\\n      <from-date>2017-03-16</from-date>\\n      <to-date>2017-04-16</to-date>\\n      <charge-type>INITIAL</charge-type>\\n    </charge-info>\\n  </charge>\\n</recurring-subscription>\",\n      \"language\": \"xml\",\n      \"name\": \"200 OK - Apple Pay\"\n    },\n    {\n      \"code\": \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\\n<recurring-subscription xmlns=\\\"http://ws.plimus.com\\\">\\n    <plan-id>2436197</plan-id>\\n    <vaulted-shopper-id>21846521</vaulted-shopper-id>\\n    <soft-descriptor>Oooops LTD</soft-descriptor>\\n    <payer-info>\\n        <first-name>John</first-name>\\n        <last-name>Doe</last-name>\\n        <country>fr</country>\\n        <zip>12345</zip>\\n        <phone>1234567890</phone>\\n    </payer-info>\\n    <payment-source>\\n        <sepa-direct-debit-info>\\n            <sepa-direct-debit>\\n                <iban-first-four>DE09</iban-first-four>\\n                <iban-last-four>7893</iban-last-four>\\n                <mandate-id>Ooo156577</mandate-id>\\n                <mandate-date>01-Aug-17</mandate-date>\\n                <pre-notification-text>The amount of 29.99 EUR will be collected using SEPA Direct Debit with Mandate Ooo156577 from your bank account IBAN DE09XXXXXX7893 in the next few days. Please ensure sufficient funds in your account.</pre-notification-text>\\n            </sepa-direct-debit>\\n        </sepa-direct-debit-info>\\n    </payment-source>\\n    <charge>\\n        <plan-id>2436197</plan-id>\\n        <vaulted-shopper-id>21846521</vaulted-shopper-id>\\n        <transaction-id>1011278923</transaction-id>\\n        <transaction-date>2017-08-01</transaction-date>\\n        <amount>29.99</amount>\\n        <currency>EUR</currency>\\n        <soft-descriptor>Oooops LTD</soft-descriptor>\\n        <payment-source>\\n            <sepa-direct-debit-info>\\n                <sepa-direct-debit>\\n                    <iban-first-four>DE09</iban-first-four>\\n                    <iban-last-four>7893</iban-last-four>\\n                    <mandate-id>Ooo156577</mandate-id>\\n                    <mandate-date>01-Aug-17</mandate-date>\\n                    <pre-notification-text>The amount of 29.99 EUR will be collected using SEPA Direct Debit with Mandate Ooo156577 from your bank account IBAN DE09XXXXXX7893 in the next few days. Please ensure sufficient funds in your account.</pre-notification-text>\\n                </sepa-direct-debit>\\n            </sepa-direct-debit-info>\\n        </payment-source>\\n        <processing-info>\\n            <processing-status>PENDING</processing-status>\\n        </processing-info>\\n    </charge>\\n</recurring-subscription>\",\n      \"language\": \"xml\",\n      \"name\": \"200 OK - SEPA Direct Debit\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>\n\n<hr>\n\n##Example Descriptions\n\n###Create Subscription: with new shopper\nThis example shows a basic Create Subscription request for a new shopper, with details about the shopper and their payment method. If you are using client-side encryption, you can send the encrypted card info in this requested instead of the plain card details.\n\n###Create Subscription: with vaulted shopper and optional fields\nThis example shows a Create Subscription request with an existing vaulted shopper who has only one saved payment method, so there is no need to specify which payment method to use.\n\nThis example request also includes all optional subscription fields, such as quantity, soft descriptor and the various override fields. The override values take precedence over the settings at the plan level, and they apply only to this subscription. \n\n###Create Subscription: with vaulted shopper and specific payment method\nThis example shows a Create Subscription request with an existing vaulted shopper who has multiple saved payment methods, so you must specify which payment method to use.\n\n### Create Subscription: with new shopper and Hosted Payment Fields\nThis example shows a Create Subscription request with a new shopper whose card information was collected using [Hosted Payment Fields](/v4.0/docs/hosted-payment-fields). Include `pf-token` in the request with its value set to the Hosted Payment Fields token. \n\n### Create Subscription: with new shopper and vendor info\nThis example shows a Create Subscription request with a new shopper and a [Marketplace](/v1.0/docs/marketplace-overview) vendor. To link the vendor to the transaction, include `vendor-id` inside `vendor-info` in the request.\n\n###Create Subscription: with Apple Pay \nThis example shows a Create Subscription request with an Apple Pay wallet. In the request, include `encoded-payment-token` inside `payment-source` > `wallet` > `apple-pay`. See the [Apple Pay Guide](/v1.0/docs/apple-pay#section-implementing-apple-pay-in-your-website-or-ios-app) for more information.\n\n**Note**: To test Apple Pay, follow the steps in the [Apple Pay Guide](/v1.0/docs/apple-pay#section-implementing-apple-pay-in-your-website-or-ios-app). The API Explorer does not support Apple Pay testing. \n\n###Create Subscription: with SEPA Direct Debit \nThis example shows a Create Subscription request with a new shopper with the SEPA Direct Debit payment method. In the request, include `authorized-by-shopper` with a value set to **true** to indicate that you've collected the shopper's [mandate acceptance](/v1.0/docs/sepa-direct-debit#section-step-1-collect-a-mandate-acceptance-from-your-shopper).\n\n**Note**: `subscription-id` will not be returned in the Create Subscription response. The subscription ID will be created when the shopper's account is debited (typically within 5 - 6 business days) and the `processing-status` value changes to **SUCCESS**. You will be informed of the subscription ID via `Charge` webhook or via [Retrieve Specific Charge](doc:retrieve-specific-charge) request. \n\n<br>\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>\n\n<hr>\n\n##API Explorer\nTo test out a call, enter the XML portion of the request below and then click **Try it!**\n\n**Tip**: Copy the XML portion from one of the example requests above, or use the XML code below as a starting point. You can enter different parameter values to see how your test scenario would work. *The request headers, including authorization, are already built in for you in this test area, so you should not include them here.*\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<recurring-subscription xmlns=\\\"http://ws.plimus.com\\\">\\n  <plan-id>2283845</plan-id>\\n  <payer-info>\\n    <first-name>John</first-name>\\n    <last-name>Doe</last-name>\\n    <zip>12345</zip>\\n    <phone>1234567890</phone>\\n  </payer-info>\\n  <payment-source>\\n    <credit-card-info>\\n      <credit-card>\\n        <card-number>4111111111111111</card-number>\\n        <security-code>111</security-code>\\n        <expiration-month>07</expiration-month>\\n        <expiration-year>2019</expiration-year>         \\n      </credit-card> \\n    </credit-card-info>\\n  </payment-source>\\n</recurring-subscription>\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"create-subscription","type":"post","title":"Create Subscription"}

postCreate Subscription


Definition

{{ api_url }}{{ page_api_url }}

Documentation

The Create Subscription request enables you to set up a subscription, which associates a shopper with a plan to bill on an ongoing basis.

For more information about working with subscriptions, see the Subscriptions tutorial.

Testing subscription charges in sandbox

After creating a subscription in sandbox, you can simulate a recurring charge event and trigger associated IPNs, emails, and invoices. Visit the Subscriptions Guide to learn how.

Try it in the API Explorer

Request Content

recurring-subscription container    required, contains the following properties (see recurring-subscription):
      plan-id integer    required
      vendor-info container    required if using marketplace vendors (see vendor-info)
      vaulted-shopper-id integer    optional - do not include if sending payer-info
      payer-info container    optional - do not include if sending vaulted-shopper-id (see payer-info)
      payment-source container    required for payer-info; optional for vaulted-shopper-id (see payment-source)
      quantity integer    optional
      soft-descriptor string    optional
      descriptor-phone-number string    optional
      authorized-by-shopper     boolean   required for SEPA Direct Debit   value must be true
      override-trial-period-days integer    optional
      override-recurring-charge-amount decimal   optional
      override-initial-charge-amount decimal   optional
      transaction-fraud-info container    optional (see transaction-fraud-info)

Response Details

If successful, the response HTTP status code is 200 OK.
The response body contains the recurring-subscription resource.
The subscription-id appears in the response body and the location header (unless payment source was SEPA DD).


Examples

Request Examples

curl -v -X POST https://sandbox.bluesnap.com/services/2/recurring/subscriptions \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<recurring-subscription xmlns="http://ws.plimus.com">
  <plan-id>2283845</plan-id>
  <payer-info>
    <first-name>John</first-name>
    <last-name>Doe</last-name>
    <zip>12345</zip>
    <phone>1234567890</phone>
  </payer-info>
  <payment-source>
    <credit-card-info>
      <credit-card>
        <card-number>4111111111111111</card-number>
        <security-code>111</security-code>
        <expiration-month>07</expiration-month>
        <expiration-year>2019</expiration-year>         
      </credit-card> 
    </credit-card-info>
  </payment-source>
  <transaction-fraud-info>
    <fraud-session-id>1234</fraud-session-id>
  </transaction-fraud-info>
</recurring-subscription>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/recurring/subscriptions \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<recurring-subscription xmlns="http://ws.plimus.com">
  <plan-id>2283845</plan-id>
  <vaulted-shopper-id>20769005</vaulted-shopper-id>
  <quantity>2</quantity>
  <soft-descriptor>Merchant name</soft-descriptor>
  <override-trial-period-days>10</override-trial-period-days>
  <override-recurring-charge-amount>29.99</override-recurring-charge-amount>
  <override-initial-charge-amount>10.5</override-initial-charge-amount>
  <transaction-fraud-info>
    <fraud-session-id>1234</fraud-session-id>
    <shopper-ip-address>123.12.134.1</shopper-ip-address>
    <company>Company Name</company>
    <shipping-contact-info>
      <last-name>John</last-name>
      <first-name>Doe</first-name>
      <country>US</country>
      <state>AK</state>
      <city>Juneau</city>
      <address1>1 Main St</address1>
      <address2>Apt 2</address2>
      <zip>12345</zip>
    </shipping-contact-info>
  </transaction-fraud-info>
</recurring-subscription>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/recurring/subscriptions \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<recurring-subscription xmlns="http://ws.plimus.com">
  <plan-id>2283845</plan-id>
  <vaulted-shopper-id>20769005</vaulted-shopper-id>
  <payment-source>
    <credit-card-info>
      <credit-card>
        <card-last-four-digits>9299</card-last-four-digits>
        <card-type>VISA</card-type>
      </credit-card> 
    </credit-card-info>
  </payment-source>
</recurring-subscription>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/recurring/subscriptions \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<recurring-subscription xmlns="http://ws.plimus.com">
     <plan-id>2186278</plan-id>
     <payer-info>
    <first-name>John</first-name>
    <last-name>Doe</last-name>
    <zip>12345</zip>
    <phone>1234567890</phone>
  </payer-info>
   <payment-source>
      <credit-card-info>
            <pf-token>339110a75e2cdbb5f5f2cea8d7cd8af261ad7c89fb0ce1aae_</pf-token>
      </credit-card-info>
   </payment-source>
</recurring-subscription>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/recurring/subscriptions \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<recurring-subscription xmlns="http://ws.plimus.com">
  <plan-id>2283845</plan-id>
  <vendor-info>
    <vendor-id>541425</vendor-id>
  </vendor-info>  
  <payer-info>
    <first-name>John</first-name>
    <last-name>Doe</last-name>
    <zip>12345</zip>
    <phone>1234567890</phone>
  </payer-info>
  <payment-source>
    <credit-card-info>
      <credit-card>
        <card-number>4111111111111111</card-number>
        <security-code>111</security-code>
        <expiration-month>07</expiration-month>
        <expiration-year>2019</expiration-year>         
      </credit-card> 
    </credit-card-info>
  </payment-source>
  <transaction-fraud-info>
    <fraud-session-id>1234</fraud-session-id>
  </transaction-fraud-info>
</recurring-subscription>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/recurring/subscriptions \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<recurring-subscription xmlns="http://ws.plimus.com">
  <plan-id>2283845</plan-id>
  <payment-source>
    <wallet>
      <apple-pay>
        <encoded-payment-token>ImRhdGEiO1AvRitIUy85Im9RbXhCMFd</encoded-payment-token>
      </apple-pay>
    </wallet>
  </payment-source>
</recurring-subscription>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/recurring/subscriptions \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<recurring-subscription xmlns="http://ws.plimus.com">
   <plan-id>2283845</plan-id>
   <authorized-by-shopper>true</authorized-by-shopper>
   <payer-info>
     <first-name>John</first-name> 
     <last-name>Doe</last-name>
     <zip>12345</zip>
     <country>fr</country>
     <phone>1234567890</phone>
   </payer-info>
   <payment-source>
     <sepa-direct-debit-info>
       <sepa-direct-debit>
         <iban>DE09100100101234567893</iban>
       </sepa-direct-debit>
     </sepa-direct-debit-info>
	</payment-source>
</recurring-subscription>'

Response Examples

HTTP/ 1.1 200 OK

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recurring-subscription xmlns="http://ws.plimus.com">
  <subscription-id>8492717</subscription-id>
  <plan-id>2283845</plan-id>
  <vaulted-shopper-id>21188909</vaulted-shopper-id>
  <status>ACTIVE</status>
  <quantity>1</quantity>
  <soft-descriptor>BLS&#x2a;default_descriptor</soft-descriptor>
  <charge-frequency>MONTHLY</charge-frequency>
  <trial-period-days>14</trial-period-days>
  <recurring-charge-amount>29.99</recurring-charge-amount>
  <currency>USD</currency>
  <initial-charge-amount>100.00</initial-charge-amount>
  <auto-renew>true</auto-renew>
  <next-charge-date>2016-08-16</next-charge-date>
  <payer-info>
    <first-name>John</first-name>
    <last-name>Doe</last-name>
  </payer-info>
  <payment-source>
    <credit-card-info>
      <billing-contact-info>
        <first-name>John</first-name>
        <last-name>Doe</last-name>
      </billing-contact-info>
      <credit-card>
        <card-last-four-digits>1111</card-last-four-digits>
        <card-type>VISA</card-type>
        <card-sub-type>CREDIT</card-sub-type>
        <card-category>CLASSIC</card-category>
        <expiration-month>07</expiration-month>
        <expiration-year>2019</expiration-year>
      </credit-card>
    </credit-card-info>
  </payment-source>
  <charge>
    <charge-id>12117877</charge-id>
    <subscription-id>8492717</subscription-id>
    <plan-id>2283845</plan-id>
    <vaulted-shopper-id>21188909</vaulted-shopper-id>
    <transaction-id>1012463333</transaction-id>
    <transaction-date>2016-08-02</transaction-date>
    <amount>100.00</amount>
    <currency>USD</currency>
    <soft-descriptor>BLS&#x2a;default_descriptor</soft-descriptor>
    <payment-source>
      <credit-card-info>
        <credit-card>
          <card-last-four-digits>1111</card-last-four-digits>
          <card-type>VISA</card-type>
          <card-sub-type>CREDIT</card-sub-type>
          <expiration-month>07</expiration-month>
          <expiration-year>2019</expiration-year>
        </credit-card>
      </credit-card-info>
    </payment-source>
    <charge-info>
      <from-date>2016-08-02</from-date>
      <to-date>2016-08-16</to-date>
      <charge-type>INITIAL</charge-type>
    </charge-info>
  </charge>
  <fraud-result-info>
    <device-data-collector>Y</device-data-collector>
  </fraud-result-info>
</recurring-subscription>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recurring-subscription xmlns="http://ws.plimus.com">
    <subscription-id>39565914</subscription-id>
    <plan-id>2200594</plan-id>
    <vaulted-shopper-id>19608696</vaulted-shopper-id>
    <status>ACTIVE</status>
    <quantity>1</quantity>
    <soft-descriptor>BLS&#x2a;default_descriptor</soft-descriptor>
    <charge-frequency>MONTHLY</charge-frequency>
    <recurring-charge-amount>29.99</recurring-charge-amount>
    <currency>USD</currency>
    <auto-renew>true</auto-renew>
    <next-charge-date>2017-04-16</next-charge-date>
    <payer-info>
      <first-name>John</first-name>
      <last-name>Doe</last-name>
      <zip>12345</zip>
      <phone>1234567890</phone>
  </payer-info>
  <payment-source>
    <Wallet>
      <billing-contact-info>
        <first-name>John</first-name>
        <last-name>Doe</last-name>
        <address1>South St</address1>
        <city>Waltham</city>
        <state>MA</state>
        <zip>02453</zip>
      </billing-contact-info>
      <apple-pay>
        <card-last-four-digits>0492</card-last-four-digits>
        <card-type>VISA</card-type>
        <card-sub-type>debit</card-sub-type>
        <dpan-last-four-digits>4109</dpan-last-four-digits>
        <dpan-expiration-month>11</dpan-expiration-month>
        <dpan-expiration-year>25</dpan-expiration-year>
      </apple-pay>	
    </Wallet>
  </payment-source>
  <charge>
    <charge-id>235835</charge-id>
    <subscription-id>39565914</subscription-id>
    <plan-id>2200594</plan-id>
    <vaulted-shopper-id>19608696</vaulted-shopper-id>
    <transaction-id>38548964</transaction-id>
    <transaction-date>2017-03-16</transaction-date>
    <amount>29.99</amount>
    <currency>USD</currency>
    <soft-descriptor>BLS&#x2a;default_descriptor</soft-descriptor>
    <payment-source>
      <Wallet>
        <billing-contact-info>
          <first-name>John</first-name>
          <last-name>Doe</last-name>
          <address1>South St</address1>
          <city>Waltham</city>
          <state>MA</state>
          <zip>02453</zip>
        </billing-contact-info>
        <apple-pay>
          <card-last-four-digits>0492</card-last-four-digits>
          <card-type>VISA</card-type>
          <card-sub-type>debit</card-sub-type>
          <dpan-last-four-digits>4109</dpan-last-four-digits>
          <dpan-expiration-month>11</dpan-expiration-month>
          <dpan-expiration-year>25</dpan-expiration-year>
        </apple-pay>	
      </Wallet>
    </payment-source>
    <charge-info>
      <from-date>2017-03-16</from-date>
      <to-date>2017-04-16</to-date>
      <charge-type>INITIAL</charge-type>
    </charge-info>
  </charge>
</recurring-subscription>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recurring-subscription xmlns="http://ws.plimus.com">
    <plan-id>2436197</plan-id>
    <vaulted-shopper-id>21846521</vaulted-shopper-id>
    <soft-descriptor>Oooops LTD</soft-descriptor>
    <payer-info>
        <first-name>John</first-name>
        <last-name>Doe</last-name>
        <country>fr</country>
        <zip>12345</zip>
        <phone>1234567890</phone>
    </payer-info>
    <payment-source>
        <sepa-direct-debit-info>
            <sepa-direct-debit>
                <iban-first-four>DE09</iban-first-four>
                <iban-last-four>7893</iban-last-four>
                <mandate-id>Ooo156577</mandate-id>
                <mandate-date>01-Aug-17</mandate-date>
                <pre-notification-text>The amount of 29.99 EUR will be collected using SEPA Direct Debit with Mandate Ooo156577 from your bank account IBAN DE09XXXXXX7893 in the next few days. Please ensure sufficient funds in your account.</pre-notification-text>
            </sepa-direct-debit>
        </sepa-direct-debit-info>
    </payment-source>
    <charge>
        <plan-id>2436197</plan-id>
        <vaulted-shopper-id>21846521</vaulted-shopper-id>
        <transaction-id>1011278923</transaction-id>
        <transaction-date>2017-08-01</transaction-date>
        <amount>29.99</amount>
        <currency>EUR</currency>
        <soft-descriptor>Oooops LTD</soft-descriptor>
        <payment-source>
            <sepa-direct-debit-info>
                <sepa-direct-debit>
                    <iban-first-four>DE09</iban-first-four>
                    <iban-last-four>7893</iban-last-four>
                    <mandate-id>Ooo156577</mandate-id>
                    <mandate-date>01-Aug-17</mandate-date>
                    <pre-notification-text>The amount of 29.99 EUR will be collected using SEPA Direct Debit with Mandate Ooo156577 from your bank account IBAN DE09XXXXXX7893 in the next few days. Please ensure sufficient funds in your account.</pre-notification-text>
                </sepa-direct-debit>
            </sepa-direct-debit-info>
        </payment-source>
        <processing-info>
            <processing-status>PENDING</processing-status>
        </processing-info>
    </charge>
</recurring-subscription>

Back to Top


Example Descriptions

Create Subscription: with new shopper

This example shows a basic Create Subscription request for a new shopper, with details about the shopper and their payment method. If you are using client-side encryption, you can send the encrypted card info in this requested instead of the plain card details.

Create Subscription: with vaulted shopper and optional fields

This example shows a Create Subscription request with an existing vaulted shopper who has only one saved payment method, so there is no need to specify which payment method to use.

This example request also includes all optional subscription fields, such as quantity, soft descriptor and the various override fields. The override values take precedence over the settings at the plan level, and they apply only to this subscription.

Create Subscription: with vaulted shopper and specific payment method

This example shows a Create Subscription request with an existing vaulted shopper who has multiple saved payment methods, so you must specify which payment method to use.

Create Subscription: with new shopper and Hosted Payment Fields

This example shows a Create Subscription request with a new shopper whose card information was collected using Hosted Payment Fields. Include pf-token in the request with its value set to the Hosted Payment Fields token.

Create Subscription: with new shopper and vendor info

This example shows a Create Subscription request with a new shopper and a Marketplace vendor. To link the vendor to the transaction, include vendor-id inside vendor-info in the request.

Create Subscription: with Apple Pay

This example shows a Create Subscription request with an Apple Pay wallet. In the request, include encoded-payment-token inside payment-source > wallet > apple-pay. See the Apple Pay Guide for more information.

Note: To test Apple Pay, follow the steps in the Apple Pay Guide. The API Explorer does not support Apple Pay testing.

Create Subscription: with SEPA Direct Debit

This example shows a Create Subscription request with a new shopper with the SEPA Direct Debit payment method. In the request, include authorized-by-shopper with a value set to true to indicate that you've collected the shopper's mandate acceptance.

Note: subscription-id will not be returned in the Create Subscription response. The subscription ID will be created when the shopper's account is debited (typically within 5 - 6 business days) and the processing-status value changes to SUCCESS. You will be informed of the subscription ID via Charge webhook or via Retrieve Specific Charge request.



Back to Top


API Explorer

To test out a call, enter the XML portion of the request below and then click Try it!

Tip: Copy the XML portion from one of the example requests above, or use the XML code below as a starting point. You can enter different parameter values to see how your test scenario would work. The request headers, including authorization, are already built in for you in this test area, so you should not include them here.

<recurring-subscription xmlns="http://ws.plimus.com">
  <plan-id>2283845</plan-id>
  <payer-info>
    <first-name>John</first-name>
    <last-name>Doe</last-name>
    <zip>12345</zip>
    <phone>1234567890</phone>
  </payer-info>
  <payment-source>
    <credit-card-info>
      <credit-card>
        <card-number>4111111111111111</card-number>
        <security-code>111</security-code>
        <expiration-month>07</expiration-month>
        <expiration-year>2019</expiration-year>         
      </credit-card> 
    </credit-card-info>
  </payment-source>
</recurring-subscription>

User Information

Try It Out


post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}