This document is issued as an addendum to the CCBill API documentation and discusses Advanced Dynamic Upgrade functionality. This document is written for developers, technicians, and others with advanced coding skills.
Advanced Dynamic Upgrades allow clients to upgrade consumers’ past subscriptions to a new subscription without pre-configuring a price in the system. Advanced Dynamic Upgrades can be made to the same subaccount or a different subaccount and are set up entirely by the client. Because Advanced Dynamic Upgrades do not require the consumer to re-enter payment information, the client is responsible for hosting the terms of the upgrade being offered.
Advanced Dynamic Upgrades do not require pre-configured upgrades to be set up in CCBill’s system. However, price points can be created in the Pricing Area of the CCBill Webmaster Admin, to which the upgrade will occur.
The system supports both Credit Card and ACH (Automated Clearing House) upgrades.
Advanced Dynamic Upgrades can support Regional Pricing, with an additional step. Two requests will be made; the initial upgrade request calculates the new price and the second request actually performs the transaction. This process is described in detail later in this document.
CCBill Velocity Controls is an advanced CCBill API feature, and it enables you to limit customer transactions by the number of transactions and/or by cash amount of transactions within a specific time-frame. This means that you can set the number of transactions for a specific customer within a given period of time.
Rules apply to all payment types, and each customer is assigned a unique ID based on their financial information and security background. By setting up CCBill Velocity Controls, you limit the chances of fraud and, on an individual basis, you allow good loyal customers to continue to make purchases beyond the established limits.
Note: Each rule can be set up on a single subaccount or across all subaccounts.
If you are interested in this advanced feature, please contact merchantsupport@ccbill.com to set up velocity controls according to your business requirements.
Advanced Dynamic Upgrades are created by passing parameters into a query string. Requests should be sent to the following CGI script with variable values appended:
https://bill.ccbill.com/jpost/billingApi.cgi
The upgrade will be performed pending validation from CCBill. Depending on the result of the validation, different results will be returned. Results can be returned in either comma-separated value (CSV) format or XML format. Examples of request strings and their potential output are shown below.
The following list describes each field value for Advanced Dynamic Upgrades.
Note: If specialOffer is set to zero (0), the prorate parameter must be included. Otherwise, the prorate parameter is not used.
All parameters explained above are required in addition to the required fields listed in the main CCBill API documentation. The following table indicates which fields are required or optional:
clientAccnum | userName | Password | clientSubacc | usingSubacc | returnXML | action | |
---|---|---|---|---|---|---|---|
Main Account | ✔ | ✔ | ✔ | ✔ | |||
Main Account w/XML | ✔ | ✔ | ✔ | ✔ | ✔ | ||
Sub Account | ✔ | ✔ | ✔ | ✔ | ✔ | ||
Sub Account w/XML | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
subscriptionId | upgradeTypeId | upgradeClientAccnum | upgradeClientSubacc | |
---|---|---|---|---|
Main Account | ✔ | ✔ | ✔ | ✔ |
Main Account w/XML | ✔ | ✔ | ✔ | ✔ |
Sub Account | ✔ | ✔ | ✔ | ✔ |
Sub Account w/XML | ✔ | ✔ | ✔ | ✔ |
Main Account w/Special Offer | ✔ | ✔ | ✔ | ✔ |
Main Account w/XML | ✔ | ✔ | ✔ | ✔ |
and Special Offer | ✔ | ✔ | ✔ | ✔ |
Sub Account w/Special Offer | ✔ | ✔ | ✔ | ✔ |
Sub Account w/XML and Special Offer | ✔ | ✔ | ✔ | ✔ |
specialOffer | prorate | overrideAffiliate | overrideParticipation | |
---|---|---|---|---|
Main Account | ✔ | ✔ | ||
Main Account w/XML | ✔ | ✔ | ||
Sub Account | ✔ | ✔ | ||
Sub Account w/XML | ✔ | ✔ | ||
Main Account w/Special Offer | ✔ | |||
Main Account w/XML | ✔ | |||
and Special Offer | ✔ | |||
Sub Account w/Special Offer | ✔ | |||
Sub Account w/XML and Special Offer | ✔ |
The following code examples use the upgradeSubscription action, which does not support Regional Pricing.
Request String
https://bill.ccbill.com/jpost/billingApi.cgi?clientAccnum=900100&username=testUser&password=testPass&action=upgradeSubscription&subscriptionId=18902345789012343781¤cyCode=840&upgradeTypeId=14&upgradeClientAccnum=900100&upgradeClientSubacc=0000&specialOffer=1&sharedAuthentication=1
Results Sent (for approved transactions):
Fields: "approved", "subscriptionId"
Values: "1", "100000000000000000"
Results Sent (for denied transactions):
Fields: "approved", "denialId", "declineCode", "declineText"
Values: "0", "100000000000745921", "15", "declined by bank"
Results Sent (when an error occurs)
Fields: "results"
Values: "-1"
Request String
https://bill.ccbill.com/jpost/billingApi.cgi?clientAccnum=900100&username=testUser&password=testPass&action=upgradeSubscription&subscriptionId=0108114301000018799¤cyCode=840&upgradeTypeId=14&upgradeClientAccnum=900100&upgradeClientSubacc=0000&specialOffer=1&sharedAuthentication=1&returnXML=1
Results Sent (for approved transactions)
<?xml version='1.0' standalone='yes'?>
<results>
<approved>1</approved>
<subscriptionId>100000000000000000</subscriptionId>
</results>
Results Sent (for denied transactions):
<?xml version='1.0' standalone='yes'?>
<results>
<approved>0</approved>
<denialId>100000000000000000</denialId>
<declineCode>15</declineCode>
<declineText> declined by bank </declineText>
</results>
Results Sent (when an error occurs)
<?xml version='1.0' standalone='yes'?>
<results>-1</results>
To use Regional Pricing with Advanced Dynamic Upgrades, two requests must be made. The first request is a standard Advanced Dynamic Upgrade request using the getUpgradeDetails action. The first request only returns data; no transaction is processed until the second request is sent. The first request will return data to be used in the second request as described below.
The second request will be sent using the chargeByPreviousTransactionId action. This request processes the upgrade transaction.
Note: This document only describes the chargeByPreviousTransactionId action in enough detail for use with Advanced Dynamic Upgrades. For more information about this action, consult the chargeByPreviousTransactionId addendum to the the CCBill API Guide.
The first request returns the following values:
Once the data has been passed back, submit the processTransactionUrl value as the second request. This will process the transaction.
The following code examples use the getUpgradeDetails action to support Regional Pricing. Because this action requires a second request to actually process the transaction, code examples for both requests are provided.
Note that the first request returns a value called processTransactionUrl which contains the exact string needed for the second request. This URL will process the actual transaction. The second request returns data describing the results of the transaction.
First Request String
https://bill.ccbill.com/jpost/billingApi.cgi?clientAccnum=999999&clientSubacc=0000&username=qatest1&password=testing1&action=getUpgradeDetails&prorate=2&subscriptionId=0908267201000000008&upgradeClientAccnum=999999&upgradeClientSubacc=0000¤cyCode=840&specialOffer=1&sharedAuthentication=0&upgradeTypeId=0000060948
Data Returned from First Request
Fields: "currencyCode","recurringPriceDescription","initialPriceDescription","initialPeriod",
"initialPrice","recurringPrice","recurringPeriod","processTransactionUrl","rebills"
Values: "840","","$19.95(USD) for 30 days","30","19.95","12.95","30", "[link below]","99"
Second Request String
https://bill.ccbill.com/jpost/billingApi.cgi?clientAccnum=999999&clientSubacc=0000&username=qatest1&password=testing1&action=chargeByPreviousTransactionId&subscriptionId=0908267201000000008&newClientAccnum=999999&newClientSubacc=0000&specialOffer=1&sharedAuthentication=0¤cyCode=840&initialPrice=19.95&initialPeriod=30&recurringPrice=12.95&recurringPeriod=30&rebills=99
Results Sent from Second Request (for approved transactions)
Fields: "approved", "subscriptionId"
Values: "1", "1234567890"
Results Sent from Second Request (for denied transactions):
Fields: "approved", "denialId", "declineCode", "declineText"
Values: "0", "100000000000000000", "15", "declined by bank"
Results Sent from Second Request (when an error occurs)
Fields: "results"
Values: "-1"
https://bill.ccbill.com/jpost/billingApi.cgi?clientAccnum=999999&clientSubacc=0000&username=qatest1&password=testing1&action=getUpgradeDetails&prorate=2&subscriptionId=0908267201000000008¤cyCode=840&upgradeClientAccnum=999999&upgradeClientSubacc=0000&specialOffer=1&sharedAuthentication=0&upgradeTypeId=0000060948
Data Returned from First Request
<results>
<currencyCode>840</currencyCode>
<initialPeriod>30</initialPeriod>
<initialPrice>19.95</initialPrice>
<initialPriceDescription>$19.95(USD) for 30 days</initialPriceDescription>
<processTransactionUrl>[link below]</processTransactionUrl>
<rebills>99</rebills>
<recurringPeriod>30</recurringPeriod>
<recurringPrice>12.95</recurringPrice>
<recurringPriceDescription/>
</results>
Second Request String
https://bill.ccbill.com/jpost/billingApi.cgi?clientAccnum=999999&clientSubacc=0000&username=qatest1&password=testing1&action=chargeByPreviousTransactionId&subscriptionId=0908267201000000008&newClientAccnum=999999&newClientSubacc=0000&specialOffer=1&sharedAuthentication=0¤cyCode=840&initialPrice=19.95&initialPeriod=30&recurringPrice=12.95&recurringPeriod=30&rebills=99
Results Sent from Second Request (for approved transactions):
<?xml version='1.0' standalone='yes'?>
<results>
<approved>1</approved>
<subscriptionId>100000000000000000</subscriptionId>
</results>
Results Sent from Second Request (for denied transactions):
<?xml version='1.0' standalone='yes'?>
<results>
<approved>0</approved>
<denialId>100000000000000000</denialId>
<declineCode>15</declineCode>
<declineText> declined by bank </declineText>
</results>
Results Sent from Second Request (when an error occurs):
<?xml version='1.0' standalone='yes'?>
<results>-1</results>
Regardless of which action is used, numeric codes will be returned if the request fails due to an error. For a full list of error codes and explanations, please consult the CCBill API Guide.
CCBill’s 1-Click API’s allow merchants to offer their customers with a convenient upgrade billing solution which enables customers from having to re-enter their payment details on subsequent purchases. The API’s are managed by the merchant and transactions are initiated by the consumers within the merchant’s website or member’s area. While these can be very convenient and useful tools, they do not come without added risk. The merchant is required to manage much of the consumer experience, and the API’s are designed to bypass CCBill’s authentication system, V-Scrub.
As a result, it is imperative for the merchant to understand their responsibilities and implement a system of controls designed to manage the consumer experience and minimize the risk of chargebacks and revenue loss.
While each merchant’s business model is inherently unique, and controls they implement may differ, the following best practices act as a guide for merchants who process 1-Click transactions.