{"id":20290611,"url":"https://github.com/gocardless/gocardless-nodejs","last_synced_at":"2025-04-04T23:07:32.297Z","repository":{"id":40544061,"uuid":"237978267","full_name":"gocardless/gocardless-nodejs","owner":"gocardless","description":"GoCardless Node.js client","archived":false,"fork":false,"pushed_at":"2025-04-04T13:56:18.000Z","size":1369,"stargazers_count":29,"open_issues_count":31,"forks_count":20,"subscribers_count":53,"default_branch":"master","last_synced_at":"2025-04-04T14:34:49.494Z","etag":null,"topics":["created-using-appetiser"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gocardless.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2020-02-03T14:00:07.000Z","updated_at":"2025-04-04T13:49:05.000Z","dependencies_parsed_at":"2023-09-26T12:35:58.955Z","dependency_job_id":"c54df5af-02a8-4c40-a793-6b596eb6abc5","html_url":"https://github.com/gocardless/gocardless-nodejs","commit_stats":{"total_commits":90,"total_committers":7,"mean_commits":"12.857142857142858","dds":0.09999999999999998,"last_synced_commit":"c624ae1940430a96e8d52ad66397186d0b116378"},"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocardless%2Fgocardless-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocardless%2Fgocardless-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocardless%2Fgocardless-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocardless%2Fgocardless-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gocardless","download_url":"https://codeload.github.com/gocardless/gocardless-nodejs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247261603,"owners_count":20910108,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["created-using-appetiser"],"created_at":"2024-11-14T15:08:28.780Z","updated_at":"2025-04-04T23:07:32.269Z","avatar_url":"https://github.com/gocardless.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node.js client for the GoCardless API\n\n[![GoCardless](https://circleci.com/gh/gocardless/gocardless-nodejs.svg?style=svg)](https://github.com/gocardless/gocardless-nodejs/commits/master) [![npm version](https://badge.fury.io/js/gocardless-nodejs.svg)](https://badge.fury.io/js/gocardless-nodejs)\n\nA Node.js client for the GoCardless API. For full details of the GoCardless API, see the [API docs](https://developer.gocardless.com/).\n\n## Installation\n\n```bash\n$ npm i gocardless-nodejs\n```\n\n## Usage\n\n### Initialising the client\n\nTo initialise the client, you must provide:\n\n- An [access token](https://developer.gocardless.com/getting-started/api/making-your-first-request/#creating-an-access-token).\n- The environment that this token is for (see [here](https://github.com/gocardless/gocardless-nodejs/blob/master/src/constants.ts) for a list of available environments).\n- Any additional options (see [here](#available-client-options) for a list of supported options).\n\n\u003c!-- prettier-ignore --\u003e\n```js\nconst gocardless = require('gocardless-nodejs');\nconst constants = require('gocardless-nodejs/constants');\n\n\n// Initialise the client.\nconst client = gocardless(\n  process.env.GC_ACCESS_TOKEN,\n  constants.Environments.Sandbox,\n  { raiseOnIdempotencyConflict: true },\n);\n```\n\n### The Basics\n\nWe'll illustrate the basic library usage by demonstrating on the [payment resource](https://developer.gocardless.com/api-reference/#core-endpoints-payments).\n\nFor a full list of available resources, visit the [GoCardless API reference](https://developer.gocardless.com/api-reference/#core-endpoints).\n\n\u003c!-- prettier-ignore --\u003e\n```js\nconst uuidv4 = require('uuid/v4');\n\n// Create a new payment.\nconst payment = await client.payments.create(\n  {\n    amount: 100,\n    currency: \"GBP\",\n    links: { mandate: \"MD123\" },\n  },\n  { uuidv4() },\n);\n\n// List the first three payments past a certain date.\nconst payments = await client.payments.list({\n  limit: 3,\n  created_at: {\n    gt: '2020-01-01T17:01:06.000Z',\n  },\n});\n\n// Get a payment.\nconst payment = await client.payments.find('PM123');\n\n// Update a payment.\nawait client.payments.update('PM123', { amount: '22' });\n\n// Cancel a payment.\nawait client.payments.cancel('PM123');\n```\n\n### The `all` method\n\nAll resources with a `list` method will also have an additional `*all` method. This method acts like the regular `list` method and accepts the same parameters, but instead returns an async generator.\n\n\u003c!-- prettier-ignore --\u003e\n```js\nfor await (const payment of client.payments.all()) {\n  console.log(payment.id);\n}\n```\n\n### Available client options\n\n- `raiseOnIdempotencyConflict`: set to `true` to raise exceptions on [idempotency](https://developer.gocardless.com/api-reference/#making-requests-idempotency-keys) conflicts. Defaults to `false`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgocardless%2Fgocardless-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgocardless%2Fgocardless-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgocardless%2Fgocardless-nodejs/lists"}