Megaventory API v2017a

<back to all web services

DocumentTypeUpdate

The following routes are available for this service:
POST/DocumentType/DocumentTypeUpdateUpdates a document type.Uses your API Key and some Filters in an array format to apply the given action to an existing DocumentType.

Examples:



A.

Update the Document type with DocumentTypeAbbreviation = "PO". The result is returned as an mvDocumentTypes object.
The documentType with DocumentTypeAbbreviation = "PO" before the Update:

Response:

    {
        "mvDocumentType":
        {
            "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": ""
        }
    }

Then we call the documentTypeUpdate.
We update the DocumentTypeOptionsShowSKUImage to false and DocumentTypeOptionsShowSupplierSKU to false.

Value:

  {
   "mvDocumentType":
      {
         "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": false,
          "DocumentTypeOptionsShowSupplierSKU": false,
          "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": ""
      },
   "mvRecordAction":"Update"
}

Response:

{
   "mvDocumentType":
      {
         "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": false,
          "DocumentTypeOptionsShowSupplierSKU": false,
          "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 .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

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

{"APIKEY":"String","mvDocumentType":{"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"},"mvRecordAction":"Insert","mvInsertUpdateDeleteSourceApplication":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"mvDocumentType":{"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"}