Megaventory API v2017a

<back to all web services

DocumentGet

The following routes are available for this service:
GET POST/Document/DocumentGetGets information on existing documents.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 DocumentId descending order.

Examples:



A.

Return the first document whose currency is EUR and its billing address is not empty. The result is returned as an mvDocuments object.

Value:

 {
   "Filters": [
      {
         "FieldName": "DocumentCurrencyCode",
         "SearchOperator": "Equals",
         "SearchValue": "EUR"
      },
      {
         "AndOr": "And",
         "FieldName": "DocumentBillingAddress",
         "SearchOperator": "NotEquals",
         "SearchValue": ""
      }
   ],
   "ReturnTopNRecords": 1
}

Response:

{
   "mvDocuments": [
      {
         "DocumentId": 48222,
         "DocumentTypeId": -3,
         "DocumentTypeAbbreviation": "GO",
         "DocumentTypeDescription": "Goods Outbound",
         "DocumentNo": "dfsd",
         "DocumentReferenceNo": "",
         "DocumentReferenceApplication": "",
         "DocumentDate": "/Date(1522251084943-0000)/",
         "DocumentCustomOrderDate1": "/Date(-62135596800000-0000)/",
         "DocumentCustomOrderDate2": "/Date(-62135596800000-0000)/",
         "DocumentCurrencyCode": "EUR",
         "DocumentSupplierClientID": 5358,
         "DocumentBillingAddress": "sdfasdfsdf",
         "DocumentAddress": "dfdsfgdf",
         "DocumentContactPerson": "",
         "DocumentInventoryLocationID": 3405,
         "DocumentCustomFlag1": false,
         "DocumentCustomFlag2": false,
         "DocumentCustomFlag3": false,
         "DocumentCustomFlag4": false,
         "DocumentCustomFlag5": false,
         "DocumentCustomFlag6": false,
         "DocumentCustomFlag7": false,
         "DocumentCustomFlag8": false,
         "DocumentCustomFlag9": false,
         "DocumentCustomFlag10": false,
         "DocumentShippingProviderID": 0,
         "DocumentTrackingID": "",
         "DocumentComments": "",
         "DocumentPaymentTermsEnumeration": "0",
         "DocumentTags": "",
         "DocumentPaymentTermsEnumeration": "None",
         "DocumentParentDocId": 48221,
         "DocumentTotalQuantity": 2,
         "DocumentAmountSubtotalWithoutTaxAndDiscount": 0,
         "DocumentAmountShipping": 0,
         "DocumentAmountTotalDiscount": 0,
         "DocumentAmountTotalTax": 0,
         "DocumentAmountGrandTotal": 0,
         "DocumentDetails": [
            {
               "DocumentRowDetailID": 76504,
               "DocumentRowProductID": 60424,
               "DocumentRowProductSKU": "serialized",
               "DocumentRowProductDescription": "serialized",
               "DocumentRowQuantity": 1,
               "DocumentRowUnitPriceWithoutTaxOrDiscount": 0,
               "DocumentRowTaxID": 0,
               "DocumentTotalTaxAmount": 0,
               "DocumentRowDiscountID": 0,
               "DocumentRowTotalDiscountAmount": 0,
               "DocumentRowTotalAmount": 0,
               "DocumentRowSerialNumbers": [],
               "DocumentRowBatchNumbers": [],
               "DocumentRowRemarks": ""
            },
            {
               "DocumentRowDetailID": 76504,
               "DocumentRowProductID": 60424,
               "DocumentRowProductSKU": "serialized",
               "DocumentRowProductDescription": "serialized",
               "DocumentRowQuantity": 1,
               "DocumentRowUnitPriceWithoutTaxOrDiscount": 0,
               "DocumentRowTaxID": 0,
               "DocumentTotalTaxAmount": 0,
               "DocumentRowDiscountID": 0,
               "DocumentRowTotalDiscountAmount": 0,
               "DocumentRowTotalAmount": 0,
               "DocumentRowSerialNumbers": [],
               "DocumentRowBatchNumbers": [],
               "DocumentRowRemarks": ""
            }
         ],
         "DocumentStatus": "Verified",
         "DocumentCreationDate": "/Date(1522251084927-0000)/",
         "DocumentLastUpdatedDate": "/Date(1522251084943-0000)/"
      }
   ],
   "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/DocumentGet HTTP/1.1 
Host: api.megaventory.com 
Content-Type: application/json
Content-Length: length

{"Filters":[{"AndOr":"And","Group":"Undefined","FieldName":"String","SearchOperator":"Undefined","SearchValue":"String"}],"ReturnTopNRecords":0,"APIKEY":"String","mvDocumentTypeIDs":[0],"mvDocumentNo":"String","mvDocumentStatus":"ValidStatus"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"mvDocuments":[{"DocumentId":0,"DocumentTypeId":0,"DocumentTypeAbbreviation":"String","DocumentTypeDescription":"String","DocumentNo":"String","DocumentReferenceNo":"String","DocumentReferenceApplication":"String","DocumentDate":"\/Date(-62135596800000-0000)\/","DocumentCustomOrderDate1":"\/Date(-62135596800000-0000)\/","DocumentCustomOrderDate2":"\/Date(-62135596800000-0000)\/","DocumentCurrencyCode":"String","DocumentSupplierClientID":0,"DocumentSupplierClientName":"String","DocumentBillingAddress":"String","DocumentAddress":"String","DocumentAddresses":[{"AddressType":"General","AddressLine1":"String","AddressLine2":"String","AddressLine3":"String","Name":"String","Phone":"String","Email":"String","TaxIdNumber":"String","Organization":"String","City":"String","State":"String","Country":"NONE","CountryName":"String","Longitude":"String","Latitude":"String","ZipCode":"String"}],"DocumentContactPerson":"String","DocumentInventoryLocationID":0,"DocumentCustomFlag1":false,"DocumentCustomFlag6":false,"DocumentCustomFlag2":false,"DocumentCustomFlag7":false,"DocumentCustomFlag3":false,"DocumentCustomFlag8":false,"DocumentCustomFlag4":false,"DocumentCustomFlag9":false,"DocumentCustomFlag5":false,"DocumentCustomFlag10":false,"DocumentShippingProviderID":0,"DocumentTrackingID":"String","DocumentShippingInfo":{"ProviderInfo":{"ProviderId":0,"ServiceId":"String","PackageId":"String"},"CostInfo":{"ShippingCost":0,"OtherCosts":0,"TotalCost":0},"WeightInfo":{"Weight":0,"WeightUnitId":0},"ShipDateInfo":{"ShipDate":"String"},"GenericAftersalesProServicesInfo":{"COD":false,"GTEEC":false,"Protocol":false,"Reception":false,"Insurance":false,"ChequeCod":false,"SpecialRate":false,"VipDelivery":false,"SenderCharge":false,"PackageReturn":false,"ReturnDocument":false,"CodTotalInCents":0,"MorningDelivery":false,"SameDayIntracity":false,"SaturdayDelivery":false,"SeaFreightCyprus":false,"RefrigeratedGoods":false,"LessThanTwoKilograms":false,"LessThanFourKilograms":false,"SubmissionOfTenderDocuments":false,"NextDayAirTransportToIslands":false,"ContainsDocumentsOnlyAndIsLessThanTwoKilograms":false},"TrackingId":"String","LockerId":0},"DocumentComments":"String","DocumentTags":"String","DocumentPaymentTermsEnumeration":"None","DocumentPaymentMethod":"None","DocumentParentDocId":0,"DocumentHandlingDocId":0,"DocumentTotalQuantity":0,"DocumentAmountSubtotalWithoutTaxAndDiscount":0.00,"DocumentAmountShipping":0.00,"DocumentAmountTotalDiscount":0.00,"DocumentAmountTotalTax":0.00,"DocumentAmountGrandTotal":0.00,"DocumentTotalWeight":0,"DocumentTotalWeightUnitID":0,"DocumentDetails":[{"DocumentRowDetailID":0,"DocumentRowProductID":0,"DocumentRowProductSKU":"String","DocumentRowProductDescription":"String","DocumentRowQuantity":0,"DocumentRowUnitPriceWithoutTaxOrDiscount":0.00,"DocumentRowTaxID":0,"DocumentTotalTaxAmount":0.00,"DocumentRowDiscountID":0,"DocumentRowTotalDiscountAmount":0.00,"DocumentRowTotalAmount":0.00,"DocumentRowSerialNumbers":["String"],"DocumentRowBatchNumbers":[{"BatchNumberName":"String","ExpiryDate":"\/Date(-62135596800000-0000)\/","AssignedQTYInDetail":0}],"DocumentRowRemarks":"String","DocumentRowTotalWeight":0,"DocumentRowTotalWeightUnitID":0}],"DocumentStatus":"ValidStatus","chkReOpenOrCloseRelatedDocs":false,"DocumentCreationDate":"\/Date(-62135596800000-0000)\/","DocumentLastUpdatedDate":"\/Date(-62135596800000-0000)\/"}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String"}]},"InternalErrorCode":"String"}