{"id":18326869,"url":"https://github.com/codatio/sample-project-sync-for-expenses","last_synced_at":"2026-03-10T10:02:55.511Z","repository":{"id":183750767,"uuid":"670618408","full_name":"codatio/sample-project-sync-for-expenses","owner":"codatio","description":"A sample project showing Sync for Expenses in action.","archived":false,"fork":false,"pushed_at":"2023-10-06T12:16:57.000Z","size":196,"stargazers_count":2,"open_issues_count":5,"forks_count":3,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-06T01:32:17.784Z","etag":null,"topics":["codat","expenses","sample","sync"],"latest_commit_sha":null,"homepage":"https://sample-project-sync-for-expenses.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codatio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-25T13:02:47.000Z","updated_at":"2023-08-22T09:18:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"fdabb106-2430-4932-9d4d-663778b0bd87","html_url":"https://github.com/codatio/sample-project-sync-for-expenses","commit_stats":null,"previous_names":["codatio/sample-project-sync-for-expenses"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codatio/sample-project-sync-for-expenses","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codatio%2Fsample-project-sync-for-expenses","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codatio%2Fsample-project-sync-for-expenses/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codatio%2Fsample-project-sync-for-expenses/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codatio%2Fsample-project-sync-for-expenses/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codatio","download_url":"https://codeload.github.com/codatio/sample-project-sync-for-expenses/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codatio%2Fsample-project-sync-for-expenses/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30329697,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T05:25:20.737Z","status":"ssl_error","status_checked_at":"2026-03-10T05:25:17.430Z","response_time":106,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codat","expenses","sample","sync"],"created_at":"2024-11-05T19:08:31.789Z","updated_at":"2026-03-10T10:02:55.457Z","avatar_url":"https://github.com/codatio.png","language":"TypeScript","readme":"# sample-project-sync-for-expenses\n\n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fcodatio%2Fsample-project-sync-for-expenses\u0026env=CODAT_AUTH_HEADER,CODAT_RECEIVE_WEBHOOK_BASE_URL,OPTIONAL_MONGODB_CONNECTION_STRING\u0026envDescription=Your%20Codat%20Auth%20Header,The%20base%20%20url%20this%20project%20is%20deployed%20at,Optionally%20add%20this%20to%20use%20MongoDB\u0026envLink=https%3A%2F%2Fdocs.codat.io%2Freference%2Fauthentication)\n\nNote: *This sample project won't work deployed to Vercel without the `OPTIONAL_MONGODB_CONNECTION_STRING` set. It will fallback to `lowdb`, which only works locally.*\n\n---\n\nSync for Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting platforms through a standardized API.\n\nThis sample project implements setting a company up for expense sync.\n\n## Prerequisites\n\n- [Sign up](https://signup.codat.io/)!\n- Enable Sync for Expenses\n- Configure your [data type settings](https://docs.codat.io/sync-for-expenses/gettingstarted#data-types)\n- Ensure an accounting integration is enabled. You can get started with our [accounting sandbox](https://app.codat.io/settings/integrations/accounting/manage/mqjo?integrationName=Sandbox), though **sandbox syncs will fail.**. \n- You should disable our [banking](https://app.codat.io/settings/integrations/banking/manage/qhnd?integrationName=Banking%20Sandbox) and [commerce](https://app.codat.io/settings/integrations/commerce/manage/aiwb?integrationName=Commerce%20Sandbox) sandbox integrations.\n\n\nFor the full experience, enable a non-Codat sandbox integration (e.g. [QuickBook Online Sandbox](https://docs.codat.io/integrations/accounting/quickbooksonline/accounting-quickbooksonline-new-setup#create-a-quickbooks-online-app-configured-for-sandbox))\n\nFor more information, follow the [Sync for Expenses getting started guide](https://docs.codat.io/sync-for-expenses/gettingstarted).\n\n## Getting started locally\n\n### 1. Create a local env file\n\n- Copy the `.env.example` file into a `.env.local` file\n\n### 2. Set your Codat auth header\n\n- Set the `CODAT_AUTH_HEADER` to your [authorization header](https://docs.codat.io/using-the-api/authentication).\n\n### 3. Optional - Configure MongoDB as your database\n\n- If you would prefer to use a traditional database over LowDB, set the `OPTIONAL_MONGODB_CONNECTION_STRING` to your MongoDB connection string. The connection string will need to include the database name. This is recommended if you are deploying this application.\n\n### 4. Webhooks - Open up a local tunnel\n\nThis demo relies on webhooks that signal when a sync has completed successfully (or failed). To allow Codat's webhooks to hit this demo app, you'll need to open up a local tunnel. We recommend using [localtunnel](https://theboroer.github.io/localtunnel-www/):\n\n- Run `localtunnel`\n\n```\nnpx localtunnel --port 3000\n```\n\n- Extract the URL. It should look like https://some-subdomain.loca.lt\n- Set the `CODAT_RECEIVE_WEBHOOK_BASE_URL` to this URL. The `.env.local` file will need updating with this value.\n\n### 5. Run the development server\n\nInstall dependencies\n\n```bash\nnpm install\n```\n\nthen start the server\n\n```bash\nnpm run dev\n```\n\nOpen [http://localhost:3000](http://localhost:3000) with your browser to see the result.\n\nYou can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.\n\n## Implementation details\n\n- We've taken care of creating new webhook rules for each company you add - instead of this, you can just create the rules once, listening for all companies.\n- We've used [Embedded Link](https://docs.codat.io/auth-flow/authorize-embedded-link) for the authorization of access to the data.\n- This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.\n- We've implemented two approaches to storage:\n  - For local development, `lowdb` with act as a lightweight database.\n  - For deployment, we've implemented [MongoDB Atlas](https://www.mongodb.com/atlas/database). Set `OPTIONAL_MONGODB_CONNECTION_STRING` and the code will use this functionality.\n\n## Deploying the project\n\n### Deploy on Vercel\n\nThe easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template\u0026filter=next.js\u0026utm_source=create-next-app\u0026utm_campaign=create-next-app-readme) from the creators of Next.js.\n\nCheck out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.\n\n### Webhooks\n\nUnlike locally you don't need to setup anything extra to handle the webhooks. Just make sure you've set the environment variable `CODAT_RECEIVE_WEBHOOK_BASE_URL` correctly (excluding the `/api/webhooks` path).\n\nE.g. `https://sample-project-sync-for-expenses.vercel.app`\n\n## Learn More\n\nTo learn more about Next.js, take a look at the following resources:\n\n- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.\n- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.\n\nYou can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!\n\n## Pitfalls\n\n- If you're using a free trial, you may hit the [free plan limitations](https://docs.codat.io/configure/plans/free#free-plan-limitations). You won't be able to create more than 5 Sync for Expenses companies.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodatio%2Fsample-project-sync-for-expenses","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodatio%2Fsample-project-sync-for-expenses","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodatio%2Fsample-project-sync-for-expenses/lists"}