Skip to content

ffl_integrations.gunbroker.client_api

Source: apps/ffl_integrations/ffl_integrations/gunbroker/client_api.py · 17 endpoint(s)

Generated by make api-docs — do not edit by hand.

clear_sold_unknown_now

POST /api/method/ffl_integrations.gunbroker.client_api.clear_sold_unknown_now

Auth (derived from code): Roles: Stock Manager / System Manager

Clear the "may already be sold on GunBroker" flag after checking.

arg type required default description
serial_no string yes — The Serial No to clear.
note string yes — What was checked, recorded as a Comment on the serial. Required — this flag exists to stop a gun being sold twice, and lifting it is an assertion somebody should be able to stand behind afterwards.

Returns: {"ok": True, "changed": bool}.

apps/ffl_integrations/ffl_integrations/gunbroker/client_api.py:390

end_item_listing_now

POST /api/method/ffl_integrations.gunbroker.client_api.end_item_listing_now

Auth (derived from code): Roles: Stock Manager / System Manager

End this Item's GunBroker listing.

arg type required default description
item_code string yes — The Item whose listing should end.
reason string | null no None Optional note recorded in the alert if it cannot be ended automatically.

Returns: {"ok": True, "strategy": "delete_endpoint", "confirmed": True} when GunBroker confirmed it, or a pending-manual result naming the listing that a person still has to end there.

apps/ffl_integrations/ffl_integrations/gunbroker/client_api.py:356

end_listing_now

POST /api/method/ffl_integrations.gunbroker.client_api.end_listing_now

Auth (derived from code): Roles: Stock Manager / System Manager

End this gun's GunBroker listing.

arg type required default description
serial_no string yes — The Serial No whose listing should end.
reason string | null no None Optional note recorded in the alert if it cannot be ended automatically.

Returns: {"ok": True, "strategy": "delete_endpoint", "confirmed": True} when GunBroker confirmed the listing is inactive. Otherwise "confirmed" is False and the answer always carries "pending_manual": True, "gb_url" (the listing, to end by hand) and a "message" saying it can still be bought — whether the cause was the Manual Only setting, a failed call, or a read-back that still showed it active, because the person reading this has to do the same thing in every one of those cases. "strategy" says whether the system will retry by itself, and "downgraded": True appears when GunBroker withdrew permission and the setting was changed as a result.

apps/ffl_integrations/ffl_integrations/gunbroker/client_api.py:204

fetch_listing_defaults

POST /api/method/ffl_integrations.gunbroker.client_api.fetch_listing_defaults

Auth (derived from code): Roles: System Manager

Read the GunBroker account's own listing defaults.

Returns: {"ok": True, "defaults": {...}} — the raw account defaults, including gatewayEnabled and standardTextID, for filling in this store's settings.

apps/ffl_integrations/ffl_integrations/gunbroker/client_api.py:39

item_listing_offer

POST /api/method/ffl_integrations.gunbroker.client_api.item_listing_offer

Auth (derived from code): Roles: Stock Manager / System Manager

What the Send dialog offers for a model: the figures a listing sent now would

carry, so the person decides with them in front of them.

arg type required default description
item_code string yes — The uniform-price firearm Item about to be listed.

Returns: {"is_model": , "title", "sellable" (guns that can be promised now, null when a sales channel could not say), "price" (what GunBroker would show: the web store's price today), "regular_price", "on_sale" (true when a promotion makes price lower), "sale_to" (the promotion's last day, or ""), "category": {"id" (0 for none), "name", "ambiguous" (the category depends on a year the Item lacks)}, "shipping": {"own", "default", "free", "effective"}, "premium": {"featured", "showcase", "sponsored_onsite", "view_counter"} (recorded on the Item; a listing made now buys them again)}.

apps/ffl_integrations/ffl_integrations/gunbroker/client_api.py:294

item_listing_status

POST /api/method/ffl_integrations.gunbroker.client_api.item_listing_status

Auth (derived from code): Roles: Stock Manager / System Manager

