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 .xml suffix or ?format=xml

HTTP + XML

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

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

<PaymentGet xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints.Operations">
  <Filters xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints">
    <Filter>
      <AndOr>And</AndOr>
      <FieldName>String</FieldName>
      <Group>Undefined</Group>
      <SearchOperator>Undefined</SearchOperator>
      <SearchValue>String</SearchValue>
    </Filter>
  </Filters>
  <ReturnTopNRecords xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints">0</ReturnTopNRecords>
  <APIKEY>String</APIKEY>
  <mvDocumentIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:int>0</d2p1:int>
  </mvDocumentIds>
</PaymentGet>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<PaymentGetResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints.Operations">
  <mvPayments xmlns:d2p1="https://api.megaventory.com/types">
    <d2p1:MvPayment>
      <d2p1:PaymentId>0</d2p1:PaymentId>
      <d2p1:CompanyId>0</d2p1:CompanyId>
      <d2p1:SupplierClientId>0</d2p1:SupplierClientId>
      <d2p1:PaymentTransactionId>String</d2p1:PaymentTransactionId>
      <d2p1:PaymentComments>String</d2p1:PaymentComments>
      <d2p1:PaymentAmount>0</d2p1:PaymentAmount>
      <d2p1:PaymentCurrencyCode>STRING</d2p1:PaymentCurrencyCode>
      <d2p1:PaymentIssueDate>0001-01-01T00:00:00</d2p1:PaymentIssueDate>
      <d2p1:ParentPaymentId>0</d2p1:ParentPaymentId>
      <d2p1:PaymentApplication>Undefined</d2p1:PaymentApplication>
      <d2p1:PaymentApplicationReference>String</d2p1:PaymentApplicationReference>
      <d2p1:PaymentCreatedDate>0001-01-01T00:00:00</d2p1:PaymentCreatedDate>
      <d2p1:PaymentUpdatedDate>0001-01-01T00:00:00</d2p1:PaymentUpdatedDate>
      <d2p1:PaymentMethod>NotSet</d2p1:PaymentMethod>
      <d2p1:PaymentType>Undefined</d2p1:PaymentType>
      <d2p1:PaymentInvoiceType>Undefined</d2p1:PaymentInvoiceType>
      <d2p1:PaymentStatus>Undefined</d2p1:PaymentStatus>
    </d2p1:MvPayment>
  </mvPayments>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
      </d2p1:ResponseError>
    </d2p1:Errors>
  </ResponseStatus>
  <InternalErrorCode>String</InternalErrorCode>
</PaymentGetResponse>