{"_id":"59e503b6bec93f00108b849a","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"},"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","__v":31,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-10-16T19:08:38.647Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","examples":{"codes":[]},"method":"post","auth":"optional","params":[{"_id":"59e618253ccab100263e7c3f","ref":"","in":"path","required":true,"desc":"BlueSnap identifier for the subscription.","default":"","type":"int","name":"subscription-id"}],"url":"/recurring/ondemand/:subscription-id"},"isReference":false,"order":7,"body":"If you manage your own subscriptions, the Create Merchant-Managed Subscription Charge request enables you to process recurring charges for a specific subscription. Each charge is associated to the initial subscription based on the subscription ID.\n[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"See the guide on using merchant-managed subscriptions\",\n  \"body\": \"For more information on working with merchant-managed subscriptions, see [Merchant-Managed Subscriptions](doc:subscription-management#section-merchant-managed-subscriptions).\"\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`charge` *container* &nbsp;&nbsp;&nbsp;<span style=\"color:#F37500\">**required**</span>, contains the following properties (see [charge](doc:charge)):\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`amount` *decimal* &nbsp;&nbsp;&nbsp;<span style=\"color:#F37500\">**required**</span>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`currency` *string* &nbsp;&nbsp;&nbsp;<span style=\"color:#F37500\">**required**</span> \n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`charge-info` *container* &nbsp;&nbsp;&nbsp;optional (see [charge-info](doc:charge-info))\n\n###Response Details\nIf successful, the response HTTP status code is 200 OK.\nThe response body contains the [charge](doc:charge) resource. \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/ondemand/10543419 \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<charge xmlns=\\\"http://ws.plimus.com\\\">\\n\\t<amount>45</amount>\\n\\t<currency>USD</currency>\\n</charge>'\",\n      \"language\": \"curl\",\n      \"name\": \"Create Merchant-Managed Subscription Charge request\"\n    }\n  ]\n}\n[/block]\n###Response Examples\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\\n<charge xmlns=\\\"http://ws.plimus.com\\\">\\n  <charge-id>6204026</charge-id>\\n  <subscription-id>10543419</subscription-id>\\n  <vaulted-shopper-id>22220051</vaulted-shopper-id>\\n  <transaction-id>1011815941</transaction-id>\\n  <transaction-date>2017-10-17</transaction-date>\\n  <amount>45.00</amount>\\n  <currency>USD</currency>\\n  <soft-descriptor>BLS&#x2a;BlueSnap</soft-descriptor>\\n  <payment-source>\\n    <credit-card-info>\\n      <credit-card>\\n        <card-last-four-digits>0026</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>05</expiration-month>\\n        <expiration-year>2018</expiration-year>\\n      </credit-card>\\n    </credit-card-info>\\n  </payment-source>\\n  <charge-info>\\n    <charge-description>OnDemand Subscription Charge</charge-description>\\n    <charge-type>RECURRING</charge-type>\\n  </charge-info>\\n</charge>\",\n      \"language\": \"xml\",\n      \"name\": \"Create Merchant-Managed Subscription Charge response\"\n    }\n  ]\n}\n[/block]\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>\n\n<hr>\n\n##Example Description\nThe above example shows how to process recurring charges for merchant-managed subscriptions. Include the subscription ID in the request endpoint and include the `amount` and `currency` properties in the request body. This specific example is a subscription in which the payment source is a credit card. Example responses will vary depending on the specific payment method used. \n\n<hr>\n\n##API Explorer\n\nTo test out a call, enter an existing subscription ID (e.g. 10543419) in the subscription-id field. This will automatically insert the ID into the request URL. You can use the XML code sample below as a starting point for building up the request body. Click **Try it!** when you're ready to test the request. \n\n**Tip**: In the request body, 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\": \"<charge xmlns=\\\"http://ws.plimus.com\\\">\\n\\t<amount>45</amount>\\n\\t<currency>USD</currency>\\n</charge>\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"create-merchant-managed-subscription-charge","type":"endpoint","title":"Create Merchant-Managed Subscription Charge"}

postCreate Merchant-Managed Subscription Charge


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

subscription-id:
required
integer
BlueSnap identifier for the subscription.

Documentation

If you manage your own subscriptions, the Create Merchant-Managed Subscription Charge request enables you to process recurring charges for a specific subscription. Each charge is associated to the initial subscription based on the subscription ID.

See the guide on using merchant-managed subscriptions

For more information on working with merchant-managed subscriptions, see Merchant-Managed Subscriptions.

Try it in the API Explorer

Request Content

charge container    required, contains the following properties (see charge):
      amount decimal    required
      currency string    required
      charge-info container    optional (see charge-info)

Response Details

If successful, the response HTTP status code is 200 OK.
The response body contains the charge resource.


Examples

Request Examples

curl -v -X POST https://sandbox.bluesnap.com/services/2/recurring/ondemand/10543419 \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<charge xmlns="http://ws.plimus.com">
	<amount>45</amount>
	<currency>USD</currency>
</charge>'

Response Examples

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<charge xmlns="http://ws.plimus.com">
  <charge-id>6204026</charge-id>
  <subscription-id>10543419</subscription-id>
  <vaulted-shopper-id>22220051</vaulted-shopper-id>
  <transaction-id>1011815941</transaction-id>
  <transaction-date>2017-10-17</transaction-date>
  <amount>45.00</amount>
  <currency>USD</currency>
  <soft-descriptor>BLS&#x2a;BlueSnap</soft-descriptor>
  <payment-source>
    <credit-card-info>
      <credit-card>
        <card-last-four-digits>0026</card-last-four-digits>
        <card-type>VISA</card-type>
        <card-sub-type>CREDIT</card-sub-type>
        <card-category>CLASSIC</card-category>
        <expiration-month>05</expiration-month>
        <expiration-year>2018</expiration-year>
      </credit-card>
    </credit-card-info>
  </payment-source>
  <charge-info>
    <charge-description>OnDemand Subscription Charge</charge-description>
    <charge-type>RECURRING</charge-type>
  </charge-info>
</charge>

Back to Top


Example Description

The above example shows how to process recurring charges for merchant-managed subscriptions. Include the subscription ID in the request endpoint and include the amount and currency properties in the request body. This specific example is a subscription in which the payment source is a credit card. Example responses will vary depending on the specific payment method used.


API Explorer

To test out a call, enter an existing subscription ID (e.g. 10543419) in the subscription-id field. This will automatically insert the ID into the request URL. You can use the XML code sample below as a starting point for building up the request body. Click Try it! when you're ready to test the request.

Tip: In the request body, 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.

<charge xmlns="http://ws.plimus.com">
	<amount>45</amount>
	<currency>USD</currency>
</charge>

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 }}