This article applies to Contextual Commerce. (Looking for Classic Commerce documentation?)
Every purchase, subscription and charge in FastSpring is associated with the Customer Account. Usually created automatically after the first order, Customer Accounts are tied to a vendor's account and contain all customer activity and stored payment methods (if applicable). Account IDs can be obtained by subscribing to "account.created" or "order.completed" Webhooks and can be used to query FastSpring for account details, obtain all the customer's orders and subscriptions, and create orders on behalf of the customer if payment details are available on file.
Each combination of vendor ID and customer email address results in a unique account. A single customer will have 2 accounts if they purchase from 2 different vendors. The account ID is generated when the first order from a customer is placed with a vendor; all subsequent orders matching that email address and vendor are assigned to the same account ID.
Creating and Retrieving Account Information
You can use the FastSpring API to retrieve, create, or update the known customer information associated with an account. "Known" information includes the first name, last name, email address, phone number, and company. It does not include payment details. You can also pass a "user id" that you have assigned to the customer on your website. For example, this may be a user ID the customer has created for logging in. Your user ID is passed back, as well, by the API, so you can store an association between the FastSpring account ID and your own account ID. To update account information, use the server API /accounts endpoint along with the account ID you stored when the customer placed the subscription order. See more information about Applying Customer Information to the order.
There are two ways to obtain "FastSpring Account ID" for a customer:
- Pre-create an account before submitting an order using /accounts endpoint of the API
- Capture account data (including ID) by subscribing to the "account.created" Webhook event
At a later date you can also retrieve account ID associated with any order or subscription by making a call to the corresponding API using an order or subscription ID followed by a call to the /accounts endpoint to resolve account ID into a complete set of account information
Information stored with the customer account
- First and Last name of the customer along with their Email address, phone number, country and preferred language will be stored as part of the account data.
- If you passed a custom "account id" it will also be stored along with the account information and can be retrieved through the API.
- Optionally, payment details will also be stored by FastSpring whenever customer purchases a subscription or if opted-in to keep payment details on file (subject to vendor approval, please contact firstname.lastname@example.org for details).
If you are running your own authentication or otherwise have an "account concept" of your own we advise you to update customer details stored at FastSpring whenever information changes on your end. Please see Updating customer information stored at FastSpring for more information.
Payment details associated with customer accounts
FastSpring does not store actual credit card numbers and other credit card details. Instead, a "payment trigger" for credit cards, PayPal, and other payment methods which support this feature is stored. FastSpring stores the payment trigger along with the "known" account information if either of the following is true:
- The order contains one or more subscription products (including ad hoc subscriptions)
- The vendor requested that all payment information be stored for subsequent charges. (This request is subject to approval by FastSpring on a case-by-case basis, please contact email@example.com for details.)
The information is not shared with vendors and is not accessible by anyone other than customer themselves through the account management.