# Receipts in app

**URL:** <https://community.monzo.com/t/receipts-in-app/145618>\
**Category:** Help\
**Created:** [24 March 2023 09:24 UTC](https://community.monzo.com/t/receipts-in-app/145618 "2023-03-24T09:24:04Z")\
**Posts on this page:** 13\
**Page:** 2

<div class="post-metadata">

**Author:** ![Peter\_G](https://dub1.discourse-cdn.com/monzo/user_avatar/community.monzo.com/peter_g/32/89632_2.png) [@Peter\_G](https://community.monzo.com/u/Peter_G)\
**Post date:** [24 March 2023 17:06 UTC](https://community.monzo.com/t/receipts-in-app/145618/21 "2023-03-24T17:06:38Z")

</div>

> [@Peter\_G](#):
>
> Ideally, I’d like to be able to string something similar to that together with something like @bee’s current project (Paperless NGX - an open source thing to deal with documents and can log them from emails etc). But that’s beyond my technical capabilities alas.

So I went ahead and asked ChatGPT for instructions on how to do this. This needs a bit of human intervention to get it to work (and probably a few follow on prompts) but my mind continues to be blown 🤯

> [@User](#):
>
> Hello! Is there a way of integrating Paperless NGX and my Monzo bank account?
> 
> I’d like to be able to set documents in PaperlessNGX to be imported into Monzo using the Open Transaction receipts API, and also add a link to the file in Paperless to the Notes field in the Monzo transaction.

> [@ChatGPT](#):
>
> As an AI language model, I cannot directly integrate services for you, but I can guide you on how to achieve this integration using the available APIs for both Paperless NGX and Monzo bank. To accomplish this, you’ll need to create a script or a small application that acts as a bridge between the two services.
> 
> Here’s a high-level overview of the steps you’ll need to follow:
> 
> 1. Create a Monzo Developer Account: Visit Monzo’s developer portal ([https://developers.monzo.com/](https://developers.monzo.com/)) and sign up for an account. You’ll need to generate an access token and get your account ID.
> 
> 2. Set up Paperless NGX API access: Make sure you have the API enabled in your Paperless NGX instance. Obtain an API token to authenticate requests to the Paperless NGX API.
> 
> 3. Choose a programming language: Select a programming language you’re comfortable with, such as Python, JavaScript, or Ruby, to write your script or application.
> 
> 4. Fetch documents from Paperless NGX: Use the Paperless NGX API to fetch the documents you want to import into Monzo. You can use the API’s search functionality to filter documents based on specific criteria, such as tags or document types. For example, only retrieve receipts.
> 
> 5. Parse document metadata: Extract the relevant metadata from the documents, such as the transaction date, amount, and merchant name. You may need to use OCR or regex parsing to extract this information, depending on the format of the documents.
> 
> 6. Create a receipt in Monzo: Use the Monzo API’s “Create Receipt” endpoint to create a receipt in Monzo for each document. Make sure to include the relevant metadata you extracted in step 5.
> 
> 7. Attach the receipt to the corresponding transaction: Find the Monzo transaction that matches the document’s metadata (date, amount, merchant) and use the “Attach Receipt to Transaction” endpoint to attach the newly created receipt.
> 
> 8. Add a link to the Paperless NGX file in the Monzo transaction notes: Get the document URL from Paperless NGX and add it as a note to the corresponding Monzo transaction using the Monzo API’s “Update Transaction” endpoint.
> 
> 9. Schedule or trigger the script: Depending on your needs, you can either run the script manually, set up a cron job to run it periodically, or create a webhook to trigger the script when a new document is added to Paperless NGX.
> 
> Remember that you’ll need to handle error cases and properly authenticate and authorize requests to both APIs. Make sure to consult the API documentation for both Monzo and Paperless NGX to understand the required parameters and request formats:
> 
> - Monzo API documentation: [Monzo for Developers](https://developers.monzo.com/api/)
> - Paperless NGX API documentation can be found in your Paperless NGX instance by navigating to /api/docs/.

> [@User](#):
>
> Thanks! On point 3 can you suggest a python script that does this for us?

> [@ChatGPT](#):
>
> Sure! Here’s a basic Python script to help you get started with the integration. Please note that you’ll need to install the requests library to use this script.
> 
> ```auto
> # Replace with your credentials
> monzo_access_token = 'your_monzo_access_token'
> monzo_account_id = 'your_monzo_account_id'
> paperless_api_token = 'your_paperless_api_token'
> 
> paperless_base_url = 'https://your_paperless_instance_url'
> monzo_base_url = 'https://api.monzo.com'
> 
> # Headers for Paperless and Monzo API requests
> paperless_headers = {'Authorization': f'Token {paperless_api_token}'}
> monzo_headers = {'Authorization': f'Bearer {monzo_access_token}'}
> 
> def get_paperless_documents():
> url = f'{paperless_base_url}/api/documents/'
> response = requests.get(url, headers=paperless_headers)
> response.raise_for_status()
> return response.json()['results']
> 
> def create_monzo_receipt(transaction_id, receipt_data):
> url = f'{monzo_base_url}/transaction-receipts'
> data = {
> 'transaction_id': transaction_id,
> 'receipt': receipt_data
> }
> response = requests.post(url, json=data, headers=monzo_headers)
> response.raise_for_status()
> return response.json()
> 
> def attach_receipt_to_transaction(transaction_id, receipt_id):
> url = f'{monzo_base_url}/transactions/{transaction_id}/attach_receipt'
> data = {
> 'receipt_id': receipt_id
> }
> response = requests.put(url, json=data, headers=monzo_headers)
> response.raise_for_status()
> return response.json()
> 
> def update_transaction(transaction_id, note):
> url = f'{monzo_base_url}/transactions/{transaction_id}'
> data = {
> 'metadata': {
> 'notes': note
> }
> }
> response = requests.patch(url, json=data, headers=monzo_headers)
> response.raise_for_status()
> return response.json()
> 
> # Main script
> documents = get_paperless_documents()
> 
> for doc in documents:
> # Extract relevant metadata (transaction_id, receipt_data, etc.) from the document
> # This step will vary based on your documents' formats
> 
> # Create the receipt in Monzo
> receipt = create_monzo_receipt(transaction_id, receipt_data)
> 
> # Attach the receipt to the transaction
> attach_receipt_to_transaction(transaction_id, receipt['id'])
> 
> # Add a link to the Paperless NGX file in the Monzo transaction notes
> paperless_document_url = f'{paperless_base_url}/documents/{doc["id"]}/download'
> update_transaction(transaction_id, f'Receipt: {paperless_document_url}')
> 
> ```
> 
> Please note that this is a basic template and may need modification to fit your specific use case. You’ll need to replace the placeholder access tokens and URLs with your actual credentials and instance URLs. Additionally, the extraction of metadata from the Paperless documents (transaction\_id, receipt\_data, etc.) will depend on the format of your documents and may require additional processing, such as OCR or regex parsing.

If anyone’s interested, I’ll create a separate topic for ChatGPT suggested Monzo integrations!

I think this is the advanced class, but I’m going to try out generating receipts for transactions from Google Sheets when I get a free day.

---

<div class="post-metadata">

**Author:** ![RogerB](https://dub1.discourse-cdn.com/monzo/user_avatar/community.monzo.com/rogerb/32/24254_2.png) [@RogerB](https://community.monzo.com/u/RogerB)\
**Post date:** [24 March 2023 17:08 UTC](https://community.monzo.com/t/receipts-in-app/145618/22 "2023-03-24T17:08:55Z")

</div>

How amazing is that. I only understand about 10% of it but sounds helpful. Is it? R-

---

<div class="post-metadata">

**Author:** ![Peter\_G](https://dub1.discourse-cdn.com/monzo/user_avatar/community.monzo.com/peter_g/32/89632_2.png) [@Peter\_G](https://community.monzo.com/u/Peter_G)\
**Post date:** [24 March 2023 17:14 UTC](https://community.monzo.com/t/receipts-in-app/145618/23 "2023-03-24T17:14:10Z")

</div>

So I’m by no means an expert, but it looks like the basics are there. I’d need to follow it up with a ton of prompts to get things working properly. The big issue is, I think, that there’s no proper matching of the Monzo transaction and the file in Paperless. But I think that can be fixed. @bee is the expert though!

When I get time I’m gonna try to use ChatGPT to help me effectively turn Google sheets into a front end so I can manually enter receipt transactions to Monzo. It won’t be fancy or auto-match anything but it would be a nice start.

Of course, it might all be beyond my technical capability. Or ChatGPT might just be hallucinating. So success tbc!

---

<div class="post-metadata">

**Author:** ![davidwalton](https://dub1.discourse-cdn.com/monzo/user_avatar/community.monzo.com/davidwalton/32/111540_2.png) [@davidwalton](https://community.monzo.com/u/davidwalton)\
**Post date:** [24 March 2023 17:49 UTC](https://community.monzo.com/t/receipts-in-app/145618/24 "2023-03-24T17:49:18Z")

</div>

Stunning response from AI there. Stunning.

---

<div class="post-metadata">

**Author:** ![Peter\_G](https://dub1.discourse-cdn.com/monzo/user_avatar/community.monzo.com/peter_g/32/89632_2.png) [@Peter\_G](https://community.monzo.com/u/Peter_G)\
**Post date:** [24 March 2023 17:50 UTC](https://community.monzo.com/t/receipts-in-app/145618/25 "2023-03-24T17:50:58Z")

</div>

Imagine if Monzo integrated with ChatGPT and you could directly interrogate your Monzo account? 🤯🤯🤯

We’re not prepared for what’s coming, are we?

---

<div class="post-metadata">

**Author:** ![davidwalton](https://dub1.discourse-cdn.com/monzo/user_avatar/community.monzo.com/davidwalton/32/111540_2.png) [@davidwalton](https://community.monzo.com/u/davidwalton)\
**Post date:** [24 March 2023 17:57 UTC](https://community.monzo.com/t/receipts-in-app/145618/26 "2023-03-24T17:57:23Z")

</div>

It’s that linking of AI to personal services that is both amazing and dangerous. It’ll see off automation platforms too, like IFTTT

Not sure how enthusiastic the banking sector will be about handing over access to AI at this stage. Possible biometrics needed on the device used to instigate an AI link to a service each time?

---

<div class="post-metadata">

**Author:** ![Peter\_G](https://dub1.discourse-cdn.com/monzo/user_avatar/community.monzo.com/peter_g/32/89632_2.png) [@Peter\_G](https://community.monzo.com/u/Peter_G)\
**Post date:** [24 March 2023 18:02 UTC](https://community.monzo.com/t/receipts-in-app/145618/27 "2023-03-24T18:02:50Z")

</div>

> [@davidwalton](#):
>
> Not sure how enthusiastic the banking sector will be about handing over access to AI at this stage. Possible biometrics needed on the device used to instigate an AI link to a service each time?

For a read only service, I don’t see any danger over and above the issues associated with AGI / SGI. Writing to transactions (e.g. editing notes) might need additional authentication. Sending money, not for now, I’d say.

The bigger issue here is what happens to Monzo? If AI leads to a text / voice interface that can dynamically create all the transaction feeds and Trends type graphs you want on the fly, then do you really need the app?

But before we write off Monzo shares before they’ve even IPOed, could its API actually end up being the thing that makes it _the_ bank of the AI age?

---

<div class="post-metadata">

**Author:** ![Sherlock](https://dub1.discourse-cdn.com/monzo/user_avatar/community.monzo.com/sherlock/32/43308_2.png) [@Sherlock](https://community.monzo.com/u/Sherlock)\
**Post date:** [24 March 2023 18:21 UTC](https://community.monzo.com/t/receipts-in-app/145618/28 "2023-03-24T18:21:05Z")

</div>

Hey folks 👋 Creator of Unfurler, and lover of digital receipts here.

> [@dc.robertshaw](#):
>
> Such a shame Unfurler didn’t keep getting support

Honestly it’s so disheartening the sentiment here because I had every intention to keep on maintaining Unfurler. Unfortunately Monzo don’t really have anybody maintaining or pushing forward their developer API - it continues to fail in many places where once it worked.

As it stands right now, I physically cannot add authentication clients to my account. I don’t know whether Monzo has shadow banned me or whether there’s an underlying bug is the system which prevents my account from having them (be it because I have Monzo Business, or Monzo Plus, or some other issue). If I can’t add clients, I can’t add users, which means projects die.

Monzo also added (for regulatory reasons) a lot more overhead to authentication. I updated Unfurler to support it, but there continued to be bugs within Monzo’s apps which prevented the user from being prompted to update their authentication token (this has to happen every 90 days). There’s no way for me to prompt it so gradually users just became unauthenticated with no way for me to tell them (I don’t store email addresses or other contactable identifiers, etc).

> [@dc.robertshaw](#):
>
> Monzo extensions would be amazing, I’m sure the community would come up with some very clever integrations!

This was another one of my projects where we created a system where anybody could register small JavaScript scripts with access to a lightweight data payload. There was a marketplace around it to folks could share their scripts (with full visibility) and many more ideas.

There was also ‘Morezo’ which was intended to be a much more more advanced application (available on desktop and web) to control your Monzo account. It too would have more powerful automations, with bigger visualisations.

All of this could be done… if Monzo invested in their API like they did at the start. I get that it doesn’t make any financial sense for them to put effort into it - but it was that community feeling at the beginning which made me fall in love with Monzo.

* * *

So let me end with a tldr - I would love to continue maintaining Unfurler (I had huge plans for a V3 where folks could contribute), and many other projects built on top of Monzo’s API - but if they can’t or won’t address the fundamental blockers then it leaves me in the difficult position of letting the servers die.

---

<div class="post-metadata">

**Author:** ![j06](https://dub1.discourse-cdn.com/monzo/user_avatar/community.monzo.com/j06/32/97044_2.png) [@j06](https://community.monzo.com/u/j06)\
**Post date:** [24 March 2023 18:24 UTC](https://community.monzo.com/t/receipts-in-app/145618/29 "2023-03-24T18:24:27Z")

</div>

> [@Peter\_G](#):
>
> We’re not prepared for what’s coming, are we?

No. Neither are we prepared for the ethics of AI. Watch it become hugely dangerous, just like Facebook’s limitless ability to feed people disinformation.

Having just read _Stolen Focus_, quite frankly social media (or at least the current model of Surveillance Capitalism under which it currently works) should be outlawed for the good of humanity.

---

<div class="post-metadata">

**Author:** ![dc.robertshaw](https://avatars.discourse-cdn.com/v4/letter/d/6de8d8/32.png) [@dc.robertshaw](https://community.monzo.com/u/dc.robertshaw)\
**Post date:** [24 March 2023 18:55 UTC](https://community.monzo.com/t/receipts-in-app/145618/30 "2023-03-24T18:55:12Z")

</div>

Thanks for jumping in, good to hear where it’s at even though it’s disappointing news. I’ll keep my fingers crossed something changes Monzo’s side and the API becomes worth supporting. Sounds like we’d have had some amazing features from your work by now had they of done 😏

---

<div class="post-metadata">

**Author:** ![SouthseaOne](https://dub1.discourse-cdn.com/monzo/user_avatar/community.monzo.com/southseaone/32/87138_2.png) [@SouthseaOne](https://community.monzo.com/u/SouthseaOne)\
**Post date:** [25 March 2023 02:34 UTC](https://community.monzo.com/t/receipts-in-app/145618/31 "2023-03-25T02:34:01Z")

</div>

> [@Ordog](#):
>
> Only a moderator or the person who created the topic can mark it as a solution. Plus it needs to be in the ‘help’ section 🙂

🪄

---

<div class="post-metadata">

**Author:** ![bee](https://dub1.discourse-cdn.com/monzo/user_avatar/community.monzo.com/bee/32/63591_2.png) [@bee](https://community.monzo.com/u/bee)\
**Post date:** [25 March 2023 09:20 UTC](https://community.monzo.com/t/receipts-in-app/145618/32 "2023-03-25T09:20:40Z")

</div>

When paperless-ngx OCR’s the receipt it should add a date/time (hopefully), you can use that to match up with a monzo transaction 🙂

You could probably get monzo bank statement data (i believe you can export as a CSV), give it to chaptGPT and ask it to summarise your month?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/monzo/original/3X/a/e/aedf2f7852aef6ffcd99f29eac49128cfbd2ecc3.svg) [@system](https://community.monzo.com/u/system)\
**Post date:** [21 September 2023 09:21 UTC](https://community.monzo.com/t/receipts-in-app/145618/33 "2023-09-21T09:21:25Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.

[Previous page](https://community.monzo.com/t/receipts-in-app/145618.md?page=1)
