Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If your account requires FraudNet, please be sure to send the FraudNet data when calling import order and confirmPayPal under the paypalClientMetadataId field.

EXAMPLE PAYPAL EXPRESS CHECKOUT FUNNEL

...

Checkout Page

Step 1: Import Click - https://api.konnektive.com/landers/clicks/import/?

Customer lands on the ‘presellPage’ of the funnel and a click is imported using the Import Click endpoint.

  • Be sure to include pageType=presellPage and the requestUri (include affiliate tracking string for reporting)

The response from this call will contain a sessionId which should be sent on all subsequent API calls for this session.

SUCCESS
Code Block
{
    "result": "SUCCESS",
    "message": {
        "sessionId": "a27dbdf0a6e047dc84c5cc542e7608c3"
    }
}

Lead Page

Step 2: Import Lead - https://api.checkoutchamp.com/leads/import/?

Customer proceeds to the next page in the funnel, the 'leadPage', and another click is imported using the Import Click endpoint.

  • Be sure to include pageType=leadPage and sessionId

Info

If this is the first page of the funnel -

Send requestUri (include affiliate tracking string for reporting) instead of sessionId.

The response from this call will contain a sessionId which should be sent on all subsequent API calls for this session.

Step 3: Import Lead - https://api.konnektive.com/leads/import/?

Once the customer fills in and submits the lead form, a new lead is created with the Import Lead endpoint.

  • Be sure to include the sessionId that was returned from your first Import Click call.

The response from a properly formed import lead call will contain an orderId. Save this value for steps 5, 6, 8, & 10.

