Saved Dealer Validation

MasterFFL allows customers to save a preferred FFL dealer for use during express checkout, bypassing the dealer selection step entirely. Before completing an order, you can validate that the saved dealer is eligible to accept the specific transfer using the MasterFFL Select API SDK.

🧪 Interactive Testing: Test dealer validation with various filter options on our Validation Tool.


FFL License Number Format

The SDK accepts both the 8-digit shortened format and the full FFL license number format. Full format is automatically converted to the shortened format internally.

How the shortened format is derived:

  • Take the first 3 digits and last 5 digits from the full FFL license number
  • Example: Full license 5-84-123-01-6E-01521 → Shortened: 58401521
Full License NumberShortened (8 digits)
5-84-123-01-6E-0152158401521
1-63-115-01-6F-0694816306948
4-65-934-01-3M-0176846501768
āš ļø

Note: Both formats are accepted. The SDK normalizes the input automatically. If the format cannot be resolved to a valid 8-digit key, LICENSE_CHECK_FAILED is returned.


SDK Integration

Step 1: Include Required Scripts

<head>
  <!-- AWS WAF Challenge Script (Required for security) -->
  <script type="text/javascript" 
    src="https://eb9c20d17a28.us-east-2.captcha-sdk.awswaf.com/eb9c20d17a28/jsapi.js" 
    data-awswaf-challenge-compact="true" 
    defer>
  </script>
  
  <!-- MasterFFL Select API SDK -->
  <script src="https://libs.masterffl.com/ffl-select/select-api-sdk/23.0.3/ffl-select-api-sdk.js"></script>
</head>

Step 2: Validate the Dealer

Method Signature:

FFLSelectAPISDK.verifySavedDealerOrderAcceptance(
  fflLicenseNumber,
  orderCharacteristics,
  options,
  returnFullRecord
)

Parameters:

ParameterTypeRequiredDescription
fflLicenseNumberstringYesFFL license number — 8-digit shortened or full format (auto-converted internally)
orderCharacteristicsobjectNoDefines the order/transfer characteristics. If not provided, only base validations are performed
optionsobjectNoOptional checks to run in addition to base validations (email, FFL cert, SOT file)
returnFullRecordbooleanNoIf true, returns full dealer record. Defaults to false

orderCharacteristics Object (Optional):

{
  acceptsNFAItems: true,                    // Include only if order contains NFA items (suppressors, SBRs, etc.)
  acceptsTransfersFromNonFFLSellers: true,  // Include only if seller is non-FFL (multi-vendor marketplace)
  acceptsAmmoTransfers: true,               // Reserved — not yet active
  buyersFFLLicenseNumber: string            // Optional - buyer's FFL license for B2B scenarios
}

Options Object:

{
  checkEmailAddressAvailable: true,     // Optional: Fails if dealer has no email on file (defaults to false)
  checkFFLLicenseFileAvailable: true,   // Optional: Fails if dealer's FFL certificate is not on file (defaults to false)
    checkSOTLicenseFileAvailable: true    // Optional: Fails if dealer's SOT file is not on file (defaults to false),
masterFFLTransferPIN: "123456" // Optional: Use the PIN to validate dealer, if dealer is opted out.

}

Validation Logic

Validations run in a fixed order. The first failing check stops execution and returns immediately.

Validation Order

1. License Normalization
The license number is normalized to 8-digit shortened format. If the input cannot be resolved, returns LICENSE_CHECK_FAILED.

2. Dealer Lookup
The dealer is fetched from the MasterFFL index. If not found or marked as deleted, returns LICENSE_CHECK_FAILED.

3. Permanently Closed Check (always performed)
Returns PERMANENTLY_CLOSED if the dealer has permanently closed.

4. Temporarily Closed Check (always performed)
Returns TEMPORARILY_CLOSED if the dealer is temporarily closed.

5. Opt-Out Global Check (skipped in B2B scenario)
Returns OPT_OUT_GLOBAL if the dealer has opted out of accepting transfers and transfer PIN was not provided or invalid. Skipped when buyersFFLLicenseNumber matches the saved dealer's license (B2B scenario).

6. Blacklist Check (always performed)
Returns BLACKLISTED if the dealer is blacklisted by the store.

7. NFA Check (only if acceptsNFAItems: true)
Returns OPT_OUT_NFA if the dealer is not a licensed SOT dealer.

8. Non-FFL Seller Check (only if acceptsTransfersFromNonFFLSellers: true)
Returns OPT_OUT_UNLICENSED if the dealer does not accept transfers from non-FFL sellers.

9. Email Check (only if checkEmailAddressAvailable: true)
Returns DEALER_EMAIL_NOT_AVAILABLE if the dealer has no email address on file.

10. FFL Certificate Check (only if checkFFLLicenseFileAvailable: true)
Returns DEALER_FFL_LICENSE_FILE_NOT_AVAILABLE if the dealer's FFL certificate is not on file.

