Megaventory API v2017a

<back to all web services

PaymentGet

The following routes are available for this service:
GET POST/Payment/PaymentGetGet existing paymentsUses your API Key and optional Filters in an array format and returns the search results using the given filters. You can also use mvDocumentIds to limit the results to payments associated with the specified documents. 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).

Examples:



A.

Return the first pending payment for the specified document. The result is returned as mvPayments objects.

Value:

 {
  "mvDocumentIds": [
    48222
  ],
  "Filters": [
    {
      "FieldName": "PaymentStatus",
      "SearchOperator": "Equals",
      "SearchValue": "Pending"
    }
  ],
  "ReturnTopNRecords": 1
}

Response:

 {
  "mvPayments": [
    {
      "PaymentId": 1051,
      "CompanyId": 1,
      "SupplierClientId": 5471,
      "PaymentTransactionId": "202606151814280950",
      "PaymentComments": "",
      "PaymentAmount": 1,
      "PaymentCurrencyCode": "EUR",
      "PaymentIssueDate": "/Date(1781510705120-0000)/",
      "ParentPaymentId": 0,
      "PaymentApplication": "Megaventory",
      "PaymentApplicationReference": "",
      "PaymentCreatedDate": "/Date(1781510705127-0000)/",
      "PaymentUpdatedDate": "/Date(1781510705127-0000)/",
      "PaymentMethod": "NotSet",
      "PaymentType": "Payment",
      "PaymentInvoiceType": "SalesInvoice",
      "PaymentStatus": "Pending"
    }
  ],
  "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/PaymentGet 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,
	mvDocumentIds: 
	[
		0
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	mvPayments: 
	[
		{
			PaymentId: 0,
			CompanyId: 0,
			SupplierClientId: 0,
			PaymentTransactionId: String,
			PaymentComments: String,
			PaymentAmount: 0,
			PaymentCurrencyCode: STRING,
			PaymentIssueDate: 0001-01-01,
			ParentPaymentId: 0,
			PaymentApplication: Undefined,
			PaymentApplicationReference: String,
			PaymentCreatedDate: 0001-01-01,
			PaymentUpdatedDate: 0001-01-01,
			PaymentMethod: NotSet,
			PaymentType: Undefined,
			PaymentInvoiceType: Undefined,
			PaymentStatus: Undefined
		}
	],
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String
			}
		]
	},
	InternalErrorCode: String
}