{"id":26099281,"url":"https://github.com/rodgeraraujo/juno-api","last_synced_at":"2025-10-06T06:10:44.214Z","repository":{"id":38258793,"uuid":"260959611","full_name":"rodgeraraujo/juno-api","owner":"rodgeraraujo","description":"📦 Plain lib that permits bindings for the Juno API.","archived":false,"fork":false,"pushed_at":"2023-01-07T05:22:03.000Z","size":885,"stargazers_count":6,"open_issues_count":15,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T08:22:37.343Z","etag":null,"topics":["api","api-client","client","javascript","juno-api","ndoejs","node-module"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/rodgeraraujo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-03T15:27:41.000Z","updated_at":"2025-03-09T13:11:36.000Z","dependencies_parsed_at":"2023-02-06T12:46:03.567Z","dependency_job_id":null,"html_url":"https://github.com/rodgeraraujo/juno-api","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodgeraraujo%2Fjuno-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodgeraraujo%2Fjuno-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodgeraraujo%2Fjuno-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodgeraraujo%2Fjuno-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rodgeraraujo","download_url":"https://codeload.github.com/rodgeraraujo/juno-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248148239,"owners_count":21055547,"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":["api","api-client","client","javascript","juno-api","ndoejs","node-module"],"created_at":"2025-03-09T16:35:45.862Z","updated_at":"2025-10-06T06:10:39.163Z","avatar_url":"https://github.com/rodgeraraujo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Juno API Node.js\n\n[![npm version](https://img.shields.io/npm/v/juno-api?logo=npm\u0026style=flat-square)](https://badge.fury.io/js/juno-api) [![npm downloads](https://img.shields.io/npm/dm/juno-api?logo=npm\u0026style=flat-square)](https://www.npmjs.com/package/juno-api) [![Node.js CI](https://img.shields.io/github/workflow/status/rodgeraraujo/juno-api/CI?logo=github\u0026style=flat-square)](https://github.com/rodgeraraujo/juno-api/actions) [![codecov.io](https://img.shields.io/codecov/c/github/rodgeraraujo/juno-api?style=flat-square\u0026branch=master\u0026logo=codecov)](https://codecov.io/github/rodgeraraujo/juno-api?branch=master) [![Contributors](https://img.shields.io/github/contributors/rodgeraraujo/juno-api.svg?logo=\u0026style=flat-square)](https://github.com/rodgeraraujo/juno-api/graphs/contributors) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)\n\n\u003e Bindings for [Juno](https://juno.com.br/) payments API.\n\n## Installation:\n\n```shell\n$ npm install --save juno-api\n```\n\n## API\n\nCreates a new `Juno` instance.\n\nExports a constructor function which takes an `options` object, to creates a `Juno` instance.\n\n### Arguments\n\noptions - Required - A plain JavaScript object containing configuration options.\n\n#### Options\n\n-   `isProd` - Optional - A boolean that specifies the api environment, default value is `true` (for use in sandbox set as `false`).\n-   `accessToken` - Required for make requests - A string representing the permanent OAuth 2.0 access token. This option is mutually exclusive with the `resourceToken`.\n-   `resourceToken` - Required for make requests - A string that represents the permanent identifier of a digital account, which can be used when performing an operation. This option is mutually exclusive with the `accessToken`.\n-   `clientId` - Required for get access token - The client id, public identifier for apps at Juno API. This option is mutually exclusive with the `clientSecret`.\n-   `clientSecret` - Required for get access token - The client secret, a secret known only to the application and the authorization server. This option is mutually exclusive with the `clientId`.\n\n### Return\n\nA Shopify instance.\n\n### Exceptions\n\nThrows an `Error` exception if the required options are missing.\n\n#### Example usage\n\nThis simples example, returns a object of a access token, to make requests to the Juno API.\n\n```js\nconst Juno = require('juno-api');\n\nconst juno = new Juno({\n  clientId: 'your-client-id',\n  clientSecret: 'your-client-secret',\n});\n\nconst token = await juno.authorization.accessToken();\n\nconsole.log(token);\n\n// console log message\n{\n  \"access_token\": \"string-representing-access-token\",\n  \"token_type\": \"token-type\",\n  \"expires_in\": 0,\n  \"scope\": \"your-scopes\",\n  \"user_name\": \"you-email\",\n  \"jti\": \"jti-code\"\n}\n\nconst juno = new Juno({\n  accessToken: token.access_token, // referring to the previous example\n  resourceToken: 'your-resource-token',\n});\n\nconst banks = await juno.banks.list(); // retrieves a list of banks\n```\n\n## Resources\n\nEvery resource is accessed through the juno instance:\n\n```js\nconst juno = new Juno({\n    accessToken: 'your-access-token',\n    resourceToken: 'your-resource-token',\n});\n\n// juno.\u003cresource\u003e.\u003cmethod\u003e\n```\n\nEach method returns a Promise that resolves with the result:\n\n```js\njuno.businessArea\n    .get()\n    .then((res) =\u003e console.log(res))\n    .catch((err) =\u003e console.error(err));\n```\n\n## Available resources and and methods\n\n-   authorization\n    -   `getAccessToken()`\n-   balance\n    -   `get()`\n-   bank\n    -   `list()`\n-   businessArea\n    -   `list()`\n-   companyTypes\n    -   `list()`\n-   charge\n    -   `create(params)`\n-   digitalAccount\n    -   `create(params)`\n    -   `get(params)`\n-   payment\n    -   `create(params)`\n    -   `refund(id, params)`\n    -   `capture(id, params)`\n-   creditCard\n    -   `create(params)`\n-   credential\n    -   `get()`\n-   webhook\n    -   `create(params)`\n    -   `delete(id)`\n    -   `list(params)`\n    -   `update(id, params)`\n\n\u003e Obs: `params` is a plain JavaScript object, see Juno docs for params details.\n\n## License\n\n[MIT](https://github.com/rodgeraraujo/juno-api/blob/master/LICENSE)\n\n## Author\n\n[Rogério Araújo](https://github.com/rodgeraraujo)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodgeraraujo%2Fjuno-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frodgeraraujo%2Fjuno-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodgeraraujo%2Fjuno-api/lists"}