Delete Attachments Associated with a Receipt

DELETE /receipts/{id}/attachments/{attachment_ids} — Use this method to delete attachments with the specified attachment IDs associated with the receipt with the specified internal ID, or clear the association between the workspace document with the specified attachment ID and the receipt with the specified internal ID.

Parameters

Path parameters

Path parameter

Required / Optional

Description

Type

{id}

Required

The internal ID of the receipt.

integer

{attachment_ids}

Required

A comma-separated list of internal IDs for the attachments. The list must not include more than 1000 attachment IDs.

integer

Query string parameter

Path parameter

Required / Optional

Description

Type

filterSetId

Optional

The internal ID of the filter set to be applied.

  • When specified, the request is successful only if the action is available when the specified filter set is active in SuiteProjects Pro. The filter set with the specified internal ID must exist and must be associated with the user who authorized the application as per the access token.

  • Otherwise and by default, the primary filter set associated with the user who authorized the application is applied.

integer

Response definitions

A successful request returns a JSON object with the following properties:

Property

Description

data

An array containing an object with key-value pairs, where:

  • The key is each of the internal ID in the {attachement_ids} path parameter in the request.

  • The value is the object that would be returned when using a method to delete the attachment with the internal ID referenced by the key. This object has the following properties:

    • An array containing an object with only the ID of the attachment deleted, if the operation was successful.

      See Returned Data.

    • A string containing a brief message about the status of your request — for example, “Success” or “Attachment #2675 not found”.

    If your request includes multiple attachment IDs, both valid and invalid, the request will complete successfully for valid attachment IDs and return an error message for invalid attachment IDs — for example, "Access to Attachment #693 denied". The response status will be 207 Multiple statuses returned.

    If your request includes more than 1,000 attachment IDs, an error is returned — for example, "Bulk action limit reached, sent 1001 entities of 1000 allowed".

message

A string containing a brief message about the status of your request — for example, “Success”.

Sample request

            DELETE receipts/2674/attachments/4985,4987 HTTP/1.1
Host: company-id.app.netsuitesuiteprojectspro.com
Authorization: Bearer <OAuth2_access_token> 

          

In the example, <OAuth2_access_token> is the OAuth 2.0 access token obtained for the client application connecting to SuiteProjects Pro. See Authentication.

Sample response

            {
   "data": [
      {
         "4985" : {
              "data": [{
                   "id": "4985"
              }],
              "message": "success"
         },
          "4987" : {
              "data": [{
                   "id": "4987"
              }],
              "message": "success"
         }
      }
   ],
   "message": "success"
}