API Reference

The Paykickstart API allows for a wide variety of interactions with the Paykickstart Platform using an application.

The API endpoint is located here: https://app.paykickstart.com/api

  • All API requests should use the above URL as their base url.
  • All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

With the exception of the Instant Payment Notification system which uses a different validation method, every api call must include an auth_token field, which is located in your Platform Settings, under “API Key”. This key is used to verify the vendor’s account and respective API access permissions.

Responses from the Paykickstart API are returned in JSON format, unless otherwise stipulated.

Instant Payment Notification

IPN POST

IPN Validation Function

PHP
    
    <?php
        function is_valid_ipn($data, $secret_key) {
                // Hash received
                $ipnHash = $data['hash'];

                // Unset encrypted keys
                unset($data['hash'], $data['verification_code']);

                // Trim and ommit empty/null values from the data
                $data = array_filter(array_map('trim', $data));

                foreach ($data as $key => $item) {
                    $data[$key] = iconv("UTF-8","ISO-8859-1//IGNORE",$item);
                }

                // Alphabetically sort IPN parameters by their key. This ensures
                // the params are in the same order as when Paykickstart
                // generated the verification code, in order to prevent
                // hash key invalidation due to POST parameter order.
                ksort($data, SORT_STRING);

                // Implode all the values into a string, delimited by "|"
                // Generate the hash using the imploded string and secret key
                $hash = hash_hmac( 'sha1', implode("|", $data), $secret_key );

                return $hash == $ipnHash;
        }
    
JS
var Crypto={};Crypto.sha1_hmac=function(f,$){"use strict";var r,o,t,e,a,C;for($.length>64&&($=Crypto.sha1($,!0)),e=[],C=$.length,a=0;a<64;++a)e[a]=C>a?$.charCodeAt(a):0;for(a=0,r="",o="";a<64;++a)r+=String.fromCharCode(92^e[a]),o+=String.fromCharCode(54^e[a]);return t=Crypto.sha1(o+f,!0),Crypto.sha1(r+t)},Crypto.sha1=function(f,$){function r(f,$){return f<<$|f>>>32-$}function o(f){var $,r,o,t="";for($=0;$<=6;$+=2)r=f>>>4*$+4&15,o=f>>>4*$&15,t+=r.toString(16)+o.toString(16);return t}function t(f,$){var r,o,t="";for(r=7;r>=0;r--)o=f>>>4*r&15,t+=$?String.fromCharCode(o):o.toString(16);return t}var e,a,C,h,_,x,n,c,s,u,A=Array(80),d=1732584193,i=4023233417,p=2562383102,g=271733878,l=3285377520,y=f.length,D=[];for(a=0;a<y-3;a+=4)C=f.charCodeAt(a)<<24|f.charCodeAt(a+1)<<16|f.charCodeAt(a+2)<<8|f.charCodeAt(a+3),D.push(C);switch(y%4){case 0:a=2147483648;break;case 1:a=f.charCodeAt(y-1)<<24|8388608;break;case 2:a=f.charCodeAt(y-2)<<24|f.charCodeAt(y-1)<<16|32768;break;case 3:a=f.charCodeAt(y-3)<<24|f.charCodeAt(y-2)<<16|f.charCodeAt(y-1)<<8|128}for(D.push(a);D.length%16!=14;)D.push(0);for(D.push(y>>>29),D.push(y<<3&4294967295),e=0;e<D.length;e+=16){for(a=0;a<16;a++)A[a]=D[e+a];for(a=16;a<=79;a++)A[a]=r(A[a-3]^A[a-8]^A[a-14]^A[a-16],1);for(a=0,h=d,_=i,x=p,n=g,c=l;a<=19;a++)temp=r(h,5)+(_&x|~_&n)+c+A[a]+1518500249&4294967295,c=n,n=x,x=r(_,30),_=h,h=temp;for(a=20;a<=39;a++)temp=r(h,5)+(_^x^n)+c+A[a]+1859775393&4294967295,c=n,n=x,x=r(_,30),_=h,h=temp;for(a=40;a<=59;a++)temp=r(h,5)+(_&x|_&n|x&n)+c+A[a]+2400959708&4294967295,c=n,n=x,x=r(_,30),_=h,h=temp;for(a=60;a<=79;a++)temp=r(h,5)+(_^x^n)+c+A[a]+3395469782&4294967295,c=n,n=x,x=r(_,30),_=h,h=temp;d=d+h&4294967295,i=i+_&4294967295,p=p+x&4294967295,g=g+n&4294967295,l=l+c&4294967295}if(s=(t(d)+t(i)+t(p)+t(g)+t(l)).toLowerCase(),!$)return s;for(u="";s.length;)u+=String.fromCharCode(parseInt(s.substr(0,2),16)),s=s.substr(2);return u};

        /**
         *
         * @param  { {} } $data
         * @param  {string} $secret_key
         * @return  {boolean}
         */
        function is_valid_ipn($data, $secret_key)
        {
            let $ipnHash = $data.hash,
                completedData = [];

            delete $data.hash;
            delete $data.verification_code;

            let data = Object.keys($data)
                .sort()
                .reduce(function (acc, key) {
                    acc[key] = $data[key];
                    return acc;
                }, {});

            for (let key in data) {
                if (data.hasOwnProperty(key)) {
                    let value = data[key];
                    if (value !== '' && value !== '0' && value !== 0 && value !== null) {
                        completedData.push(cleanString(value));
                    }
                }
            }

            let $hash = Crypto.sha1_hmac(completedData.join("|"), $secret_key);

            return $hash === $ipnHash;
        }

        function cleanString(input) {
            if(typeof input === 'string') {
                var output = "";
                for (var i = 0; i < input.length; i++) {
                    if (input.charCodeAt(i) <= 127) {
                        output += input.charAt(i);
                    }
                }

                return output;
            }

            return input;
        }
    
