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 provides a basic set of endpoints for managing payments and subscriptions. All API requests must be sent using an HTTP POST request to https://www.SnappyCheckout.com/api/v1/. Responses are returned in JSON format.

All values included in HTTP POST requests must be URL encoded. For example, "[email protected]" should be encoded as "john%40aol%2Ecom".

Available API methods:

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.
  • api_error: An error occurred within the Snappy Checkout API. Contact [email protected] 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":""}
GetProducts
Call this method to get a list of all products.

Required key-value pairs:

  • Method: The name of the API method to call. The value must be "GetProducts".
  • Key: Your Snappy Checkout API key. You can find your API key at https://www.snappycheckout.com/admin/account/?section=api. You should never expose your API key in any public website's client-side code or anywhere else where it can be publicly viewed.

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:

  • 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 at https://www.snappycheckout.com/admin/account/?section=api. You should never expose your API key in any public website's client-side code or anywhere else where it can be publicly 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=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 at https://www.snappycheckout.com/admin/account/?section=api. You should never expose your API key in any public website's client-side code or anywhere else where it can be publicly 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}
CreatePayment
Call this method to create a new payment for a customer by charging the same Stripe credit card they most recently used for a prior payment in your Snappy Checkout account.

Required key-value pairs:

  • Method: The name of the API method to call. The value must be "CreatePayment".
  • Key: Your Snappy Checkout API key. You can find your API key at https://www.snappycheckout.com/admin/account/?section=api. You should never expose your API key in any public website's client-side code or anywhere else where it can be publicly viewed.
  • Email: The customer's email address. The API will look up this customer's most recent successful Stripe payment and reuse that card information.
  • Id: The product id to charge. You can find the product id at https://www.snappycheckout.com/admin/products.
  • Price: The amount to charge for the product.

Optional key-value pairs:

  • Shipping: The shipping amount to charge.
  • TaxPercentage: The tax percentage to apply to the payment.
  • ReceiptMessage: An optional message to include in the customer's email receipt.

Notes:

  • The customer must already have at least one previous successful Stripe payment in your account.
  • The product must be a single payment product. Subscription, split payment, scheduled payment, pre-order, authorization, and crowdfund products are not supported by this API method.
  • This method returns true when the payment is successfully created and false is not returned for charge failures. Charge failures return an API error response instead.

Example HTTP POST request to create a payment:

Method=CreatePayment&Key=abc123def456hij7890&Email=john%40aol%2Ecom
&Id=MXT8R210ZXM8GLKX2KL6P35429&Price=50.00&Shipping=0.00&TaxPercentage=0&ReceiptMessage=Thank%20you

Example response showing the payment was created:

{"success":true,"result":true}

Example response showing the API request had invalid parameters:

{"success":false,"error_code":"invalid_parameters","error_message":"No previous Stripe payments found for this customer"}
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 at https://www.snappycheckout.com/admin/account/?section=api. You should never expose your API key in any public website's client-side code or anywhere else where it can be publicly 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 at https://www.snappycheckout.com/admin/account/?section=api. You should never expose your API key in any public website's client-side code or anywhere else where it can be publicly 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
[email protected]