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 .xml suffix or ?format=xml

HTTP + XML

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

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

<DocumentTypeGet xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints.Operations">
  <Filters xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints">
    <Filter>
      <AndOr>And</AndOr>
      <FieldName>String</FieldName>
      <Group>Undefined</Group>
      <SearchOperator>Undefined</SearchOperator>
      <SearchValue>String</SearchValue>
    </Filter>
  </Filters>
  <ReturnTopNRecords xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints">0</ReturnTopNRecords>
  <APIKEY>String</APIKEY>
  <showDeleted>showOnlyUndeleted</showDeleted>
</DocumentTypeGet>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<DocumentTypeGetResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints.Operations">
  <mvDocumentTypes xmlns:d2p1="https://api.megaventory.com/types">
    <d2p1:MvDocumentType>
      <d2p1:DocumentTypeID>0</d2p1:DocumentTypeID>
      <d2p1:DocumentTypeCompanyID>0</d2p1:DocumentTypeCompanyID>
      <d2p1:DocumentTypeAbbreviation>String</d2p1:DocumentTypeAbbreviation>
      <d2p1:DocumentTypeDescription>String</d2p1:DocumentTypeDescription>
      <d2p1:DocumentTypeStockChange>None</d2p1:DocumentTypeStockChange>
      <d2p1:InvoiceType>None</d2p1:InvoiceType>
      <d2p1:RestrictProductsBySupplier>false</d2p1:RestrictProductsBySupplier>
      <d2p1:UpdateSupplierClientPriceWhenIssued>false</d2p1:UpdateSupplierClientPriceWhenIssued>
      <d2p1:IsReturn>false</d2p1:IsReturn>
      <d2p1:IsAdjustment>false</d2p1:IsAdjustment>
      <d2p1:IsTransfer>false</d2p1:IsTransfer>
      <d2p1:IsSalesQuote>false</d2p1:IsSalesQuote>
      <d2p1:IsSalesOrder>false</d2p1:IsSalesOrder>
      <d2p1:IsPurchaseOrder>false</d2p1:IsPurchaseOrder>
      <d2p1:IsFinishedGoodsReceipt>false</d2p1:IsFinishedGoodsReceipt>
      <d2p1:IsWorkOrder>false</d2p1:IsWorkOrder>
      <d2p1:IsHandlingInvoice>false</d2p1:IsHandlingInvoice>
      <d2p1:RelatedDocumentTypeID>0</d2p1:RelatedDocumentTypeID>
      <d2p1:DocumentTypeOptionsShowSKUImage>false</d2p1:DocumentTypeOptionsShowSKUImage>
      <d2p1:DocumentTypeOptionsShowSupplierSKU>false</d2p1:DocumentTypeOptionsShowSupplierSKU>
      <d2p1:DocumentTypeOptionsShowTax>false</d2p1:DocumentTypeOptionsShowTax>
      <d2p1:DocumentTypeOptionsShowDiscount>false</d2p1:DocumentTypeOptionsShowDiscount>
      <d2p1:DocumentTypeOptionsShowRemarks>false</d2p1:DocumentTypeOptionsShowRemarks>
      <d2p1:DocumentTypeOptionsShowWeight>false</d2p1:DocumentTypeOptionsShowWeight>
      <d2p1:DocumentTypeOptionsShowExpectedDeliveryDate>false</d2p1:DocumentTypeOptionsShowExpectedDeliveryDate>
      <d2p1:DocumentTypePrintOptionsUseCustomHeader>false</d2p1:DocumentTypePrintOptionsUseCustomHeader>
      <d2p1:DocumentTypePrintOptionsUseCustomFooter>false</d2p1:DocumentTypePrintOptionsUseCustomFooter>
      <d2p1:DocumentTypePrintOptionsShowClientInPickPackSlips>false</d2p1:DocumentTypePrintOptionsShowClientInPickPackSlips>
      <d2p1:DocumentTypePrintOptionsUseCustomHeaderPackingSlip>false</d2p1:DocumentTypePrintOptionsUseCustomHeaderPackingSlip>
      <d2p1:DocumentTypePrintOptionsUseCustomFooterPackingSlip>false</d2p1:DocumentTypePrintOptionsUseCustomFooterPackingSlip>
      <d2p1:DocumentTypePrintOptionsUseCustomHeaderPickingSlip>false</d2p1:DocumentTypePrintOptionsUseCustomHeaderPickingSlip>
      <d2p1:DocumentTypePrintOptionsUseCustomFooterPickingSlip>false</d2p1:DocumentTypePrintOptionsUseCustomFooterPickingSlip>
      <d2p1:DocumentTypePrintOptionsUseCustomHeaderDeliverySlip>false</d2p1:DocumentTypePrintOptionsUseCustomHeaderDeliverySlip>
      <d2p1:DocumentTypePrintOptionsUseCustomFooterDeliverySlip>false</d2p1:DocumentTypePrintOptionsUseCustomFooterDeliverySlip>
      <d2p1:DocumentTypePrintOptionsUseCustomFont>false</d2p1:DocumentTypePrintOptionsUseCustomFont>
      <d2p1:DocumentTypePrintOptionsShowEAN>false</d2p1:DocumentTypePrintOptionsShowEAN>
      <d2p1:DocumentTypePrintOptionsShowSKU>false</d2p1:DocumentTypePrintOptionsShowSKU>
      <d2p1:DocumentTypePrintOptionsShowSubLocation>false</d2p1:DocumentTypePrintOptionsShowSubLocation>
      <d2p1:DocumentTypePrintOptionsShowMovedQuantity>false</d2p1:DocumentTypePrintOptionsShowMovedQuantity>
      <d2p1:DocumentTypePrintOptionsShowURL>false</d2p1:DocumentTypePrintOptionsShowURL>
      <d2p1:DocumentTypePrintOptionsShowSerialNumbers>false</d2p1:DocumentTypePrintOptionsShowSerialNumbers>
      <d2p1:DocumentTypeOptionsShowDateTime>false</d2p1:DocumentTypeOptionsShowDateTime>
      <d2p1:DocumentTypePrintOptionsUseCustomSubject>false</d2p1:DocumentTypePrintOptionsUseCustomSubject>
      <d2p1:DocumentTypePrintOptionsShowPreTaxTotalsInRow>false</d2p1:DocumentTypePrintOptionsShowPreTaxTotalsInRow>
      <d2p1:DocumentTypePrintOptionsShowPostTaxTotalsInRow>false</d2p1:DocumentTypePrintOptionsShowPostTaxTotalsInRow>
      <d2p1:DocumentTypePrintOptionsShowPreDiscountTotalsInRow>false</d2p1:DocumentTypePrintOptionsShowPreDiscountTotalsInRow>
      <d2p1:DocumentTypePrintOptionsShowPostDiscountTotalsInRow>false</d2p1:DocumentTypePrintOptionsShowPostDiscountTotalsInRow>
      <d2p1:DocumentTypeAutoNumbering>false</d2p1:DocumentTypeAutoNumbering>
      <d2p1:DocumentTypeAutoNumberingStartFrom>0</d2p1:DocumentTypeAutoNumberingStartFrom>
      <d2p1:DocumentTypeAutoNumberingNextNumber>0</d2p1:DocumentTypeAutoNumberingNextNumber>
      <d2p1:DocumentTypeAutoNumberingPrefix>String</d2p1:DocumentTypeAutoNumberingPrefix>
      <d2p1:DocumentTypeAutoNumberingPostfix>String</d2p1:DocumentTypeAutoNumberingPostfix>
    </d2p1:MvDocumentType>
  </mvDocumentTypes>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
      </d2p1:ResponseError>
    </d2p1:Errors>
  </ResponseStatus>
  <InternalErrorCode>String</InternalErrorCode>
</DocumentTypeGetResponse>