PYTHON
    
        import hmac
        import hashlib


        def is_valid_ipn(data, secret):
            """
            :param data: json object with input data. i.e. data from post query
            :param secret: string
            """
            ipn_hash = data['hash']
            completed_data = []

            del data['hash'], data['verification_code']

            for attr, value in sorted(data.items()):
                if value != '' and value != '0' and value != 0 and value != None:
                    completed_data.append(cleanString(value))

            h = hmac.new(secret.encode(), "|".join(map(str, completed_data)).encode(), hashlib.sha1)

            return h.hexdigest() == ipn_hash

        def cleanString(input):
            if (isinstance(input, str)):
                return ''.join([i if ord(i) < 128 else '' for i in input])

            return input
    

PayKickstart’s Instant Payment Notification (IPN) is a message service that automatically notifies vendors of events related to PayKickstart transactions. Vendors can use it to automate back-office and administrative functions, including automatically creating users on apps, providing customers with their login credentials via email etc.

ARGUMENTS

event

Stipulates the type of transaction event which has occurred. Each IPN that’s fired is fired based on a specific event, so it’s possible that a single transaction can fire multiple IPNs, particularly in the case of subscriptions. Please note that these IPN events may not be fired in any particular order. The event types are:
  • sales
    IPN is fired when any transaction is successful, even in the case of subscription rebills.
  • refund
    IPN is fired any time a transaction is refunded.
  • subscription-payment
    IPN is fired when any subscription transaction is created successfully.
  • subscription-created
    IPN is fired when a subscription has been created.
  • subscription-cancelled
    IPN is fired when a subscription has been cancelled.
  • subscription-completed
    IPN is fired when a subscription has completed. This occurs only with subscriptions which have a limited number of payments and have successfully charged the final payment.
  • subscription-trial-start
    IPN is fired when a trial period has started
  • subscription-trial-end
    IPN is fired when a trial period has ended
  • subscription-payment-failed
    IPN is fired when a subscription payment fails
  • subscription-pending-cancelation
    IPN is fired when a customer’s related subscription is cancelled with the Pending Cancellation option.
  • subscription-pending-cancellation-revoked
    IPN is fired when a customer’s related subscription is reactivated, and the pending cancellation was revoked.
  • subscription-updated
    IPN is fired when a subscription is reactivated from inside the ui
  • subscription-changed
    IPN is fired when an existing subscription is upgraded / downgraded
  • subscription-pause
    IPN is fired when a customer’s related subscription is paused
  • subscription-unpaused
    IPN is fired when a customer’s related subscription is unpaused
  • cart-abandoned
    IPN is fired when a customer triggers cart abandonment
  • trial-expiring
    IPN is fired when the related customer’s subscription is about to expire
  • transaction-pending
    IPN is fired on a customer transaction that is currently pending approval with the payment gateway.
  • subscription-reminder
    IPN is fired when the customer receives a subscription reminder email that their subscription is about to bill.
  • lead-added
    IPN is fired when a new lead is added to your PK account.
  • lead-subscribed
    IPN is fired when the customer is sent the confirmation email related to your lead campaign and email responder to confirm their opt-in.
  • lead-confirmed
    IPN is fired when the customer lead is confirmed via the confirmation email related to your lead campaign and connected email responder.
  • lead-buyer
    IPN is fired when the customer converts from a lead to a buyer of a related product.
  • in_progress
    IPN is fired when a customer’s related transaction is marked as in progress with the fulfillment section.
  • fulfilling
    IPN is fired when a customer’s related transaction is marked as fulfilling with the fulfillment section.
  • shipped
    IPN is fired when a customer’s related transaction is marked as shipped with the fulfillment section.
  • delivered
    IPN is fired when a customer’s related transaction is marked as delivered with the fulfillment section.
  • returned
    IPN is fired when a customer’s related transaction is marked as returned with the fulfillment section.
  • refunded
    IPN is fired when a customer’s related transaction is marked as refunded with the fulfillment section.
  • on_hold
    IPN is fired when a customer’s related transaction is marked as on hold with the fulfillment section.
mode

Indicates whether the transaction was executed in “live” mode or “test” mode. The parameter’s possible value are:
  • live
  • test
payment_processor

Indicates the payment gateway used to create the transaction. Supported payment gateways include:
  • stripe
  • paypaladaptive
  • paypalmarketplace
  • braintree
  • authnet
amount

The transaction amount
buyer_ip

The transaction’s buyer’s details
buyer_first_name

buyer_last_name

buyer_email

vendor_first_name

The transaction’s Paykickstart vendor’s details
vendor_last_name

vendor_email

billing_address_1

The transaction’s buyer’s billing details
billing_address_2

billing_city

billing_state

billing_zip

billing_country

shipping_address_1

The transaction’s buyer’s shipping details
shipping_address_2

