giorgigrdzelidze/laravel-fina-sdk
A Laravel SDK for integrating the Fina API into PHP applications. It provides configuration, service bindings, and convenient helpers for authenticating and making Fina requests, helping keep your Laravel integration clean, reusable, and maintainable.
getProductsRest() returns { rest: [{ id, store, rest, reserve }] } — the current rest (available stock) and reserve per product, per store. This directly unblocks storefront "available in store", pick-up-in-store eligibility, low-stock badges, and store-level allocation rules without a bespoke data pipeline.rest and reserve in one call, we can decide which store ships an order, when to split a shipment, and when to fall back to backorder — a product decision that previously required either manual checks or a one-off raw integration.getProductOutSingle($id) returns the full retail sale document (product_out_single with products[]), enabling order-detail screens, returns/exchange flows, invoice re-download, and finance reconciliation against our own order records.ex raises FinaRemoteException instead of being silently returned as data. Fewer silent-wrong-numbers incidents in stock displays is a user-facing quality decision, not just a technical one.Consider adoption when:
getProductsRest, getDocProductOutSingle); confirm your FINA instance is on 8.0 before committing.FinaRemoteException and the 401 token-refresh path mean our code handles one exception type and one auth story instead of per-call special cases.Http::withToken(...)->get('getProductsRest'), take the package instead.Look elsewhere or hold when:
getProductsRest returns all products for all stores in one payload — fine for catalogues in the thousands, worth measuring before you build a live per-page inventory check on it.For executives (one paragraph): The FINA integration package shipped a release that adds the two API endpoints we previously could only reach with hand-written calls: per-store stock levels for every product, and full retail sale documents by id. That means two roadmap items — showing customers what is actually available in their store, and letting support look up a real sale — move from "needs custom integration work" to "build on an existing, tested dependency." Both endpoints now fail loudly with a proper exception instead of quietly returning bad data, so inventory numbers on screen are more trustworthy. Cost is a version bump; the alternative is bespoke integration code we would own indefinitely.
For engineering (summary): v0.1.3 adds rest() (GET getProductsRest, returns { rest: [{ id, store, rest, reserve }] }) and getProductOutSingle($id) (GET getDocProductOutSingle/{id}, returns product_out_single with products[]). Both are routed through the standard response guard, so a FINA ex surfaces as FinaRemoteException rather than as payload. Coverage includes URL/method, bearer token, payload passthrough, ex handling, HTTP 400/500, and the 401 token-refresh path — 9 new tests, 84 total. No breaking changes noted; still pre-1.0, so pin the version and expect surface movement. Recommended next step: wrap rest() behind a cached repository with an explicit TTL, and validate the shape of products[] against our order model before we commit to a reconciliation design.
How can I help you explore Laravel packages today?