Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
February 2019 Webinar | How to Maximize Sales with APIs - FAQs
1. Webinar Q&A
How to Maximize Sales with APIs
1. Should I use the API to create a session for each customer, or
am I better off using Store Builder Library?
It may depend on your use case.
If you go with the API approach it’s completely secure, so you can
do price overrides without having to encrypt your payload as you
would with Store Builder Library.
But regardless of price overrides, you’d need to create new
customers’ customer accounts first by POSTing to the /accounts
endpoint. Now if you’re thinking about building a Store
experience on your own site, you’d probably also need to develop
an interface on your web site that directly or indirectly sets up the
server-side API call (e.g. collecting customer’s name and email
address, selecting products in the order, specifying quantities,
etc.).
If you use the Store Builder Library approach, you can use our
proprietary JavaScript methods (and markup directives) to collect
the necessary info and update the order details dynamically, on
the fly, right in the customer’s browser. But since it’s client-side,
if you have a need to pass certain types of details (like product
attributes or price overrides), then in that case you’d have to use
the secure payload method of the library, which involves
encrypting the payload on your server anyway, and then only
passing the encrypted payload (as opposed to the unencrypted
order details) via the JavaScript library. But if your goal is to build
a customer-facing Store experience on your own pages and you
don’t need to override products’ prices, then Store Builder Library
sort of becomes the obvious choice, since that’s really what it’s
designed to do.
2. 2. Can I use the API to modify a customer’s subscription instance
(for example, if the customer wants to upgrade or
downgrade)?
Yes indeed. By posting to the /subscriptions endpoint with the
subscription ID, you can make all sorts of changes to the
subscription record, including changing the subscribed product,
the price, the next billing date, etc. You can even have FastSpring
automatically generate a prorated refund for the unused portion
of the current billing period at the current / old rate, and an
automated charge for the remaining portion of the current
billing period at the new rate. That’s as simple as passing
“prorate”:“true” with your POST, and we’ll handle all the
calculations and everything else automatically.
Also, if you’re wondering “but how do I get the subscription ID for
a given customer’s subscription”, the most common way is by
subscribing to our webhooks. But you could also call GET
/accounts for the customer’s account ID, if you have that, and the
API response would give you a list of all of the customer’s
subscription IDs, among other account details.
3. What happens if I lose my API credentials? Is it possible to
create a new username and password?
The username will always be the same and you can access it any
time via the Dashboard, but you can certainly have us generate a
new password if needed. On that same page in Dashboard,
under Integrations -> API Credentials, there is a RESET
CREDENTIALS command that deletes the original password and
generates a new one. Just remember that if you’ve hard-coded
your API password into scripts, cron jobs, stored methods, etc.,
you’re going to have to replace it with the new password in those
files immediately, because they will all stop working once you
replace the old password with a new one.