shipping_city

shipping_state

shipping_zip

shipping_country

transaction_id

The unique Paykickstart transaction ID
invoice_id

The unique Paykickstart purchase ID
old_invoice_id

The original Paykickstart purchase ID of the old subscription (only included in the subscription-changed event)
tracking_id

The transaction’s Paykickstart affiliate’s tracking link id
transaction_time

The time when the transaction was generated, in UNIX timestamp format.
product_id

The transaction’s product details
product_name

campaign_id

The transaction’s campaign details
campaign_name

funnel_id

The transaction’s funnel ID
funnel_name

affiliate_first_name

The transaction’s Paykickstart affiliate’s details and the amount paid to the affiliate for this transaction. Both the commission value and percentage amounts are indicated.
affiliate_last_name

affiliate_email

affiliate_commission_amount

affiliate_commission_percent

ref_affiliate_first_name

The transaction’s Paykickstart 2nd tier affiliate’s details and the amount paid to that affiliate for this transaction. Both the commission value and percentage amounts are indicated.
ref_affiliate_last_name

ref_affiliate_email

ref_affiliate_commission_amount

ref_affiliate_commission_percent

update_billing_url

* Only available in the subscription-payment-failed IPN event. Returns the URL where the customer may update their payment details for the subscription in which their payment failed.
next_billing_date

* Only available in the sales IPN event, and only if applicable (i.e. not populated in the case of 1-time transactions). Returns the unix timestamp of when the subscription will next charge (in GMT0 timezone).
custom_{field}

Field names prefixed with “custom_” in the IPN POST are custom fields which you may set in the checkout page URL. For example, if your Paykickstart checkout page URL is https://app.paykickstart.com/checkout/123, you can add additional information to the URL in the form of GET variables like this: https://app.paykickstart.com/checkout/123?var1=123&var2=email@user.com

Continuing with the example above, we’d pass these custom variables back to you in the IPN POST, like this:

custom_var1 = 123
custom_var2 = ’email@user.com’
licenses

Returns any licenses linked to the transaction, either as an array if more than 1 license, or a string if only 1 license.
hash

This is a hashed security key that can be used to validate that the IPN POST received is in fact valid / verified. You should generate a hash using the function provided (see IPN Validation Function on the left) and compare it against the hash within the POST. If they match, the IPN is verified. The secret key variable required by the IPN validation function is located in your campaign settings (see screenshot below).

Affiliate IPN POST

PayKickstart’s Affiliate Instant Payment Notification (IPN) is a message service that automatically notifies affiliates of events related to PayKickstart transactions.

amount

The transaction amount
buyer_first_name

The transaction’s buyer’s details. These fields may not reflect if the vendor has chosen to disable them.
buyer_last_name

tracking_id

The transaction’s Paykickstart affiliate’s tracking link id
transaction_time

The time when the transaction was generated, in UNIX timestamp format.
product_name

The transaction’s product details
campaign_name

The transaction’s campaign details
affiliate_first_name

The transaction’s Paykickstart affiliate’s details and the amount paid to the affiliate for this transaction.
affiliate_last_name

affiliate_email

affiliate_commission_amount

Customer Portal

Login Customer

POST /billing-customer Login Customer

Allows the user to fetch the login token of a customer for a customer portal iframe. This is useful for vendors who want to embed the customer portal into a membership area where the vendor already knows the customer’s email address and doesn’t want to require the customer to have to use the email verification login system on the portal (auto-login).

USAGE:

Once you’ve received the login token in the API response, you need to modify the iframe source URL and include a new parameter called “secret”. The value of that parameter should be the token you received in the response.

Example URI

POST https://app.paykickstart.com/api/billing-customer

Arguments

auth_token

(string)  (required)

The Paykickstart vendor’s API Key.
email

(string)  (required)

The email address of the customer.

Affiliates

The following API calls deal with retrieving affiliate data and marketing materials

Get All Affiliates

POST /affiliates/all Get All Affiliates

Returns all the affiliate’s details for a specified campaign.

Example URI

POST https://app.paykickstart.com/api/affiliates/all

Arguments

auth_token

(string)  (required)

The Paykickstart vendor’s API Key.
campaign_id

(integer)  (required)

The affiliate’s campaign’s id.

Get Affiliate

POST /affiliate Get Affiliate

Returns the affiliate’s details and links.

Example URI

POST https://app.paykickstart.com/api/affiliate

Arguments

auth_token

(string)  (required)

The Paykickstart vendor’s API Key.
campaign_id

(integer)  (required)

The affiliate’s campaign’s id.

affiliate

(string)  (required)

The affiliate’s email address or ID.

Licensing

PayKickstart’s licensing system is a service which creates and manages licenses on a per-product basis for vendors who activate the service.The service is activated by enabling “Licensing” in the Product Details section when editing a product. The “License Usage” field indicates the number of licenses which will be issued each time the product is purchased.

The issued licenses are given to the customer on Paykickstart’s default “thank you” page and on Paykickstart’s Order Lookup page. They are also indicated in the IPN service. The link to Paykickstart’s Order Lookup page is included by default to the buyer’s sales receipt email.

Get License Data

POST /licenses/data Get License Data

This GET request returns license information for a specific license key

Example URI

POST https://app.paykickstart.com/api/licenses/data

Arguments

auth_token

(string)  (required)

