{"_id":"5b19742cb3baf90003cab5a7","category":{"_id":"5b19742cb3baf90003cab4ed","version":"5b19742cb3baf90003cab5ae","project":"57336fd5a6a9c40e00e13a0b","__v":0,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-01-13T18:38:47.347Z","from_sync":false,"order":5,"slug":"ecp-transaction-service","title":"Subscriptions"},"project":"57336fd5a6a9c40e00e13a0b","user":"560d5913af97231900938124","parentDoc":null,"version":{"_id":"5b19742cb3baf90003cab5ae","project":"57336fd5a6a9c40e00e13a0b","__v":0,"forked_from":"5adf4e59ac13b80003d23152","createdAt":"2018-04-24T15:33:45.744Z","releaseDate":"2018-04-24T15:33:45.744Z","categories":["5b19742cb3baf90003cab4e8","5b19742cb3baf90003cab4e9","5b19742cb3baf90003cab4ea","5b19742cb3baf90003cab4eb","5b19742cb3baf90003cab4ec","5b19742cb3baf90003cab4ed","5b19742cb3baf90003cab4ee","5b19742cb3baf90003cab4ef","5b19742cb3baf90003cab4f0","5b19742cb3baf90003cab4f1","5b19742cb3baf90003cab4f2"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"3.26 Release","version_clean":"8976.0.0-Extended","version":"8976-Extended"},"githubsync":"","__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-05-12T15:01:27.909Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"method":"post","results":{"codes":[]},"settings":"","auth":"optional","params":[],"url":""},"isReference":true,"order":2,"body":"##Definition\nhttps<span>://sandbox.bluesnap.com/services/2/subscriptions/:subscription-id/subscription-charges</span>\n\n<hr>\n\n##Documentation\nThe Create Subscription Charge request enables you to process recurring charges for On Demand subscriptions. 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 On Demand subscriptions\",\n  \"body\": \"For more information about merchant-managed subscriptions and how to use On Demand subscription contracts, see the [Merchant-Managed Subscriptions tutorial](doc:subscriptions-guide#section-merchant-managed-subscriptions).\"\n}\n[/block]\n\n###Request Content\n`subscription-charge` &nbsp;&nbsp;&nbsp;<span style=\"color:#F37500\">**required**</span>, contains the following properties (see [subscription-charge](doc:subscription-charge)):\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`charge-info` *container* &nbsp;&nbsp;&nbsp;<span style=\"color:#F37500\">**required**</span> (see [charge-info](doc:charge-info))\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`sku-charge-price` *container* &nbsp;&nbsp;&nbsp;optional (see [sku-charge-price](doc:sku-charge-price))\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`expected-total-price` *container* &nbsp;&nbsp;&nbsp;<span style=\"color:#F37500\">**required**</span> (see [expected-total-price](doc:expected-total-price))\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"If you would like to receive the `subscription-charge` resource in the response, include the `fulldescription` parameter in the web service URL. For example: \\n`services/2/subscriptions/39486350/subscription-charges?fulldescription=true`\"\n}\n[/block]\n\n###Response Details\nIf successful, the response HTTP status code is 201 Created.\nThe URI of the newly created subscription-charge is included in the Location header.\nIf you included the `fulldescription` parameter in your request, the response body contains the `subscription-charge` resource.\nFor details about possible errors, see: [General Errors](doc:general-errors), [Payment & Processor Errors](doc:payment-errors), and [Fraud Errors](doc:fraud-errors).\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/subscriptions/29266930/subscription-charges/ \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<subscription-charge xmlns=\\\"http://ws.plimus.com\\\">\\n  <charge-info>\\n    <charge-description>September Subscription Fee</charge-description>\\n    <from-date>01-Sep-18</from-date>\\n    <to-date>30-Sep-18</to-date>\\n  </charge-info>\\n  <sku-charge-price>\\n    <amount>100</amount>\\n    <currency>USD</currency>\\n  </sku-charge-price>\\n  <expected-total-price>\\n    <amount>100</amount>\\n    <currency>USD</currency>\\n  </expected-total-price>\\n</subscription-charge>'\",\n      \"language\": \"curl\",\n      \"name\": \"Create Subscription Charge Request\"\n    },\n    {\n      \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/subscriptions/39486350/subscription-charges?fulldescription=true \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<subscription-charge xmlns=\\\"http://ws.plimus.com\\\">\\n   <charge-info>\\n      <charge-description>September Subscription Fee</charge-description>\\n      <from-date>01-Sep-18</from-date>\\n      <to-date>30-Sep-18</to-date>\\n   </charge-info>\\n   <sku-charge-price>\\n      <amount>1</amount>\\n      <currency>USD</currency>\\n   </sku-charge-price>\\n   <expected-total-price>\\n      <amount>1</amount>\\n      <currency>USD</currency>\\n   </expected-total-price>\\n</subscription-charge>'\",\n      \"language\": \"curl\",\n      \"name\": \"with `fulldescription` parameter\"\n    }\n  ]\n}\n[/block]\n###Response Examples\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"HTTP/ 1.1 201 Created\\nLocation: https://sandbox.bluesnap.com/services/2/subscriptions/29266930/subscription-charges/50043\",\n      \"language\": \"http\",\n      \"name\": \"Create Subscription Charge Response\"\n    },\n    {\n      \"code\": \"HTTP/ 1.1 201 Created\\nLocation: https://sandbox.bluesnap.com/services/2/subscriptions/39486350/subscription-charges/113643\\n\\n<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<subscription-charge xmlns=\\\"http://ws.plimus.com\\\">\\n   <charge-info>\\n      <charge-description>some text</charge-description>\\n   </charge-info>\\n   <charge-invoice-info>\\n      <date-created>11-Nov-14</date-created>\\n      <invoice-id>38442336</invoice-id>\\n      <invoice-amount>1.00</invoice-amount>\\n      <invoice-currency>USD</invoice-currency>\\n   </charge-invoice-info>\\n</subscription-charge>\",\n      \"language\": \"xml\",\n      \"name\": \"with `fulldescription` parameter\"\n    }\n  ]\n}\n[/block]\n<hr>\n\n##Example Descriptions\n\n###Create Subscription Charge\nThe example above shows how to create a basic recurring subscription charge. The charge is associated with the subscription ID 29266930, which is included in the request URl.\n\n###Create Subscription Charge (fulldescription)\nThe example above shows how to create a basic recurring subscription charge. The request includes the `fulldescription` parameter in order to receive the `subscription-charge` resource in the response. \n\n<br>\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>","excerpt":"","slug":"create-subscription-charge","type":"endpoint","title":"Create Subscription Charge"}

postCreate Subscription Charge


Definition

https://sandbox.bluesnap.com/services/2/subscriptions/:subscription-id/subscription-charges


Documentation

The Create Subscription Charge request enables you to process recurring charges for On Demand subscriptions. Each charge is associated to the initial subscription based on the subscription ID.

See the guide on using On Demand subscriptions

For more information about merchant-managed subscriptions and how to use On Demand subscription contracts, see the Merchant-Managed Subscriptions tutorial.

Request Content

subscription-charge    required, contains the following properties (see subscription-charge):
      charge-info container    required (see charge-info)
      sku-charge-price container    optional (see sku-charge-price)
      expected-total-price container    required (see expected-total-price)

If you would like to receive the subscription-charge resource in the response, include the fulldescription parameter in the web service URL. For example:
services/2/subscriptions/39486350/subscription-charges?fulldescription=true

Response Details

If successful, the response HTTP status code is 201 Created.
The URI of the newly created subscription-charge is included in the Location header.
If you included the fulldescription parameter in your request, the response body contains the subscription-charge resource.
For details about possible errors, see: General Errors, Payment & Processor Errors, and Fraud Errors.


Examples

Request Examples

curl -v -X POST https://sandbox.bluesnap.com/services/2/subscriptions/29266930/subscription-charges/ \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<subscription-charge xmlns="http://ws.plimus.com">
  <charge-info>
    <charge-description>September Subscription Fee</charge-description>
    <from-date>01-Sep-18</from-date>
    <to-date>30-Sep-18</to-date>
  </charge-info>
  <sku-charge-price>
    <amount>100</amount>
    <currency>USD</currency>
  </sku-charge-price>
  <expected-total-price>
    <amount>100</amount>
    <currency>USD</currency>
  </expected-total-price>
</subscription-charge>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/subscriptions/39486350/subscription-charges?fulldescription=true \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<subscription-charge xmlns="http://ws.plimus.com">
   <charge-info>
      <charge-description>September Subscription Fee</charge-description>
      <from-date>01-Sep-18</from-date>
      <to-date>30-Sep-18</to-date>
   </charge-info>
   <sku-charge-price>
      <amount>1</amount>
      <currency>USD</currency>
   </sku-charge-price>
   <expected-total-price>
      <amount>1</amount>
      <currency>USD</currency>
   </expected-total-price>
</subscription-charge>'

Response Examples

HTTP/ 1.1 201 Created
Location: https://sandbox.bluesnap.com/services/2/subscriptions/29266930/subscription-charges/50043
HTTP/ 1.1 201 Created
Location: https://sandbox.bluesnap.com/services/2/subscriptions/39486350/subscription-charges/113643

<?xml version="1.0" encoding="UTF-8"?>
<subscription-charge xmlns="http://ws.plimus.com">
   <charge-info>
      <charge-description>some text</charge-description>
   </charge-info>
   <charge-invoice-info>
      <date-created>11-Nov-14</date-created>
      <invoice-id>38442336</invoice-id>
      <invoice-amount>1.00</invoice-amount>
      <invoice-currency>USD</invoice-currency>
   </charge-invoice-info>
</subscription-charge>


Example Descriptions

Create Subscription Charge

The example above shows how to create a basic recurring subscription charge. The charge is associated with the subscription ID 29266930, which is included in the request URl.

Create Subscription Charge (fulldescription)

The example above shows how to create a basic recurring subscription charge. The request includes the fulldescription parameter in order to receive the subscription-charge resource in the response.



Back to Top