Create Merchant-Managed Subscription Charge

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
     vendors-info container    optional (see vendors-info)
     charge-info container    optional (see charge-info)
     level-3-data container    optional (see level-3-data)
     scheduled     boolean    optional
     merchant-transaction-id string    optional
     transaction-meta-data container    optional (see transaction-meta-data)
     tax-reference string    optional

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>
  <merchant-transaction-id>MyUniqueOnDemandSubscription</merchant-transaction-id>
  <tax-reference>048deff0-a285-47e1-bc39-42f79bf0095b</tax-reference>
  <transaction-meta-data>
    <meta-data>
      <meta-key>stateTaxAmount</meta-key>
      <meta-value>2</meta-value>
      <meta-description>State Tax Amount</meta-description>
    </meta-data>
    <meta-data>
      <meta-key>cityTaxAmount</meta-key>
      <meta-value>3</meta-value>
      <meta-description>City Tax Amount</meta-description>
    </meta-data>
  </transaction-meta-data>
</charge>'
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>
  <scheduled>true</scheduled>
  <payer-info>
    <first-name>John</first-name>
    <last-name>Doe</last-name>
    <zip>12345</zip>
    <country>us</country>
  </payer-info>
  <payment-source>
    <credit-card-info>
      <credit-card>
        <card-number>4012000033330026</card-number>
        <security-code>111</security-code>
        <expiration-month>05</expiration-month>
        <expiration-year>2023</expiration-year>
      </credit-card>
    </credit-card-info>
  </payment-source>
</charge>'
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>
  <merchant-transaction-id>MyUniqueOnDemandSubscription</merchant-transaction-id>
    <vendors-info>
    <vendor-info>
      <vendor-id>10398032</vendor-id>
    </vendor-info>
  </vendors-info>
</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>
  <merchant-transaction-id>MyUniqueOnDemandSubscription</merchant-transaction-id>
  <tax-reference>048deff0-a285-47e1-bc39-42f79bf0095b</tax-reference>
  <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>2023</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 Descriptions

Create Merchant-Managed Subscription Charge: basic

This 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. Optionally, you can add metadata to the request by including the transaction-meta-data property.

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.

Create Merchant-Managed Subscription Charge: with a scheduled event

This example shows how to process a recurring charge for a merchant-managed subscription that occurs on a regular, scheduled interval. Pass scheduled set to true in the request to indicate the transaction is a regular, scheduled event.

Create Merchant-Managed Subscription Charge: with vendors info

This example shows how to process recurring charges involving one or more Marketplace vendors for merchant-managed subscriptions. Include vendors-info in the request to associate one or more Marketplace vendors with the transaction. For more details, refer to the Marketplace Guide.


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>
Language
Credentials
:
Click Try It! to start a request and see the response here!