Megaventory API v2017a

<back to all web services

DocumentTypeGet

The following routes are available for this service:
GET POST/DocumentType/DocumentTypeGetGets information on document types.Uses your API Key and some Filters in an array format and returns the search results using the given filters. Optionally, you can use ReturnTopNRecords to limit the number of the results to the specified number (omit, or add ReturnTopNRecords = -1 to get all the available results). The ReturnTopNRecords chooses the top records in a DocumentTypeId descending order.

Examples:



A.

Return the first document type (deleted or undeleted) whose description contains orders and which shows discounts. The result is returned as an mvDocumentTypes object.
We can add two Filters by using the AndOr operator as shown below:

Value:

  {
   "showDeleted": "showAllDeletedAndUndeleted",
   "Filters": [
      {
         "FieldName": "DocumentTypeDescription",
         "SearchOperator": "Contains",
         "SearchValue": "Order"
      },
      {
         "AndOr": "And",
         "FieldName": "DocumentTypeOptionsShowDiscount",
         "SearchOperator": "Equals",
         "SearchValue": "true"
      }
   ],
   "ReturnTopNRecords":1
}

Response:

{
   "mvDocumentTypes": [
      {
         "DocumentTypeID": 4,
          "DocumentTypeAbbreviation": "PO",
          "DocumentTypeDescription": "Purchase Order",
          "DocumentTypeStockChange": "None",
          "InvoiceType": "None",
          "RestrictProductsBySupplier": false,
          "UpdateSupplierClientPriceWhenIssued": false,
          "IsReturn": false,
          "IsAdjustment": false,
          "IsTransfer": false,
          "IsSalesQuote": false,
          "IsSalesOrder": false,
          "IsPurchaseOrder": true,
          "IsFinishedGoodsReceipt": false,
          "IsWorkOrder": false,
          "IsHandlingInvoice": false,
          "DocumentTypeOptionsShowSKUImage": true,
          "DocumentTypeOptionsShowSupplierSKU": true,
          "DocumentTypeOptionsShowTax": true,
          "DocumentTypeOptionsShowDiscount": true,
          "DocumentTypeOptionsShowRemarks": false,
          "DocumentTypeOptionsShowExpectedDeliveryDate": false,
          "DocumentTypePrintOptionsUseCustomHeader": false,
          "DocumentTypePrintOptionsUseCustomFooter": false,
          "DocumentTypePrintOptionsShowClientInPickPackSlips": false,
          "DocumentTypePrintOptionsUseCustomHeaderPackingSlip": false,
          "DocumentTypePrintOptionsUseCustomFooterPackingSlip": false,
          "DocumentTypePrintOptionsUseCustomHeaderPickingSlip": false,
          "DocumentTypePrintOptionsUseCustomFooterPickingSlip": false,
          "DocumentTypePrintOptionsUseCustomFont": false,
          "DocumentTypePrintOptionsShowEAN": false,
          "DocumentTypePrintOptionsShowSKU": false,
          "DocumentTypePrintOptionsShowSubLocation": true,
          "DocumentTypePrintOptionsShowMovedQuantity": true,
          "DocumentTypePrintOptionsShowURL": true,
          "DocumentTypePrintOptionsShowSerialNumbers": false,
          "DocumentTypeOptionsShowDateTime": true,
          "DocumentTypePrintOptionsUseCustomSubject": false,
          "DocumentTypePrintOptionsShowPreTaxTotalsInRow": false,
          "DocumentTypePrintOptionsShowPostTaxTotalsInRow": false,
          "DocumentTypePrintOptionsShowPreDiscountTotalsInRow": false,
          "DocumentTypePrintOptionsShowPostDiscountTotalsInRow": false,
          "DocumentTypeAutoNumbering": true,
          "DocumentTypeAutoNumberingStartFrom": 1,
          "DocumentTypeAutoNumberingNextNumber": 50,
          "DocumentTypeAutoNumberingPrefix": "",
          "DocumentTypeAutoNumberingPostfix": ""
      }
   ],
   "ResponseStatus": {
      "ErrorCode": "0"
   }
}

To override the Content-type in your clients HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /jsv/reply/DocumentTypeGet HTTP/1.1 
Host: api.megaventory.com 
Content-Type: text/jsv
Content-Length: length

{
	Filters: 
	[
		{
			AndOr: And,
			Group: Undefined,
			FieldName: String,
			SearchOperator: Undefined,
			SearchValue: String
		}
	],
	ReturnTopNRecords: 0,
	APIKEY: String,
	showDeleted: showOnlyUndeleted
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	mvDocumentTypes: 
	[
		{
			DocumentTypeID: 0,
			DocumentTypeCompanyID: 0,
			DocumentTypeAbbreviation: String,
			DocumentTypeDescription: String,
			DocumentTypeStockChange: None,
			InvoiceType: None,
			RestrictProductsBySupplier: False,
			UpdateSupplierClientPriceWhenIssued: False,
			IsReturn: False,
			IsAdjustment: False,
			IsTransfer: False,
			IsSalesQuote: False,
			IsSalesOrder: False,
			IsPurchaseOrder: False,
			IsFinishedGoodsReceipt: False,
			IsWorkOrder: False,
			IsHandlingInvoice: False,
			RelatedDocumentTypeID: 0,
			DocumentTypeOptionsShowSKUImage: False,
			DocumentTypeOptionsShowSupplierSKU: False,
			DocumentTypeOptionsShowTax: False,
			DocumentTypeOptionsShowDiscount: False,
			DocumentTypeOptionsShowRemarks: False,
			DocumentTypeOptionsShowWeight: False,
			DocumentTypeOptionsShowExpectedDeliveryDate: False,
			DocumentTypePrintOptionsUseCustomHeader: False,
			DocumentTypePrintOptionsUseCustomFooter: False,
			DocumentTypePrintOptionsShowClientInPickPackSlips: False,
			DocumentTypePrintOptionsUseCustomHeaderPackingSlip: False,
			DocumentTypePrintOptionsUseCustomFooterPackingSlip: False,
			DocumentTypePrintOptionsUseCustomHeaderPickingSlip: False,
			DocumentTypePrintOptionsUseCustomFooterPickingSlip: False,
			DocumentTypePrintOptionsUseCustomHeaderDeliverySlip: False,
			DocumentTypePrintOptionsUseCustomFooterDeliverySlip: False,
			DocumentTypePrintOptionsUseCustomFont: False,
			DocumentTypePrintOptionsShowEAN: False,
			DocumentTypePrintOptionsShowSKU: False,
			DocumentTypePrintOptionsShowSubLocation: False,
			DocumentTypePrintOptionsShowMovedQuantity: False,
			DocumentTypePrintOptionsShowURL: False,
			DocumentTypePrintOptionsShowSerialNumbers: False,
			DocumentTypeOptionsShowDateTime: False,
			DocumentTypePrintOptionsUseCustomSubject: False,
			DocumentTypePrintOptionsShowPreTaxTotalsInRow: False,
			DocumentTypePrintOptionsShowPostTaxTotalsInRow: False,
			DocumentTypePrintOptionsShowPreDiscountTotalsInRow: False,
			DocumentTypePrintOptionsShowPostDiscountTotalsInRow: False,
			DocumentTypeAutoNumbering: False,
			DocumentTypeAutoNumberingStartFrom: 0,
			DocumentTypeAutoNumberingNextNumber: 0,
			DocumentTypeAutoNumberingPrefix: String,
			DocumentTypeAutoNumberingPostfix: String
		}
	],
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String
			}
		]
	},
	InternalErrorCode: String
}