Remove a Record by ID

In the contract-based REST API, you can remove a record by its session identifier. To remove a record from MYOB Acumatica, you access the needed URL address with the DELETE HTTP method. See the following sections for details on the request and the response.

Any REST API response contains the _links/self field for every top-level entity it returns. The value of this field is part of the URL of a GET request to retrieve this top-level entity by its ID. The same URL can be used in a DELETE request to remove this entity.

Attention:
If you need to remove a detail line of a record, you should use the PUT HTTP method, as described in Update a Record.

HTTP Method and URL

If you need to remove a record with a known entity ID, you use the DELETE HTTP method and the following URL. For details about entity IDs, see Retrieve a Record by ID.
DELETE http://<Base endpoint URL>/<Top-level entity>/<Entity ID>
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 remove a record.
  • <Entity ID> is the ID of the record to be removed. Entity ID is a GUID that is assigned to each entity you work with during an MYOB Acumatica session. You can obtain the value of the entity ID from the ID property of an entity returned from MYOB Acumatica.

For example, suppose that you want to remove the sales order with entity ID 03efa858-2351-4bd5-ae06-3d9fb3b3c1e6 from a local MYOB Acumatica instance with the name AcumaticaDB by using the system endpoint with the name Default and Version 24.200.001. You should use the following URL to remove the sales order: http://localhost/AcumaticaDB/entity/Default/24.200.001/SalesOrder/03efa858-2351-4bd5-ae06-3d9fb3b3c1e6.

Parameters

You use no parameters when you remove a record.

Request Headers

You do not specify any header in the request.

Response Status Codes

The following table lists the HTTP status codes that the system returns for a request that removes a record by its entity ID.

Code Description
204 The request has been completed successfully. The record is removed.
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 API 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 shows an example of the removal of the sales order with the ID 286F2AF0-21F5-EB11-9DF1-9828A61840C3.
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.
DELETE /286F2AF0-21F5-EB11-9DF1-9828A61840C3 HTTP/1.1
Host: [<MYOB Acumatica instance URL>]/entity/Default/24.200.001/SalesOrder
Accept: application/json
Content-Type: application/json