{"openapi":"3.1.0","info":{"title":"Reports API","description":"<b>The Reports API can be used as a tool for analyzing your logistics with Bring\nThe API lets you generate reports within the categories\n<i>status, quality and deviation, economy</i> and <i>environment</i>.\nSupported report formats are XML and Excel.\n</b><h2>Reports API</h2>\n<ul>\n    <li>List available customers 🙋‍♂️</li>\n    <li>List available reports for a customer 📊</li>\n    <li>Generate a report 📑</li>\n    <li>Check the status of a report ✅</li>\n    <li>Get report 📥</li>\n</ul>\n\n<h2>Fetching reports</h2>\n<p>\n    The first two steps in the process is only necessary to find customer numbers and\nreport types for the user.</br>You can save these IDs, and perform the generation-step without\nverifying the IDs.</br>The response may get added information, so implementation should ignore\nnew elements added to the response.\n</p>\n<ol>\n    <li>Get the customers IDs</li>\n    <li>Get the list of report types available for the customer</li>\n    <li>Initiate report creation and get the report ID. The Report ID is initially used to\n    monitor reports creation progress, later to get the actual report (XML or Excel file)</li>\n    <li>After initiating report creation, you can check the status, if it’s in-progress,\n    completed or failed. When completed, a URL to the actual report is returned</li>\n    <li>Download report</li><li>Get list of invoice numbers for given customer or group</li>\n</ol>"},"servers":[{"url":"https://www.mybring.com/reports","description":"Generated server url"}],"paths":{"/api/report/{reportId}":{"get":{"tags":["api-controller"],"summary":"Get report","description":"Returns the generated report, file type determined by Accept Header.\n<br />\nAlso available with specified formats with endpoints:\n<ul>\n    <li>/api/report/{reportId}.xlsx</li>\n    <li>/api/report/{reportId}.xml</li>\n</ul>\n","operationId":"resultAsXmlXlsx","parameters":[{"name":"reportId","in":"path","description":"A report ID from a 'generate a report' call.","required":true,"schema":{"type":"string"}},{"name":"Accept","in":"header","description":"Format to return response as, XML or XLSX.","examples":{"XML":{"description":"XML","value":"application/xml"},"Excel":{"description":"Excel","value":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}},{"name":"Accept-Language","in":"header","description":"A comma-separated list of language codes.","examples":{"Norwegian":{"description":"Norwegian","value":"no"},"English":{"description":"English","value":"en"}}},{"name":"compress","in":"query","description":"Get the XML report as a compressed ZIP archive.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"The report as XML or Excel file","content":{"application/xml":{"examples":{"Successful with invoice details":{"description":"Successful with invoice details","value":"<Report xmlns=\"urn:bring.no/mybring/Report\">\n  <MetaData>\n    <ReportName>Specified invoice - Groupage and partload</ReportName>\n    <FinishedAt type=\"iso8601\">2019-12-12T12:31:36.933+01:00</FinishedAt>\n    <CustomerId>3444353</CustomerId>\n    <CustomerName>TEST Customer</CustomerName>\n    <InvoiceNumber>1220033899</InvoiceNumber>\n    <NumberOfRows>204</NumberOfRows>\n    <InvoiceSource>AMPHORA_DOMESTIC</InvoiceSource>\n    <AttachmentCount>Number of attachment(s):1</AttachmentCount>\n    <AttachmentUrl>Invoices in Mybring.https://www.mybring.com/invoicearchive/invoice/attachmentsRedirect/3444353/1220033899.html</AttachmentUrl>\n  </MetaData>\n  <Lines>\n    <Line>\n      <PICK_UP_POSTAL_CODE>5020</PICK_UP_POSTAL_CODE>\n      <RECEIVER_NAME>TEST Customer</RECEIVER_NAME>\n      <DELIVERY_POSTAL_CODE>3050</DELIVERY_POSTAL_CODE>\n      <WAYBILL_NUMBER>70700611051925484</WAYBILL_NUMBER>\n      <FREIGHT_PAYER>A</FREIGHT_PAYER>\n      <ITEM_DESCRIPTION>Frakt</ITEM_DESCRIPTION>\n      <DESCRIPTION>RETAIL ITEMS FOR SALE IN SK STORES</DESCRIPTION>\n      <FREIGHT_CALC_WEIGHT>150.0</FREIGHT_CALC_WEIGHT>\n      <TRX_DATE>25.04.2019</TRX_DATE>\n      <NUMBER_OF_PACKAGES>1</NUMBER_OF_PACKAGES>\n      <GrossPrice>1426.00</GrossPrice>\n      <AMOUNT>271.00</AMOUNT>\n    </Line>\n  </Lines>\n</Report>"},"Successful":{"description":"Successful","value":"<Report xmlns=\"urn:bring.no/mybring/Report\">\n  <MetaData>\n    <ReportName>Delivered to recipient</ReportName>\n    <FinishedAt type=\"iso8601\">2015-10-19T15:17:07.077+02:00</FinishedAt>\n    <CustomerId>00012341234</CustomerId>\n    <CustomerName>TEST CUSTOMER</CustomerName>\n    <Interval>\n      <Start type=\"iso8601\">2015-01-01T00:00:00.000+01:00</Start>\n      <End type=\"iso8601\">2015-10-19T23:59:59.000+02:00</End>\n    </Interval>\n    <NumberOfRows>0</NumberOfRows>\n  </MetaData>\n  <Lines>\n  </Lines>\n</Report>"}}}}},"404":{"description":"Report with specified id not found","content":{"text/plain":{"examples":{"Not Found":{"description":"Not Found","value":"Not Found"}}}}}},"security":[{"apiKey":[]},{"apiUid":[]}],"x-developer-site-metadata":{"order":"4"}}},"/api/report/{reportId}/status":{"get":{"tags":["api-controller"],"summary":"Check the status of a report","description":"Since the generation of reports may take several minutes, we supply a status address to check the status of the report generation.\nThe status page will display NOT_DONE, until the report is ready to be downloaded. When the report is ready, URLs to download the report will be in the response\n<br />\nAlso available with specified formats with endpoints:\n<ul>\n    <li>/api/report/{reportId}/status.json</li>\n    <li>/api/report/{reportId}/status.xml</li>\n</ul>\n","operationId":"statusXmlJson","parameters":[{"name":"reportId","in":"path","description":"A report ID from a 'generate a report' call.","required":true,"schema":{"type":"string"}},{"name":"Accept","in":"header","description":"Format to return response as. Either application/json or application/xml","example":"application/json"},{"name":"Accept-Language","in":"header","description":"A comma-separated list of language codes.","examples":{"Norwegian":{"description":"Norwegian","value":"no"},"English":{"description":"English","value":"en"}}}],"responses":{"200":{"description":"Status of requested report, including URL to get the report if it is DONE. Response type based on Accept Header","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportStatusResponseDto"},"examples":{"Report status done":{"$ref":"#/components/examples/reportStatusDone"},"Report status not done":{"$ref":"#/components/examples/reportStatusNotDone"},"Report status failed":{"$ref":"#/components/examples/reportStatusFailed"}}},"application/xml":{"schema":{"$ref":"#/components/schemas/ReportStatusResponseDto"},"examples":{"Report status done":{"$ref":"#/components/examples/reportStatusDone"},"Report status not done":{"$ref":"#/components/examples/reportStatusNotDone"},"Report status failed":{"$ref":"#/components/examples/reportStatusFailed"}}}}},"404":{"description":"Report not found","content":{"text/plain":{"examples":{"Not Found":{"description":"Not Found","value":"Not Found"}}}}}},"security":[{"apiKey":[]},{"apiUid":[]}],"x-developer-site-metadata":{"order":"3"}}},"/api/generate":{"get":{"tags":["api-controller"],"summary":"List available customers","description":"List available customers for the provided API credentials.\n\nAlso available with specified formats with endpoints:\n<ul>\n    <li>/api/generate.json</li>\n    <li>/api/generate.xml</li>\n</ul>\n","operationId":"listCustomersXmlJson","parameters":[{"name":"Accept","in":"header","description":"Format to return response as. Either application/json or application/xml","example":"application/json"}],"responses":{"200":{"description":"Successfully fetched a list of available customers for provided API credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerList"},"examples":{"Successful":{"$ref":"#/components/examples/customerList"}}},"application/xml":{"schema":{"$ref":"#/components/schemas/CustomerList"},"examples":{"Successful":{"$ref":"#/components/examples/customerList"}}}}}},"security":[{"apiKey":[]},{"apiUid":[]}],"x-developer-site-metadata":{"order":"0"}}},"/api/generate/{customerId}":{"get":{"tags":["api-controller"],"summary":"List available reports for a customer","description":"Each customer has a set of reports available. This endpoint lists all available reports for a given customer.\n\nAlso available with specified formats with endpoints:\n<ul>\n    <li>/api/generate/{customerId}.json</li>\n    <li>/api/generate/{customerId}.xml</li>\n</ul>\n","operationId":"listReportsXmlJson","parameters":[{"name":"customerId","in":"path","description":"A customer ID from the 'list of available customers' call.","required":true,"schema":{"type":"string"}},{"name":"Accept","in":"header","description":"Format to return response as. Either application/json or application/xml","example":"application/json"}],"responses":{"200":{"description":"Successfully got available reports","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportList"},"examples":{"Successful":{"$ref":"#/components/examples/reportList"}}},"application/xml":{"schema":{"$ref":"#/components/schemas/ReportList"},"examples":{"Successful":{"$ref":"#/components/examples/reportList"}}}}}},"security":[{"apiKey":[]},{"apiUid":[]}],"x-developer-site-metadata":{"order":"1"}}},"/api/generate/{customerId}/{apiDefinitionId}":{"get":{"tags":["api-controller"],"summary":"Generate a report","description":"To generate a report do a GET to the supplied URL, and include the parameters described in the previous response.\nYou need not invoke the two first steps for every report generation if customer id and report type are known.\n<br />\nThis is asynchronous request. So the GET-call will return 202, telling the caller the that the request for\na report is put on the queue. The URL to query to get the status for the request if provided as an HTTP\nheader and also in the response.\n<br />\nAlso available with specified formats with endpoints:\n<ul>\n    <li>/api/generate/{customerId}/{apiDefinitionId}.json</li>\n    <li>/api/generate/{customerId}/{apiDefinitionId}.xml</li>\n</ul>\n","operationId":"generateXmlJson","parameters":[{"name":"customerId","in":"path","description":"A customer ID from the 'list of available customers' call.","required":true,"schema":{"type":"string"}},{"name":"apiDefinitionId","in":"path","description":"A report type ID from the 'list of available reports' call.","required":true,"schema":{"type":"string"}},{"name":"queryParams","in":"query","description":"The different report types have different params. The params are documented in the list of available reports, for example fromDate and toDate.","required":true,"schema":{"type":"object","additionalProperties":{"type":"string"}}},{"name":"Accept-Language","in":"header","description":"A comma-separated list of language codes.","examples":{"Norwegian":{"description":"Norwegian","value":"no"},"English":{"description":"English","value":"en"}}},{"name":"Accept","in":"header","description":"Format to return response as. Either application/json or application/xml","example":"application/json"}],"responses":{"202":{"description":"The URL to query to get the status for the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/result"},"examples":{"Successful":{"$ref":"#/components/examples/reportGenerate"}}},"application/xml":{"schema":{"$ref":"#/components/schemas/result"},"examples":{"Successful":{"$ref":"#/components/examples/reportGenerate"}}}}}},"security":[{"apiKey":[]},{"apiUid":[]}],"x-developer-site-metadata":{"order":"2"}}}},"components":{"schemas":{"ReportStatusResponseDto":{"type":"object","properties":{"status":{"type":"string"},"xmlUrl":{"type":"string"},"xlsUrl":{"type":"string"}},"xml":{"name":"result"}},"CustomerList":{"type":"object","properties":{"customers":{"type":"array","items":{"$ref":"#/components/schemas/customers"},"xml":{"wrapped":true}}},"xml":{"name":"CustomerList"}},"customers":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"reports":{"type":"string","format":"uri"}},"xml":{"name":"customers"}},"ApiParameterDto":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"description":{"type":"string"}},"xml":{"name":"parameters"}},"ReportList":{"type":"object","properties":{"reports":{"type":"array","items":{"$ref":"#/components/schemas/reports"},"xml":{"wrapped":true}}},"xml":{"name":"ReportList"}},"reports":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"url":{"type":"string","format":"uri"},"parameters":{"type":"array","items":{"$ref":"#/components/schemas/ApiParameterDto"},"xml":{"wrapped":true}}},"xml":{"name":"reports"}},"result":{"type":"object","properties":{"statusUrl":{"type":"string","format":"uri"}}}},"examples":{"reportStatusFailed":{"value":{"status":"FAILED"}},"reportStatusNotDone":{"value":{"status":"NOT_DONE"}},"reportStatusDone":{"value":{"status":"DONE","xmlUrl":"https://www.mybring.com/reports/api/report/4cb1f149-19b9-4403-a871-17e1d142214f.xml","xlsUrl":"https://www.mybring.com/reports/api/report/4cb1f149-19b9-4403-a871-17e1d142214f.xlsx"}},"reportList":{"value":{"reports":[{"id":"PARCELS-PRE_NOTIFICATION_RECEIVED","name":"Pre-notification provided","description":"Overview of shipments you have sent pre-notification for.","url":"https://www.mybring.com/reports/api/generate/00012341234/PARCELS-PRE_NOTIFICATION_RECEIVED/","parameters":[{"name":"fromDate","type":"date","description":"Startdate of the report. Format: DD.MM.YYYY"},{"name":"toDate","type":"date","description":"Enddate of the report. Format: DD.MM.YYYY"}]},{"id":"PARCELS-FREIGHT_STATISTICS_SUMMED","name":"Freight costs, summarized by service","description":"Invoiced shipping costs per service.","url":"https://www.mybring.com/reports/api/generate/00012341234/PARCELS-FREIGHT_STATISTICS_SUMMED/","parameters":[{"name":"reporttype","type":"string","description":"INVOICED=Invoiced year, HANDED_IN=Handed in year"},{"name":"year","type":"int","description":"Year for report"}]}]}},"reportGenerate":{"value":{"statusUrl":"https://www.mybring.com/reports/api/report/db285042-6e8d-4563-94ca-eb1100706a73/status/"}},"customerList":{"value":{"customers":[{"id":"PARCELS_NORWAY-00012341234","name":"TEST CUSTOMER","reports":"https://www.mybring.com/reports/api/generate/00012341234/"}]}}},"securitySchemes":{"apiKey":{"type":"apiKey","name":"X-MyBring-API-Key","in":"header","scheme":"basic"},"apiUid":{"type":"apiKey","name":"X-MyBring-API-Uid","in":"header","scheme":"basic"}}}}