The Paykickstart vendor’s API Key.
license_key

(string)  (required)

The customer’s license key

Get License Status

POST /licenses/status Get License Status

This GET request returns license status information for a specific license key

Example URI

POST https://app.paykickstart.com/api/licenses/status

Arguments

auth_token

(string)  (required)

The Paykickstart vendor’s API Key.
license_key

(string)  (required)

The customer’s license key

Activate License

POST /licenses/activate Activate License

This POST request activates the license for a specific license key / GUID combination

Example URI

POST https://app.paykickstart.com/api/licenses/activate

Arguments

auth_token

(string)  (required)

The Paykickstart vendor’s API Key.
license_key

(string)  (required)

The customer’s license key
guid

(string)  (required)

The GUID is usually a 128-bit integer number used to identify unique resources, but for the purpose of activating a license on Paykickstart it can be any unique hash or “identifier” to identify where the license has been activated, such as a unique hardware identifier, or a unique URL. This prevents the license from being activated in multiple environments at once (1 license per use).

Clear License "De-Register"

POST /licenses/clear Clear License "De-Register"

This POST request “clears” / de-registers the license from its specified GUID, allowing it to be activated again for a new (or the same) GUID

Example URI

POST https://app.paykickstart.com/api/licenses/clear

Arguments

auth_token

(string)  (required)

The Paykickstart vendor’s API Key.
license_key

(string)  (required)

The customer’s license key

Enable License

POST /licenses/enable Enable License

This POST request enables the license for being activated and verified

Example URI

POST https://app.paykickstart.com/api/licenses/enable

Arguments

auth_token

(string)  (required)

The Paykickstart vendor’s API Key.
license_key

(string)  (required)

The customer’s license key

Disable License

POST /licenses/disable Disable License

This POST request disables the license from being activated or verified

Example URI

POST https://app.paykickstart.com/api/licenses/disable

Arguments

auth_token

(string)  (required)

The Paykickstart vendor’s API Key.
license_key

(string)  (required)

The customer’s license key

Reissue License

POST /licenses/reissue Reissue License

This POST request reissue the license

NOTE: The license key must first be "cleared" / de-registered before it can be reissued.

Example URI

POST https://app.paykickstart.com/api/licenses/reissue

Arguments

auth_token

(string)  (required)

The Paykickstart vendor’s API Key.
license_key

(string)  (required)

The customer’s license key

New Purchase

PayKickstart’s New Purchase API call is a highly flexible system designed to allow you as the vendor complete flexibility in terms of creating and managing new purchases. Using the API, you’re able to override your products’ default price settings, or even create a new charge without needing a client’s credit card information (reference transaction).

Step 1 (Tokenization)

The Paykickstart API supports accepting payment processor tokens in order to effect payment as opposed to raw card data. It is therefore a TWO-PART or THREE-PART (if customer authorization is required) system. The first part involves creating tokens directly from your checkout page using javascript provided by your payment processor, and the second part involves sending those tokens to the Paykickstart API endpoint.

We have created an example page which you can access to view the javascript required for each of your processors in each of your campaigns, as well as a copy-and-paste javascript you can use on your checkout pages to simplify the process.

In order to access this, please login to your Paykickstart vendor account, then go to this URL: https://app.paykickstart.com/test-code-v2/pci. The page which loads will list all your current campaigns and their associated processor integrations:

Click “go” next to the campaign you are integrating with using the API. On the following page, you’ll find tabs at the top for your supported payment types (credit card, SEPA, ACH etc.) and an “all” option. Clicking on any of those tabs will provide you with a sample form and javascript, as well as the done for you, copy-and-paste javascript sample at the top of the page.

The done-for-you PK tokenize javascript MUST BE PLACED BELOW THE PURCHASE FORM ELEMENT in the DOM structure. It accepts the following GET variables:

ccNum

(string)

The form field element ID which is responsible for capturing the customer’s credit card number.
ccExpireMonth

(string)

The form field element ID which is responsible for capturing the customer’s credit card’s expiry month_column
ccExpireYear

(string)

The form field element ID which is responsible for capturing the customer’s credit card’s expiry year
ccCSV

(string)

The form field element ID which is responsible for capturing the customer’s credit card’s CSV number
ccBtn

(string)

The form field element ID which is responsible for submitting the form with credit card details
ppBtn

(string)

The form field element ID where the PayPal button will be rendered into.
form

(string)

The form’s DOM element ID
ccExpireYear

(string)

The form field element ID which is responsible for capturing the customer’s credit card’s expiry year
wt_account_holder_name

(string)

The form field element ID which is responsible for capturing the customer’s account holder name
sepa_email

(string)

The form field element ID which is responsible for capturing the customer’s email address for SEPA verification
iban_number

(string)

The form field element ID which is responsible for capturing the customer’s IBAN account number
sepaBtn

(string)

The form button ID which is responsible for generating the customer’s SEPA token
route_number

(string)

The form field element ID which is responsible for capturing the customer’s ACH account route number
account_number

(string)

The form field element ID which is responsible for capturing the customer’s ACH account number
achBtn

(string)

The form button ID which is responsible for capturing the customer’s credit card’s expiry year
ccExpireYear

(string)

The form field element ID which is responsible for generating the customer’s ACH token
billing_address_1

(string)

