Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
amiddeldorp
Associate
Associate
I have been a Technical Consultant at SAP Concur for quite some time and have worked with many clients to help them build their interfaces between their systems and SAP Concur. One requirement I regularly see come up is to maintain a local archive of receipt images in that country.

In this blog we are focusing on the use case where you may need to retrieve Expense Receipt Images for a particular country. There are several ways of getting Expense Receipt Image files from SAP Concur. These include:

  • Image Delivery Extract
    A zip-file delivered via SFTP in a predefined format. It does not allow for any country filtering.



  • SAP Integration with Concur Solutions (ICS) for SAP ERP Systems
    Allow you to define an image archive location within the SAP ERP system. Once setup the receipt images are retrieved as part of the FI posting.



  • Web Service APIs
    Allows you to retrieve images based on filter criteria through a series of calls from a program to extract the data for immediate consumption. This is an excellent of retrieving receipt images for a local country archive when other standard methods cannot fulfill your requirements. This will be the focus of this blog-post.


Prerequisites


This post will not discuss authentication with Concur Expense.  Please see this post to get an explanation on authentication and application building within Concur Expense.  You will need an application with the following SCOPEs:

  • EXPRPT

  • IMAGE






Introduction


Receipt Images can be downloaded by Expense Report. All receipt for the Expense Report will be compiled into a single PDF-file. You can filter the Report list on certain criteria result by using the parameters on the Reports v3 API to ensure the result only returns the relevant reports to download images for.

Steps

  • Get Report list based on filter criteria

  • Get Image per Report ID

  • Get Image file



Sequence diagram


To help you understand APIs used in this use case, I developed the following Postman collection (found here) as an example.  More detail on the APIs used can be found on the SAP Business Accelerator Hub:

Detailed Walkthrough


Get Report list based on filter criteria


The first step is to retrieve all the expense reports for which we need to get the receipt images. For this we can use the Reports v3 API - GET /api/v3.0/expense/reports . By adding query parameters we can filter the result. For example, if we want to see all expense report (1) from Italy (2) that have images (3) and have been sent for payment on 13 June 2023 (4), we could use the following parameters:

  1. user=ALL

  2. countryCode=IT

  3. hasImages=TRUE

  4. paidDateBefore=2023-06-14&paidDateAfter=2023-06-13


The actual GET call would then look like this:
GET /api/v3.0/expense/reports?user=ALL&countryCode=IT&hasImages=TRUE&paidDateBefore=2023-06-14&paidDateAfter=2023-06-13

In the result, each Expense Report will include an element “ID”, which is the Report ID.

Further detail about the available filter criteria can be found here.

Get Image per Report ID


For each Expense Report you can then use the Image v1 API to get a URL from where you can download a PDF-file with all images for that single report. Since this is per Report ID, you will need make this GET-call for each Expense Report.
GET /api/image/v1.0/report/{reportId}

The response will contain a URL that can be used to retrieve the actual image file. This URL is valid for 15 minutes after the request.

Get Image file


To get the Receipt Image file, you can call a direct GET to the URL that was returned in the previous step. Any parameters the URL includes will need to be included as well. This URL could look something like this:
https://www-us2.api.concursolutions.com/imaging/web/us2/file/p0099999xyzz/5E5B592E3F9F0B100736275DAE...

Conclusion


Combining SAP Concur’s Reports v3 and Image v1 APIs offer a very flexible way to retrieve Receipt Images based on relevant filter criteria. This allows you to specifically target only those images that you need to store in a local archive.

Share and Connect


What do you think?  Do you have anything to add? Leave a comment below.

Did you find it useful? Give us a like and share on social media.

Want to know more about SAP Concur? Please follow here.

Want to ask questions about SAP Concur and its offerings? Ask here

Follow my profile for similar content.

Thank you!