{"introduction":"This document provides a reference to the Receipt SPI and API. It includes a series of notes and instructions that outline the Receipt SPI and API.","audience":{"label":"Audience","description":"This document has been created for the Egencia Receipt API and SPI customers, partners and software developers who’d like to consume the Receipt SPI and API."},"overview":{"label":"Overview","description":"Egencia Receipt SPI will push a notification to the consumer with booking id, item id and the receipt URL (to download the receipt PDF) whenever there is a receipt generated for a booking item in Egencia system. The consumer can download the PDF receipt by calling the Receipt API with the URL passed in this push notification whenever required. This document will help you find links to the Receipt SPI and API endpoints in detail."},"versioning":{"versions":[{"id":"1.0","change_description":"First stable version."}]},"error_codes":[{"code":"EGE-ER-OS-4002","description":"Resource not found, you are trying to access an invalid or non existent resource."},{"code":"EGE-ER-OS-4008","description":"Receipt is unavailable for this booking item."},{"code":"EGE-ER-OS-5001","description":"Unable to process your request right now. Please try again later."}],"api_details":{"label":"Receipt SPI/API","subheadings":[{"label":"Receipt SPI","description":"Using Receipt SPI, Egencia will push a notification to the the connected Partner system (web service) whenever a receipt for a booking item is generated in Egencia system.\n\n\t1. The client consumer has to build the web service to consume this data. Egencia uses this web service to notify the partner by sending the the booking Id, item Id and receipt URL.\n\t2. The web service (provided by the client) returns a success message if the notification has been taken into account.\n\t3. Egencia will connect to the web service (provided by the client) to transfer the data. The data transfer will happen in a secured manner(Over HTTPS).","subheadings":[{"label":"Receipt SPI payload","description":"Below is an example of the SPI payload that Egencia will share to the external clients.\n\n{ \r\n \"booking_id\": \"8000-2573-464\",\r\n \"item_id\": \"86a508692d9282afa0d96e5f6af\",\r\n \"product_type\": \"FLIGHT\",\r\n \"company_id\": 133343,\r\n \"traveler_id\" : 323675,\r\n \"organization_parent_id\": 23345,\r\n \"_links\": {\r\n  \"receipt\": {\r\n   \"href\": \"https://apis.egencia.com/openconnect/api/v1/receipts/86a508692d9282afa0d96e5f6af\"\r\n   }\r\n  } \r\n}"}]},{"label":"Receipt API","description":"The Receipt API offers you an interface to retrieve receipt pdf for a booking item from Egencia. The Receipt API is organised around REST /JSON over HTTPS for receipts retrieval. This API uses standard HTTPs response codes, authentication, and verbs. You can call this endpoint once you receive the Receipt SPI Push message. To have a secure data transfer and streamlined integration, we use the HTTPs protocol for API calls."}]},"enumerations":{},"http_verbs":[{"label":"Receipt SPI Implementation","description":"Egencia will send receipt notification to the consumers, the client consumer has to build the web service to consume this data. Below are the further details","values":[{"name":"Endpoint","description":"/v1/receipts/"},{"name":"Method","description":"POST"},{"name":"Accept","description":"application/hal+json"}]},{"label":"Receipt SPI Request Attributes","values":[{"name":"booking_id","description":"Unique Identifier number for the booking."},{"name":"item_id","description":"Unique Identifier for the item."},{"name":"product_type","description":"Line of business of the item."},{"name":"company_id","description":"Id of the company."},{"name":"traveler_id","description":"Id of the traveler."},{"name":"organization_parent_id","description":"Organization Id of the company."},{"name":"_links/receipt/href","description":"Receipt API url to fetch the receipt pdf."}]}],"documentation_link":"https://apis.egencia.com/openconnect/docs/api-docs/ReceiptAPISPI"}