Get invoice list
Returns a list of invoices.
URL
/cnbs/v1/invoices
Method(s)
GET | POST
Parameters
Required
- Payer (payer_data)
- Payer Number (customer_number)
- Company Code (company_code)
- Parameters (search_parameters)
- Document type (document_type)
- 01 … Invoice
- Status (status)
- 01 … Open
- 02 … Complete
- 03 … Open or Complete
- Date From (date_from)
- Only valid for status 02 and status 03
- Refers to posting date in the backend.
- Format MM-DD-YYYY
- Date To (date_to)
- Only valid for status 02 and status 03, refers to posting date in the backend.
- Refers to posting date in the backend.
- Format MM-DD-YYYY
Optional
- Sold-To (soldto_data)
- Customer Number (customer_number)
- Sales Area Data (sales_area_data)
- Sales Organization (sales_organization)
- Distribution Channel (distribution_channel)
- Division (division)
- Parameters (search_parameters)
- Due Date From (due_date_from)
- With the due date from field you can narrow down the selected documents by their net due date in the backend.
- Due Date To (due_date_to)
- With the due date to field you can narrow down the selected documents by their net due date in the backend.
- To show all invoices, regardless of their net due date, leave this and the Due date from field empty.
- Currency (currency_key)
- No currency as input will use the currency of the 1st selected item as default currency.
- IMPORTANT: Items not matching the currency will return as “read-only” items which are not payable in this currency.
- Filter Table (filter)
- Table with 2 rows where filter_type is the filter type and value is the respective filter value.
- Standard Filter Types:
- 01 … SD document number
- 02 … FI document number
- Custom Filter Types:
- 90-99 … Custom Filters can be implemented on a project basis and require a custom implementation in the backend as well.
Example POST
JSON Payload:
{
"payer_data": {
"customer_number": "3000",
"company_code": "3000"
},
"soldto_data": {
"customer_number": "3000",
"sales_area_data": {
"sales_organization": "3000",
"distribution_channel": "10",
"division": "00"
}
},
"search_parameters": {
"document_type": "01",
"status": "01",
"date_from": "01-01-2017",
"date_to": "12-31-2017",
"due_date_from": "",
"due_date_to": "",
"currency_key": "",
"filter": [
{
"filter_type": "",
"value": ""
}
]
}
}
cURL:
curl -X POST "https://<<your.server.here>>/cnbs/v1/invoices?sap-client=800&sap-language=EN&apiid=CNBSMV01P" -H "accept: application/json" -H "content-type: application/json" -H "cnbssysid: gPuM1VyY1dxlTE2MEs2yajJUkX3/4+2Pw1alRw4BOtI=" -H "authorization: Basic Q05CU0FQSUlDRjpjbmJzNHlvdTE=" -d "{ \"payer_data\": { \"customer_number\": \"3000\", \"company_code\": \"3000\" }, \"soldto_data\": { \"customer_number\": \"3000\", \"sales_area_data\": { \"sales_organization\": \"3000\", \"distribution_channel\": \"10\", \"division\": \"00\" } }, \"search_parameters\": { \"document_type\": \"01\", \"status\": \"01\", \"date_from\": \"01-01-2017\", \"date_to\": \"12-31-2017\", \"due_date_from\": \"\", \"due_date_to\": \"\", \"currency_key\": \"\", \"filter\": [ { \"filter_type\": \"\", \"value\": \"\" } ] }}"
Example GET
cURL:
curl -X GET "https://<<your.server.here>>/cnbs/v1/invoices?sap-client=800&sap-language=EN&apiid=CNBSMV01R&soldto_number=3000&sales_organization=3000&distribution_channel=10&division=00&payer_number=3050&company_code=3000&document_type=01&document_search_status=01&date_from=01-01-2017&date_to=12-31-2099" -H "accept: application/json" -H "content-type: application/json" -H "cnbssysid: gPuM1VyY1dxlTE2MEs2yajJUkX3/4+2Pw1alRw4BOtI="
Response
The response consists of a document list table (document_list) and a status (status).
- Document List (document_list)
- Sales Related Fields (only items related to sales billing documents will have those fields populated)
- Billing Document Number (billing_document_number)
- Contains the billing document number.
- Billing Document Type (billing_document_type)
- Contains the billing document type of the billing document.
- Sales Organization (sales_organization)
- Distribution Channel (distribution_channel)
- Division (division)
- Finance Related Fields
- Finance Document Number (document_number_finance)
- Contains the document number under which the transaction is recorded in the financial accounting ledger.
- Document Item Number (line_item_in_the_relevant_invoice)
- Contains the related item number within the financial accounting document.
- Clearing Document Number (clearing_document_number_finance)
- Contains the clearing document number from financial accounting.
- Finance Document Type (finance_document_type)
- Contains the financial accounting document type.
- Reference Document Number (reference_number)
- Contains the Reference Document Number found in the header of the financial accounting document.
- Document Fiscal Year (fiscal_year_of_the_relevant invoice)
- Contains the Fiscal Year when the related document got recorded.
- Finance Document Only (finance_document_only)
- If the document has its only origin in financial accounting this flag will be set to X.
- Item Is A Payment (item_is_a_payment)
- If the document item is actually a payment transaction then this flag will be set to X.
- Posting Date (posting_date)
- Contains the posting date used in the financial accounting ledger.
- Document Date (document_date)
- Contains the document date used in the financial accounting ledger.
- Due Date (due_date)
- Net due date of this line item.
- Clearing Date (clearing_date)
- Clearing date of the line item. Date when the item got flagged as completed in financial accounting.
- Days in arrears (days_in_arrears)
- Number of overdue days.
- Currency (currency_key)
- Document currency key.
- Customer related fields
- Payer Number (payer_number)
- Number of the payer customer.
- Sold-To Number (soldto_number)
- For billing related items, the Sold-To customer number.
- For non-billing related items, it will match the payer customer number.
- Amount fields
- Total amount (total_amount)
- Total amount of the line item.
- Open amount (open_amount)
- The open amount for the line item.
- Paid amount (paid_amount)
- Amount already paid for the line item.
- Discount amount (discount_amount)
- Potential deductable cash discount amount if timing and payment term allows it.
- Read-Only Flag (read_only_flag)
- Item can't be selected for a payment transaction. For instance if the selected currency does not match the item's currency.
- PDF field
- PDF Document Available(pdf_document_available)
- If this flag is set a PDF can be retrieved for this line item.
- Status (status)
- Message Type (message_type)
- SAP Message Type.
- Errors:
- E = Error
- A = Abort
- X = Exception
- Others:
- S = Success
- W = Warning
- I = Information
- Message Identifier (message_identification)
- SAP Message ID.
- Message Number (message_number)
- SAP Message Number.
- Message Line (message_line_string)
- SAP Message Text.
Example Response
JSON:
{
"document_list": [
{
"billing_document_number": "90038990",
"billing_document_type": "F2",
"sales_organization": "3000",
"distribution_channel": "10",
"division": "00",
"document_number_finance": "1400000229",
"line_item_in_the_relevant_invoice": 1,
"finance_document_type": "RV",
"reference_number": "90038990",
"fiscal_year_of_the_relevant invoice": 2016,
"soldto_number": "3000",
"payer_number": "3050",
"posting_date": "04-30-2016",
"document_date": "04-12-2016",
"due_date": "05-31-2016",
"days_in_arrears": "157",
"currency_key": "USD",
"total_amount": 1000,
"open_amount": 900,
"paid_amount": 100,
"discount_amount": 0,
"pdf_document_available": "X"
}
],
"status": {
"message_type": "S",
"message_identification": "/CNBS/X_API",
"message_number": 10,
"message_line_string": "Request successfully processed ,document selected 1"
}
}