Design Guide: PreAuth Payments
PreAuth Payments are when the website creates a sale and takes a pre authorised payment against the customers credit card. The sale is then sent for picking and dispatch and once complete the payment amount is charged to the customers card. This process is necessary where the original order and what is actually dispatched can vary.
Customer Creates Sale | Your website and shopping cart |
⇓ | |
Connects to Payment Processor and PreAuths an Amount | Your website and shopping cart |
⇓ | |
Sale POST to Fieldpine /Sales | Your website and shopping cart |
⇓ | |
Team Member picks and packs order | Warehouse |
⇓ | |
Sale finished and final amount due set | Warehouse |
⇓ | |
Final Sale details obtained | Your website and shopping cart |
⇓ | |
Payment processor charges credit card | Your website and shopping cart |
Sending Sale to Fieldpine
Consider a sale where the customer purchases two items, and has a credit voucher (a payment) for $20.
{ "ExternalId": "Sale.000001", "CompletedDt": "2019-07-01T10:35", "Phase": 200, // NOTE. Sale is in picking state "LINE": [{ "Pid": 12345, "Qty": 1, "TotalPrice": 9.00, }, { "Pid": 992, "Qty": 1, "TotalPrice": 77.00 } ], "PAYM": [{ "Type": "Manual Credit", "Amount": 20.00 },{ "Type": "Credit PreAuth", "Amount": 66.00 }] }
While in the warehouse the $9 item is out of stock and not dispatched. So the sale is finalised for a total of $77 not the original $86. After subtracted the $20 manual credit the amount $57 should finally be charged to the credit card.
Your webserver should obtain a copy of the finalised sale, either via WebHook or polling. This might look something like this:
{ "SaleId": 850000194, "ExternalId": "Sale.000001", "CompletedDt": "2019-07-01T10:35", "Location": 23, "SaleTotal": 66.00, "SaleTotalExTax": 56.80, "SaleTotalTax1", 9.20, "Phase": 1, // Sale is now in Completed Phase "LINE": [{ "Pid": 12345, "Qty": 0, // Item is not deleted, but quantity set to zero "TotalPrice": 9.00 }, { "Pid": 992, "Qty": 1, "TotalPrice": 77.00 } ], "PAYM": [{ "Type": "Manual Credit", "CompletedDt": "2019-07-01T10:51", "Sequence": 1, "Amount": 20.00 },{ "Type": "Credit PreAuth", "CompletedDt": "2019-07-01T10:51", "Sequence": 2, "Amount": 66.00 },{ "Type": "Change", // New Payment type added "DateTime": "2019-07-03T14:23", "Sequence": 3, "Amount": 9.00 }] }