What this Item's GunBroker listing looks like, locally and remotely.

arg type required default description
item_code string yes — The Item to report on.

Returns: {"ok": True, "state": ..., "gb_item_id": ..., "gb_sync_error": ..., "quantity_local": , "quantity_pushed": , "remote": {...} | None} — the two quantities are what show a drift between stock and the listing.

apps/ffl_integrations/ffl_integrations/gunbroker/client_api.py:374

listing_offer

POST /api/method/ffl_integrations.gunbroker.client_api.listing_offer

Auth (derived from code): Roles: Stock Manager / System Manager

What the Send dialog offers for one gun: the figures a listing would

carry if nothing were changed, and the choices GunBroker allows.

arg type required default description
serial_no string yes — The Serial No about to be listed.

Returns: {"title", "derived_title", "price", "pos_price", "type", "types", "starting_bid", "reserve_price", "buy_now_price", "duration", "durations", "auto_relist", "auto_relist_options": [{"value", "label"}], "shipping": {"own", "default", "free", "effective"}, "category": {"id": , "options": [{"id", "name"}]}, "premium": {"featured", "showcase", "sponsored_onsite", "view_counter"} (the paid promotions recorded on the gun, each true/false; a listing made now buys them again), "condition" (the code recorded for this gun, 0 for none), "derived_condition" (what the Item alone gives), "condition_options" (the codes allowed: only the derived one for an antique)}.

apps/ffl_integrations/ffl_integrations/gunbroker/client_api.py:122

listing_ship_cost

POST /api/method/ffl_integrations.gunbroker.client_api.listing_ship_cost

Auth (derived from code): Roles: Stock Manager / System Manager

What a listing of this record would charge the buyer for shipping.

arg type required default description
doctype string yes — "Serial No" for a gun, "Item" for a model-level listing.
name string yes — The record.