The form field element ID which is responsible for capturing the customer’s billing address line 1 (used when creating the payment profile / token, if supplied)
billing_address_2

(string)

The form field element ID which is responsible for capturing the customer’s billing address line 1 (used when creating the payment profile / token, if supplied)
billing_city

(string)

The form field element ID which is responsible for capturing the customer’s billing address city (used when creating the payment profile / token, if supplied)
billing_state

(string)

The form field element ID which is responsible for capturing the customer’s billing address state (used when creating the payment profile / token, if supplied)
billing_zip

(string)

The form field element ID which is responsible for capturing the customer’s billing address zip code (used when creating the payment profile / token, if supplied)
billing_country

(string)

The form field element ID which is responsible for capturing the customer’s billing address country (used when creating the payment profile / token, if supplied)

You may choose to NOT use that done for you PK tokenisation script if your form is a bit more complex, in which case the example javascript provided may be copied to your own form and modified as required:

You can also fill in the form field provided on the page and click “click me” to see an example output of the working javascript:

Using the generated token, you can submit an API call (see below) to process the transaction.

Step 2 (New Purchase Request)

POST /purchase Step 2 (New Purchase Request)

Example URI

POST https://app.paykickstart.com/api/purchase
auth_token

(string) (required)

The Paykickstart vendor’s API Key.
product

(integer) (required)

The campaign’s id.
plan

(integer) (required)

The product’s id.
affiliate_id

(string)

The paykickstart affiliate id for the affiliate which should be credited (and/or receive commission) for the purchase. The commission settings from the campaign / product / affiliate overrides will be used to calculate the commission owed.
first_name

(string) (required)

The buyer’s first name.
last_name

(string) (required)

The buyer’s last name.
email

(string) (required)

The buyer’s email address.
ref_purchase

(string)

Instead of providing the buyer’s PayPal or credit card information via token to create the purchase, you can pass the invoice id you receive via the IPN post as the ref purchase. This will cause the system to use the payment profile already stored in Paykickstart and associated to that original purchase to create the new purchase. This field is not required, provided that a token is submitted instead.
test_mode

(integer)

Create this purchase using Paykickstart’s native “test mode” ability. NOTE: This will ONLY work if the campaign is set to “test mode” first, and REPLACES card information completely i.e. if you enable this option then do not send a payment token as well. This field is not required.
price

(integer)

Override the product’s price amount for this purchase. If this field is not set, the price from the product’s settings is used.
quantity

(integer) (required) Default: 1

The quantity of the product being purchased. NOTE: The charge amount will be calculated by a multiplying the price and quantity fields before adding tax, shipping etc..
coupon_code

(string)

Apply a specific coupon code to the purchase.
split_selected

(string)

Override to charge the product as a split_pay. This field is not required unless you are setting total_installments and price_per_installment.
total_installments

(string)

The number of split pay installments to be set. This field is only required when split_selected is set
price_per_installment

(string)

The price per split pay installment. This field is required when split_pay_selected is set, and must also be LESS that the product’s main price.
is_recurring

(string)

Enable a subscription-based product purchase. This field is not required unless you are setting up the purchase to be a subscription (see fields below)
recurring_freq

(integer)

The number of recurring_freq_type E.g. recurring_frequency of 2 and a recurring_freq_type of months, means the subscription will charge every 2 months. This field is required when is_recurring is set.
recurring_freq_type

(string)

The recurring period for the recurring payment. This field is required when is_recurring is set.
  • day
  • month
  • year
cycles

(string)

The number of payments for your subscription. Set as null for an infinite subscription. This field is required when is_recurring is set.
has_trial

(string)

Enable trial period for the purchase. Please note this is only currently possible for recurring subscription products. This field is not required unless you which to create a trial period for your product.
trial_amount

(string)

The initial amount to charge for the trial. Amount may be set to 0 for free trial. This field is not required unless you have has_trial enabled.
trial_days

(integer)

The number of days before the subscription transactions begin. For example, if you want to set a 14 day free trial, make sure the product is set to recurring in its settings or via the API, then set trial_amount to 0 and trial_days to 14. This field is not required unless you have has_trial enabled.
buyer_tax_number

(string)

The customer’s Tax / VAT ID. This field only applies if you have tax profile(s) enabled for your related product. Value of null can be passed.
buyer_tax_name

(string)

The buyer’s company name to be added to the invoice. This field only applies if you have tax profile(s) enabled for your related product. Value of null can be passed.
capture_billing_address

(integer)

Option to toggle whether or not you want to capture the buyer’s billing address. This field is not required.
billing_address_1

(string)

This field is required when capture_billing_address is set.
billing_address_2

(string)

This field is required when capture_billing_address is set.
billing_city

(string)

This field is required when capture_billing_address is set.
billing_state

(string)

This field is required when capture_billing_address is set.
billing_zip

(string)

This field is required when capture_billing_address is set.
billing_country

(string)

This field is required when capture_billing_address is set. Format: ISO country code (2 letters)
billing_phone_code

(string)

The billing phone code.
billing_phone_number

(string)

The billing phone number.
capture_shipping_address

(integer)

Option to toggle whether or not you want to capture the buyer’s shipping address. This field is not required.
shipping_address_1

(string)

This field is required when capture_shipping_address is set.
shipping_address_2

(string)

This field is required when capture_shipping_address is set.
shipping_city

(string)

