Skip to content

Backend Integration (Online Checkout)

This guide walks through integrating WeGetFinancing at checkout from a self-developed platform. If you use a standard shopping cart, start with a ready-made plugin instead, or email integrations@wegetfinancing.com so we can help.

For copy-paste request snippets in many languages, see the Create Request reference.

A complete online-checkout integration has four steps:

  1. Create a financing request. When the customer chooses WeGetFinancing at checkout, your back end POSTs the cart and customer details to the Create Request API. The response returns an inv_id (your request token) and an href (the customer-facing application URL).
  2. Show the application to the customer. Open the href in the lightbox widget (wegetfinancing.js) or redirect to it. The customer completes the application and chooses an offer. Some customers may not finish — that is expected.
  3. Receive the decision. After a lender decides, WeGetFinancing sends a postback to your configured URL. This server-to-server notification is the authoritative signal.
  4. Create the order. Create the order only when you receive an approved postback, then ship.

Successful online-checkout flow

You point at a different subdomain for testing and production; both behave the same way:

EnvironmentAPI host
Sandbox (testing)https://api.sandbox.wegetfinancing.com
Productionhttps://api.wegetfinancing.com

Always integrate and test against the sandbox first — see Test Environment & Test Data. Going live is just a matter of switching the host.

After you sign up as a merchant you receive a login ID (for the partner portal) and a merchant ID (used in the API path). The portal lets you view your requests, configure your webshop URL, set your postback URL, and find ready-to-use integration snippets. There is a staging portal and a production portal.

POST the cart and customer details to create a financing request. The response gives you the href to show the customer and the inv_id to store as your request token. Use version: "1.9" to receive modern JSON postbacks, and pass your own merchant_transaction_id so you can correlate the postback with your order.

See the Create Request reference for the full parameter list, address and cart-item formats, response shape, and code examples.

The WeGetFinancing application runs as a modal popup. Use the wegetfinancing.js lightbox widget, passing the href from step 1 and two callbacks:

var onComplete = function() {
// Customer finished all steps and was pre-approved.
// Redirect to a thank-you / order-status page.
// Do NOT create the order here — wait for the postback.
};
var onAbort = function() {
// Customer closed the lightbox before finishing.
// Offer a retry or a different payment method.
};
new WeGetFinancing(href, onComplete, onAbort);

See the Lightbox Widget guide for including the widget (it depends on jQuery), preventing double-submit, and the iframe alternative. You can also redirect the customer to the href directly and use success_url / failure_url for post-flow redirects — but those are for user notification only, never for order creation.

WeGetFinancing POSTs a JSON postback to the URL you configure in the portal. With version: "1.9", an approval looks like:

{
"version": "1.9",
"request_token": "0991dfd815ad17e530d88728ce046c4c",
"merchant_transaction_id": "order_1234",
"updates": { "status": "approved" }
}

status is one of approved, preapproved, rejected, or refund. approved is the one to implement first — it means you can create the order and ship. Respond with HTTP 2XX; if you do not, delivery is retried. Handle duplicate deliveries idempotently (respond 200 OK). See Postbacks to Merchants for every dialect, the retry/backoff schedule, and the signature you should verify.

Section titled “Recommended strategy for creating the order”

To create orders reliably without depending on customer behaviour:

  1. Before calling the API, save the current cart to a separate wegetfinancing-carts table (same shape as your orders table) with a unique ID.
  2. Call the API with that unique ID as the merchant_transaction_id.
  3. Show the returned href to the customer.
  4. When an approved postback arrives, look up the cart by merchant_transaction_id and promote it into your orders table. Ignore preapproved/rejected unless you want to act on them.

This way your orders table only ever contains confirmed orders, and order creation never depends on the browser.

Build and test everything against the sandbox, then send a couple of requests to production to confirm. See Test Environment & Test Data for the staging portal, test subjects, and test bank details, and the FAQ for common testing questions (for example, to test a rejected postback, submit an amount that is too large or too small for your active lenders).