Megaventory API v2017a

<back to all web services

SupplierStockGet

The following routes are available for this service:
GET POST/SupplierStock/SupplierStockGetGets information on current supplier stock listUses 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 ProductId descending order.

Examples:



A.

Return the first mvSupplierStockList object with an "ExactStock" ProductStockChoise and a ProductId that is greater than 30. The results are returned as mvSupplierStockList objects. We can add two Filters by using the AndOr operator as shown below:

Value:

 {
   "Filters": [
      {
         "FieldName": "ProductStockChoise",
         "SearchOperator": "Equals",
         "SearchValue": "ExactStock"
      },
      {
         "AndOr": "And",
         "FieldName": "ProductId",
         "SearchOperator": "GreaterThan",
         "SearchValue": 30
      }
   ],
   "ReturnTopNRecords": 1
}


Response:

 {
   "mvSupplierStockList": [
      {
         "ProductID": 27388,
         "ProductSKU": "",
         "ProductLeadTimeChoice": "DayRange",
         "ProductLeadTimeExactDate": "/Date(-62135596800000-0000)/",
         "ProductLeadTimeMinDays": 0,
         "ProductLeadTimeMaxDays": 3,
         "ProductStockChoice": "ExactStock",
         "ProductExactStock": 1,
         "ProductStockRangeMin": 0,
         "ProductStockRangeMax": 0,
         "ProductSupplierPrice": 9
      }
   ],
   "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/SupplierStockGet 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,
	ProductSKU: String,
	ProductCategoryID: 
	[
		0
	],
	ProductMainSupplierID: 
	[
		0
	],
	includeReferencedObjects: False
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	mvSupplierStockList: 
	[
		{
			ProductID: 0,
			ProductSKU: String,
			mvProduct: 
			{
				ProductID: 0,
				ProductType: BuyFromSupplier,
				ProductSKU: String,
				ProductEAN: String,
				ProductDescription: String,
				ProductVersion: String,
				ProductLongDescription: String,
				ProductCategoryID: 0,
				mvProductCategory: 
				{
					ProductCategoryID: 0,
					ProductCategoryName: String,
					ProductCategoryDescription: String
				},
				ProductUnitOfMeasurement: String,
				ProductSellingPrice: 0,
				ProductPurchasePrice: 0,
				ProductUnitCost: 
				[
					{
						
					}
				],
				ProductWeight: 0,
				ProductWeightUnitID: 0,
				mvProductWeightUnit: 
				{
					WeightUnitID: 0,
					WeightUnitAbbrev: String,
					WeightUnitName: String,
					WeightUnitConversionToGrams: 0
				},
				ProductLength: 0,
				ProductBreadth: 0,
				ProductHeight: 0,
				ProductImageURL: String,
				ProductComments: String,
				ProductCustomField1: String,
				ProductCustomField2: String,
				ProductCustomField3: String,
				ProductCustomField4: String,
				ProductCustomField5: String,
				ProductCustomField6: String,
				ProductCustomField7: String,
				ProductCustomField8: String,
				ProductCustomField9: String,
				ProductCustomField10: String,
				ProductMainSupplierID: 0,
				mvProductMainSupplier: 
				{
					SupplierClientID: 0,
					SupplierClientType: Both,
					SupplierClientName: String,
					SupplierClientBillingAddress: String,
					SupplierClientShippingAddress1: String,
					SupplierClientShippingAddress2: String,
					SupplierClientAddresses: 
					[
						{
							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
						}
					],
					SupplierClientPhone1: String,
					SupplierClientPhone2: String,
					SupplierClientFax: String,
					SupplierClientIM: String,
					SupplierClientEmail: String,
					SupplierClientCurrency: String,
					SupplierClientPaymentTermsEnum: None,
					SupplierClientPaymentMethodEnum: None,
					SupplierClientComments: String,
					SupplierClientCustomField1: String,
					SupplierClientCustomField2: String,
					SupplierClientCustomField3: String,
					SupplierClientCustomField4: String,
					SupplierClientCustomField5: String,
					SupplierClientOption1: False,
					SupplierClientOption2: False,
					SupplierClientOption3: False,
					SupplierClientOption4: False,
					SupplierClientOption5: False,
					SupplierClientCreationDate: 0001-01-01,
					mvContacts: 
					[
						{
							ContactId: 0,
							ContactName: String,
							ContactDepartment: String,
							ContactAddress: String,
							ContactFullAddress: 
							{
								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
							},
							ContactEmail: String,
							ContactPhone1: String,
							ContactPhone2: String,
							ContactFax: String,
							ContactIM: String,
							ContactCustomField1: String,
							ContactCustomField2: String,
							ContactIsPrimary: False,
							mvSuppliersClients: 
							[
								{
									SupplierClientID: 0,
									SupplierClientType: Both,
									SupplierClientName: String,
									SupplierClientBillingAddress: String,
									SupplierClientShippingAddress1: String,
									SupplierClientShippingAddress2: String,
									SupplierClientAddresses: 
									[
										{
											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
										}
									],
									SupplierClientPhone1: String,
									SupplierClientPhone2: String,
									SupplierClientFax: String,
									SupplierClientIM: String,
									SupplierClientEmail: String,
									SupplierClientCurrency: String,
									SupplierClientPaymentTermsEnum: None,
									SupplierClientPaymentMethodEnum: None,
									SupplierClientComments: String,
									SupplierClientCustomField1: String,
									SupplierClientCustomField2: String,
									SupplierClientCustomField3: String,
									SupplierClientCustomField4: String,
									SupplierClientCustomField5: String,
									SupplierClientOption1: False,
									SupplierClientOption2: False,
									SupplierClientOption3: False,
									SupplierClientOption4: False,
									SupplierClientOption5: False,
									SupplierClientCreationDate: 0001-01-01,
									mvContacts: 
									[
										{
											ContactId: 0,
											ContactName: String,
											ContactDepartment: String,
											ContactAddress: String,
											ContactFullAddress: 
											{
												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
											},
											ContactEmail: String,
											ContactPhone1: String,
											ContactPhone2: String,
											ContactFax: String,
											ContactIM: String,
											ContactCustomField1: String,
											ContactCustomField2: String,
											ContactIsPrimary: False,
											mvSuppliersClients: 
											[
												{
													SupplierClientID: 0,
													SupplierClientType: Both,
													SupplierClientName: String,
													SupplierClientBillingAddress: String,
													SupplierClientShippingAddress1: String,
													SupplierClientShippingAddress2: String,
													SupplierClientAddresses: 
													[
														{
															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
														}
													],
													SupplierClientPhone1: String,
													SupplierClientPhone2: String,
													SupplierClientFax: String,
													SupplierClientIM: String,
													SupplierClientEmail: String,
													SupplierClientCurrency: String,
													SupplierClientPaymentTermsEnum: None,
													SupplierClientPaymentMethodEnum: None,
													SupplierClientComments: String,
													SupplierClientCustomField1: String,
													SupplierClientCustomField2: String,
													SupplierClientCustomField3: String,
													SupplierClientCustomField4: String,
													SupplierClientCustomField5: String,
													SupplierClientOption1: False,
													SupplierClientOption2: False,
													SupplierClientOption3: False,
													SupplierClientOption4: False,
													SupplierClientOption5: False,
													SupplierClientCreationDate: 0001-01-01,
													mvContacts: 
													[
														{
															ContactId: 0,
															ContactName: String,
															ContactDepartment: String,
															ContactAddress: String,
															ContactFullAddress: 
															{
																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
															},
															ContactEmail: String,
															ContactPhone1: String,
															ContactPhone2: String,
															ContactFax: String,
															ContactIM: String,
															ContactCustomField1: String,
															ContactCustomField2: String,
															ContactIsPrimary: False,
															mvSuppliersClients: 
															[
																{
																	
																}
															]
														}
													],
													SupplierClientTaxID: String
												}
											]
										}
									],
									SupplierClientTaxID: String
								}
							]
						}
					],
					SupplierClientTaxID: String
				},
				ProductMainSupplierPrice: 0.00,
				ProductMainSupplierSKU: String,
				ProductMainSupplierDescription: String,
				ProductCreationDate: 0001-01-01,
				ProductOption1: False,
				ProductOption2: False,
				ProductOption3: False,
				ProductOption4: False,
				ProductOption5: False,
				IsInventorySerialised: False,
				IsBatchNumbersEnabled: False,
				SerialNumberPrefix: String,
				IsPurchasable: False,
				PurchasableStartDate: 0001-01-01,
				PurchasableEndDate: 0001-01-01,
				IsSellable: False,
				SellableStartDate: 0001-01-01,
				SellableEndDate: 0001-01-01
			},
			mvSupplierClient: 
			{
				SupplierClientID: 0,
				SupplierClientType: Both,
				SupplierClientName: String,
				SupplierClientBillingAddress: String,
				SupplierClientShippingAddress1: String,
				SupplierClientShippingAddress2: String,
				SupplierClientAddresses: 
				[
					{
						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
					}
				],
				SupplierClientPhone1: String,
				SupplierClientPhone2: String,
				SupplierClientFax: String,
				SupplierClientIM: String,
				SupplierClientEmail: String,
				SupplierClientCurrency: String,
				SupplierClientPaymentTermsEnum: None,
				SupplierClientPaymentMethodEnum: None,
				SupplierClientComments: String,
				SupplierClientCustomField1: String,
				SupplierClientCustomField2: String,
				SupplierClientCustomField3: String,
				SupplierClientCustomField4: String,
				SupplierClientCustomField5: String,
				SupplierClientOption1: False,
				SupplierClientOption2: False,
				SupplierClientOption3: False,
				SupplierClientOption4: False,
				SupplierClientOption5: False,
				SupplierClientCreationDate: 0001-01-01,
				mvContacts: 
				[
					{
						ContactId: 0,
						ContactName: String,
						ContactDepartment: String,
						ContactAddress: String,
						ContactFullAddress: 
						{
							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
						},
						ContactEmail: String,
						ContactPhone1: String,
						ContactPhone2: String,
						ContactFax: String,
						ContactIM: String,
						ContactCustomField1: String,
						ContactCustomField2: String,
						ContactIsPrimary: False,
						mvSuppliersClients: 
						[
							{
								SupplierClientID: 0,
								SupplierClientType: Both,
								SupplierClientName: String,
								SupplierClientBillingAddress: String,
								SupplierClientShippingAddress1: String,
								SupplierClientShippingAddress2: String,
								SupplierClientAddresses: 
								[
									{
										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
									}
								],
								SupplierClientPhone1: String,
								SupplierClientPhone2: String,
								SupplierClientFax: String,
								SupplierClientIM: String,
								SupplierClientEmail: String,
								SupplierClientCurrency: String,
								SupplierClientPaymentTermsEnum: None,
								SupplierClientPaymentMethodEnum: None,
								SupplierClientComments: String,
								SupplierClientCustomField1: String,
								SupplierClientCustomField2: String,
								SupplierClientCustomField3: String,
								SupplierClientCustomField4: String,
								SupplierClientCustomField5: String,
								SupplierClientOption1: False,
								SupplierClientOption2: False,
								SupplierClientOption3: False,
								SupplierClientOption4: False,
								SupplierClientOption5: False,
								SupplierClientCreationDate: 0001-01-01,
								mvContacts: 
								[
									{
										ContactId: 0,
										ContactName: String,
										ContactDepartment: String,
										ContactAddress: String,
										ContactFullAddress: 
										{
											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
										},
										ContactEmail: String,
										ContactPhone1: String,
										ContactPhone2: String,
										ContactFax: String,
										ContactIM: String,
										ContactCustomField1: String,
										ContactCustomField2: String,
										ContactIsPrimary: False,
										mvSuppliersClients: 
										[
											{
												SupplierClientID: 0,
												SupplierClientType: Both,
												SupplierClientName: String,
												SupplierClientBillingAddress: String,
												SupplierClientShippingAddress1: String,
												SupplierClientShippingAddress2: String,
												SupplierClientAddresses: 
												[
													{
														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
													}
												],
												SupplierClientPhone1: String,
												SupplierClientPhone2: String,
												SupplierClientFax: String,
												SupplierClientIM: String,
												SupplierClientEmail: String,
												SupplierClientCurrency: String,
												SupplierClientPaymentTermsEnum: None,
												SupplierClientPaymentMethodEnum: None,
												SupplierClientComments: String,
												SupplierClientCustomField1: String,
												SupplierClientCustomField2: String,
												SupplierClientCustomField3: String,
												SupplierClientCustomField4: String,
												SupplierClientCustomField5: String,
												SupplierClientOption1: False,
												SupplierClientOption2: False,
												SupplierClientOption3: False,
												SupplierClientOption4: False,
												SupplierClientOption5: False,
												SupplierClientCreationDate: 0001-01-01,
												mvContacts: 
												[
													{
														ContactId: 0,
														ContactName: String,
														ContactDepartment: String,
														ContactAddress: String,
														ContactFullAddress: 
														{
															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
														},
														ContactEmail: String,
														ContactPhone1: String,
														ContactPhone2: String,
														ContactFax: String,
														ContactIM: String,
														ContactCustomField1: String,
														ContactCustomField2: String,
														ContactIsPrimary: False,
														mvSuppliersClients: 
														[
															{
																
															}
														]
													}
												],
												SupplierClientTaxID: String
											}
										]
									}
								],
								SupplierClientTaxID: String
							}
						]
					}
				],
				SupplierClientTaxID: String
			},
			ProductLeadTimeChoice: UseExactDateOrDayRange,
			ProductLeadTimeExactDate: 0001-01-01,
			ProductLeadTimeMinDays: 0,
			ProductLeadTimeMaxDays: 0,
			ProductStockChoice: UseExactStockOrStockRangeOrNotAvailable,
			ProductExactStock: 0,
			ProductStockRangeMin: 0,
			ProductStockRangeMax: 0,
			ProductSupplierPrice: 0
		}
	],
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String
			}
		]
	},
	InternalErrorCode: String
}