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":
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":
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":
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":
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": 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": "
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": "
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":
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":
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":
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