SUCCESS
Code Block
{
    "result": "SUCCESS",
    "message": {
        "orderId": "5FFF3B1F5D",
        "orderStatus": "PARTIAL",
        "campaignId": 6,
        "firstName": "Boss",
        "lastName": "Cat",
        "emailAddress": "BossCat@fakeemail.com",
        "phoneNumber": "1231231234",
        "shipAddress1": "100 Alley Cat Lane",
        "billShipSame": true,
        "shipCountry": "US",
        "sessionId": "a27dbdf0a6e047dc84c5cc542e7608c3",
        "userAgent": "Mozilla\/5.0 (X11; Linux i686) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/57.0.2987.98 Safari\/537.36",
        "acceptHeader": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,*\/*;q=0.8",
        "ipAddress": "107.142.169.24",
        "httpReferer": "https:\/\/myserver.com\/PAYPAL_TEST\/",
        "orderType": "NEW_SALE",
        "shipFirstName": "Boss",
        "shipLastName": "Cat",
        "customerId": 67,
        "agentUserId": 202,
        "dateUpdated": "2017-07-19 16:40:32"
    }
}

Checkout Page

Step 4: Import Click - https://api.konnektive.com/landers/clicks/import/?

After a successful submission of the Lead Page, the customer proceeds to the next page in the funnel, the 'checkoutPage', and another click is imported using the Import Click endpoint.

...

The Checkout page contains the PayPal button. Call the Import Click API when the page loads to obtain a session.

  • Be sure to include pageType=checkoutPage and sessionId

Info

If this is the first page of the funnel -

Send requestUri (include affiliate tracking string for reporting) instead of sessionId.

The response from this call will contain a sessionId which should be sent on all subsequent API calls for this session.

Step

...

2: Import Order - https://api.konnektive.com/order/import/?

This is the part of your funnel that will contain the Paypal Express checkout button. It is important that you bind the Import Order call to the Paypal PayPal checkout button. When your customer clicks on that button, a partial order will be sent to Konnektive and the user will be sent to Paypal.

  • Be sure to include the sessionId and orderId from the previous steps, if known

  • Card details are optional. PayPal may accept credit cards if your account is setup properly. In most cases you will not pass card details.

There are three Paypal four PayPal specific requirements that need to be passed to Import Order:

  1. paySource needs to be set to 'PAYPAL'

...

  1. forceMerchantId is the value assigned to your PayPal Commerce gateway, found on your gateway list.

...

  1. redirectsTo is the url of the page in your funnel that PayPal will redirect to on a successful transaction.

  2. errorRedirectsTo is the url of the page in your funnel that

...

  1. PayPal will redirect to on a

...

  1. cancelled transaction.

SUCCESS

A successful response will return a MERC_REDIRECT exception to the page along with a PayPal url.

Code Block
{
    "result": "SUCCESSMERC_REDIRECT",
    "message": {
        "orderId": "5FFF3B1F5D",
        "ipAddress": "107.142.169.24",
        "sourceId": null,
        "sourceValue1": null,
        "sourceValue2": null,
        "sourceValue3": null,
        "sourceValue4": null,
        "sourceValue5": null,
        "shipCarrier": null,
        "shipMethod": null,
        "profileName": null,
        "dateCreated": "2017-07-19 15:54:23",
        "orderType": "NEW_SALE",
        "orderStatus": "PARTIAL",
        "reviewStatus": null,
        "totalAmount": null,
        "campaignName": "PAYPAL_TEST",
        "orderValue": null,
        "customerId": 67,
        "name": "Boss Cat",
        "emailAddress": "BossCat@fakeemail.com",
        "phoneNumber": "1231231234",
        "firstName": "Boss",
        "lastName": "Cat",
        "companyName": null,
        "address1": "100 Alley Cat  Lane",
        "address2": "Apt 6",
        "shipmentInsured": null,
        "shipmentInsurancePrice": null,
        "insuranceCharged": 0,
        "city": "KittyCity",
        "state": "GA",
        "country": "US",
        "postalCode": "30000",
        "shipFirstName": "Boss",
        "shipLastName": "Cat",
        "shipCompanyName": null,
        "shipAddress1": "100 Alley Cat  Lane",
        "shipAddress2": "Apt 6",
        "shipCity": "KittyCity",
        "shipState": "GA",
        "shipCountry": "US",
        "shipPostalCode": "30000",
        "custom1": null,
        "custom2": null,
        "custom3": null,
        "custom4": null,
        "custom5": null,
        "paySource": null,
        "cardType": null,
        "cardLast4": null,
        "cardExpiryDate": null,
        "achAccountHolderType": null,
        "achAccountType": null,
        "achRoutingNumber": null,
        "achNameOnAccount": null,
        "achAccountNumber": null,
        "couponCode": null,
        "agentUserId": 202,
        "basePrice": null,
        "baseShipping": null,
        "voiceLogNumber": null,
        "discountPrice": "0.00",
        "salesTax": null,
        "shipUpcharge": null,
        "shipProfileId": null,
        "currencySymbol": "$",
        "campaignId": 6,
        "merchantTxnId": null,
        "originalCycleNumber": null,
        "subTotal": null,
        "shipTotal": null,
        "taxTotal": null,
        "totalDiscount": null,
        "amountPaid": null,
        "items": null,
        "paypalUrl": "https:\/\/www.sandbox.paypal.com\/cgi-bin\/webscr?cmd=_express-checkout&token=EC-5BA439844N709200Purl": "https://redirecttheuserhere.com"
    }
}

Step 6: Confirm Paypal - https://api.konnektive.com/transactions/confirmPaypal/?

Once the Import Order call is performed the customer will be redirected to the PayPal login page (or to PayPal’s guest checkout page if the “guestCheckout” option is enabled on the mid).

After the transaction in PayPal the customer will be redirected by PayPal to your salesUrl (from step 5) with a query string appended containing three parameters: paypalAccept, token, and PayerId.

(Example: https://myserver.com/PAYPAL_TEST/checkout.php?paypalAccept=1&token=EC-31442014591217430&PayerID=GC6MU6RAZE3TW )

If using PayPalCommerce then paypalAccept and ba_token

(Example: https://myserver.com/PAYPAL_TEST/checkout.php?paypalAccept=1&ba_token=2345234523454 )

Confirm Paypal endpoint is called to finalize the transaction.

  • Be sure to include the token, PayerID, and orderId values

  • For PayPal Commerce, be sure to pass ba_token as baToken

Note

Also include the following values if they were passed in via Import Order and you are not using Import Lead call:

  • emailAddress

  • phoneNumber

  • couponCode

  • shipProfileId

  • salesTax

SUCCESS

...

This example script can be used to redirect the consumer to PayPal

Code Block
if (result === "MERC_REDIRECT") {
    if (message && message.url) {
               "price": "50.00",
                "initialSalesTax": "0.00",
                "customSalesTax": "",
                "refundRemaining": "50.00",
                "purchaseStatus": "",
                "billingCycleType": "",
                "finalBillingCycle": "",
                "isPreauthVoid": "0",
                "nextBillDate": "",
                "trialEnabled": "",
                "trialType": "",
                "regularPrice": "",
                "productQty": "1",
                "cycle1_billDelay": "",
                "cycle2_price": "",
                "cycle2_shipPrice": "",
                "cycle2_isShippable": "0",
                "cycle2_billDelay": "",
                "cycle3_price": "",
                "cycle3_shipPrice": "",
                "cycle3_isShippable": "0",
                "cycle3_billDelay": "",
                "lastCustomCycle": "0",
                "purchaseCycle": "",
                "txnType": "SALE",
                "cancellationScheduled": "0",
                "cancelAfterDate": "",
                "billingCycleNumber": "1",
                "staggerIntervalCycles": "",
                "staggerFulfillments": "0"
            }
        ]
    window.location.href = message.url;
    }
}

Upsell Pages

Step 7: Import Click - https://api.konnektive.com/landers/clicks/import/?

...

After all upsells the customer finally lands on the 'thankyouPage' Thank You (receipt) page and another click is imported using the Import Click endpoint.

...

Confirm Order is called to send the customer’s their customer a confirmation email immediately.

...