Nº 15AutomationSpec sample

PrestaShop to QuickBooks Desktop import

A PHP script that turns PrestaShop orders into a QuickBooks Desktop IIF invoice file, with test orders you can run offline.

A sample PrestaShop order beside the QuickBooks invoice lines it becomes
Fig. 1 · Order import scriptSpec sample

What's in it

  1. ps2qb.php (PHP 8, curl only): one invoice per order, one line per product (QB item = PrestaShop SKU), plus shipping and discount lines
  2. A checklist and a flag when an order total does not match
  3. Account and item names sit in a $cfg block so they can match a chart of accounts
  4. Offline test: php ps2qb.php --fixture=sample-orders.json --out=test.iif
  5. Sample buyers are clearly fake (Example Boutique LLC, Pat Example, Sam Sample)

The output

sample-orders.iifsample-orders.iif: what the script wrote for the two test orders
!TRNS  TRNSID  TRNSTYPE  DATE  ACCNT  NAME  AMOUNT  DOCNUM  MEMO
!SPL  SPLID  TRNSTYPE  DATE  ACCNT  NAME  AMOUNT  DOCNUM  MEMO  QNTY  PRICE  INVITEM
!ENDTRNS
TRNS    INVOICE  11/12/2026  Accounts Receivable  Example Boutique LLC  1245.00  PS-XKBKNABJK  PrestaShop order 1041
SPL    INVOICE  11/12/2026  Sales - Wholesale  Example Boutique LLC  -510.00  PS-XKBKNABJK  Heavyweight Tee - Black, L  -60  8.50  TEE-BLK-L
SPL    INVOICE  11/12/2026  Sales - Wholesale  Example Boutique LLC  -690.00  PS-XKBKNABJK  Fleece Hoodie - Grey, M  -40  17.25  HOOD-GRY-M
SPL    INVOICE  11/12/2026  Shipping Income  Example Boutique LLC  -45.00  PS-XKBKNABJK  Shipping      Shipping
ENDTRNS
TRNS    INVOICE  11/13/2026  Accounts Receivable  Sam Sample  612.00  PS-QOPLWZTRE  PrestaShop order 1042
SPL    INVOICE  11/13/2026  Sales - Wholesale  Sam Sample  -648.00  PS-QOPLWZTRE  Twill Cap, Navy  -120  5.40  CAP-NVY
SPL    INVOICE  11/13/2026  Sales Discounts  Sam Sample  36.00  PS-QOPLWZTRE  Discount      Discount
ENDTRNS

Want something like this?

alexmercer.projects@gmail.com

Email me the job. You get a free sample first, and most jobs are done within 24 hours once the brief and files are ready.

Email Alex