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.
Request Content
charge
object required, contains the following properties (see charge):
amount
decimal required
currency
string required
chargeInfo
object optional (see chargeInfo)
vendorsInfo
object optional (see vendorsInfo)
level3Data
object optional (see level3Data)
scheduled
boolean optional
merchantTransactionId
string optional
taxReference
string optional
transactionMetaData
object optional (refer to transactionMetaData)
Response Details
If successful, the response HTTP status code is 200 OK.
The response body contains the charge object.
Examples
Request Examples
curl -v -X POST https://sandbox.bluesnap.com/services/2/recurring/ondemand/10543419 \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
"amount": 45,
"currency": "USD",
"merchantTransactionId": "MyUniqueOnDemandSubscription",
"taxReference": "048deff0-a285-47e1-bc39-42f79bf0095b",
"transactionMetaData": {
"metaData": [
{
"metaValue": 3,
"metaKey": "StateTaxAmount",
"metaDescription": "State Tax Amount"
},
{
"metaValue": 2,
"metaKey": "CityTaxAmount",
"metaDescription": "City Tax Amount"
}
]
}
}'
curl -v -X POST https://sandbox.bluesnap.com/services/2/recurring/ondemand/10543419 \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
"amount": 45,
"currency": "USD",
"scheduled": true,
"payerInfo": {
"firstName": "John",
"lastName": "Doe",
"zip": "02453",
"country": "us"
},
"paymentSource": {
"creditCardInfo": {
"creditCard": {
"expirationYear": 2023,
"securityCode": 111,
"expirationMonth": "05",
"cardNumber": 4012000033330026
}
}
}
}'
curl -v -X POST https://sandbox.bluesnap.com/services/2/recurring/ondemand/10543419 \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
"amount": 45,
"currency": "USD",
"merchantTransactionId": "MyUniqueOnDemandSubscription",
"vendorsInfo": {
"vendorInfo": [{ "vendorId": "10398032" }]
}
}'
Response Examples
{
"chargeId": 12949131,
"subscriptionId": 10543419,
"vaultedShopperId": 22194079,
"transactionId": "1015010743",
"merchantTransactionId": "MyUniqueOnDemandSubscription",
"taxReference": "048deff0-a285-47e1-bc39-42f79bf0095b",
"transactionDate": "2017-10-31",
"amount": 45,
"currency": "USD",
"softDescriptor": "default_descriptor",
"paymentSource": {
"creditCardInfo": {
"creditCard": {
"cardLastFourDigits": "0026",
"cardType": "VISA",
"cardSubType": "CREDIT",
"cardCategory": "CLASSIC",
"expirationMonth": "05",
"expirationYear": "2023"
}
}
},
"chargeInfo": {
"chargeDescription": "OnDemand Subscription Charge",
"chargeType": "RECURRING"
},
"processingInfo": {
"processingStatus": "SUCCESS"
}
}
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 transactionMetaData
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 vendorsInfo
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 JSON 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.
{
"amount": 45,
"currency": "USD"
}