11. SOT File Check (only if checkSOTLicenseFileAvailable: true)
Returns DEALER_SOT_LICENSE_FILE_NOT_AVAILABLE if the dealer's SOT license file is not on file.

12. Pass
All checks passed — returns dealerPasses: true.

13. SOT File Compatible Check (only if checkSOTLicenseFileAvailable: true)
Returns DEALER_SOT_LICENSE_FILE_NOT_AVAILABLE_FOR_THIS_LICENSE if the dealer has an SOT license on file, but it is not compatible with the provided license type.


B2B Special Case

If buyersFFLLicenseNumber matches the saved dealer's fflLicenseNumber (both normalized), it is treated as a B2B scenario. In this case, step 5 (Opt-Out Global) is skipped because the buyer is receiving the transfer at their own license location. All other checks still apply.


Examples

Example 1: Basic Validation (No orderCharacteristics)

// Validates license format, dealer existence, closed status, and blacklist only
const result = await FFLSelectAPISDK.verifySavedDealerOrderAcceptance(
  '58401521',
  null  // or {} or undefined
);

Example 2: NFA Transfer (Suppressor)

const result = await FFLSelectAPISDK.verifySavedDealerOrderAcceptance(
  '58401521',
  { acceptsNFAItems: true },
  {},
  true
);

Example 3: Non-FFL Seller (Multi-Vendor Marketplace)

Applicable for marketplaces like GunBroker, Guns.com, ArmsList, etc.

const result = await FFLSelectAPISDK.verifySavedDealerOrderAcceptance(
  '58401521',
  { acceptsTransfersFromNonFFLSellers: true },
  {},
  true
);

Example 4: Complex Order (NFA + Non-FFL Seller)

const result = await FFLSelectAPISDK.verifySavedDealerOrderAcceptance(
  '58401521',
  {
    acceptsNFAItems: true,
    acceptsTransfersFromNonFFLSellers: true
  },
  {},
  true
);

Example 5: B2B Transfer (Buyer Receiving at Own License)

// Opt-Out Global check is skipped when buyer's license matches the saved dealer
const result = await FFLSelectAPISDK.verifySavedDealerOrderAcceptance(
  '58401521',
  { buyersFFLLicenseNumber: '58401521' }  // Same as saved dealer — B2B scenario
);

Example 6: With Optional Checks

const result = await FFLSelectAPISDK.verifySavedDealerOrderAcceptance(
  '58401521',
  { acceptsNFAItems: true },
  {
    checkEmailAddressAvailable: true,
    checkFFLLicenseFileAvailable: true,
    checkSOTLicenseFileAvailable: true
  },
  true
);

Response Format

{
  dealerPasses: boolean,        // true if all validations pass, false otherwise
  dealerRecord: object | null,  // full dealer record (only populated if returnFullRecord=true)
  reason: {                     // only present when dealerPasses=false
    code: string,               // machine-readable error code
    message: string             // display-ready message, safe to show directly to users
  }
}

Success Response Example

{
  dealerPasses: true,
  dealerRecord: {
    id: "58401521",
    fflLicenseNumber: "5-84-123-01-6E-01521",
    tradeName: "ADAMSON POLICE PRODUCTS",
    phoneNumber: "3038334661",
    agreedToAcceptTransfer: true,
    agreedToAcceptTransfersFromNonFFLSellers: true,
    isPermanentlyClosed: false,
    isTemporarilyClosed: false,
    isBlacklisted: false,
    hasEmails: true,
    hasValidFFLCertificateOnFile: true,
    premiseAddress: {
      street: "3763 IMPERIAL STREET UNIT A",
      city: "FREDERICK",
      state: "CO",
      zipCode: "80516"
    },
    sotInformation: {
      isSotDealer: true,
      hasValidSOTFile: false
    },
    licenseExpiry: "02/01/2027",
    preferredLicenseNumber: "58401521",
    preferredLicenseExpiry: "02/01/2027",
    isPreferredSameAsGivenLicense: true,
    hasCompatibleSOT: true,
    masterFFLTransferPINEnabled: flase,
    isNFAPreferred: true
  },
  reason: null
}

Failure Response Example

{
  dealerPasses: false,
  dealerRecord: null,  // or partial dealer data if returnFullRecord=true
  reason: {
    code: "PERMANENTLY_CLOSED",
    message: "This dealer is permanently closed and cannot accept transfers."
  }
}

Note: When returnFullRecord: true, dealerRecord is populated even on failure (except for LICENSE_CHECK_FAILED when the dealer cannot be found at all).

Dealer Record Fields

When returnFullRecord: true, dealerRecord contains the full dealer object. Key fields are listed below.

