![]() Documentation
Connect Stripe AccountConnect PayPal Account Display Checkout Coupons Discounts Subscription Trial Failed Payments Test Payments Fraudulent Payments Restricted Businesses Integrations
WordPress - WishList MemberWordPress - WP Webhooks Zapier References
WebhooksAPI FAQ
PricingGetting Paid Available Currencies Security More
Contact
|
API
Overview
The Snappy Checkout API offers a basic set of calls to manage payments and subscriptions. Calls must be made via an HTTP POST request
to https://www.SnappyCheckout.com/api/v1/. JSON will be returned in all HTTP POST responses. All values must be HTML encoded in
HTTP POST requests. For example, "john@aol.com" must be encoded as "john%40aol%2Ecom".Error Messages
When an API method fails, the response will return a success of "false". Also, the error_code will indicate what failed.The following error codes can be returned:
Example response showing that an invalid API method was called:
{"success":false,"error_code":"invalid_method","error_message":""}
GetProducts
Call this method to get a list of all products.Required key-value pairs:
Example HTTP POST request to retrieve a list of all products:
Method=GetProducts&Key=abc123def456hij7890
Example response:
{"success":true,"result":[{"id":"123TESTPRODUCTPFP27", "name":"Product Name", "nickname":"Product Nickname", "description":"Product Description"}]}
GetProductQuantity
Call this method to get the quantity available for products that have a limited quantity.Required key-value pairs:
Example HTTP POST request to retrieve a product quantity:
Method=GetProductQuantity&Key=abc123def456hij7890&Id=123TESTPRODUCTPFP27
Example response:
{"success":true,"result":[{"id":"123TESTPRODUCTPFP27", "count":5}]}
ValidatePayment
Call this method to verify that a payment exists in your Snappy Checkout account. This is most commonly used to verify a payment after receiving a Snappy Checkout "Payment Received URL" webhook.Required key-value pairs:
Optional key-value pairs:
Example HTTP POST request to check if a payment exists:
Method=ValidatePayment&Key=abc123def456hij7890&Id=ch_2FWcXbLIsFm61E
Example response showing the payment does exist:
{"success":true,"result":true}
Example response showing the payment does not exist:
{"success":true,"result":false}
ValidateSubscription
Call this method to verify that a subscription exists for the passed product id and customer email address.Required key-value pairs:
Example HTTP POST request to check if a subscription exists:
Method=ValidateSubscription&Key=abc123def456hij7890&Id=50&Email=john%40aol%2Ecom
Example response showing the subscription does exist:
{"success":true,"result":true}
Example response showing the subscription does not exist:
{"success":true,"result":false}
CancelSubscription
Call this method to cancel an existing subscription.Required key-value pairs:
Example HTTP POST request to cancel a subscription:
Method=CancelSubscription&Key=abc123def456hij7890&Id=50&Email=john%40aol%2Ecom
Example response showing the subscription was cancelled:
{"success":true,"result":true}
Example response showing the subscription could not be cancelled:
{"success":true,"result":false}
|