{"openapi":"3.1.0","info":{"title":"Invoice API","description":"<b>The Invoice API can be used to list your invoices and to download the invoices in PDF format.</b>"},"servers":[{"url":"https://www.mybring.com/invoicearchive","description":"Generated server url"}],"tags":[{"name":"List of all Invoices","description":"Gets the list of invoices corresponding to the given customer number. By default it shows last 65 days of invoices, with the possibility to access last 365 days by providing “fromDate” and “toDate”. This endpoint supports Parcel Domestic, Parcel International and Cargo customers."},{"name":"Invoice PDF download endpoint","description":"This link is used to download the invoice pdf for the customers by providing API customer number and invoice number in URI params."}],"paths":{"/pdf/{customerNumberUnique}/{invoiceNumber}.pdf":{"get":{"tags":["Invoice PDF download endpoint"],"summary":"Invoice PDF download endpoint","description":"This link is used to download the invoice pdf for the customers by providing API customer number and invoice number in URI params.","operationId":"getDocument","parameters":[{"name":"customerNumberUnique","in":"path","description":"Unique API Customer Number for each customer.","required":true,"schema":{"type":"string"}},{"name":"invoiceNumber","in":"path","description":"Invoice number of the particular invoice to be downloaded.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/pdf":{"schema":{"type":"string","format":"byte"}}}}},"security":[{"apiKey":[]},{"apiUid":[]}]}},"/api/invoices/{customerNumber}.xml":{"get":{"tags":["List of all Invoices"],"summary":"List of all Invoices","description":"Gets the list of invoices corresponding to the given customer number. By default it shows last 65 days of invoices, with the possibility to access last 365 days by providing “fromDate” and “toDate”. This endpoint supports Parcel Domestic, Parcel International and Cargo customers.","operationId":"getCustomerInvoicesXml","parameters":[{"name":"customerNumber","in":"path","description":"Unique API Customer Number.","required":true,"schema":{"type":"string"}},{"name":"X-MyBring-API-Uid","in":"header","description":"Your Mybring login ID","required":true,"example":"john.doe@example.com"},{"name":"X-MyBring-API-Key","in":"header","description":"Your user’s API key","required":true,"example":"1234abc-abcd-1234-5678-abcd1234abcd"},{"name":"X-Bring-Client-URL","in":"header","description":"A URL that sort of identifies where you’re using the APIs.","required":true,"example":"https://example.com"},{"name":"fromDate","in":"query","description":"Start date for fetching invoices in format dd.mm.yyyy.","required":false,"schema":{"type":"string","format":"date"},"example":"15.01.2020"},{"name":"toDate","in":"query","description":"End date for fetching invoices in format dd.mm.yyyy.","required":false,"schema":{"type":"string","format":"date"},"example":"25.01.2020"},{"name":"invoicesWithSpecification","in":"query","description":"Displays only invoices with available specifications when set to true.","required":false,"schema":{"type":"boolean"}},{"name":"onlyProcessedInvoices","in":"query","description":"Displays only invoices that has been processed when set to true.","required":false,"schema":{"type":"boolean"}},{"name":"isApiCall","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Successful","content":{"application/xml":{"schema":{"$ref":"#/components/schemas/InvoiceResponse"},"examples":{"Successful":{"description":"Successful","value":{"invoices":[{"customerNumber":"customerNumber","invoiceNumber":"10158070","invoiceDate":"31.12.2019","invoiceIssuer":"POSTEN_NORGE_AS","status":"Open","totalAmount":"386.25","dueDate":"28.02.2020","type":"Invoice","attachmentCount":0,"specInvoiceReportId":"specified_invoice_customer_master","currency":"NOK","parentInvoiceNumber":null,"invoiceSpecificationAvailable":true},{"customerNumber":"customerNumber","invoiceNumber":"152148","invoiceDate":"31.12.2019","invoiceIssuer":"POSTEN_NORGE_AS","status":"Closed","totalAmount":"7771.69","dueDate":"25.02.2020","type":"Invoice","batchSource":"PMS_BULKMAIL_OM","attachmentCount":0,"specInvoiceReportId":"specified_invoice_customer_master","currency":"NOK","parentInvoiceNumber":null,"invoiceSpecificationAvailable":false},{"customerNumber":"customerNumber","invoiceNumber":"1109932","invoiceDate":"31.01.2020","invoiceIssuer":"POSTEN_NORGE_AS","status":"Open","totalAmount":"115.0","dueDate":"06.03.2020","type":"Invoice","batchSource":"TMS_AMPHORA_OM","attachmentCount":0,"specInvoiceReportId":"specified_invoice_customer_master","currency":"NOK","parentInvoiceNumber":null,"invoiceSpecificationAvailable":true},{"customerNumber":"customerNumber","invoiceNumber":"11404211","invoiceDate":"31.01.2020","invoiceIssuer":"POSTEN_NORGE_AS","status":"Open","totalAmount":"12117.16","dueDate":"03.03.2020","type":"Invoice","batchSource":"TMS_LM_OM","attachmentCount":0,"specInvoiceReportId":"specified_invoice_customer_master","currency":"NOK","parentInvoiceNumber":null,"invoiceSpecificationAvailable":true},{"customerNumber":"customerNumber","invoiceNumber":"1100146","invoiceDate":"30.11.2019","invoiceIssuer":"POSTEN_NORGE_AS","status":"Closed","totalAmount":"485.01","dueDate":"03.01.2020","type":"Invoice","batchSource":"TMS_AMPHORA_OM","attachmentCount":0,"specInvoiceReportId":"specified_invoice_customer_master","currency":"NOK","parentInvoiceNumber":null,"invoiceSpecificationAvailable":true},{"customerNumber":"customerNumber","invoiceNumber":"11403110","invoiceDate":"30.11.2019","invoiceIssuer":"POSTEN_NORGE_AS","status":"Closed","totalAmount":"1964.06","dueDate":"31.12.2019","type":"Invoice","batchSource":"TMS_LM_OM","attachmentCount":0,"specInvoiceReportId":"specified_invoice_customer_master","currency":"NOK","parentInvoiceNumber":null,"invoiceSpecificationAvailable":true},{"customerNumber":"customerNumber","invoiceNumber":"12139462","invoiceDate":"30.11.2019","invoiceIssuer":"POSTEN_NORGE_AS","status":"Closed","totalAmount":"2076.69","dueDate":"31.12.2019","type":"Invoice","batchSource":"PMS_BULKMAIL_OM","attachmentCount":0,"specInvoiceReportId":"specified_invoice_customer_master","currency":"NOK","parentInvoiceNumber":null,"invoiceSpecificationAvailable":false},{"customerNumber":"customerNumber","invoiceNumber":"10021151","invoiceDate":"30.01.2020","invoiceIssuer":"POSTEN_NORGE_AS","status":"Closed","totalAmount":"-75.0","dueDate":"30.01.2020","type":"Credit note","batchSource":"CRM_SF_EXT","attachmentCount":0,"specInvoiceReportId":"specified_invoice_customer_master","currency":"NOK","parentInvoiceNumber":null,"invoiceSpecificationAvailable":false}],"status":"OK"}},"Specified invoice is being created and is not ready yet":{"description":"Specified invoice is being created and is not ready yet","value":{"invoices":[{"customerNumber":"customerNumber","invoiceNumber":"10158070","invoiceDate":"31.12.2019","invoiceIssuer":"POSTEN_NORGE_AS","status":"Open","totalAmount":"186.25","dueDate":"2022-06-29","type":"Invoice","batchSource":"TMS_AMPHORA_OM","invoiceSpecificationAvailable":true,"specificationAvailability":"NO","invoiceProcessed":"YES","attachmentCount":0,"specInvoiceReportId":"specified_invoice_customer_master","currency":"NOK","parentInvoiceNumber":"","parentInvoiceNumberList":[],"supportCaseUrl":null,"supportCaseNumber":null}],"status":"OK"}},"Specified invoice is available":{"description":"Specified invoice is available","value":{"invoices":[{"customerNumber":"customerNumber","invoiceNumber":"10158070","invoiceDate":"31.12.2019","invoiceIssuer":"POSTEN_NORGE_AS","status":"Open","totalAmount":"186.25","dueDate":"2022-06-29","type":"Invoice","batchSource":"TMS_AMPHORA_OM","invoiceSpecificationAvailable":true,"specificationAvailability":"YES","invoiceProcessed":"YES","attachmentCount":0,"specInvoiceReportId":"specified_invoice_customer_master","currency":"NOK","parentInvoiceNumber":"","parentInvoiceNumberList":[],"supportCaseUrl":null,"supportCaseNumber":null}],"status":"OK"}},"Invoice has no specification":{"description":"Invoice has no specification","value":{"invoices":[{"customerNumber":"customerNumber","invoiceNumber":"10158070","invoiceDate":"31.12.2019","invoiceIssuer":"POSTEN_NORGE_AS","status":"Open","totalAmount":"-386.25","dueDate":"2022-06-29","type":"Credit note","batchSource":"CRM_SF_EXT","invoiceSpecificationAvailable":false,"specificationAvailability":"NO","invoiceProcessed":"YES","attachmentCount":0,"specInvoiceReportId":"specified_invoice_customer_master","currency":"NOK","parentInvoiceNumber":"","parentInvoiceNumberList":[],"supportCaseUrl":null,"supportCaseNumber":null}],"status":"OK"}}}}}},"403":{"description":"User don't have required access for the customer","content":{"application/xml":{"examples":{"Forbidden":{"description":"Forbidden","value":"Forbidden"}}}}},"429":{"description":"Too many requests","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying the request.","style":"simple","schema":{"type":"integer","format":"int64"}}},"content":{"text/plain":{}}}}}},"/api/invoices/{customerNumber}.json":{"get":{"tags":["List of all Invoices"],"summary":"List of all Invoices","description":"Gets the list of invoices corresponding to the given customer number. By default it shows last 65 days of invoices, with the possibility to access last 365 days by providing “fromDate” and “toDate”. This endpoint supports Parcel Domestic, Parcel International and Cargo customers.","operationId":"getCustomerInvoicesJson","parameters":[{"name":"customerNumber","in":"path","description":"Unique API Customer Number.","required":true,"schema":{"type":"string"}},{"name":"X-MyBring-API-Uid","in":"header","description":"Your Mybring login ID","required":true,"example":"john.doe@example.com"},{"name":"X-MyBring-API-Key","in":"header","description":"Your user’s API key","required":true,"example":"1234abc-abcd-1234-5678-abcd1234abcd"},{"name":"X-Bring-Client-URL","in":"header","description":"A URL that sort of identifies where you’re using the APIs.","required":true,"example":"https://example.com"},{"name":"fromDate","in":"query","description":"Start date for fetching invoices in format dd.mm.yyyy.","required":false,"schema":{"type":"string","format":"date"},"example":"15.01.2020"},{"name":"toDate","in":"query","description":"End date for fetching invoices in format dd.mm.yyyy.","required":false,"schema":{"type":"string","format":"date"},"example":"25.01.2020"},{"name":"invoicesWithSpecification","in":"query","description":"Displays only invoices with available specifications when set to true.","required":false,"schema":{"type":"boolean"}},{"name":"onlyProcessedInvoices","in":"query","description":"Displays only invoices that has been processed when set to true.","required":false,"schema":{"type":"boolean"}},{"name":"isApiCall","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Successful","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceResponse"},"examples":{"Successful":{"description":"Successful","value":{"invoices":[{"customerNumber":"customerNumber","invoiceNumber":"10158070","invoiceDate":"31.12.2019","invoiceIssuer":"POSTEN_NORGE_AS","status":"Open","totalAmount":"386.25","dueDate":"28.02.2020","type":"Invoice","attachmentCount":0,"specInvoiceReportId":"specified_invoice_customer_master","currency":"NOK","parentInvoiceNumber":null,"invoiceSpecificationAvailable":true},{"customerNumber":"customerNumber","invoiceNumber":"152148","invoiceDate":"31.12.2019","invoiceIssuer":"POSTEN_NORGE_AS","status":"Closed","totalAmount":"7771.69","dueDate":"25.02.2020","type":"Invoice","batchSource":"PMS_BULKMAIL_OM","attachmentCount":0,"specInvoiceReportId":"specified_invoice_customer_master","currency":"NOK","parentInvoiceNumber":null,"invoiceSpecificationAvailable":false},{"customerNumber":"customerNumber","invoiceNumber":"1109932","invoiceDate":"31.01.2020","invoiceIssuer":"POSTEN_NORGE_AS","status":"Open","totalAmount":"115.0","dueDate":"06.03.2020","type":"Invoice","batchSource":"TMS_AMPHORA_OM","attachmentCount":0,"specInvoiceReportId":"specified_invoice_customer_master","currency":"NOK","parentInvoiceNumber":null,"invoiceSpecificationAvailable":true},{"customerNumber":"customerNumber","invoiceNumber":"11404211","invoiceDate":"31.01.2020","invoiceIssuer":"POSTEN_NORGE_AS","status":"Open","totalAmount":"12117.16","dueDate":"03.03.2020","type":"Invoice","batchSource":"TMS_LM_OM","attachmentCount":0,"specInvoiceReportId":"specified_invoice_customer_master","currency":"NOK","parentInvoiceNumber":null,"invoiceSpecificationAvailable":true},{"customerNumber":"customerNumber","invoiceNumber":"1100146","invoiceDate":"30.11.2019","invoiceIssuer":"POSTEN_NORGE_AS","status":"Closed","totalAmount":"485.01","dueDate":"03.01.2020","type":"Invoice","batchSource":"TMS_AMPHORA_OM","attachmentCount":0,"specInvoiceReportId":"specified_invoice_customer_master","currency":"NOK","parentInvoiceNumber":null,"invoiceSpecificationAvailable":true},{"customerNumber":"customerNumber","invoiceNumber":"11403110","invoiceDate":"30.11.2019","invoiceIssuer":"POSTEN_NORGE_AS","status":"Closed","totalAmount":"1964.06","dueDate":"31.12.2019","type":"Invoice","batchSource":"TMS_LM_OM","attachmentCount":0,"specInvoiceReportId":"specified_invoice_customer_master","currency":"NOK","parentInvoiceNumber":null,"invoiceSpecificationAvailable":true},{"customerNumber":"customerNumber","invoiceNumber":"12139462","invoiceDate":"30.11.2019","invoiceIssuer":"POSTEN_NORGE_AS","status":"Closed","totalAmount":"2076.69","dueDate":"31.12.2019","type":"Invoice","batchSource":"PMS_BULKMAIL_OM","attachmentCount":0,"specInvoiceReportId":"specified_invoice_customer_master","currency":"NOK","parentInvoiceNumber":null,"invoiceSpecificationAvailable":false},{"customerNumber":"customerNumber","invoiceNumber":"10021151","invoiceDate":"30.01.2020","invoiceIssuer":"POSTEN_NORGE_AS","status":"Closed","totalAmount":"-75.0","dueDate":"30.01.2020","type":"Credit note","batchSource":"CRM_SF_EXT","attachmentCount":0,"specInvoiceReportId":"specified_invoice_customer_master","currency":"NOK","parentInvoiceNumber":null,"invoiceSpecificationAvailable":false}],"status":"OK"}},"Specified invoice is being created and is not ready yet":{"description":"Specified invoice is being created and is not ready yet","value":{"invoices":[{"customerNumber":"customerNumber","invoiceNumber":"10158070","invoiceDate":"31.12.2019","invoiceIssuer":"POSTEN_NORGE_AS","status":"Open","totalAmount":"186.25","dueDate":"2022-06-29","type":"Invoice","batchSource":"TMS_AMPHORA_OM","invoiceSpecificationAvailable":true,"specificationAvailability":"NO","invoiceProcessed":"YES","attachmentCount":0,"specInvoiceReportId":"specified_invoice_customer_master","currency":"NOK","parentInvoiceNumber":"","parentInvoiceNumberList":[],"supportCaseUrl":null,"supportCaseNumber":null}],"status":"OK"}},"Specified invoice is available":{"description":"Specified invoice is available","value":{"invoices":[{"customerNumber":"customerNumber","invoiceNumber":"10158070","invoiceDate":"31.12.2019","invoiceIssuer":"POSTEN_NORGE_AS","status":"Open","totalAmount":"186.25","dueDate":"2022-06-29","type":"Invoice","batchSource":"TMS_AMPHORA_OM","invoiceSpecificationAvailable":true,"specificationAvailability":"YES","invoiceProcessed":"YES","attachmentCount":0,"specInvoiceReportId":"specified_invoice_customer_master","currency":"NOK","parentInvoiceNumber":"","parentInvoiceNumberList":[],"supportCaseUrl":null,"supportCaseNumber":null}],"status":"OK"}},"Invoice has no specification":{"description":"Invoice has no specification","value":{"invoices":[{"customerNumber":"customerNumber","invoiceNumber":"10158070","invoiceDate":"31.12.2019","invoiceIssuer":"POSTEN_NORGE_AS","status":"Open","totalAmount":"-386.25","dueDate":"2022-06-29","type":"Credit note","batchSource":"CRM_SF_EXT","invoiceSpecificationAvailable":false,"specificationAvailability":"NO","invoiceProcessed":"YES","attachmentCount":0,"specInvoiceReportId":"specified_invoice_customer_master","currency":"NOK","parentInvoiceNumber":"","parentInvoiceNumberList":[],"supportCaseUrl":null,"supportCaseNumber":null}],"status":"OK"}}}}}},"403":{"description":"User don't have required access for the customer","content":{"application/json":{"examples":{"Forbidden":{"description":"Forbidden","value":"Forbidden"}}}}},"429":{"description":"Too many requests","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying the request.","style":"simple","schema":{"type":"integer","format":"int64"}}},"content":{"text/plain":{}}}}}},"/api/internal/invoices/{customerNumber}":{"get":{"tags":["internal-fetch-invoice-controller"],"operationId":"fetchInvoices","parameters":[{"name":"customerNumber","in":"path","required":true,"schema":{"type":"string"}},{"name":"fromDate","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"toDate","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"dataProvider","in":"query","required":false,"schema":{"type":"string","default":"MYBRING_DATAWAREHOUSE","enum":["MYBRING_DATAWAREHOUSE","MYBRING_DATAWAREHOUSE_QA"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/internal/invoice/{customerNumber}/{invoiceNumber}":{"get":{"tags":["internal-fetch-invoice-controller"],"operationId":"fetchInvoice","parameters":[{"name":"customerNumber","in":"path","required":true,"schema":{"type":"string"}},{"name":"invoiceNumber","in":"path","required":true,"schema":{"type":"string"}},{"name":"dataProvider","in":"query","required":false,"schema":{"type":"string","default":"MYBRING_DATAWAREHOUSE","enum":["MYBRING_DATAWAREHOUSE","MYBRING_DATAWAREHOUSE_QA"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}}},"components":{"schemas":{"InvoiceDetails":{"type":"object","properties":{"customerNumber":{"type":"string"},"invoiceNumber":{"type":"string"},"invoiceDate":{"type":"string"},"invoiceIssuer":{"type":"string"},"status":{"type":"string"},"amount":{"type":"string"},"taxAmount":{"type":"string"},"totalAmount":{"type":"string"},"dueDate":{"type":"string"},"type":{"type":"string"},"batchSource":{"type":"string"},"invoiceSpecificationAvailable":{"type":"boolean"},"specificationAvailability":{"type":"string","enum":["YES","NO","PARTLY"]},"invoiceProcessed":{"type":"string","enum":["YES","NO","PARTLY"]},"attachmentCount":{"type":"integer","format":"int32"},"specInvoiceReportId":{"type":"string"},"currency":{"type":"string"},"parentInvoiceNumber":{"type":"string"},"parentInvoiceNumberList":{"type":"array","items":{"type":"string"}},"supportCaseUrl":{"type":"string"},"supportCaseNumber":{"type":"string"},"invalidPdfLink":{"type":"boolean"}},"required":["customerNumber","invalidPdfLink","invoiceIssuer","invoiceProcessed","invoiceSpecificationAvailable","parentInvoiceNumberList","specificationAvailability"]},"InvoiceResponse":{"type":"object","properties":{"invoices":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceDetails"}},"status":{"type":"string"}},"required":["invoices","status"]}},"securitySchemes":{"apiKey":{"type":"apiKey","name":"X-MyBring-API-Key","in":"header","scheme":"basic"},"apiUid":{"type":"apiKey","name":"X-MyBring-API-Uid","scheme":"basic"}}}}