FieldTypeDescription
idstring8-digit shortened FFL license number of the validated license
fflLicenseNumberstringFull FFL license number of the validated license
tradeNamestringDealer trade name
phoneNumberstringDealer phone number
premiseAddressobjectDealer's physical address (street, city, state, zipCode)
agreedToAcceptTransferbooleantrue if the dealer accepts incoming transfers
agreedToAcceptTransfersFromNonFFLSellersbooleantrue if the dealer accepts transfers from non-FFL sellers
isPermanentlyClosedbooleantrue if the dealer has permanently closed
isTemporarilyClosedbooleantrue if the dealer is temporarily closed
isBlacklistedbooleantrue if the dealer is restricted from this store
hasEmailsbooleantrue if the dealer has an email address on file
hasValidFFLCertificateOnFilebooleantrue if the dealer's FFL certificate is on file
licenseExpirystringExpiry date of the validated license in MM/DD/YYYY format
preferredLicenseNumberstring8-digit license key of the dealer's primary (preferred) license
preferredLicenseExpirystringExpiry date of the preferred license in MM/DD/YYYY format
isPreferredSameAsGivenLicensebooleantrue if the license you validated is the dealer's preferred license. false if the dealer holds multiple licenses and a non-primary one was validated
sotInformation.isSotDealerbooleantrue if the dealer is a licensed SOT dealer (required for NFA transfers)
sotInformation.hasValidSOTFilebooleantrue if the dealer's SOT license file is on file
hasCompatibleSOTbooleantrue if the dealer has an approved SOT on file that matches the license type being validated.
isNFAPreferredbooleantrue if this license is the dealer’s preferred NFA license for NFA transfers.

For the complete field reference, see the checkout API SDK Models.


Error Handling

Error Codes

All reason.message values are display-ready and can be shown directly to users without modification.

Error CodeMessageWhen It Occurs
LICENSE_CHECK_FAILED"The FFL license number is not valid or has expired."License number format is invalid, dealer not found, or dealer record is inactive
PERMANENTLY_CLOSED"This dealer is permanently closed and cannot accept transfers."The dealer has permanently closed their business
TEMPORARILY_CLOSED"This dealer is temporarily closed and cannot accept transfers right now."The dealer is temporarily closed
OPT_OUT_GLOBAL"This dealer has opted out of accepting transfers."The dealer has opted out of all transfers (skipped for B2B transfers)
BLACKLISTED"This dealer unable to accept transfers from this store."The dealer is restricted from accepting transfers from this store
OPT_OUT_NFA"This dealer is unable to accept, or has opted out from receiving NFA transfers"The dealer is not a licensed SOT dealer — returned when acceptsNFAItems: true
OPT_OUT_UNLICENSED"This dealer has opted out from receiving transfers from unlicensed sellers"The dealer does not accept transfers from non-FFL sellers — returned when acceptsTransfersFromNonFFLSellers: true
DEALER_EMAIL_NOT_AVAILABLE"This dealer does not have an email address on file. Please select a different dealer."Dealer has no email address on file — returned when checkEmailAddressAvailable: true
DEALER_FFL_LICENSE_FILE_NOT_AVAILABLE"This dealer's FFL license file is not available. Please select a different dealer."Dealer's FFL certificate is not on file — returned when checkFFLLicenseFileAvailable: true
DEALER_SOT_LICENSE_FILE_NOT_AVAILABLE"This dealer's SOT license file is not available. Please select a different dealer."Dealer's SOT file is not on file — returned when checkSOTLicenseFileAvailable: true
INTERNAL_SERVER_ERROR"An internal error occurred while validating the dealer."An unexpected error occurred on the server
DEALER_SOT_LICENSE_FILE_NOT_AVAILABLE_FOR_THIS_LICENSE"This dealer's SOT file is not available for this license. Please select a different dealer."Returned when checkSOTLicenseFileAvailable: true, dealer has an SOT file on file, but it is not compatible with the provided license type.

Error Handling Example

const result = await FFLSelectAPISDK.verifySavedDealerOrderAcceptance(
  '58401521',
  { acceptsTransfersFromNonFFLSellers: true }
);

if (!result.dealerPasses) {
  console.log('Error Code:', result.reason.code);
  console.log('Error Message:', result.reason.message); // safe to display to user
}

orderCharacteristics Reference

FieldTypeDescriptionError Code if Fails
acceptsNFAItemsbooleanSet to true if the order contains NFA items (suppressors, machine guns, SBRs, etc.)OPT_OUT_NFA
acceptsTransfersFromNonFFLSellersbooleanSet to true if the seller is not FFL-licensed (multi-vendor marketplaces, etc.)OPT_OUT_UNLICENSED
acceptsAmmoTransfersbooleanSet to true if the order contains ammunitionReserved — not yet active
buyersFFLLicenseNumberstringBuyer's FFL license number (8-digit or full format). When this matches the saved dealer's license, the opt-out check is skipped (B2B transfer).—

Common Scenarios

ScenarioorderCharacteristics
Basic validation onlynull or {} or not provided
NFA item transfer{ acceptsNFAItems: true }
Non-FFL seller (marketplace){ acceptsTransfersFromNonFFLSellers: true }
NFA + Non-FFL seller{ acceptsNFAItems: true, acceptsTransfersFromNonFFLSellers: true }
B2B transfer{ buyersFFLLicenseNumber: '58401521' }


Did this page help you?