Docs

Docs / FFL Checkout / FFL orders

For FFL Checkout stores
Endpoint · Report the dealer a buyer chose

POST/ffl-orders

Record which licensed dealer a buyer chose for one of your orders, by your own order number. Safe to repeat.

Needs FFL orders: Read and writeBase URL https://backend.fflmonkey.com/api/v1Counts 1 toward 120 a minute

Fields

Needs FFL orders: Read and write, a permission of FFL Checkout stores. An FFL order is one fact about one of your orders: the dealer the buyer chose, and later whether the transfer happened. Your own system keeps the order.

FieldTypeRule
refrequiredstringYour own order number, kept as sent: the number you complete and read the order by. Up to 64 letters, digits, dots, underscores, colons and hyphens, starting with a letter or a digit. A WooCommerce order key (it starts wc_) is refused: it is the secret that opens a guest's order page.
dealer_license_numberoptionalstringThe licence number of the dealer the buyer chose, in any form, up to 32 characters: the license_number or license_key from GET /dealers/search.
dealer_snapshotoptionalobjectWhat the buyer saw of the dealer: business_name (up to 255 characters), address (512) and expires (32). Anything else is dropped, so no buyer data is kept.
optionoptionalstringdealer, the default: the buyer chose a dealer. deferred: the buyer will name one later.
  • The first report answers 201 and is announced as ffl_selection.captured.
  • Safe to repeat. The same ref again answers 200: the dealer is refreshed (the buyer may have changed it before the order settled), the status is kept, and nothing is announced again.
  • A dealer the registry does not know is recorded all the same, with dealer_resolved false.
  • Then report the transfer with POST /ffl-orders/{ref}/complete, which puts the dealer on file with your store.

What it answers

data is the order, the shape the three FFL order endpoints answer with:

FieldMeaning
refYour order number as you sent it, or, for an order your FFL Monkey checkout plugin reported, the reference it made (wc- and 32 hex characters).
statuscaptured: reported. completed: the transfer happened. More values may be added.
optiondealer or deferred, as reported.
dealer_license_numberAs you sent it, or null.
dealer_license_keyThe licence without its expiry group, the same across renewals; null when no number was sent or it could not be read.
dealer_resolvedWhether the licence number named a dealer in FFL Monkey's registry when the order was reported.
dealer_snapshotWhat the buyer saw of the dealer, below. Always its three fields, null where nothing was sent.
captured_atWhen the order was first reported.
completed_atWhen the transfer was reported, or null.
canceled_atWhen the order was cancelled, or null.
dealer_snapshotMeaning
business_nameThe dealer's name, as shown to the buyer.
addressThe dealer's address, as shown.
expiresThe dealer's licence expiry, as shown.

Returns

  • 201Reported: the order, in data.
  • 200Reported already: the order, its dealer refreshed.
  • 422validation_failed: a ref that is not an order number, a WooCommerce order key, or a field that broke a rule.

This endpoint can also answer 401 invalid_api_key, 403 license_not_active, 403 product_not_included, 403 insufficient_scope and 429 rate_limited.

Example

FFL Monkey FFL Checkout API, version 1. Questions: Support in your FFL Monkey account, or [email protected].