This field is required when capture_shipping_address is set.
shipping_state

(string)

This field is required when capture_shipping_address is set.
shipping_zip

(string)

This field is required when capture_shipping_address is set.
shipping_country

(string)

This field is required when capture_shipping_address is set. Format: ISO country code (2 letters)
shipping_phone_code

(string)

The shipping phone code.
shipping_phone_number

(string)

The shipping phone number.
tos-read

(string)

Boolean (accepts 0 or 1 as values). Indicates that the user has accepted your terms of service. Required if Terms of Service option is enabled in the product’s settings.
ccNum

(integer)

The last 4 digits of the customer’s credit card number.
ccExpireYear

(integer)

The 4-digit expiry year of the customer’s credit card.
ccExpireMonth

(integer)

The 2-digit expiry month of the customer’s credit card.
custom_field[<FIELDNAME>]

(array)

Pass as many custom fields you like through to the purchase api. Replace <FIELDNAME> with the field name of your choice.

Below outlines the token fields required in the API call depending on your payment processor:

Stripe Credit Card:

If you have NOT enabled Strong Customer Authentication (SCA) for your Stripe integration:

stripeToken

(string)

The token generated by Stripe JS on your checkout page when accepting Credit Card data.

If you HAVE enabled Strong Customer Authentication (SCA) for your Stripe integration:

stripePm

(string)

The payment method generated by Stripe JS on your checkout page when accepting credit card data from the customer

Stripe SEPA:

stripeSourceId

(string)

The source generated by Stripe JS on your checkout page when accepting bank details.
sepa

(integer)

The last 4 digits of the IBAN number
wt-type

(integer)

This should be set to: sepa

Stripe ACH:

stripeSourceId

(string)

The source generated by Stripe JS on your checkout page when accepting bank details
route_number

(integer)

The customer’s bank’s route number
account_number

(integer)

The last 4 digits of the customer’s account number number
stripeBAToken

(string)

The Stripe bank token ID returned from Stripe JS
wt-type

(string)

This should be set to: ach

Braintree Credit Card:

pay_method_nonce

(string)

The Baintree token created by BraintreeJS when accepting Credit Card purchases using Braintree.

Authorize.net:

dataDescriptor

(string)

Should be set to: COMMON.ACCEPT.INAPP.PAYMENT
dataValue

(string)

The token ID returned from Authorize.net AcceptJS

Easy Pay Direct:

epdSaleToken

(string)

The sale token ID returned from Easy Pay Direct
epdCustomerToken

(string)

The customer profile token ID returned from Easy Pay Direct

PayPal / Braintree PayPal:

paypal_ba_id

(string)

The authorization token created returned from PayPal / BT PayPal.

Connect:

payment_method_token

(string)

The Connect token created by ConenctJS when accepting Credit Card purchases using Connect.

Step 3 (Verification)

If you are using Stripe and you have SCA enabled, you may need to request authorization from your customer to process the transaction. Paykickstart will inform you if this is the case in the response from step 2 by returning a status of “requires_action”.

In this case, you will need to load a page which includes Stripe’s javascript that’ll open a modal asking your customer to authorize the transaction – please see the example provided on https://app.paykickstart.com/test-code-v2/pci.

Once the customer authorizes the transaction, you will need to submit another API call to Paykickstart as follows:

POST https://app.paykickstart.com/api/confirm-payment

Arguments

auth_token

(string)

The relevant vendor account’s API key.
invoice_id

(string)

The purchase_id returned in the response from Paykickstart on step 2.
stripePi

(string)

The relevant Stripe Payment Intent ID generated in step 1

NOTE: you MUST submit the above request to the endpoint indicated above even if authorization fails or is not completed by the customer!

Payments

The following API calls offer checkout and payment-related API functions.

Get Purchase

POST /purchase/get Get Purchase

Returns the purchase details.

Example URI

POST https://app.paykickstart.com/api/purchase/get

Arguments

auth_token

(string)  (required)

The Paykickstart vendor’s API Key.
id

(string)  (required)

The purchase’s id.

Get Transaction

POST /transaction/get Get Transaction

Returns the transaction details.

Example URI

POST https://app.paykickstart.com/api/transaction/get

Arguments

auth_token

(string)  (required)

The Paykickstart vendor’s API Key.
id

(string)  (required)

The transaction’s id.

Update Credit Card

POST /purchase/update-cc Update Credit Card

This POST request updates a customer’s credit card information for a specified purchase. Please note that we DO NOT store your customer’s credit card details in Paykickstart. Paykickstart uses frontend tokenisation technology to protect you and your customers from passing payment information insecurely, and all information supplied via this API call is directly relayed to the linked payment processor where the payment profile is updated.

Example URI

POST https://app.paykickstart.com/api/purchase/update-cc

Arguments

auth_token

(string)  (required)

The Paykickstart vendor’s API Key.
invoice_id

(string)  (required)

The unique Paykickstart purchase ID
PaymentProcessorTokens

(string)  (required)

The payment processor token is required. Please refer to the new purchase documentation on how to generate tokens and which parameters to set.

ccNum

(string)  (required)

The last 4 digits of the customer’s credit card number.

ExpireMonth

(string)  (required)

The 2-digit expiry month of the customer’s credit card.

ExpireYear

(string)  (required)

The 4-digit expiry year of the customer’s credit card.

Get Transactions (last 100)

