DeletedRecord

Get deleted records

Changed on

List the records of one type that were deleted from your company, oldest deletion first. Use it alongside the updated_datetime filter of that type's list endpoint to keep a copy of your data in sync (Incremental Sync): list endpoints leave deleted records out by default, so a copy synced from them never learns of a deletion on its own. Each record_type is the type of one endpoint, such as ORDER for GET /public/v1/orders or COMPANY_GROUP for GET /public/v1/company-groups.

Every deletion is listed, including the ones caused by deleting something else, such as an order's invoices or a product's batches; each is listed under its own type. A voided invoice or payment is not deleted; it stays on its list endpoint with its new status. A record that is restored after it was deleted leaves this list and comes back on its list endpoint with a new updated_datetime.

Deletions are kept for 90 days. If your copy was last synced longer ago than that, reconcile it as in Incremental Sync step 7 before resuming.

A deletion becomes visible here once its change is committed, which can be shortly after its deleted_datetime, and this endpoint is eventually consistent: a deletion can take up to 1 second to appear. When you poll with deleted_datetime, use the same lower bound as your list calls (Incremental Sync) and ignore records you already removed.

Results are paginated. Follow the next_page URL in the response to fetch the following page.

Required permission: the same as the endpoint of record_type (for example orders_permissions_view for ORDER); tags and unit types need none. Team restrictions do not apply here: every deletion of that type in your company is listed.

get/public/v1/deleted-records

Request

  • Base URL
    https://app.distru.com
  • Auth
    HTTP bearer

Query parameters

record_type'ADJUSTMENT' | 'ASSEMBLY' | 'BATCH' | 'BIN' | 'CHARGE_PRESET' | 'COMPANY' | 'COMPANY_GROUP' | 'CONTACT' | 'COST_TYPE' | 'CREDIT' | 'CUSTOM_FIELD' | 'DRIVER' | 'INVOICE' | 'LICENSE' | 'LOCATION' | 'MENU' | 'ORDER' | 'PACKAGE' | 'PAYMENT' | 'PAYMENT_METHOD' | 'PAYMENT_TERM' | 'PRICE_TIER' | 'PRODUCT' | 'PRODUCT_CATEGORY' | 'PRODUCT_GROUP' | 'PRODUCT_POS_MAPPING' | 'PRODUCT_SUBCATEGORY' | 'PURCHASE' | 'RETURN' | 'STRAIN' | 'TAG' | 'TASK' | 'TAX' | 'TEST_RESULT' | 'UNIT_TYPE' | 'USER' | 'VEHICLE' required

Required. The kind of deleted record to list. Each request lists one kind; make one request per kind you sync.

deleted_datetimestring

Filter by deletion datetime, given as an inclusive after,before range of ISO 8601 timestamps separated by a comma. Either bound may be left empty: after, keeps only records deleted on or after after; ,before only those deleted on or before before; after,before keeps those inside the closed range. A range with both bounds empty is rejected.

pagestring

Page selector. Page size is fixed by the server; paginate by following the next_page URL in each response rather than building page selectors yourself — it is null on the last page. next_page uses page[after]=<cursor>, an opaque token marking where the next page resumes; pass it back exactly as given, and only to the endpoint that issued it. This is seek-based, so every page stays fast no matter how deep you page.

Response

A list of deleted records

next_pagestring

URL for the next page of results; null when there is no next page

