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.
Process overview
Section titled “Process overview”A complete online-checkout integration has four steps:
- 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 aninv_id(your request token) and anhref(the customer-facing application URL). - Show the application to the customer. Open the
hrefin 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. - Receive the decision. After a lender decides, WeGetFinancing sends a postback to your configured URL. This server-to-server notification is the authoritative signal.
- Create the order. Create the order only when you receive an
approvedpostback, then ship.

Environments
Section titled “Environments”You point at a different subdomain for testing and production; both behave the same way:
| Environment | API host |
|---|---|
| Sandbox (testing) | https://api.sandbox.wegetfinancing.com |
| Production | https://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.
Portal access and credentials
Section titled “Portal access and credentials”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.
Step 1 — Create the request
Section titled “Step 1 — Create the request”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.
Step 2 — Show the application
Section titled “Step 2 — Show the application”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.
Step 3 — Receive postbacks
Section titled “Step 3 — Receive postbacks”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.
Recommended strategy for creating the order
Section titled “Recommended strategy for creating the order”To create orders reliably without depending on customer behaviour:
- Before calling the API, save the current cart to a separate
wegetfinancing-cartstable (same shape as your orders table) with a unique ID. - Call the API with that unique ID as the
merchant_transaction_id. - Show the returned
hrefto the customer. - When an
approvedpostback arrives, look up the cart bymerchant_transaction_idand promote it into your orders table. Ignorepreapproved/rejectedunless you want to act on them.
This way your orders table only ever contains confirmed orders, and order creation never depends on the browser.
Testing
Section titled “Testing”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).
Related pages
Section titled “Related pages”- Create Request — full API reference and code examples.
- Lightbox Widget — embedding
wegetfinancing.js. - Postbacks to Merchants — payload formats, retries, signature.
- Plugins & Integrations — ready-made and front-end options.