1.Introduction
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.
2.Topics
2.1.Instant Payment Notification
2.1.1.IPN POST
Example Response
<?php $_POST = [ 'event' => 'subscription-payment', 'mode' => 'live', 'payment_processor' => 'stripe', 'is_rebill' => 1, 'amount' => 9.99, 'quantity' => 1, 'buyer_ip' => '196.215.215.215', 'buyer_first_name' => 'Ruggero', 'buyer_last_name' => 'Sandri-Boriani', 'buyer_email' => 'ruggero@sandri.com', 'vendor_first_name' => 'Digital', 'vendor_last_name' => 'Kickstart', 'vendor_email' => 'support@digitalkickstart.com', 'billing_address_1' => '', 'billing_address_2' => '', 'billing_city' => '', 'billing_state' => '', 'billing_zip' => '', 'billing_country' => '', 'shipping_address_1' => '', 'shipping_address_2' => '', 'shipping_city' => '', 'shipping_state' => '', 'shipping_zip' => '', 'shipping_country' => '', 'transaction_id' => 'PK-TN0LNO7XWR', 'invoice_id' => 'PK-PZ1WK636WR', 'tracking_id' => 216, 'transaction_time' => 1469014598, 'product_id' => 2354, 'product_name' => 'SEO Snapshot - Main', 'campaign_id' => 215, 'campaign_name' => 'SEO Snapshot', 'affiliate_first_name' => 'Bob', 'affiliate_last_name' => 'Jones', 'affiliate_email' => 'bob@jones.com', 'affiliate_commission_amount' => 4.99, 'affiliate_commission_percent' => 50, 'ref_affiliate_first_name' => null, 'ref_affiliate_last_name' => null, 'ref_affiliate_email' => null, 'ref_affiliate_commission_amount' => null, 'ref_affiliate_commission_percent' => null, 'buyer_tax_number' => null, 'buyer_tax_name' => null, 'tax_transaction_id' => null, 'tax_amount' => null, 'tax_percent' => null, 'coupon_code' => '', 'coupon_type' => '', 'coupon_rate' => '', 'custom_var1' => 123, 'custom_var2' => 'email@user.com', 'licenses' => ['HPLD-XSQW-KDW3-8HTD', 'AWDF-XADWR-HYTF-4T7B'], 'hash' => '9f02b0208c3eb0710d57b05a61d9f411d023fca6' 'verification_code' => 'e2288202ad23b877c3498a6db6214b5a417b75a4' ];
IPN Validation Function
<?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)); // 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; }
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
- 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-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 - 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
- live
- test
payment_processor
- stripe
- paypaladaptive
- paypalmarketplace
- braintree
- authnet
amount
buyer_ip
buyer_first_name
buyer_last_name
buyer_email
vendor_first_name
vendor_last_name
vendor_email
billing_address_1
billing_address_2
billing_city
billing_state
billing_zip
billing_country
shipping_address_1
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
product_name
campaign_id
campaign_name
affiliate_first_name
affiliate_last_name
affiliate_email
affiliate_commission_amount
affiliate_commission_percent
ref_affiliate_first_name
ref_affiliate_last_name
ref_affiliate_email
ref_affiliate_commission_amount
ref_affiliate_commission_percent
update_billing_url
next_billing_date
custom_{field}
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
hash
2.1.2.Affiliate IPN POST
Example Response
<?php $_POST = [ 'amount' => 9.99, 'buyer_first_name' => 'Ruggero', 'buyer_last_name' => 'Sandri-Boriani', 'tracking_id' => 216, 'transaction_time' => 1469014598, 'product_name' => 'SEO Snapshot - Main', 'campaign_name' => 'SEO Snapshot', 'affiliate_first_name' => 'Bob', 'affiliate_last_name' => 'Jones', 'affiliate_email' => 'bob@jones.com', 'affiliate_commission_amount' => 4.99, ];
PayKickstart’s Affiliate Instant Payment Notification (IPN) is a message service that automatically notifies affiliates of events related to PayKickstart transactions.
amount
buyer_first_name
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
campaign_name
affiliate_first_name
affiliate_last_name
affiliate_email
affiliate_commission_amount
2.2.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.
2.2.1.Get License Data
Example Request
<?php //Set up API path and method $base_url = "https://app.paykickstart.com/api/"; $route = "licenses/data"; $url = $base_url . $route; //Create request data string $data = http_build_query([ 'auth_token' => '3A0GTRFIJHYE', 'license_key' => 'D3WS-UCTG-IDFZ-ASHU' ]); //Execute cURL request $ch = curl_init(); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); $output = curl_exec($ch); curl_close($ch); //Output Response echo json_decode($output);
Example Response
{ "success": 0, "message": "", "data": { "license_key": "D3WS-UCTG-IDFZ-ASHU", "purchase_id": "PK-P0DHYTR0WZ", "product_id": 1234, "status": 1, "guid": null } }
This GET request returns license information for a specific license key
ARGUMENTS
license_key
The customer’s license key
auth_token
The Paykickstart vendor’s API Key
2.2.2.Get License Status
Example Request
<?php //Set up API path and method $base_url = "https://app.paykickstart.com/api/"; $route = "licenses/status"; $url = $base_url . $route; //Create request data string $data = http_build_query([ 'auth_token' => '3A0GTRFIJHYE', 'license_key' => 'D3WS-UCTG-IDFZ-ASHU' ]); //Execute cURL request $ch = curl_init(); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); $output = curl_exec($ch); curl_close($ch); //Output Response echo json_decode($output);
Example Response
{ "success": 1, "message": "", "data": { "valid": 1, "active": 1 } }
This GET request returns license status information for a specific license key
ARGUMENTS
license_key
The customer’s license key
auth_token
The Paykickstart vendor’s API Key
2.2.3.Activate License
Example Request
<?php //Set up API path and method $base_url = "https://app.paykickstart.com/api/"; $route = "licenses/activate"; $url = $base_url . $route; $post = true; //Create request data string $data = http_build_query([ 'auth_token' => '3A0GTRFIJHYE', 'license_key' => 'D3WS-UCTG-IDFZ-ASHU', 'guid' => '46B4560CC-128A-6EDA-439F-80623S7A' ]); //Execute cURL request $ch = curl_init(); if ($post) { curl_setopt($ch, CURLOPT_POSTFIELDS, $data); } else { $url = $url . "?" . $data; } curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); $output = curl_exec($ch); curl_close($ch); //Output Response echo json_decode($output);
Example Response
{ "success": 1, "message": "", "data": { "license_key": "A4FE-UPYH-EN5Z-PW5E", "status": 1, "guid": "46B4560CC-128A-6EDA-439F-80623S7A" } }
This POST request activates the license for a specific license key / GUID combination
ARGUMENTS
license_key
The customer’s license key
guid
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).
auth_token
The Paykickstart vendor’s API Key
2.2.4.Clear License ("De-Register")
Example Request
<?php //Set up API path and method $base_url = "https://app.paykickstart.com/api/"; $route = "licenses/clear"; $url = $base_url . $route; $post = true; //Create request data string $data = http_build_query([ 'auth_token' => '3A0GTRFIJHYE', 'license_key' => 'D3WS-UCTG-IDFZ-ASHU', ]); //Execute cURL request $ch = curl_init(); if ($post) { curl_setopt($ch, CURLOPT_POSTFIELDS, $data); } else { $url = $url . "?" . $data; } curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); $output = curl_exec($ch); curl_close($ch); //Output Response echo json_decode($output);
Example Response
{ "success": 1, "message": "License successfully cleared.", "data": [] }
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
ARGUMENTS
license_key
The customer’s license key
auth_token
The Paykickstart vendor’s API Key
2.2.5.Enable License
Example Request
<?php //Set up API path and method $base_url = "https://app.paykickstart.com/api/"; $route = "licenses/enable"; $url = $base_url . $route; $post = true; //Create request data string $data = http_build_query([ 'auth_token' => '3A0GTRFIJHYE', 'license_key' => 'D3WS-UCTG-IDFZ-ASHU' ]); //Execute cURL request $ch = curl_init(); if ($post) { curl_setopt($ch, CURLOPT_POSTFIELDS, $data); } else { $url = $url . "?" . $data; } curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); $output = curl_exec($ch); curl_close($ch); //Output Response echo json_decode($output);
Example Response
{ "success": 1, "message": "License successfully enabled.", "data": [] }
This POST request enables the license for being activated and verified
ARGUMENTS
license_key
The customer’s license key
auth_token
The Paykickstart vendor’s API Key
2.2.6.Disable License
Example Request
<?php //Set up API path and method $base_url = "https://app.paykickstart.com/api/"; $route = "licenses/disable"; $url = $base_url . $route; $post = true; //Create request data string $data = http_build_query([ 'auth_token' => '3A0GTRFIJHYE', 'license_key' => 'D3WS-UCTG-IDFZ-ASHU' ]); //Execute cURL request $ch = curl_init(); if ($post) { curl_setopt($ch, CURLOPT_POSTFIELDS, $data); } else { $url = $url . "?" . $data; } curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); $output = curl_exec($ch); curl_close($ch); //Output Response echo json_decode($output);
Example Response
{ "success": 1, "message": "License successfully disabled.", "data": [] }
This POST request disables the license from being activated or verified
ARGUMENTS
license_key
The customer’s license key
auth_token
The Paykickstart vendor’s API Key
2.3.Subscriptions
The subscriptions methods allow you to update a subscription’s status and set the next charge date, or to cancel the subscription.
2.3.1.Cancel Subscription
Example Request
<?php //Set up API path and method $base_url = "https://app.paykickstart.com/api/"; $route = "subscriptions/cancel"; $url = $base_url . $route; //Create request data string $data = http_build_query([ 'auth_token' => '3A0GTRFIJHYE', 'invoice_id' => 'PK-PORW20JQE5', 'cancel_at' => 1535702710, 'fire_event' => 1, 'charge_overage' => 1 ]); //Execute cURL request $ch = curl_init(); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); $output = curl_exec($ch); curl_close($ch); //Output Response echo json_decode($output);
Example Response
{ "success": 1, "message": "Subscription was cancelled" }
This POST request cancels an active subscription
ARGUMENTS
invoice_id
The unique Paykickstart purchase ID
auth_token
The Paykickstart vendor’s API Key
fire_event
Toggle whether or not Paykickstart should fire all the subscription cancellation events. This field is not required and default is 1 (true).
charge_overage
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).
cancel_at
Optional field to set a specific cancellation date (unix timestamp).
2.3.2.Reactivate Subscription
Example Request
<?php //Set up API path and method $base_url = "https://app.paykickstart.com/api/"; $route = "subscriptions/re-activate"; $url = $base_url . $route; //Create request data string $data = http_build_query([ 'auth_token' => '3A0GTRFIJHYE', 'invoice_id' => 'PK-PORW20JQE5', 'date' => 1535702710, ]); //Execute cURL request $ch = curl_init(); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); $output = curl_exec($ch); curl_close($ch); //Output Response echo json_decode($output);
Example Response
{ "code": 200, "status": true, "message": "Subscription was re-activated" }
This POST request reactivates a canceled subscription
ARGUMENTS
invoice_id
The unique Paykickstart purchase ID
auth_token
The Paykickstart vendor’s API Key
date
Set the next billing date (Unix timestamp).This field is required.
2.3.3.Up/Downgrade Subscription
Example Request
<?php //Set up API path and method $base_url = "https://app.paykickstart.com/api/"; $route = "subscriptions/change"; $url = $base_url . $route; //Create request data string $data = http_build_query([ 'auth_token' => '3A0GTRFIJHYE', 'invoice_id' => 'PK-PORW20JQE5', 'product_id' => 2759, 'charge_date' => 1578827340, 'first_charge' => 10, 'allowed_units' => 1000 ]); //Execute cURL request $ch = curl_init(); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); $output = curl_exec($ch); curl_close($ch); //Output Response echo json_decode($output);
Example Response
{ "code": 200, "message": "Subscription was changed" }
This POST request changes a subscription by activating the new subscription first, then cancelling the current subscription.
ARGUMENTS
auth_token
The Paykickstart vendor’s API Key
invoice_id
The unique Paykickstart purchase ID
product_id
The new product with which subscription should now be associated.
charge_date
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
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
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.
2.3.4.Subscriptions Usage
Example Request
<?php //Set up API path and method $base_url = "https://app.paykickstart.com/api/"; $route = "subscriptions/usage"; $url = $base_url . $route; //Create request data string $data = http_build_query([ 'auth_token' => '3A0GTRFIJHYE', 'invoice_id' => 'PK-PORW20JQE5', 'units' => 100, 'notes' => 'Generated a PDF Report' ]); //Execute cURL request $ch = curl_init(); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); $output = curl_exec($ch); curl_close($ch); //Output Response echo json_decode($output);
Example Response
{ "status_code": 200, "units_remaining": 300, "units_consumed": 700, "units_included": 1000 }
This POST request allows you to add usage to a subscription
ARGUMENTS
invoice_id
The unique Paykickstart purchase ID
auth_token
The Paykickstart vendor’s API Key
units
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
Add a comment/reason for the usage / credit. This field is not required.
2.4.Payments
The following API calls offer checkout and payment-related API functions.
2.4.1.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).
CUSTOMER PAYMENT DATA TOKENISATION
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.
FIRST PART:
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
ccExpireMonth
ccExpireYear
ccCSV
ccBtn
ppBtn
form
ccExpireYear
wt_account_holder_name
sepa_email
iban_number
sepaBtn
route_number
account_number
achBtn
ccExpireYear
billing_address_1
billing_address_2
billing_city
billing_state
billing_zip
billing_country
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.
SECOND PART:
Example Request
<?php //Set up API path and method $base_url = "https://app.paykickstart.com/api/"; $route = "purchase"; $url = $base_url . $route; $post = true; //Create request data string $data = http_build_query([ "auth_token" => "DLFJKGHW9834", "product" => 123456789, "plan" => 123456789, "first_name" => "Jack", "last_name" => "Sparrow", "email" => "jack@sparrow.com", "stripeToken" => "tok_1DrPnbGHbWjVjDgKnht3VpQW", "is_recurring" => 1, "price" => 12, "recurring_freq" => 1, "recurring_freq_type" => "day", "cycles" => 3, "ccNum" => 1985, "ccExpireYear" => 2020, "ccExpireMonth" => 12 ]); //Execute cURL request $ch = curl_init(); if ($post) { curl_setopt($ch, CURLOPT_POSTFIELDS, $data); } else { $url = $url . "?" . $data; } curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); $output = curl_exec($ch); curl_close($ch); //Output Response echo json_decode($output);
Example Response
{ "data": { "event": "sales", "mode": "live", "payment_processor": "stripe", "amount": "9.00", "buyer_ip": "127.0.0.1", "buyer_first_name": "Micky", "buyer_last_name": "Mouse", "buyer_email": "mickeymouse@gmail.com", "vendor_first_name": "Digital", "vendor_last_name": "Kickstart", "vendor_email": "test@vendor.com", "transaction_id": "PK-TORW2N8NE5", "invoice_id": "PK-PN7E5R9NW5", "tracking_id": "", "transaction_time": 1485940001, "product_id": 2425, "product_name": "TEst product", "campgaign_id": 258, "campaign_name": "Test Demo Campaign", "affiliate_first_name": "Jack", "affiliate_last_name": "Sparrow", "affiliate_email": "", "affiliate_commission_amount": "", "affiliate_commission_percent": "", "ref_affiliate_first_name": "", "ref_affiliate_last_name": "", "ref_affiliate_email": "", "ref_affiliate_commission_amount": "", "ref_affiliate_commission_percent": "", "licenses": "", "verification_code": "d0822d01a254c2f394265dae22de8aecdaed08e5" }, "url": null, "type": 1, "plan": 2425 }
In this step, the token generated from the first step is submitted along with your new purchase request data / instructions. Below are the arguments the API call accepts:
ARGUMENTS
auth_token
The Paykickstart vendor’s API Key. This field is required.
product
plan
affiliate_id
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
The buyer’s first name. This field is required.
last_name
The buyer’s last name. This field is required.
The buyer’s email address. This field is required.
ref_purchase
test_mode
price
quantity
coupon_code
split_selected
total_installments
price_per_installment
is_recurring
recurring_freq
recurring_freq_type
- day
- month
- year
This field is required when is_recurring is set.
cycles
has_trial
trial_amount
trial_days
capture_billing_address
-
- billing_address_1
- billing_address_2
- billing_city
- billing_state
- billing_zip
- billing_country
capture_shipping_address
-
-
- shipping_address_1
- shipping_address_2
- shipping_city
- shipping_state
- shipping_zip
- shipping_country
-
tos-read
ccNum
ccExpireYear
ccExpireMonth
custom_field[‘<FIELDNAME>’]
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
If you HAVE enabled Strong Customer Authentication (SCA) for your Stripe integration:
stripePi
stripePm
Stripe SEPA:
stripeSourceId
sepa
wt-type
Stripe ACH:
stripeSourceId
route_number
account_number
stripeBAToken
wt-type
Braintree Credit Card:
pay_method_nonce
Authorize.net:
dataDescriptor
COMMON.ACCEPT.INAPP.PAYMENT
dataValue
Easy Pay Direct:
epdSaleToken
epdCustomerToken
PayPal / Braintree PayPal:
paypal_ba_id
PART 3:
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
Params:
auth_token
invoice_id
stripePi
NOTE: you MUST submit the above request to the endpoint indicated above even if authorization fails or is not completed by the customer!
2.4.2.Update Credit Card
Example Request
<?php //Set up API path and method $base_url = "https://app.paykickstart.com/api/"; $route = "purchase/update-cc"; $url = $base_url . $route; $post = true; //Create request data string $data = http_build_query([ "invoice_id" => "PK-PMNW0V5NLP", "auth_token" => "52YjafEGX4P8", "stripeToken" => "tok_1DrPnbGHbWjVjDgKnht3VpQW", "ccNum" => "1985", "ExpireMonth" => 5, "ExpireYear" => 2022 ]); //Execute cURL request $ch = curl_init(); if ($post) { curl_setopt($ch, CURLOPT_POSTFIELDS, $data); } else { $url = $url . "?" . $data; } curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); $output = curl_exec($ch); curl_close($ch); //Output Response echo json_decode($output);
Example Response
{ "success": 1, "message": "Card updated" }
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.
ARGUMENTS
invoice_id
The unique Paykickstart purchase ID
Payment Processor Tokens*
The payment processor token is required. Please refer to the new purchase documentation on how to generate tokens and which parameters to set.
ccNum
The last 4 digits of the customer’s new credit card number
ExpireMonth
The customer’s new credit card expiry month
ExpireYear
The customer’s new credit card expiry year
auth_token
The Paykickstart vendor’s API Key
2.4.3.Get Purchase
Example Request
<?php //Set up API path and method $base_url = "https://app.paykickstart.com/api/"; $route = "purchase/get"; $url = $base_url . $route; //Create request data string $data = http_build_query([ 'auth_token' => '3A0GTRFIJHYE', 'id' => 'PK-PZ1WKO79ER' ]); //Execute cURL request $ch = curl_init(); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); $output = curl_exec($ch); curl_close($ch); //Output Response echo json_decode($output);
Example Response
{ "id": 6363, "pk_id": "PK-P5RLOOPDL7", "buyer_id": 4426, "customer": "1811054900", "product_id": 265, "product_name": "Test Demo Campaign", "plan_id": 2440, "plan_name": "Nogaprdo", "buyer_name": "test jack", "buyer_email": "test@jack.com", "buyer_country": "", "buyer_gender": "", "amount": 10, "trial_amount": null, "split_pay_recurring_frequency": null, "split_pay_recurring_frequency_type": null, "split_pay_amount": null, "split_pay_cycles": null, "trial_days": null, "split_pay": 0, "delayed_chain_payment": 0, "is_recurring": 1, "recurring_frequency": 1, "recurring_frequency_type": "day", "recurring_cycles": 10, "refund_period": 0, "coupon_id": null, "coupon_code": null, "coupon_type": null, "coupon_rate": null, "coupon_is_recurring": 0, "coupon_redeemed": 0, "original_amount": null, "vendor_id": 137, "vendor_first_name": "Digital", "vendor_last_name": "Kickstart", "vendor_email": "administrators@digitalkickstart.com", "gateway_id": 145, "affiliate_id": null, "affiliate_id_level_2": null, "commission_level_1": 50, "commission_level_2": 0, "funnel_id": 236, "funnel_plan_id": 626, "tracking_link_id": null, "visit_id": null, "tax_service_id": 1, "is_purchased": 1, "is_executed": 1, "execute_in_queue": 0, "custom_params": null, "browser": "Chrome", "platform": "OS X", "device": "Macintosh", "billing_address_1": null, "billing_address_2": null, "billing_city": null, "billing_state": null, "billing_zip": null, "billing_country": null, "shipping_address_1": null, "shipping_address_2": null, "shipping_city": null, "shipping_state": null, "shipping_zip": null, "shipping_country": null, "created_at": "2017-03-22 14:07:22", "updated_at": "2017-03-31 14:08:05", "update_cc_pw": null, "request_type": "embed", "parent_id": null, "base_currency": "USD", "transactions": [ { "id": 11175, "pk_id": "PK-T8OL140QL4", "purchase_id": 6363, "buyer_ip": "93.189.43.18", "amount": 12.1, "base_currency_conversion_id": 1258, "processor": "authnet", "processor_data": "{\"transaction\":{\"responseCode \":\"1\",\"rawResponseCode\":null,\"authCode\":\"IDCQZ8\",\"avsResultCode\":\"Y\",\"cvvResultCode\":\"P\",\"cavvResultCode\":\"2\",\"transactionId\":\"60020593016\",\"refTransID\":\"\",\"transHash\":\"37C8EB74F1BFADB91F0559833BF040A1\",\"testRequest\":\"0\",\"accountNumber\":\"XXXX1111\",\"accountType\":\"Visa\",\"messages\":{\"0\":{\"code\":\"1\",\"description\":\"This transaction has been approved.\"}},\"errors\":null,\"splitTenderPayments\":null,\"shipTo\":null,\"userFields\":null,\"secureAcceptance\":null},\"profile_response\":null,\"ref_id\":\"ref_1490191643\",\"messages\":{\"result_code\":\"Ok\",\"message\":{\"0\":{\"code\":\"I00001\",\"description\":\"Successful.\"}}}}", "gateway_id": 145, "paypal_txn_id": null, "is_refund": 0, "is_approved": 1, "dispute_status": null, "failed_email_sent": 0, "commission_refunded": 0, "cc_type": null, "cc_month": null, "cc_year": null, "cc_last4": null, "m_p_user_id": null, "cc_holder_name": null, "refund_end_date": "2017-03-22 14:03:07", "created_at": "2017-03-22 14:07:23", "updated_at": "2017-03-22 14:07:24", "tax_transaction_id": null, "tax_amount": null, "tax_percent": null }, { "id": 11243, "pk_id": "PK-TV3EV97ZLX", "purchase_id": 6363, "buyer_ip": "93.189.43.18", "amount": 12.1, "base_currency_conversion_id": 1378, "processor": "authnet", "processor_data": "{\"transaction\":{\"responseCode \":\"1\",\"rawResponseCode\":null,\"authCode\":\"NTGAWJ\",\"avsResultCode\":\"Y\",\"cvvResultCode\":\"P\",\"cavvResultCode\":\"2\",\"transactionId\":\"60020650883\",\"refTransID\":\"\",\"transHash\":\"7BADB6EFBF1ACC33CA8BB983F3627BE1\",\"testRequest\":\"0\",\"accountNumber\":\"XXXX1111\",\"accountType\":\"Visa\",\"messages\":{\"0\":{\"code\":\"1\",\"description\":\"This transaction has been approved.\"}},\"errors\":null,\"splitTenderPayments\":null,\"shipTo\":null,\"userFields\":null,\"secureAcceptance\":null},\"profile_response\":null,\"ref_id\":\"ref_1490278084\",\"messages\":{\"result_code\":\"Ok\",\"message\":{\"0\":{\"code\":\"I00001\",\"description\":\"Successful.\"}}}}", "gateway_id": 145, "paypal_txn_id": null, "is_refund": 0, "is_approved": 1, "dispute_status": null, "failed_email_sent": 1, "commission_refunded": 0, "cc_type": null, "cc_month": null, "cc_year": null, "cc_last4": null, "m_p_user_id": null, "cc_holder_name": null, "refund_end_date": "2017-03-23 14:03:08", "created_at": "2017-03-23 14:08:04", "updated_at": "2017-03-23 14:08:05", "tax_transaction_id": null, "tax_amount": null, "tax_percent": null } ], "subscriptions": [ { "id": 574, "purchase_id": 6363, "subscription_uuid": null, "count": 10, "split_count": null, "status": 0, "failed_attempts": 0, "trial_expire_notified": 0, "trial_ends": null, "next_date": "2017-04-01 14:07:24", "cancel_note": null, "cancelled_by": null, "cancel_at": "2017-03-31 14:08:05", "in_queue": 0, "attempted_at": "2017-03-31 14:08:05", "created_at": "2017-03-22 14:07:24", "updated_at": "2017-03-31 14:08:05" } ] }
Returns the purchase details.
ARGUMENTS
auth_token
The Paykickstart vendor’s API Key. This field is required.
id
2.4.4.Get Transaction
Example Request
<?php //Set up API path and method $base_url = "https://app.paykickstart.com/api/"; $route = "transaction/get"; $url = $base_url . $route; //Create request data string $data = http_build_query([ 'auth_token' => '3A0GTRFIJHYE', 'id' => 'PK-TZ1WKO79ER' ]); //Execute cURL request $ch = curl_init(); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); $output = curl_exec($ch); curl_close($ch); //Output Response echo json_decode($output);
Example Response
{ "id": 11320, "pk_id": "PK-TZ1WKO79ER", "purchase_id": 6363, "buyer_ip": "93.189.43.18", "amount": 12.1, "base_currency_conversion_id": 1791, "processor": "authnet", "processor_data": "{\"transaction\":{\"responseCode \":\"1\",\"rawResponseCode\":null,\"authCode\":\"3VPHMX\",\"avsResultCode\":\"Y\",\"cvvResultCode\":\"P\",\"cavvResultCode\":\"2\",\"transactionId\":\"60020781439\",\"refTransID\":\"\",\"transHash\":\"ECA6CC5198FE40EBC6DE60401351D365\",\"testRequest\":\"0\",\"accountNumber\":\"XXXX1111\",\"accountType\":\"Visa\",\"messages\":{\"0\":{\"code\":\"1\",\"description\":\"This transaction has been approved.\"}},\"errors\":null,\"splitTenderPayments\":null,\"shipTo\":null,\"userFields\":null,\"secureAcceptance\":null},\"profile_response\":null,\"ref_id\":\"ref_1490537286\",\"messages\":{\"result_code\":\"Ok\",\"message\":{\"0\":{\"code\":\"I00001\",\"description\":\"Successful.\"}}}}", "gateway_id": 145, "paypal_txn_id": null, "is_refund": 0, "is_approved": 1, "dispute_status": null, "failed_email_sent": 1, "commission_refunded": 0, "cc_type": null, "cc_month": null, "cc_year": null, "cc_last4": null, "m_p_user_id": null, "cc_holder_name": null, "refund_end_date": "2017-03-26 14:03:08", "created_at": "2017-03-26 14:08:06", "updated_at": "2017-03-26 14:08:07", "tax_transaction_id": null, "tax_amount": null, "tax_percent": null }
Returns the transaction details.
ARGUMENTS
auth_token
The Paykickstart vendor’s API Key. This field is required.
id
2.4.5.Get Transactions (last 100)
Example Request
<?php //Set up API path and method $base_url = "https://app.paykickstart.com/api/"; $route = "transactions"; $url = $base_url . $route; //Create request data string $data = http_build_query([ 'auth_token' => '3A0CKDSETE', 'created_at' => 1529316446 ]); //Execute cURL request $ch = curl_init(); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); $output = curl_exec($ch); curl_close($ch); //Output Response echo json_decode($output);
Example Response
{ "transactions":[ { "id":25324, "pk_id":"PK-TKE3MQN2WO", "purchase_id":10904, "buyer_ip":"188.64.175.190", "amount":"10.00", "coupon_code":null, "coupon_type":null, "coupon_rate":null, "shipping_charge":"0.00", "base_currency_conversion_id":61679, "processor":"stripe", "processor_data":"{\"id\":\"ch_1CudlTGi3a8JpZeBZ0iAnsdO\",\"object\":\"charge\",\"amount\":1000,\"amount_refunded\":0,\"application\":\"ca_6mCGmjSlaUQxHChZL3QrUPfHrKNWTw83\",\"application_fee\":null,\"balance_transaction\":\"txn_1CudlTGi3a8JpZeBkfTXGoIE\",\"captured\":true,\"created\":1533204639,\"currency\":\"usd\",\"customer\":\"cus_DLKQJl1hKZgW0c\",\"description\":\"SEO Snapshot Testing - SEO Snapshot - Main (copied) (copied)\",\"destination\":null,\"dispute\":null,\"failure_code\":null,\"failure_message\":null,\"fraud_details\":{},\"invoice\":null,\"livemode\":false,\"metadata\":{},\"on_behalf_of\":null,\"order\":null,\"outcome\":{\"network_status\":\"approved_by_network\",\"reason\":null,\"risk_level\":\"normal\",\"seller_message\":\"Payment complete.\",\"type\":\"authorized\"},\"paid\":true,\"receipt_email\":null,\"receipt_number\":null,\"refunded\":false,\"refunds\":{\"object\":\"list\",\"data\":{},\"has_more\":false,\"total_count\":0,\"url\":\"\\\/v1\\\/charges\\\/ch_1CudlTGi3a8JpZeBZ0iAnsdO\\\/refunds\"},\"review\":null,\"shipping\":null,\"source\":{\"id\":\"card_1CudlRGi3a8JpZeBU3L5qwoJ\",\"object\":\"card\",\"address_city\":null,\"address_country\":null,\"address_line1\":null,\"address_line1_check\":null,\"address_line2\":null,\"address_state\":null,\"address_zip\":null,\"address_zip_check\":null,\"brand\":\"Visa\",\"country\":\"US\",\"customer\":\"cus_DLKQJl1hKZgW0c\",\"cvc_check\":\"pass\",\"dynamic_last4\":null,\"exp_month\":1,\"exp_year\":2022,\"fingerprint\":\"fiQQPgJup0disG8o\",\"funding\":\"credit\",\"last4\":\"4242\",\"metadata\":{},\"name\":\"424242\",\"tokenization_method\":null},\"source_transfer\":null,\"statement_descriptor\":\"SEO Snapshot Testing\",\"status\":\"succeeded\",\"transfer_group\":null}", "refund_processor_data":null, "gateway_id":216, "paypal_txn_id":null, "is_refund":0, "is_refund_pending":0, "refund_pending_cleared_at":null, "refund_pending_check_reserved":0, "is_approved":1, "is_recovered":0, "is_pending":0, "pending_cleared_at":null, "pending_check_reserved":0, "pending_email_sent":0, "dispute_status":null, "failed_email_sent":0, "commission_refunded":0, "cc_type":"Visa", "cc_month":1, "cc_year":2022, "cc_last4":4242, "m_p_user_id":null, "cc_holder_name":"424242", "refund_end_date":"2018-09-01 10:09:10", "created_at":"2018-08-02 10:10:37", "refund_date":null, "updated_at":"2018-08-02 10:10:40", "tax_transaction_id":null, "tax_amount":null, "tax_percent":null, "buyer_tax_number":null, "buyer_tax_name":null, "landing_page":null }, { "id":25323, "pk_id":"PK-TMWQV9RXL4", "purchase_id":10903, "buyer_ip":"188.64.175.190", "amount":"10.00", "coupon_code":null, "coupon_type":null, "coupon_rate":null, "shipping_charge":"0.00", "base_currency_conversion_id":61679, "processor":"testmode", "processor_data":"testmode", "refund_processor_data":null, "gateway_id":null, "paypal_txn_id":null, "is_refund":0, "is_refund_pending":0, "refund_pending_cleared_at":null, "refund_pending_check_reserved":0, "is_approved":1, "is_recovered":0, "is_pending":0, "pending_cleared_at":null, "pending_check_reserved":0, "pending_email_sent":0, "dispute_status":null, "failed_email_sent":0, "commission_refunded":0, "cc_type":null, "cc_month":null, "cc_year":null, "cc_last4":"000", "m_p_user_id":null, "cc_holder_name":null, "refund_end_date":"2018-09-01 09:09:59", "created_at":"2018-08-02 09:59:39", "refund_date":null, "updated_at":"2018-08-02 09:59:39", "tax_transaction_id":null, "tax_amount":null, "tax_percent":null, "buyer_tax_number":null, "buyer_tax_name":null, "landing_page":null }, [..] }
Fetches the last 100 transactions (or 100 transactions up to the created_at date) for the associated account.
ARGUMENTS
auth_token
The Paykickstart vendor’s API Key. This field is required.
created_at
2.5.Affiliates
The following API calls deal with retrieving affiliate data and marketing materials
2.5.1.Get All Affiliates
Example Request
<?php //Set up API path and method $base_url = "https://dev.paykickstart.com/api/"; $route = "affiliates/all"; $url = $base_url . $route; //Create request data string $data = http_build_query([ "auth_token" => "DLFJKGHW9834", "campaign_id" => 123, ]); //Execute cURL request $ch = curl_init(); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); $output = curl_exec($ch); curl_close($ch); //Output Response echo json_decode($output);
Example Response
[ { "id": 319, "parent_id": null, "role": 1, "first_name": "Matt", "last_name": "Callen", "username": "supermatt@gmail.com", "email": "supermatt@gmail.com", "password": "$2y$10$WfGQqIqs.UNjWpIbPptukea7BbsYv21GuJhq4HK90FsC4vFeh82RG", "vendor_show_quick_start": 0, "affiliate_show_quick_start": 0, "is_premium": 1, "is_invited_user": 0, "basic_purchase_id": null, "premium_purchase_id": null, "company": "iNet Innovation", "skype": "", "phone": "", "address_1": "550 Congressional Blvd", "address_2": "Suite 125", "city": "Carmel", "state": "Indiana", "country": "United States", "zip": "46032", "tax_form_type": "w9", "tax_form": "123423437204_InetInnovation_W9_2015.pdf", "pdf_form": null, "status": 1, "vendor_status": 1, "image": "https://s3.amazonaws.com/img.paykickstart.com/vendor_profile_pics/Q5RIvM3g2h4T", "image_auto_generated": 0, "token": null, "subdomain": "j4vrb8vx", "auth_token": "CdG16eYJPjiQ", "remember_token": "dsdnuymXPdknoRQc9USy7OQpL8eZjSCBLbl6Z1ePfWLGMlw0rUBhnSXLj9Pj", "paypal_email": "paypal@inet.com", "paypal_secret": "cktHyhhdlQhGXHNq.gJAx0zfWBc", "paypal_token": "ZOcrlX46.bhXaA4z.fjjsrZTNLMC2dOE1LJaOMJioamwJ8jwZBDB8A", "paypal_note": null, "ip_address": "196.215.74.50", "refresh_permissions": 1, "created_at": "2016-06-20 13:23:10", "updated_at": "2016-11-15 02:34:14" }, { "id": 1, "parent_id": null, "role": 1, "first_name": "Mark", "last_name": "Thompson", "username": "mark@paykickstart.com", "email": "mark@searchcreatively.com", "password": "$2y$10$WfGQqIqs.UNjWpIbPptukea7BbsYv21GuJhq4HK90FsC4vFeh82RG", "vendor_show_quick_start": 0, "affiliate_show_quick_start": 0, "is_premium": 1, "is_invited_user": 0, "basic_purchase_id": null, "premium_purchase_id": null, "company": "Pay Kickstart", "skype": "", "phone": "", "address_1": "1234 Hello Dr", "address_2": "", "city": "Charlotte", "state": "North Carolina", "country": "United States", "zip": "27187", "tax_form_type": "w9", "tax_form": "1473450237_mark-thompson-w9.pdf", "pdf_form": null, "status": 1, "vendor_status": 1, "image": "https://s3.amazonaws.com/img.paykickstart.com/vendor_profile_pics/YiwuGUU4OlhK", "image_auto_generated": 0, "token": null, "subdomain": "app", "auth_token": "3A0CjgqBXafhE", "remember_token": "MRbY6Kh0ak3MHE6v5uxPQf6XHN5ufZ0jKM1UEPPjhJy7h7lDOnOo3I8mu9bC", "paypal_email": "mark@searchcreatively.com", "paypal_secret": "8RPIJfLD9VoiOZDSUORiHbn10tQ", "paypal_token": "PNEnKsvFhxNXn1XK.fjjsrZEDj8.Kn-QOAafKv4po6UNVPe71lwcMA", "paypal_note": null, "ip_address": "174.109.159.232", "refresh_permissions": 0, "created_at": "2015-03-30 07:37:41", "updated_at": "2016-11-15 08:38:46" }, { "id": 431, "parent_id": null, "role": 3, "first_name": "Jasmin", "last_name": "Craft", "username": "jcraft@gmail.com", "email": "jcraft@gmail.com", "password": "$2y$10$Ba6xTd0M01hmMdrMug5n0OrZ.Am4H4aJxTFa1C8yiQqWPpDlaxPIq", "vendor_show_quick_start": 1, "affiliate_show_quick_start": 0, "is_premium": 0, "is_invited_user": 0, "basic_purchase_id": null, "premium_purchase_id": null, "company": null, "skype": "", "phone": "", "address_1": null, "address_2": null, "city": null, "state": "Indiana", "country": "United States", "zip": null, "tax_form_type": null, "tax_form": null, "pdf_form": null, "status": 1, "vendor_status": 1, "image": "https://s3.amazonaws.com/img.paykickstart.com/vendor_profile_pics/5s0USumyKOPL", "image_auto_generated": 1, "token": null, "subdomain": "app", "auth_token": "dCD3P7VSRkX2", "remember_token": "eLn4lX1aZc7dM3KqNXT7rZeokWHVPC492kH9mrYFkUd7BKa8g8qdDUxg6UXa", "paypal_email": null, "paypal_secret": null, "paypal_token": null, "paypal_note": null, "ip_address": "104.137.223.89", "refresh_permissions": 1, "created_at": "2016-08-25 19:29:46", "updated_at": "2016-09-08 19:54:01" } ]
Returns all the affiliate’s details for a specified campaign.
ARGUMENTS
auth_token
The Paykickstart vendor’s API Key. This field is required.
campaign_id
2.5.2.Get Affiliate
Example Request
<?php //Set up API path and method $base_url = "https://app.paykickstart.com/api/"; $route = "affiliate"; $url = $base_url . $route; //Create request data string $data = http_build_query([ 'auth_token' => '3A0CKD9XafhE', 'campaign_id' => 146, 'affiliate' => 'affiliate@email.com' ]); //Execute cURL request $ch = curl_init(); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); $output = curl_exec($ch); curl_close($ch); //Output Response echo json_decode($output);
Example Response
{ "affiliate": { "id": 1430, "parent_id": null, "role": 2, "first_name": "Paul", "last_name": "English", "username": "paulenglish@gmail.com", "email": "paulenglish@gmail.com", "vendor_show_quick_start": 1, "affiliate_show_quick_start": 0, "is_premium": 1, "is_invited_user": 0, "basic_purchase_id": 7445, "premium_purchase_id": 7446, "company": "", "skype": "", "phone": "", "address_1": "", "address_2": "", "city": "", "state": "North Island", "country": "New Zealand", "zip": "", "tax_form_type": null, "tax_form": null, "pdf_form": null, "status": 1, "vendor_status": 1, "image": "https://s3.amazonaws.com/img.paykickstart.com/vendor_profile_pics/Qoy96K16AH43", "image_auto_generated": 0, "token": null, "subdomain": "yk3xpk3x", "auth_token": "8M0VEULQIj2b", "paypal_email": "mobilesiteapplications@gmail.com", "paypal_secret": "ZXOt3apj3C14RRwOo0G48kQxKDU", "paypal_token": "JhazpY6OIlhYEHmd.fjjsraT9kOPc.BdVNyYnIFg7YVN3AJQnFYMyQ", "paypal_note": null, "ip_address": "219.88.236.189", "refresh_permissions": 0, "created_at": "2016-10-11 11:24:33", "updated_at": "2016-11-23 12:13:03" }, "links": [ "http://paykstrt.local/2107/1430" ] }
Returns the affiliate’s details and links.
ARGUMENTS
auth_token
The Paykickstart vendor’s API Key. This field is required.
campaign_id
affiliate
2.5.3.Get Promo Material
Example Request
<?php //Set up API path and method $base_url = "https://dev.paykickstart.com/api/"; $route = "promo-material"; $url = $base_url . $route; //Create request data string $data = http_build_query([ "auth_token" => "DLFJKGHW9834", "campaign_id" => 123, ]); //Execute cURL request $ch = curl_init(); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); $output = curl_exec($ch); curl_close($ch); //Output Response echo json_decode($output);
Example Response
{ "banner": [ { "id": 95, "product_id": 246, "campaign_title": "Banner #1 - 300x250", "notes": "Launch Banner", "material_type": "banner", "banner_url": "https://s3.amazonaws.com/docs.paykickstart.com/banner-images/1473449008_banner-300x250-a.jpg", "banner_size": "", "email_text": "", "created_at": "-0001-11-30 00:00:00", "updated_at": "2016-09-21 22:42:58" }, { "id": 102, "product_id": 246, "campaign_title": "Banner #2 - 300x250", "notes": "Launch Banner", "material_type": "banner", "banner_url": "https://s3.amazonaws.com/docs.paykickstart.com/banner-images/1474487017_banner-300x250-b.jpg", "banner_size": "", "email_text": "", "created_at": "-0001-11-30 00:00:00", "updated_at": "-0001-11-30 00:00:00" }, { "id": 103, "product_id": 246, "campaign_title": "Banner #3 - 100x72", "notes": "Launch Banner", "material_type": "banner", "banner_url": "https://s3.amazonaws.com/docs.paykickstart.com/banner-images/1474487045_banner-100x72-a.jpg", "banner_size": "", "email_text": "", "created_at": "-0001-11-30 00:00:00", "updated_at": "-0001-11-30 00:00:00" } ], "email": [ { "id": 115, "product_id": 246, "campaign_title": "Pre-Launch Webinar", "notes": "Send Jan 11th-12th", "material_type": "email", "banner_url": "", "banner_size": "", "email_text": "{\"subject\":\"[Register] 92% of top Clickbank products use this... (trick EXPOSED)\n[Live Event] Simple \"trick\" EXPOSED...3-5x sales page booster!\n[1/13] Top-Selling product FORMULA exposed! (register now)\",\"body\":\"<p>This Tuesday, the 13th at 11:00AM EST there is<br />\na can't miss, one-time event that is being held by<br />\ntwo marketers who both run 8-figure publishing<br />\ncompanies.</p>\n\n<p>Register for the live event:<br />\n{{$tracking_link}}</p>\n\n<p>During this live training, they are going to be<br />\nrevealing:</p>\n\n<p>- the 1 "trick" that top-selling products on<br />\nClickbank, JV Zoo, and WarriorPlus are using<br />\nto generate thousands of buyers and 6-7 figure<br />\npaydays.</p>\n\n<p>- how to increase sales page conversion rates<br />\nby 3-5x in ONE DAY.</p>\n\n<p>- how to replicate the same type of videos that<br />\nare used by 95% of the top selling vendors on<br />\nClickbank - each that generate thousands per day<br />\nin revenue.</p>\n\n<p>- a live demo at the new EasyVSL software that<br />\nmakes creating high-converting video sales letters<br />\npoint-and-click easy WITHOUT having to hire or pay<br />\nfor professionals.</p>\n\n<p>This will be a one-time only event.</p>\n\n<p>Click here to reserve your FREE spot.<br />\n{{$tracking_link}}</p>\n\n<p>Looking forward to the training event!</p>\n\n<p>To your success,<br />\nNAME</p>\n\"}", "created_at": "-0001-11-30 00:00:00", "updated_at": "-0001-11-30 00:00:00" }, { "id": 117, "product_id": 246, "campaign_title": "Launch Swipe #2", "notes": "Send Jan 13th", "material_type": "email", "banner_url": "", "banner_size": "", "email_text": "{\"subject\":\"[NEW] Create better, faster, easier, & automated videos\nEasy video creation...unlike anything you've seen!\nAre your sales videos TANKING...? (here is why)\nWant better results from your sales videos? (then watch this)\",\"body\":\"<p>If you are a lot like me...</p>\n\n<p>...you don't want to have to pay hundreds or thousands<br />\non a professional to create high-converting videos.</p>\n\n<p>...you don't want to spend all day messing around with<br />\ncomplicated software.</p>\n\n<p>...you don't want to waste time and energy creating<br />\nvideos that don't generate leads and sales.</p>\n\n<p>Well - good news (click here)!</p>\n\n<p>{{$tracking_link}}</p>\n\n<p>Mark Thompson and Matt Callen - two of the best in the<br />\nbiz for creating amazing software for marketers (you will<br />\nactually use) - have created a SIMPLE, yet effective<br />\nsoftware for creating sales videos fast & easy.</p>\n\n<p>...oh yeah - and most importantly, actually CONVERT!</p>\n\n<p>Its called EasyVSL and it JUST went live!<br />\nHere is what EasyVSL can do...</p>\n\n<p>- Creates Easy and Powerful Sales Videos<br />\n- Easy presentation style videos, faster then using<br />\nPowerpoint and way better quality!<br />\n- Point & Click Easy - Learning Curve is in Minutes<br />\n- Over 25+ Professional Slide Themes/Backgrounds<br />\n- Powerpoint-Easy Text & Graphics Editing<br />\n- Over 30+ Fonts<br />\n- Eye-Popping Slide Animation Options<br />\n- Easy 1-Click Audio/Slide Sync<br />\n- Upload-Ready, HD Quality Export in MP4 Format<br />\n- Direct Upload to YouTube Account<br />\n- Manage all VSLs in one Interface<br />\n- Save Hours, Even Days Creating High-Converting VSLs!</p>\n\n<p>The best part is EasyVSL is Adobe Air based, which<br />\nmeans is runs smoothly on both Mac and PC.</p>\n\n<p>Watch a live demo of EasyVSL, plus see all of the features<br />\nabove in action.</p>\n\n<p>{{$tracking_link}}</p>\n\n<p>This is currently available at an extremely low price.<br />\nHowever this price will not be available for long.</p>\n\n<p>For a short time you can get a LIFETIME copy of<br />\nEasyVSL, creating an unlimited number of videos<br />\nat a ONE-TIME investment.</p>\n\n<p>NOW is the time to grab your copy - before the price<br />\nsky-rockets!</p>\n\n<p>{{$tracking_link}}</p>\n\n<p>To your success,<br />\nNAME</p>\n\"}", "created_at": "-0001-11-30 00:00:00", "updated_at": "-0001-11-30 00:00:00" } ], "contests": [ { "id": 32, "product_id": 246, "user_id": 137, "type": 0, "name": "Main Launch Contest (Jan 13-20th)", "affiliates_count": 20, "show_affiliates_count": 1, "start_date": "2016-01-13 08:00:00", "end_date": "2016-01-20 08:00:00", "notes": "$50,000 Prize Contest", "created_at": "2016-09-21 22:54:21", "updated_at": "2016-09-21 22:54:21" }, { "id": 33, "product_id": 246, "user_id": 137, "type": 0, "name": "Weekend Contest (Jan 16-17th)", "affiliates_count": 20, "show_affiliates_count": 1, "start_date": "2016-01-16 08:00:00", "end_date": "2016-01-17 08:00:00", "notes": "$5,000 Weekend Contest", "created_at": "2016-09-21 22:55:30", "updated_at": "2016-09-21 22:55:30" } ] }
Returns all the marketing material for a specified campaign.
ARGUMENTS
auth_token
The Paykickstart vendor’s API Key. This field is required.
campaign_id
2.6.Coupons
This section describes all the available coupon API calls
2.6.1.Create Coupon
Example Request
<?php //Set up API path and method $base_url = "https://app.paykickstart.com/api/"; $route = "coupons"; $url = $base_url . $route; $post = true; //Create request data string $data = http_build_query([ 'auth_token' => '3A0CKDSETE', 'coupon_name' => 'My Coupon Name', 'coupon_code' => 'discountcode', 'coupon_rate' => '25', 'coupon_type' => 'amount', 'coupon_apply_to' => [1,3], 'coupon_start_date' => '06/20/2017 11:00 PM', 'coupon_end_date' => '06/30/2017 11:00 AM', 'coupon_max_redemption' => null, 'plan_ids' => [ 2382, 2391 ], 'product_id' => 223 ]); //Execute cURL request $ch = curl_init(); if ($post) { curl_setopt($ch, CURLOPT_POSTFIELDS, $data); } else { $url = $url . "?" . $data; } curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); $output = curl_exec($ch); curl_close($ch); //Output Response echo json_decode($output);
Example Response
{ "success": true, "coupon_id": 27, "message": "Coupon was created successfully" }
Creates a new coupon.
ARGUMENTS
auth_token
The Paykickstart vendor’s API Key. This field is required.
coupon_name
coupon_code
The Unique coupon code for your coupon.
coupon_rate
The value of your coupon.
coupon_type
The type of value – accepted arguments are: “amount” and “percentage”
coupon_apply_to
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
The start date of when the coupon is active
coupon_end_date
The end date of when the coupon is active
coupon_max_redemption
The maximum number of times a coupon may be redeemed
plan_ids
An array of plan ids which the coupon should be applied to
product_id
The campaign id which the coupon should be applied to
2.7.Leads
2.7.1.Confirm Lead
Example Request
<?php //Set up API path and method $base_url = "https://app.paykickstart.com/api/"; $route = "leads/confirm"; $url = $base_url . $route; //Create request data string $data = http_build_query([ "auth_token" => "3A0GTRFIJHYE", "lead_id" => "PK-L123456789", "lead_campaign_id" => 15 ]); //Execute cURL request $ch = curl_init(); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); $output = curl_exec($ch); curl_close($ch); //Output Response echo json_decode($output);
Example Response
{ "success": true, "message": "Lead is confirmed" }
Allows the user to confirm an unconfirmed lead.
ARGUMENTS
auth_token
The Paykickstart vendor’s API Key. This field is required.
lead_id
lead_campaign_id
2.8.Customer Portal
2.8.1.Login Customer
Example Request
<?php //Set up API path and method $base_url = "https://app.paykickstart.com/api/"; $route = "billing-customer"; $url = $base_url . $route; //Create request data string $data = http_build_query([ "auth_token" => "3A0GTRFIJHYE", "email" => "donald@duck.com" ]); //Execute cURL request $ch = curl_init(); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); $output = curl_exec($ch); curl_close($ch); //Output Response echo json_decode($output);
Example Response
{ "status": true, "secret": "eyJpdiI6ImNkMW1RSTVDYTNwbjU5TjFcL2lmdGx3PT0iLCJ2YWx1ZSI6InVMRVc3VUZNRlcwZzlsME1zSjhyTFE9PSIsIm1hYyI6IjlhOGM1YTQyMDRkMGIxN2ZmNjk2MzkxNTZkMWZjNDljMGIxMTJmMzdkYWUxYzlhYmU3YmQ4ZmRlODdlZjBkODIifQ==" }
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).
ARGUMENTS
auth_token
The Paykickstart vendor’s Platform settings API Key. This field is required.
The email address of the customer.
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.