FD1 Client Protocol
 
Library Developer Home FD1 Client Protocol Home Concepts Reading Data Writing Data Protocol Defined Servers Connect & Authenticate Proxies & Tunnels
Webhooks & Firehoses Programming Support Logging Minor Facts State Facts Response Format How To Guides eCommerce Sites Custom Point of Sale Customer Access Bulk Downloads Major APIs / Endpoints All Endpoints Products Sales SalesBuilder Session Get Attribute Sale Capture General Purpose Data Capture Devices Barcode Scanners Eftpos IoT Sensors Power Outlets Printing Scales Security Cameras Purchasing / Supply Side Purchase Orders Invoices Invoice Payments Document Capture Rare APIs / Endpoints SSL Certificates API Key Management Diagnositics PosGreen Server to Client Messages Overview Resources / Objects Purchase Order Invoice Payable Invoice Payment Product Supplier Location Sale Lines Sale Delivery Details Sales Price Maps Employees Carriers Payments Product Kits Department 1 Customers

FD1 SalesBuilder

SalesBuilder functions are used to create and manipulate sales as they are assembled. SalesBuilder implements shopping cart functionality or allows you to create instore checkouts.

You do not need to use SalesBuilder functions to create new sales, you can simply send a complete sale definition into fd1.sales.sale_save_new

Index

Create, Pause, Complete
  • salesbuilder.sale_create
Set Sale Properties
  • salesbuilder.sale_set_customer
Add and Remove Items and their properties
  • salesbuilder.sale_add_product

salesbuilder.sale_create

Request
{
  a: "fd1.salesbuilder.sale_create",
}
Response
{
  r: "fd1.salesbuilder.sale_create",
  data: {
    rows: [ {
       physkey: "jafj459385hggdg39vgcg53038qQQ8",
       startdt: "2024-02-04 14:45:23",
       ...
    } ]
  }
}

salesbuilder.sale_fetch

Example

{
  a: "fd1.salesbuilder.sale_fetch",
  k: "jafj459385hggdg39vgcg53038qQQ8"
}

salesbuilder.sale_get_price

Example

Request
{
  a: "fd1.salesbuilder.sale_get_price",
  rq: 92838,
  k: "jafj459385hggdg39vgcg53038qQQ8",
  v: {
    pid: [ 1256, 8231 ]
  }
}
Response
{
  r: "fd1.salesbuilder.sale_park",
  rp: 92838,
  k: "jafj459385hggdg39vgcg53038qQQ8",
  data: {
    rows: [
        { pid: 1256, price: 19.95 },
        { pid: 8231, price: 17.20 }
    ]
  }
}

Alternatively a key/value response format can be requested; this may be easier to work with in some circumstances

Request
{
  a: "fd1.salesbuilder.sale_get_price",
  rq: 92838,
  k: "jafj459385hggdg39vgcg53038qQQ8",
  v: {
    _format: "kv",
    pid: [ 1256, 8231 ]
  }
}
Response
{
  r: "fd1.salesbuilder.sale_park",
  rp: 92838,
  k: "jafj459385hggdg39vgcg53038qQQ8",
  data: {
    kv: {
        "1256": 19.95,
        "8231": 17.20
    }
  }
}

salesbuilder.sale_add_product

salesbuilder.sale_edit_product

salesbuilder.sale_set_delivery_address

salesbuilder.sale_set_customer

salesbuilder.sale_add_payment

salesbuilder.sale_edit_payment

salesbuilder.sale_invoke_eftpos

Starts an integrated Eftpos payment sequence. The exact action varies depending on the Eftpos provider in use.

Example

{
  a: "fd1.salesbuilder.sale_invoke_eftpos",
  k: "jafj459385hggdg39vgcg53038qQQ8",
  v: {
    amount: 56.00
  }
}

salesbuilder.sale_park

Example

Request
{
  a: "fd1.salesbuilder.sale_park",
  k: "jafj459385hggdg39vgcg53038qQQ8"
}
Response
{
  r: "fd1.salesbuilder.sale_park",
  k: "jafj459385hggdg39vgcg53038qQQ8"
}

salesbuilder.sale_unpark

Example

Request
{
  a: "fd1.salesbuilder.sale_unpark",
  k: "jafj459385hggdg39vgcg53038qQQ8"
}
Response
{
  r: "fd1.salesbuilder.sale_unpark",
  k: "jafj459385hggdg39vgcg53038qQQ8",
  data: {
    ... sale definition ...
  }
}

salesbuilder.sale_void

Marks a sale as void and stores it for audit purposes.

Example

Request
{
  a: "fd1.salesbuilder.sale_void",
  k: "jafj459385hggdg39vgcg53038qQQ8"
}
Response
{
  r: "fd1.salesbuilder.sale_void",
  k: "jafj459385hggdg39vgcg53038qQQ8"
}