POST /transactions Get Transactions (last 100)

Fetches the last 100 transactions (or 100 transactions up to the created_at date) for the associated account.

Example URI

POST https://app.paykickstart.com/api/transactions

Arguments

auth_token

(string)  (required)

The Paykickstart vendor’s API Key.
created_at

(timestamp)  (optional)

The end date up to when to fetch the transactions in UNIX timestamp format.

affiliate_id

(integer)  (optional)

Fetch all affiliate transactions.

Refund Transaction

POST /transaction/refund Refund Transaction

Example URI

POST https://app.paykickstart.com/api/transaction/refund

Arguments

auth_token

(string)  (required)

The Paykickstart vendor’s API Key.
transaction_id

(string)  (required)

The transaction’s id.

Subscription

The subscriptions methods allow you to update a subscription’s status and set the next charge date, or to cancel the subscription.

Cancel Subscription

POST /subscriptions/cancel Cancel Subscription

This POST request cancels an active subscription

Example URI

POST https://app.paykickstart.com/api/subscriptions/cancel

Arguments

auth_token

(string)  (required)

The Paykickstart vendor’s API Key.
invoice_id

(string)  (required)

The unique Paykickstart purchase ID
cancel_at

(timestamp)  (optional)

Optional field to set a specific cancellation date (unix timestamp).

fire_event

(integer)  (optional)  Default: 1

Toggle whether or not Paykickstart should fire all the subscription cancellation events. This field is not required and default is 1 (true).

charge_overage

(integer)  (optional)

Toggle whether or not Paykickstart should calculate and charge any overage fees due during cancellation. This field is not required and default is 0 (false).

Reactivate Subscription

POST /subscriptions/re-activate Reactivate Subscription

This POST request reactivates a canceled subscription

Example URI

POST https://app.paykickstart.com/api/subscriptions/re-activate

Arguments

auth_token

(string)  (required)

The Paykickstart vendor’s API Key.
invoice_id

(string)  (required)

The unique Paykickstart purchase ID
date

(timestamp)  (required)

Set the next billing date (Unix timestamp).This field is required.

Change The Next Subscription Billing Date

POST /subscriptions/change_next_date Change The Next Subscription Billing Date

This POST request changes the next billing date of an active subscription

NOTE: The Subscription must be "Active".

Example URI

POST https://app.paykickstart.com/api/subscriptions/change_next_date

Arguments

auth_token

(string)  (required)

The Paykickstart vendor’s API Key.
invoice_id

(string)  (required)

The unique Paykickstart purchase ID
date

(timestamp)  (required)

Set the next billing date (Unix timestamp).This field is required.

Up/Downgrade Subscription

POST /subscriptions/change Up/Downgrade Subscription

This POST request changes a subscription by activating the new subscription first, then cancelling the current subscription.

Example URI

POST https://app.paykickstart.com/api/subscriptions/change

Arguments

auth_token

(string)  (required)

The Paykickstart vendor’s API Key.
invoice_id

(string)  (required)

The unique Paykickstart purchase ID
product_id

(integer)  (required)

The new product with which subscription should now be associated.

charge_date

(timestamp)  (required)

The next time the customer will be charged for the subscription. This field is optional; if not provided then the next charge date will remain unchanged.

first_charge

(integer)  (required)

This is the pro-rata amount to charge/credit immediately. To add a credit instead of a charge, pass a NEGATIVE value in this parameter. This field is not required; if not provided the system will automatically calculate the amount to charge or to credit.

allowed_units

(integer)  (optional)

If usage is enabled, this parameter allows you to provide the usage limit for the pro-rata period. This field is not required; if not provided the system will automatically calculate it.

coupon_code

(string)  (optional)

Apply a specific coupon code to the subscription.

Subscriptions Usage

POST /subscriptions/usage Subscriptions Usage

This POST request allows you to add usage to a subscription

Example URI

POST https://app.paykickstart.com/api/subscriptions/usage

Arguments

auth_token

(string)  (required)

The Paykickstart vendor’s API Key.
invoice_id

(string)  (required)

The unique Paykickstart purchase ID
units

(integer)  (required)

Set the number of usage units to attribute to this subscription for the current subscription period. This field can be negative if you wish to “credit” units to a specific subscription for the current subscriptino period.

notes

(string)  (optional)

Add a comment/reason for the usage / credit. This field is not required.

Subscriptions Add Credit

POST /subscriptions/credit/add Subscriptions Add Credit

This POST request allows you to add credit to a subscription

Example URI

POST https://app.paykickstart.com/api/subscriptions/credit/add

Arguments

auth_token

(string)  (required)

The Paykickstart vendor’s API Key.
subscription_id

(string)  (required)

The unique Paykickstart subscription ID

amount

(integer)  (required)

Set the amount of credit to this subscription. This field can be negative.

note

(string)  (optional)

Add a comment/reason for the credit. This field is not required.

Set Subscription Payment Method

POST /subscriptions/set-pm Set Subscription Payment Method

Example URI

POST https://app.paykickstart.com/api/subscriptions/set-pm
auth_token

(string) (required)

The Paykickstart vendor’s API Key.
invoice_id

(string) (required)

The unique Paykickstart purchase ID
type

(string) (required)

Type of gateway which can be used in related campaign. Possible types:
  • cc
  • pp
  • wt

