Snappy Checkout
I'm Mike Singer, the founder & developer of Snappy Checkout. I'm here to help if you have any questions. Feel free to email me anytime.
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:

  • invalid_method: The called API method does not exist.
  • invalid_parameters: An invalid key-value pair was passed in the HTTP POST request.
  • invalid_key: An invalid Snappy Checkout API key was passed in the HTTP POST request. Check the Account --> API section of the Snappy Checkout admin to verify that you're using the correct API key.
  • api_error: An error occurred within the Snappy Checkout API. Contact support@snappycheckout.com if you need help resolving this issue.

Example response showing that an invalid API method was called:

{"success":false,"error_code":"invalid_method","error_message":""}
GetProductQuantity
Call this method to get the quantity available for products that have a limited quantity.

Required key-value pairs:

  • Method: The name of the API method to call. The value must be "GetProductQuantity".
  • Key: Your Snappy Checkout API key. You can find your API key in the Account --> API section of the Snappy Checkout admin. You should never expose your API key in any public website's client-side code or anywhere else where it can be publically viewed.
  • Id: The id of the product from the "Products" section of your Snappy Checkout account. Separate multiple product ids with a comma.

Example HTTP POST request to retrieve a product quantity:

Method=GetProductQuantity&Key=abc123def456hij7890&Id=ch_2FWcXbLIsFm61E
&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:

  • Method: The name of the API method to call. The value must be "ValidatePayment".
  • Key: Your Snappy Checkout API key. You can find your API key in the Account --> API section of the Snappy Checkout admin. You should never expose your API key in any public website's client-side code or anywhere else where it can be publically viewed.
  • Id: The unique payment id that is generated by Stripe/PayPal. This is the "PaymentId" value that is passed by the Snappy Checkout "Payment Received URL" webhook.
  • Email: The customer's email address. This is the "CustomerEmail" value that is passed by the Snappy Checkout "Payment Received URL" webhook.

Optional key-value pairs:

  • Amount: The amount of the item purchased. This is the "PaymentTotal" value that is passed by the Snappy Checkout "Payment Received URL" webhook.

Example HTTP POST request to check if a payment exists:

Method=ValidatePayment&Key=abc123def456hij7890&Id=ch_2FWcXbLIsFm61E
&Amount=50.00&Email=john%40aol%2Ecom

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:

  • Method: The name of the API method to call. The value must be "ValidateSubscription".
  • Key: Your Snappy Checkout API key. You can find your API key in the Account --> API section of the Snappy Checkout admin. You should never expose your API key in any public website's client-side code or anywhere else where it can be publically viewed.
  • Id: The subscription product id. When adding a product in the Products section of the Snappy Checkout admin, this is the value in the "Product ID" text box.
  • Email: The customer's email address.

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:

  • Method: The name of the API method to call. The value must be "CancelSubscription".
  • Key: Your Snappy Checkout API key. You can find your API key in the Account --> API section of the Snappy Checkout admin. You should never expose your API key in any public website's client-side code or anywhere else where it can be publically viewed.
  • Id: The subscription product id. When adding a product in the Products section of the Snappy Checkout admin, this is the value in the "Product ID" text box.
  • Email: The customer's email address.

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}
© Snappy Checkout
support@snappycheckout.com