Megaventory API v2017a

<back to all web services

SupplierClientGet

The following routes are available for this service:
GET POST/SupplierClient/SupplierClientGetGets information on existing suppliers and clients.Uses your API Key and some Filters in an array format and returns the search results using 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 SupplierClientId descending order.

Examples:



A.

Return all the clients whose billing address contains CA. The results are returned as mvSupplierClients objects.
We can add two Filters by using the AndOr operator as shown below:

Value:

  {
   "Filters": [
      {
         "FieldName": "SupplierClientType",
         "SearchOperator": "Equals",
         "SearchValue": "Client"
      },
      {
         "AndOr": "And",
         "FieldName": "SupplierClientBillingAddress",
         "SearchOperator": "Contains",
         "SearchValue": "CA"
      }
   ]
} 

Response:

 {
   "mvSupplierClients": [
      {
         "SupplierClientID": 9,
         "SupplierClientType": "Client",
         "SupplierClientName": "Retail Client",
         "mvContacts": [],
         "SupplierClientBillingAddress": "1 Infinite Loop Cupertino CA 95014",
         "SupplierClientShippingAddress1": "1600 Amphitheatre Parkway Mountain View CA",
         "SupplierClientShippingAddress2": "",
         "SupplierClientPhone1": "+1234567890",
         "SupplierClientPhone2": "+0987654321",
         "SupplierClientFax": "",
         "SupplierClientIM": "",
         "SupplierClientEmail": "first@client.com",
         "SupplierClientTaxID": "client taxid",
         "SupplierClientComments": "",
         "SupplierClientCustomField1": "",
         "SupplierClientCustomField2": "",
         "SupplierClientCustomField3": "",
         "SupplierClientCustomField4": "",
         "SupplierClientCustomField5": "",
         "SupplierClientCustomField6": "",
         "SupplierClientCustomField7": "",
         "SupplierClientCustomField8": "",
         "SupplierClientCustomField9": "",
         "SupplierClientCustomField10": "",
         "SupplierClientOption1": "",
         "SupplierClientOption2": "",
         "SupplierClientOption3": "",
         "SupplierClientOption4": "",
         "SupplierClientOption5": "",
         "SupplierClientOption6": "",
         "SupplierClientOption7": "",
         "SupplierClientOption8": "",
         "SupplierClientOption9": "",
         "SupplierClientOption10": "",
         "SupplierClientCreationDate": "/Date(1499856477997-0000)/"
      }
   ],
   "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/SupplierClientGet 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

{
	mvSupplierClients: 
	[
		{
			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,
			SupplierClientCustomField6: String,
			SupplierClientCustomField7: String,
			SupplierClientCustomField8: String,
			SupplierClientCustomField9: String,
			SupplierClientCustomField10: String,
			SupplierClientOption1: False,
			SupplierClientOption2: False,
			SupplierClientOption3: False,
			SupplierClientOption4: False,
			SupplierClientOption5: False,
			SupplierClientOption6: False,
			SupplierClientOption7: False,
			SupplierClientOption8: False,
			SupplierClientOption9: False,
			SupplierClientOption10: 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,
							SupplierClientCustomField6: String,
							SupplierClientCustomField7: String,
							SupplierClientCustomField8: String,
							SupplierClientCustomField9: String,
							SupplierClientCustomField10: String,
							SupplierClientOption1: False,
							SupplierClientOption2: False,
							SupplierClientOption3: False,
							SupplierClientOption4: False,
							SupplierClientOption5: False,
							SupplierClientOption6: False,
							SupplierClientOption7: False,
							SupplierClientOption8: False,
							SupplierClientOption9: False,
							SupplierClientOption10: 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,
											SupplierClientCustomField6: String,
											SupplierClientCustomField7: String,
											SupplierClientCustomField8: String,
											SupplierClientCustomField9: String,
											SupplierClientCustomField10: String,
											SupplierClientOption1: False,
											SupplierClientOption2: False,
											SupplierClientOption3: False,
											SupplierClientOption4: False,
											SupplierClientOption5: False,
											SupplierClientOption6: False,
											SupplierClientOption7: False,
											SupplierClientOption8: False,
											SupplierClientOption9: False,
											SupplierClientOption10: 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
		}
	],
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String
			}
		]
	},
	InternalErrorCode: String
}