For Developers

Hosted Solution

Transaction Flow

We have built our Hosted solution for merchants looking for an easy and fast integration, without taking the liability and responsibility of credit card insertion (yes, this solution will keep you out of PCI compliance scope)! This means that as soon as the shopper has chosen to pay with Splitit on your checkout, you will be able to redirect him to Splitit pages.

Illustration:

Implementation

Before starting the Hosted solution API implementation, make sure to read our API Documentation Introduction and continue with the following workflow:

1. Login
First, in order to connect to our services, you will need to authenticate yourself and get a SessionId.

 

Request:

{
    "UserName": "{{UserName}}",
    "Password": "{{Password}}"
}

Response (partial response displayed)

{
    "ResponseHeader": {
        "Succeeded": true,
        "Errors": null
    },
    "SessionId": "d76829c1-1234-5678-9012-8b2f63c7aadb"
}

 

2. Initiate Installment Plan

Call Initiate Service (from server side) with the SessionId, order details (amount, shopper information, billing address) and exit Urls (SuccessUrl, CancelUrl).
The service response will include a checkout Url which you can use for opening the Splitit payment wizard.

 

Request:

{
  "RequestHeader": {
    "SessionId": "{{SessionId}}",
    "ApiKey": "{{ApiKey}}"
  },
  "PlanData": {
    "Amount": {"Value": 50,"CurrencyCode": "USD"},
    "NumberOfInstallments": 3,    
    "RefOrderNumber": "012AB",
    "AutoCapture": true,
    "Attempt3DSecure": false
  },
  "BillingAddress": {
    "AddressLine": "260 Madison Avenue.",
    "AddressLine2": "Appartment 1",
    "City": "New York",
    "State": "NY",
    "Country": "USA",
    "Zip": "10016"
  },
  "ConsumerData": {
    "FullName": "John Smith",
    "Email": "JohnS@splitit.com",
    "PhoneNumber": "1-844-775-4848",
    "CultureName": "en-us"
  },
  "PaymentWizardData": {
    "RequestedNumberOfInstallments": "2,3,4"
  },
  "RedirectUrls": {
    "Succeeded": "https://www.success.com/",
    "Failed": "https://www.failed.com/",
    "Canceled": "https://www.canceled.com/"
  },
  "EventsEndpoints": {
    "CreateSucceeded": "https://www.async-success.com/"
  }
}

Response (partial response displayed)

{    
    "ResponseHeader": {
        "Succeeded": false,
        "Errors": []
    },
  "CheckoutUrl": "https://checkout-dev.splitit.com",    
    "PublicToken": "2b5e8a83-9ca5-4c2c-9ae5-e60d44b35415",
}

 

 

3. Redirect from merchant checkout to the Splitit payment form

After receiving a checkout Url from the former response, you will be able to redirect the shopper to the Splitit payment wizard to complete the payment process.

Optional – In order to provide a better shopping experience, you can instead open the payment form as a floating iframe overlay to your website. To obtain this, please follow the steps below:

Add following code in the <header> tag:

<head>
      <script id="splitit-form-loader" src="{URL}/js/payment-form-loader.js"></script>
</head>

Remark – {URL} :

Add following code in the <body> tag:

<body>
     <div>
          <button onclick="loadSplititPaymentForm('{checkoutURL}')">Open Splitit IFrame</button>
     </div>
     <div id="splitit-payment-form" class="iframe-container"></div>
</body>

Remark – {checkoutURL}The url that was returned from the initiate call


4. Redirect back from the Splitit payment form to the merchant checkout and closing the order 

After a payment is completed (or canceled by the shopper), the shopper will be redirected back to the exit Urls defined in the previous call (SuccessUrl or CancelUrl). The redirect Url will also include the unique InstallmentPlanNumber and your ReferenceOrderNumber that will help you close the order on your end.

  1. Remarks:
    • Before you close the order on your end, it is highly recommended that you run a VerifyPayment request to the Splitit server in order to verify that the payment was done successfully via Splitit. This step is required to prevent: (A) unauthorized or faked success Urls, (B) prevent false “order closed” notification without the payment actually being completed on the Splitit server.
    • To prevent rare cases where the order has been paid via the Splitit payment form but the redirection failed (example: network problem or merchant server temporary downtime), it is also recommended to set the CreateSucceeded property (under EventsEndpoints object of the Initiate service) with a dedicated Url (see previous step). This Url will be called asynchronously from the Splitit server after the plan is created successfully. This is done to confirm that the caller is notified that the plan has been created.
    • In case you have decided to open the payment form as a floating iframe (see previous section), it’s not mandatory to populate the canceled redirection property (under RedirectUrls object of the Initiate service). In this case, when clicking “cancel” on the payment form, the form will be closed with no further redirection.
  2. (Optional) Start installments:
    A scenario in which you have decided not to capture your first installment automatically on creation but rather hold with the first charge until product is shipped (by setting "AutoCapture": false in the Initiate Service), you will need to call the StartInstallments service. This request will trigger the first charge of the installment plan.

     

You are done!
The plan has been created and the process is now in progress.

Interested in Splitit?

Leave your details so we can be in touch

Thank you for contacting us

We appreciate your interest and will be in touch shortly

BACK TO WEBSITE