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-chargeresource in the response, include thefulldescriptionparameter 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>'
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>
<seller-order-id>12345</seller-order-id>
</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>
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>
HTTP/ 1.1 201 Created
Location: https://sandbox.bluesnap.com/services/2/subscriptions/29266930/subscription-charges/50043
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