Changes

    • warning

      added the new ADJUSTMENT enum value to the // response property for the response status

    • warning

      added the new BATCH enum value to the // response property for the response status

    • warning

      added the new BIN enum value to the // response property for the response status

    • warning

      added the new CHARGE_PRESET enum value to the // response property for the response status

    • warning

      added the new COMPANY enum value to the // response property for the response status

    • warning

      added the new COMPANY_GROUP enum value to the // response property for the response status

    • warning

      added the new CONTACT enum value to the // response property for the response status

    • warning

      added the new COST_TYPE enum value to the // response property for the response status

    • warning

      added the new CREDIT enum value to the // response property for the response status

    • warning

      added the new CUSTOM_FIELD enum value to the // response property for the response status

    • warning

      added the new DRIVER enum value to the // response property for the response status

    • warning

      added the new LICENSE enum value to the // response property for the response status

    • warning

      added the new LOCATION enum value to the // response property for the response status

    • warning

      added the new MENU enum value to the // response property for the response status

    • warning

      added the new PAYMENT enum value to the // response property for the response status

    • warning

      added the new PAYMENT_METHOD enum value to the // response property for the response status

    • warning

      added the new PAYMENT_TERM enum value to the // response property for the response status

    • warning

      added the new PRICE_TIER enum value to the // response property for the response status

    • warning

      added the new PRODUCT enum value to the // response property for the response status

    • warning

      added the new PRODUCT_CATEGORY enum value to the // response property for the response status

    • warning

      added the new PRODUCT_GROUP enum value to the // response property for the response status

    • warning

      added the new PRODUCT_POS_MAPPING enum value to the // response property for the response status

    • warning

      added the new PRODUCT_SUBCATEGORY enum value to the // response property for the response status

    • warning

      added the new PURCHASE enum value to the // response property for the response status

    • warning

      added the new RETURN enum value to the // response property for the response status

    • warning

      added the new STRAIN enum value to the // response property for the response status

    • warning

      added the new TAG enum value to the // response property for the response status

    • warning

      added the new TASK enum value to the // response property for the response status

    • warning

      added the new TAX enum value to the // response property for the response status

    • warning

      added the new TEST_RESULT enum value to the // response property for the response status

    • warning

      added the new UNIT_TYPE enum value to the // response property for the response status

    • warning

      added the new USER enum value to the // response property for the response status

    • warning

      added the new VEHICLE enum value to the // response property for the response status

    • info

      added the new enum value ADJUSTMENT to the query request parameter record_type

    • info

      added the new enum value BATCH to the query request parameter record_type

    • info

      added the new enum value BIN to the query request parameter record_type

    • info

      added the new enum value CHARGE_PRESET to the query request parameter record_type

    • info

      added the new enum value COMPANY to the query request parameter record_type

    • info

      added the new enum value COMPANY_GROUP to the query request parameter record_type

    • info

      added the new enum value CONTACT to the query request parameter record_type

    • info

      added the new enum value COST_TYPE to the query request parameter record_type

    • info

      added the new enum value CREDIT to the query request parameter record_type

    • info

      added the new enum value CUSTOM_FIELD to the query request parameter record_type

    • info

      added the new enum value DRIVER to the query request parameter record_type

    • info

      added the new enum value LICENSE to the query request parameter record_type

    • info

      added the new enum value LOCATION to the query request parameter record_type

    • info

      added the new enum value MENU to the query request parameter record_type

    • info

      added the new enum value PAYMENT to the query request parameter record_type

    • info

      added the new enum value PAYMENT_METHOD to the query request parameter record_type

    • info

      added the new enum value PAYMENT_TERM to the query request parameter record_type

    • info

      added the new enum value PRICE_TIER to the query request parameter record_type

    • info

      added the new enum value PRODUCT to the query request parameter record_type

    • info

      added the new enum value PRODUCT_CATEGORY to the query request parameter record_type

    • info

      added the new enum value PRODUCT_GROUP to the query request parameter record_type

    • info

      added the new enum value PRODUCT_POS_MAPPING to the query request parameter record_type

    • info

      added the new enum value PRODUCT_SUBCATEGORY to the query request parameter record_type

    • info

      added the new enum value PURCHASE to the query request parameter record_type

    • info

      added the new enum value RETURN to the query request parameter record_type

    • info

      added the new enum value STRAIN to the query request parameter record_type

    • info

      added the new enum value TAG to the query request parameter record_type

    • info

      added the new enum value TASK to the query request parameter record_type

    • info

      added the new enum value TAX to the query request parameter record_type

    • info

      added the new enum value TEST_RESULT to the query request parameter record_type

    • info

      added the new enum value UNIT_TYPE to the query request parameter record_type

    • info

      added the new enum value USER to the query request parameter record_type

    • info

      added the new enum value VEHICLE to the query request parameter record_type

    • info

      endpoint added