Publish items
Publish Ready items to the connected accounting software.
POST https://cotlet.dev/api/v1/dext/items/publish
write Confirm
Sends the extracted data and the document image of each item to its destination, where it appears within a few seconds. Only Ready items publish; others come back with the missing field. Needs the Admin role or publishing permission. Dext archives published items by default. Failed items return the publishing error. By default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| item_ids string[] required | string[] | Item IDs from list_items. |
| publish_to string | string | Destination. Default: the item's Publish to. |
| publish_as string | string | Xero only: the status to publish as, one of those Dext offers. |
Request
curl -X POST https://cotlet.dev/api/v1/dext/items/publish \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"item_ids":["it_7f3a11","it_7f3a12"],"publish_to":"Xero","publish_as":"draft"}' result = client.call("dext", "publish_items", {"item_ids":["it_7f3a11","it_7f3a12"],"publish_to":"Xero","publish_as":"draft"}) const result = await cotlet.call('dext', 'publish_items', {"item_ids":["it_7f3a11","it_7f3a12"],"publish_to":"Xero","publish_as":"draft"}); cotlet call dext publish_items --data '{"item_ids":["it_7f3a11","it_7f3a12"],"publish_to":"Xero","publish_as":"draft"}' Example response
{
"published": [
{
"item_id": "it_7f3a11",
"publish_to": "Xero",
"publish_as": "draft"
}
],
"failed": [],
"skipped": [
{
"item_id": "it_7f3a10",
"reason": "missing category"
}
]
}