{"id":28102208,"url":"https://github.com/woosignal/wp-json-api-flutter","last_synced_at":"2025-06-22T14:09:49.245Z","repository":{"id":43904514,"uuid":"254355873","full_name":"woosignal/wp-json-api-flutter","owner":"woosignal","description":"WordPress and WooCommerce JSON API for Flutter Mobile. Register Users, Login (with email or username), Get Users Info, Update Users Info, Update Users Password + more.","archived":false,"fork":false,"pushed_at":"2025-05-23T05:30:50.000Z","size":418,"stargazers_count":30,"open_issues_count":0,"forks_count":10,"subscribers_count":2,"default_branch":"4.x","last_synced_at":"2025-05-23T06:50:06.292Z","etag":null,"topics":["dart","flutter","json","json-api","woocommerce","woocommerce-api","woocommerce-flutter","wordpress","wordpress-api","wordpress-flutter"],"latest_commit_sha":null,"homepage":"https://woosignal.com","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/woosignal.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-04-09T11:44:07.000Z","updated_at":"2025-05-23T05:30:52.000Z","dependencies_parsed_at":"2023-01-31T06:46:10.536Z","dependency_job_id":"8f91a30c-1a2f-441a-b2f6-65c9e395cd39","html_url":"https://github.com/woosignal/wp-json-api-flutter","commit_stats":{"total_commits":33,"total_committers":4,"mean_commits":8.25,"dds":"0.48484848484848486","last_synced_commit":"eb9e0da8b8bc81a142483920dcdf00c96e123fc6"},"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"purl":"pkg:github/woosignal/wp-json-api-flutter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woosignal%2Fwp-json-api-flutter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woosignal%2Fwp-json-api-flutter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woosignal%2Fwp-json-api-flutter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woosignal%2Fwp-json-api-flutter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/woosignal","download_url":"https://codeload.github.com/woosignal/wp-json-api-flutter/tar.gz/refs/heads/4.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woosignal%2Fwp-json-api-flutter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261304266,"owners_count":23138301,"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":["dart","flutter","json","json-api","woocommerce","woocommerce-api","woocommerce-flutter","wordpress","wordpress-api","wordpress-flutter"],"created_at":"2025-05-13T19:33:47.377Z","updated_at":"2025-06-22T14:09:44.221Z","avatar_url":"https://github.com/woosignal.png","language":"Dart","readme":"# WordPress and WooCommerce JSON API Dart package for Flutter\n\nYou can download the WordPress plugin here [WP JSON API](https://woosignal.gumroad.com/l/wp-json-api).\n\nInstall the WordPress plugin to use this Flutter package.\n\n## API features:\n\n**WordPress**\n\n* Register/Sign Up API for Users\n* Login (with email or username)\n* Get Users Info\n* Update Users Info\n* Update Users Password\n* Add role to a user\n* Remove role from a user\n* Delete a user\n\n**WooCommerce**\n\n* Get Customers Info (Billing and Shipping)\n* Update Customers details\n\nTo use this API you must have the [WP JSON API Plugin](https://woosignal.com/plugins/wordpress/wp-json-api) installed first on your WordPress site, you can download it via the WooSignal website.\n\n### Getting Started #\nIn your flutter project add the dependency:\n\n``` dart \ndependencies:\n  ...\n  wp_json_api: ^4.3.2\n```\n\n### Usage example #\nImport wp_json_api.dart\n``` dart\nimport 'package:wp_json_api/wp_json_api.dart';\n```\n\n### Example using Wp JSON API\n\n``` dart\nimport 'package:wp_json_api/wp_json_api.dart';\n...\n\nvoid main() {\n\nWPJsonAPI.instance.init(baseUrl: \"https://mysite.com\");\n\n...\n```\n\n\n### Call a method from the request callback\n``` dart\ntry {\nWPUserLoginResponse wpUserLoginResponse = await WPJsonAPI.instance\n          .api((request) =\u003e request.wpLogin(\n            email: email,\n            password: password\n          ));\n} on Exception catch (e) {\n    print(e);\n}\n```\n\n### Available API Requests\n\n#### WordPress - Get Nonce\n- Used for returning a valid nonce\n``` dart\nWPNonceResponse wpNonceResponse = await WPJsonAPI.instance\n          .api((request) =\u003e request.wpNonce());\n```\n\n#### WordPress - Verify Nonce\n- Used for verifying register and login request\n``` dart\nWPNonceVerifiedResponse wpNonceVerifiedResponse = await WPJsonAPI.instance\n          .api((request) =\u003e request.wpNonceVerify(\n            nonce: nonce\n          ));\n```\n\n#### WordPress - Login with email\n- Used to login a user\n\n``` dart\nWPUserLoginResponse wpUserLoginResponse = await WPJsonAPI.instance\n      .api((request) =\u003e request.wpLogin(\n          email: email,\n          password: password,\n          authType: WPAuthType.WpEmail\n      ));\n```\n\n#### WordPress - Login with username\n- Used to login a user\n\n``` dart\nWPUserLoginResponse wpUserLoginResponse = await WPJsonAPI.instance\n      .api((request) =\u003e request.wpLogin(\n          username: username,\n          password: password,\n          authType: WPAuthType.WpUsername\n      ));\n```\n\n#### WordPress - Register\n- Used to register a user\n- The username parameter is required, ensure that this is unique\n\n``` dart\nWPUserRegisterResponse wpUserRegisterResponse = await WPJsonAPI.instance\n      .api((request) =\u003e request.wpRegister(\n          email: email,\n          password: password,\n          // username: username // optional - the library will automatically generate a username if not provided\n      ));\n```\n\n#### WordPress - Get Users Info\n- Used to get a WordPress users info\n- After you login/register, you can all this method to get the users info\n\n``` dart\nWPUserInfoResponse wpUserInfoResponse = await WPJsonAPI.instance\n        .api((request) =\u003e request.wpGetUserInfo());\n```\n\n#### WordPress - Update Users Info\n- Used to update a WordPress users info\n- After you login/register, you can all this method to update the users info\n\n``` dart\nWPUserInfoUpdatedResponse wpUserInfoUpdatedResponse = await WPJsonAPI.instance\n        .api((request) =\u003e request.wpUpdateUserInfo(\n          firstName: firstName,\n          lastName: lastName,\n          displayName: displayName\n      ));\n```\n\n#### WordPress - Update users password\n- Used to update a users password\n- After you login/register, you can all this method to update the users password\n\n``` dart\nWPUserResetPasswordResponse wpUserResetPasswordResponse = await WPJsonAPI.instance\n        .api((request) =\u003e request.wpResetPassword(\n            password: password\n        ));\n```\n\n#### WordPress - Add a role to a user\n- Used to add a role to a user in WordPress\n- After you login/register, you can all this method to add a role to the user\n\n``` dart\nWPUserAddRoleResponse wpUserAddRoleResponse = await WPJsonAPI.instance\n        .api((request) =\u003e request.wpUserAddRole(\n            role: \"customer\" // e.g. customer, subscriber\n        ));\n```\n\n#### WordPress - Remove a role from a user\n- Used to remove a role from a user in WordPress\n- After you login/register, you can all this method to remove a role from the user\n\n``` dart\nWPUserRemoveRoleResponse wpUserRemoveRoleResponse = await WPJsonAPI.instance\n        .api((request) =\u003e request.wpUserRemoveRole(\n            role: \"customer\" // e.g. customer, subscriber\n        ));\n```\n\n#### WordPress - Delete a user\n- Used to delete a user in WordPress\n- After you login/register, you can all this method to delete the user\n- You can pass an optional argument 'reassign' to reassign posts and links to new User ID.\n\n``` dart\nWPUserDeleteResponse wpUserDeleteResponse = await WPJsonAPI.instance\n        .api((request) =\u003e request.wpUserDelete());\n```\n\n#### WooCommerce - Register\n- Used to register a user\n\n``` dart\nWPUserRegisterResponse wpUserRegisterResponse = await WPJsonAPI.instance\n      .api((request) =\u003e request.wpRegister(\n          email: email,\n          password: password\n      ));\n```\n\n#### WooCommerce - Get users info in WooCommerce\n- Used to get WooCommerce info for a given user\n- After you login/register, you can all this method to get the users WooCommerce info\n\n``` dart\nWCCustomerInfoResponse wcCustomerInfoResponse = await WPJsonAPI.instance\n          .api((request) =\u003e request.wcCustomerInfo(\n          userToken\n      ));\n```\n\n#### WooCommerce - Update users info in WooCommerce\n- Used to update a users WooCommerce details\n- All the parameter are optional so if you wanted to just update the name, you could just add first_name and last_name\n- After you login/register, you can all this method to update the users WooCommerce info\n\n``` dart\nWCCustomerUpdatedResponse wcCustomerUpdatedResponse = await WPJsonAPI.instance\n        .api((request) =\u003e request.wcUpdateCustomerInfo(\n            firstName: firstName,\n            lastName: lastName,\n            displayName: displayName,\n            billingFirstName: billingFirstName,\n            billingLastName: billingLastName,\n            billingCompany: billingCompany,\n            billingAddress1: billingAddress1,\n            billingAddress2: billingAddress2,\n            billingCity: billingCity,\n            billingState: billingState,\n            billingPostcode: billingPostcode,\n            billingCountry: billingCountry,\n            billingEmail: billingEmail,\n            billingPhone: billingPhone,\n            shippingFirstName: shippingFirstName,\n            shippingLastName: shippingLastName,\n            shippingCompany: shippingCompany,\n            shippingAddress1: shippingAddress1,\n            shippingAddress2: shippingAddress2,\n            shippingCity: shippingCity,\n            shippingState: shippingState,\n            shippingPostcode: shippingPostcode,\n            shippingCountry: shippingCountry,\n            shippingEmail: shippingEmail,\n            shippingPhone: shippingPhone\n        ));\n```\n\n#### WooCommerce Points and Rewards - Get user's points \n- This is used to get the user's current points in the [WooCommerce Points and Rewards](https://woo.com/products/woocommerce-points-and-rewards/) plugin\n- After you login/register, you can all this method to get the users points\n\n``` dart\nWcPointsAndRewardUser wcPointsAndRewardUser = await WPJsonAPI.instance\n          .api((request) =\u003e request.wcPointsAndRewardsUser());\n```\n\n#### WooCommerce Points and Rewards - Calculate the value of points\n- This is used to calculate the value of points in the [WooCommerce Points and Rewards](https://woo.com/products/woocommerce-points-and-rewards/) plugin\n- After you login/register, you can all this method to calculate the value of points\n\n``` dart\nWcPointsAndRewardCalculatePoints wcPointsAndRewardsCalculatePoints = await WPJsonAPI.instance\n          .api((request) =\u003e request.wcPointsAndRewardsCalculatePoints(\n          points: 100\n      ));\n```\n\nFor help getting started with WooSignal, view our\n[online documentation](https://woosignal.com/docs/flutter/wp-json-api), which offers a more detailed guide.\n\n## Usage\nTo use this plugin, add `wp_json_api` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/).\n\n## Note\nInstall our WordPress plugin \"[WP JSON API](https://woosignal.com/plugins/wordpress/wp-json-api)\" v3.4.0 to use this flutter plugin.\n\nDisclaimer: This plugin is not affiliated with or supported by Automattic, Inc. All logos and trademarks are the property of their respective owners.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoosignal%2Fwp-json-api-flutter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwoosignal%2Fwp-json-api-flutter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoosignal%2Fwp-json-api-flutter/lists"}