If your "type" is "cc", then you need send the following data inside request:

ccNum

(string) (required)

The form field element ID which is responsible for capturing the customer’s credit card number.
ccExpireMonth

(string) (required)

The form field element ID which is responsible for capturing the customer’s credit card’s expiry month_column
ccExpireYear

(string) (required)

The form field element ID which is responsible for capturing the customer’s credit card’s expiry year

If your gateway one of braintree, paypalvault then next field is required:

pay_method_nonce

(string) (required)

The Gateway token created by BraintreeJS when accepting Credit Card purchases using Braintree.

If your gateway is stripe then next field is required:

payment_method

(string) (required)

The Gateway token created by StripeJS Code when accepting Credit Card purchases using Stripe. Required if "type" is "cc"
source_id

(string) (required)

The Gateway token created by StripeJS Code when accepting Wire Transfer purchases using Stripe. Required if "type" is "wt"

If your gateway is epd then next field is required:

payment_token

(string) (required)

The Gateway token created by EPDJS Code when accepting Credit Card purchases using EPD.

If your gateway is authnet then next field is required:

dataDescriptor

(string)

Should be set to: COMMON.ACCEPT.INAPP.PAYMENT
dataValue

(string)

The token ID returned from Authorize.net AcceptJS

If your gateway is connect then next field is required:

payment_method_token

(string) (required)

The Gateway token created by Connect JS Code when accepting Credit Card purchases using CONNECT.
country

(string) (required)

Set country 2 ISO code.
postal_code

(string) (required)

Set postal code

Set Subscription Upgrade/Downgrade terms

POST /subscriptions/upgrade/wording Get Subscription Upgrade/Downgrade terms

Example URI

POST https://app.paykickstart.com/api/subscriptions/upgrade/wording
auth_token

(string)  (required)

The Paykickstart vendor’s API Key.
invoice_id

(string) (required)

The unique Paykickstart purchase ID of the current active subscription
product_id

(integer)  (required)

The new product with which subscription should now be associated.

first_charge

(string) (not required)

This is the pro-rata amount to charge/credit immediately. To add a credit instead of a charge, pass a NEGATIVE value in this parameter. This field is not required; if not provided the system will automatically calculate the amount to charge or to credit.

charge_date

(timestamp) (not required)

The next time the customer will be charged for the subscription. This field is optional; if not provided then the next charge date will remain unchanged.

allowed_units

(integer)  (optional)

If usage is enabled, this parameter allows you to provide the usage limit for the pro-rata period. This field is not required; if not provided the system will automatically calculate it.

Coupons

This section describes all the available coupon API calls

Create Coupon

POST /coupons Create Coupon

Creates a new coupon.

Example URI

POST https://app.paykickstart.com/api/coupons

Arguments

auth_token

(string)  (required)

The Paykickstart vendor’s API Key.
coupon_name

(string)  (required)

The display name for your coupon.

coupon_code

(string)  (required)

The Unique coupon code for your coupon.

coupon_rate

(string)  (required)

The value of your coupon.

coupon_type

(string)  (required)

The type of value – accepted arguments are: “amount” and “percentage”

coupon_apply_to

(array)  (required)

Determines if the coupon should be applied to first charge (excludes split pay), first charge, rebills and/or split payments. This is an array parameter where one or more of the below arguments are accepted:

  • 1: First Charge (excludes split pay)

  • 2: First Charge

  • 3: Rebills

  • 4: Split Payments

coupon_start_date

(string)  (required)

The start date of when the coupon is active. Correct format '12/31/2022 00:00:00'

coupon_end_date

(string)  (required)

The end date of when the coupon is active. Correct format '12/31/2023 00:00:00'

coupon_max_redemption

(string)  (required)

The maximum number of times a coupon may be redeemed

plan_ids

(array)  (required)

An array of plan ids which the coupon should be applied to

product_id

(integer)  (required)

The campaign id which the coupon should be applied to

affiliate_id

(integer)  (optional)

The affiliate ID which should be applied to the coupon

affiliate_id_tier_2

(integer)  (optional)

The affiliate ID which should be applied to the coupon

coupon_rebills_number

(integer)  (optional)

Coupon Rebills Number. Applies only when coupon_apply_to contains 3.

Check Coupon Status

POST /coupon/status Check Coupon Status

Check status of the coupon.

Example URI

POST https://app.paykickstart.com/api/coupon/status

Calculate Coupon

POST /coupon/calculate Calculate Coupon

Calculate data for coupon

Example URI

POST https://app.paykickstart.com/api/coupon/calculate

Leads

This section describes all the available leads API calls

Confirm Lead

POST /leads/confirm Confirm Lead

Allows the user to confirm an unconfirmed lead.

Example URI

POST https://app.paykickstart.com/api/leads/confirm

Arguments

auth_token

(string)  (required)

The Paykickstart vendor’s API Key.
lead_id

(string)  (required)

The lead’s id.

lead_campaign_id

(integer)  (required)

The Lead Campaign’s id.

Invoices

This section describes all the available invoice API calls

Get Invoice

Allows the user to get the link to invoice pdf file.

Example URI

POST https://app.paykickstart.com/api/invoice

Arguments

auth_token

(string)  (required)

The Paykickstart vendor’s API Key.
transaction_id

(string)  (required)

The transaction PK id.

Технологии Google ПереводчикПереводчик