Operate with Archived Records

In MYOB Acumatica, you can archive records for particular entities. When you use the contract-based REST API to retrieve records, archived records are hidden by default. To make archived records visible, in the HTTP requests you make, you use the custom PX-ApiArchive HTTP header and the SHOW value. See the following sections for details on the request and the response.

Note: The updating of an archived record can lead to unpredictable consequences.

HTTP Method and URL

When you retrieve records in MYOB Acumatica, you use the GET HTTP method and the following URL.

GET http://<Base endpoint URL>/<Top-level entity>
The URL has the following components:
  • <Base endpoint URL> is the URL of the contract-based endpoint through which you are going to work with MYOB Acumatica. This URL has the following format: http://<MYOB Acumatica instance URL>/entity/<Endpoint name>/<Endpoint version>/.
  • <Top-level entity> is the name of the entity for which you are going to create or update a record.

For example, suppose that you want to retrieve shipments from a local MYOB Acumatica instance with the name AcumaticaDB by using a system endpoint with the name Default and Version 23.200.001. You would use the following URL to retrieve records.

http://localhost/AcumaticaDB/entity/Default/23.200.001/Shipment

Parameters

For information on the request parameters, see the Parameters section of Retrieve Records by Conditions.

Request Headers

You can use the PX-ApiArchive optional header and set its value to SHOW to make archived records visible for REST API requests.

Response Status Codes

The following table lists the HTTP status codes that the system returns for a request that retrieves records by conditions.

CodeDescription
200The request has been completed successfully. The response body contains the list of records that satisfy the specified conditions.
401

The user is not signed in to the system.

403

The user has insufficient rights to access the MYOB Acumatica form that corresponds to the entity.

429

The number of requests has exceeded the limit imposed by the license (see License Restrictions for API Users).

500

An internal server error has occurred.

Example

The following request is an example of the retrieval of shipments (including archived ones) that were created before December 31, 2023.

Tip: In the request example below, <MYOB Acumatica instance URL> is the URL of the MYOB Acumatica instance (such as https://my.acumatica.com/MyInstance). You can omit the instance name in the URL (that is, you can use https://my.acumatica.com) if the instance is installed in the root of the website.
GET ?$filter=ShipmentDate lt datetimeoffset'2023-12-31' HTTP/1.1
Host: [<MYOB Acumatica instance URL>]/entity/Default/23.200.001/Shipment
Accept: application/json
Content-Type: application/json
PX-ApiArchive: SHOW