{"id":21332552,"url":"https://github.com/notrab/printful-request","last_synced_at":"2025-07-12T10:31:36.592Z","repository":{"id":42535181,"uuid":"328992950","full_name":"notrab/printful-request","owner":"notrab","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-01T04:59:07.000Z","size":373,"stargazers_count":21,"open_issues_count":2,"forks_count":5,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-11-01T05:26:26.266Z","etag":null,"topics":[],"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/notrab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"github":"notrab"}},"created_at":"2021-01-12T13:19:22.000Z","updated_at":"2024-11-01T04:59:10.000Z","dependencies_parsed_at":"2023-12-01T04:29:10.626Z","dependency_job_id":"7834494b-cbcf-4160-b9b1-e9603ebf0db3","html_url":"https://github.com/notrab/printful-request","commit_stats":{"total_commits":13,"total_committers":2,"mean_commits":6.5,"dds":0.07692307692307687,"last_synced_commit":"ab88601204fad16eeaf0c5e16919aa7789c733be"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notrab%2Fprintful-request","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notrab%2Fprintful-request/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notrab%2Fprintful-request/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notrab%2Fprintful-request/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/notrab","download_url":"https://codeload.github.com/notrab/printful-request/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225814861,"owners_count":17528295,"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_at":"2024-11-21T22:52:19.063Z","updated_at":"2024-11-21T22:52:19.474Z","avatar_url":"https://github.com/notrab.png","language":"TypeScript","funding_links":["https://github.com/sponsors/notrab"],"categories":[],"sub_categories":[],"readme":"# printful-request\n\nSimple Node.js request wrapper for Printful, with authorization management. **Not to be used client-side**.\n\n**VERSION 2.0 USERS:** You will want to use Printful API Tokens, and **NOT** API KEYS. [Read migration guide](https://help.printful.com/hc/en-us/articles/4632388335260-What-should-I-know-about-API-key-to-API-token-migration).\n\n## Quickstart\n\n```js\nconst { PrintfulClient, request } = require(\"printful-request\");\n\nconst printful = new PrintfulClient(\"PRINTFUL_API_TOKEN\");\n\nprintful.get(\"orders\").then(({ result }) =\u003e console.log(result));\n\n// Or with a simple request\n\nrequest(\"orders\", {\n  token: \"PRINTFUL_API_TOKEN\",\n  params: { limit: 1 },\n}).then(({ result }) =\u003e console.log(result));\n```\n\n## Examples\n\nRefer to the [Printful API Documentation](https://www.printful.com/docs) for possible URLs. This library acts as a small layer for parsing JSON, and passing API keys as authorization headers.\n\n### `GET`\n\n```js\nconst { PrintfulClient, request } = require(\"printful-request\");\n\nconst printful = new PrintfulClient(\"PRINTFUL_API_TOKEN\");\n\nprintful.get(\"orders\").then(({ result }) =\u003e console.log(result));\n\n// or using request\n\nrequest(\"orders\", { token: \"PRINTFUL_API_TOKEN\" }).then(({ result }) =\u003e\n  console.log(result)\n);\n```\n\n### `GET` with params\n\n```js\nconst { PrintfulClient, request } = require(\"printful-request\");\n\nconst printful = new PrintfulClient(\"PRINTFUL_API_TOKEN\");\n\nprintful\n  .get(\"orders\", { limit: 5, offset: 10 })\n  .then(({ result }) =\u003e console.log(result));\n\n// or using request\n\nrequest(\"orders\", {\n  token: \"PRINTFUL_API_TOKEN\",\n  params: { limit: 5, offset: 10 },\n}).then(({ result }) =\u003e console.log(result));\n```\n\n### `POST`\n\n```js\nconst { PrintfulClient, request } = require(\"printful-request\");\n\nconst printful = new PrintfulClient(\"PRINTFUL_API_TOKEN\");\n\nprintful\n  .get(\"orders/estimate-costs\", {\n    recipient: { name: \"...\" },\n    items: [{ id: \"...\" }],\n  })\n  .then(({ result }) =\u003e console.log(result));\n\n// or using request\n\nrequest(\"orders/estimate-costs\", {\n  token: \"PRINTFUL_API_TOKEN\",\n  params: { recipient: { name: \"...\" }, items: [{ id: \"...\" }] },\n}).then(({ result }) =\u003e console.log(result));\n```\n\n### `PUT`\n\n```js\nconst { PrintfulClient, request } = require(\"printful-request\");\n\nconst printful = new PrintfulClient(\"PRINTFUL_API_TOKEN\");\n\nprintful\n  .get(\"orders/{id}\", {\n    id: \"...\",\n    confirm: true,\n  })\n  .then(({ result }) =\u003e console.log(result));\n\n// or using request\n\nrequest(\"orders/{id}\", {\n  token: \"PRINTFUL_API_TOKEN\",\n  params: { id: \"...\", confirm: true },\n}).then(({ result }) =\u003e console.log(result));\n```\n\n### `DELETE`\n\n```js\nconst { PrintfulClient, request } = require(\"printful-request\");\n\nconst printful = new PrintfulClient(\"PRINTFUL_API_TOKEN\");\n\nprintful.delete(\"orders/{id}\").then(({ result }) =\u003e console.log(result));\n\n// or using request\n\nrequest(\"orders/{id}\", {\n  token: \"PRINTFUL_API_TOKEN\",\n  method: \"DELETE\",\n}).then(({ result }) =\u003e console.log(result));\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotrab%2Fprintful-request","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnotrab%2Fprintful-request","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotrab%2Fprintful-request/lists"}