---
name: wegetfinancing-integration
description: Use when integrating WeGetFinancing financing at checkout — create financing requests on the Merchant API, embed the lightbox, and handle decision postbacks with signature verification. Triggers on tasks about adding WeGetFinancing as a financing/payment option to a store or custom shopping cart.
---

# Integrate WeGetFinancing at checkout

**Skill version: 1.0.0** · Full docs: <https://docs.wegetfinancing.com/merchants/v1/>

This skill helps you implement a WeGetFinancing checkout integration against the public
Merchant API. Use `reference.md` (next to this file) for the condensed contract, and the
`templates/` directory for working starting points in Python, Node, PHP, and curl.

## When to use

When a merchant wants to offer WeGetFinancing financing at checkout from a custom or
self-developed store (not a supported off-the-shelf plugin). For ready-made plugins
(Shopify, etc.) see <https://docs.wegetfinancing.com/merchants/plugins/>.

## The flow — implement in this order

1. **Create a financing request.** `POST /merchant/{merchant_id}/requests` with HTTP Basic
   auth and a JSON body. The response returns `inv_id` (save as your request token) and
   `href` (the customer-facing application URL).
   Template: `templates/create_request.*` · Docs: <https://docs.wegetfinancing.com/merchants/v1/create-request/>
2. **Show the application.** Open `href` in the WeGetFinancing lightbox via `wegetfinancing.js`
   (`onComplete` / `onAbort`), or redirect the customer to it.
   Template: `templates/lightbox.html` · Docs: <https://docs.wegetfinancing.com/merchants/plugins/lightbox/>
3. **Handle the postback.** WeGetFinancing POSTs a JSON decision to your configured URL.
   **Verify the `x-signature`** and **create the order only when `status` is `approved`**.
   Template: `templates/postback_handler.*` · Docs: <https://docs.wegetfinancing.com/merchants/v1/postbacks/>
4. **Test.** Use the sandbox host `api.sandbox.wegetfinancing.com` before production.
   Docs: <https://docs.wegetfinancing.com/test-environment/>

## Rules that matter

- **Create the order only after an `approved` postback** — never on the browser callback
  (it can be spoofed).
- **Verify the postback signature:** `x-signature = sha256(x-timestamp + key_id + raw_body + key_secret)`.
  Use a constant-time comparison.
- **Sandbox first** (`api.sandbox.wegetfinancing.com`), then production (`api.wegetfinancing.com`).
- See `reference.md` for the request fields, the currency/country rule, and the postback format.

## End-to-end guide

<https://docs.wegetfinancing.com/merchants/backend-integration/>