Returns: {"own": , "default": <the store default for this record's kind>, "free": , "effective": }.

apps/ffl_integrations/ffl_integrations/gunbroker/client_api.py:147

listing_status

POST /api/method/ffl_integrations.gunbroker.client_api.listing_status

Auth (derived from code): Roles: Stock Manager / System Manager

Report what this POS and GunBroker each think of one listing.

arg type required default description
serial_no string yes — The Serial No to inspect.

Returns: {"ok": True, "state": , "gb_item_id": str, "gb_sync_error": str, "remote": {...}|None} — remote is what GunBroker currently says, or None when there is no listing to ask about. Read-only.

apps/ffl_integrations/ffl_integrations/gunbroker/client_api.py:229

push_item_now

POST /api/method/ffl_integrations.gunbroker.client_api.push_item_now

Auth (derived from code): Roles: Stock Manager / System Manager

List one Item on GunBroker as a quantity listing.

Ammunition, optics, parts — one listing standing for the stock on hand — and a uniform-price firearm, listed as a MODEL: one listing standing for the guns that are free to sell, filed under the bare item code with the licence requirement on. A gun priced one by one is refused here; those are listed one at a time from the Serial No form.

arg type required default description
item_code string yes — The Item to list.
relist int str no 0
ship_cost float str no None
listing dict str no None

Returns: {"ok": True, "gb_item_id": "", "quantity": , "warnings": [...]} on success, or {"ok": False, "skipped": "", "message": ""} when a guard refused. A refusal is a normal answer.

apps/ffl_integrations/ffl_integrations/gunbroker/client_api.py:246

push_serial_now

POST /api/method/ffl_integrations.gunbroker.client_api.push_serial_now

Auth (derived from code): Roles: Stock Manager / System Manager

List one firearm on GunBroker.

arg type required default description
serial_no string yes — The Serial No to list.
relist int str no 0
ship_cost float str no None
listing dict str no None
category_id int str no None
free_shipping int str no None

Returns: {"ok": True, "gb_item_id": "", "gb_url": "<the listing's page>", "warnings": [...]} on success ("no_upc" among the warnings means GunBroker had no UPC to fill Manufacturer / Model / Caliber from), or {"ok": False, "skipped": "", "message": ""} when a guard refused. A refusal is a normal answer, not an error.

apps/ffl_integrations/ffl_integrations/gunbroker/client_api.py:56

replace_pictures_now

POST /api/method/ffl_integrations.gunbroker.client_api.replace_pictures_now

Auth (derived from code): Roles: System Manager

Replace a live listing's photos with the ones a new push would send now.

For when the photos or the store's watermark changed after the listing went up. GunBroker keeps the search thumbnail it took at listing time.

arg type required default description
serial_no string no '' The gun whose per-serial listing to update.
item_code string no '' Or the model / item whose item-level listing to update.

Returns: {"ok": True, "gb_item_id": ..., "uploaded": n, "removed": n, "warnings": [...]}, or a skip dict (not listed, an auction with bids, no photos, GunBroker refused).

apps/ffl_integrations/ffl_integrations/gunbroker/client_api.py:181

reprice_item_now

POST /api/method/ffl_integrations.gunbroker.client_api.reprice_item_now

Auth (derived from code): Roles: Stock Manager / System Manager

Send this Item's current selling rate to its GunBroker listing.

A model (uniform-price firearm) is sent the web store's price today, a running promotion included; anything else its standard rate.

arg type required default description
item_code string yes — The Item whose listing should be repriced.

Returns: {"ok": True, "fixed_price": , "verified": True} when the listing was read back showing the new price, otherwise a skip dict.

apps/ffl_integrations/ffl_integrations/gunbroker/client_api.py:317

reprice_serial_now

POST /api/method/ffl_integrations.gunbroker.client_api.reprice_serial_now

Auth (derived from code): Roles: Stock Manager / System Manager

Send this gun's current sell price to its GunBroker listing.

arg type required default description
serial_no string yes — The Serial No whose listing should be repriced.

Returns: {"ok": True, "fixed_price": , "verified": True} — verified means the listing was read back and shows the new price, which is the only proof that counts here. Otherwise a skip dict.

apps/ffl_integrations/ffl_integrations/gunbroker/client_api.py:165

sync_item_quantity_now

POST /api/method/ffl_integrations.gunbroker.client_api.sync_item_quantity_now

Auth (derived from code): Roles: Stock Manager / System Manager

Push this Item's stock count to its GunBroker listing.

Normally automatic — every stock movement of a listed item triggers it — so this is the manual repair for a count that has drifted. A model's count is the guns free to sell less the units GunBroker has sold that no order has brought in yet; when GunBroker cannot be read nothing is sent.

arg type required default description
item_code string yes — The listed Item.

Returns: {"ok": True, "quantity": } — with "unchanged": True when GunBroker already held that number, or the end-listing result when stock is zero (GunBroker rejects a quantity of zero, so selling out ends the listing).

apps/ffl_integrations/ffl_integrations/gunbroker/client_api.py:335

sync_orders_now

POST /api/method/ffl_integrations.gunbroker.client_api.sync_orders_now

Auth (derived from code): Roles: System Manager

Run the GunBroker order poll now instead of waiting for the schedule.

Queued rather than run inline: a poll can walk many pages and fetch every order in full, which is far too long to hold a Desk request open. The job is de-duplicated against the scheduled one, so pressing the button while a poll is already running joins it rather than starting a second.

Returns: {"queued": True}.

apps/ffl_integrations/ffl_integrations/gunbroker/client_api.py:411

test_connection

POST /api/method/ffl_integrations.gunbroker.client_api.test_connection

Auth (derived from code): Roles: System Manager

Check the GunBroker credentials and report which environment they reach.

Returns: {"ok": True, "sandbox": bool, "base_url": str, "server_time": str, "account": str, "gateway_enabled": bool, "warnings": [str]} — or {"ok": False, "sandbox": bool, "error": str} when it could not connect. sandbox is included either way so an operator can see at a glance which GunBroker was just contacted.

apps/ffl_integrations/ffl_integrations/gunbroker/client_api.py:24