Skip to main content

NetSuite Preview and CSV Export

Preview the NetSuite vendorBill records a posting would send, with the bills left out and why, or export the same bills as a NetSuite CSV Import Assistant file.

GET /v1/ap/netsuite/preview returns the REST Record API vendorBill bodies for the bills a posting run would post, and the bills it leaves out with the reason. The adapter is simulated and nothing is sent to NetSuite. The response has adapter.mode: "simulated_sandbox" to say so. Duplicate bills are never included. Held bills are included only with include_held, and then post on payment hold with approval pending. Bills whose entity posts to another system, or whose entity has no NetSuite subsidiary, are skipped.

GET/v1/ap/netsuite/preview

Query parameters

include_heldstring1 or true to include held bills (other than duplicates), on payment hold with approval pending. Any other value leaves them out.
entitystringOnly this entity's bills (its code). An empty value selects bills with no entity.

Response fields

adapterobjectname NetSuite, mode simulated_sandbox, and the sandbox account label.
include_heldbooleanWhether held bills are included.
records[]arraybill_key, method POST, path /services/rest/record/v1/vendorBill and the vendorBill body.
skipped[]arraybill_key, invoice_number, vendor and the reason the bill is left out.
totalsobjectrecords, amount and held_on_payment_hold.

cURL: Preview including held bills for one entity

curl "https://api.talonic.com/v1/ap/netsuite/preview?include_held=true&entity=US01" \
  -H "Authorization: Bearer $TALONIC_API_KEY"

Response: Preview (abridged)

{
  "adapter": { "name": "NetSuite", "mode": "simulated_sandbox", "account": "SANDBOX-1" },
  "include_held": true,
  "records": [
    { "bill_key": "bill-0001", "method": "POST", "path": "/services/rest/record/v1/vendorBill", "body": { "externalId": "bill-0001" } }
  ],
  "skipped": [
    { "bill_key": "bill-0004", "invoice_number": "A-88", "vendor": "Harbor Supply", "reason": "duplicate" }
  ],
  "totals": { "records": 1, "amount": 18450, "held_on_payment_hold": 1 }
}
GET/v1/ap/netsuite/export.csv

Query parameters

include_heldstring1 or true to include held bills, as in the preview.
entitystringOnly this entity's bills (its code); an empty value selects bills with no entity.

cURL: Download the CSV

curl -o netsuite-vendor-bills.csv "https://api.talonic.com/v1/ap/netsuite/export.csv" \
  -H "Authorization: Bearer $TALONIC_API_KEY"
The CSV has the same bills as the preview for the same parameters, so a file imported through NetSuite's CSV Import Assistant matches what the simulated posting would have sent. The REST field names follow NetSuite's REST Record API but have not been posted to a real account. Item lines reference items by externalId, which is the SKU.

Frequently asked questions

Why is a bill missing from the preview?+
It appears in skipped with a reason. Duplicates are never included, held bills are left out unless include_held is set, and bills whose entity posts to another system or has no NetSuite subsidiary are skipped.
Does the preview call NetSuite?+
No. The preview is computed inside the platform from the bills and the AP configuration, and the adapter mode is simulated_sandbox. Nothing is sent to NetSuite by the preview, the CSV export or the posting route.
What does entity with an empty value select?+
Bills that have no entity. A non-empty value selects the bills of the entity with that code. Omit the parameter to include every entity.