Skip to content

Commit 22ba9d8

Browse files
authored
Merge pull request #62 from veryfi/feature/delete-a-tag
Add delete_tag API and update dependencies
2 parents b71e2b6 + 17692ec commit 22ba9d8

5 files changed

Lines changed: 1530 additions & 3497 deletions

File tree

lib/client/client.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ require('../documents/processDocumentUrl');
3939
require('../documents/updateDocument');
4040
require('../documents/tags/addTags');
4141
require('../documents/tags/addTag');
42+
require('../documents/tags/deleteTag');
4243
require('../documents/tags/deleteTags');
4344
require('../documents/tags/replaceTags');
4445
require('../split/splitDocumentBase64');

lib/documents/tags/deleteTag.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const Client = require('../../client/constructor');
2+
/**
3+
* Unlink a tag from a document. https://docs.veryfi.com/api/receipts-invoices/unlink-a-tag-from-a-document/
4+
*
5+
* @param {string} document_id ID of the document you'd like to unlink the tag from
6+
* @param {string} tag_id ID of the tag you'd like to unlink
7+
* @return {JSON} response about the unlinked tag.
8+
*/
9+
Client.prototype.delete_tag = async function (document_id, tag_id) {
10+
let endpoint_name = `/documents/${document_id}/tags/${tag_id}/`;
11+
let request_arguments = {};
12+
return this._request("DELETE", endpoint_name, request_arguments);
13+
}

lib/types/Client.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,6 +1104,16 @@ export declare class Client {
11041104
*/
11051105
public delete_tags(document_id: string): Promise<any>;
11061106

1107+
/**
1108+
* Unlink a tag from a document. https://docs.veryfi.com/api/receipts-invoices/unlink-a-tag-from-a-document/
1109+
*
1110+
* @memberof Client
1111+
* @param {string} document_id ID of the document you'd like to unlink the tag from
1112+
* @param {string} tag_id ID of the tag you'd like to unlink
1113+
* @return {Promise<any>} response about the unlinked tag.
1114+
*/
1115+
public delete_tag(document_id: string, tag_id: string): Promise<any>;
1116+
11071117
/**
11081118
* Add multiple tags on an existing document. https://docs.veryfi.com/api/receipts-invoices/add-tags-to-a-document/
11091119
*

0 commit comments

Comments
 (0)