{"id":18320230,"url":"https://github.com/gedex/wc-api-erlang","last_synced_at":"2025-04-09T14:24:08.450Z","repository":{"id":136685777,"uuid":"42450803","full_name":"gedex/wc-api-erlang","owner":"gedex","description":"Erlang client for WooCommerce REST API","archived":false,"fork":false,"pushed_at":"2015-09-14T14:03:56.000Z","size":316,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-15T08:24:31.355Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Erlang","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/gedex.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}},"created_at":"2015-09-14T13:37:27.000Z","updated_at":"2015-09-14T14:03:57.000Z","dependencies_parsed_at":"2023-03-13T07:45:40.532Z","dependency_job_id":null,"html_url":"https://github.com/gedex/wc-api-erlang","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gedex%2Fwc-api-erlang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gedex%2Fwc-api-erlang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gedex%2Fwc-api-erlang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gedex%2Fwc-api-erlang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gedex","download_url":"https://codeload.github.com/gedex/wc-api-erlang/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248054367,"owners_count":21039988,"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-05T18:15:36.133Z","updated_at":"2025-04-09T14:24:08.416Z","avatar_url":"https://github.com/gedex.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"WooCommerce REST API - Erlang Client\n====================================\n\nErlang client for WooCommerce REST API.\n\n_Under heavy development. Not ready yet._\n\n## Quick Start\n\n```\ngit clone git://github.com/gedex/wc-api-erlang\ncd wc-api-erlang\nmake\n```\n\nFirst, start up an Erlang shell with the path to `wc-api-erlang` and all\ndependencies included, the start sasl and ibrowse:\n\n```\nerl -pa path/to/wc-api-erlang/ebin path/to/wc-api-erlang/deps/*/ebin\nEshell V6.2  (abort with ^G)\n1\u003e [ ok = application:start(A) || A \u003c- [sasl, ibrowse]  ].\n```\n\nNext, create your client:\n\n```\n2\u003e Url = \"https://local.wordpress.dev\",\n2\u003e CK = \"ck_4c55fd532db0743d9b7a5e2ad3231d2b6d1e32a0\",\n2\u003e CS = \"cs_e11d1944891290318d21dd5320d34248bd91c223\",\n2\u003e C = wc_api:create_client(Url, CK, CS).\n{client,\"https://local.wordpress.dev\",\n        \"ck_4c55fd532db0743d9b7a5e2ad3231d2b6d1e32a0\",\n        \"cs_e11d1944891290318d21dd5320d34248bd91c223\",\n        [{is_ssl,true},{version,\"v3\"}]}\n```\n\nPass the client to `wc_api:get/2`, `wc_api:get/3`, `wc_api:post/3`, `wc_api:put/3`, `wc_api:delete/2`, or `wc_api:delete/3` as first argument. Here's an example:\n\n```\n%% Get list of coupons.\n3\u003e {ok, Coupons} = get(C, \"coupons\").\n{ok,[{coupon,140,\"coupon-from-erlang-a\",\"fixed_cart\",\n             \"2015-09-14T03:05:14Z\",\"2015-09-14T03:05:14Z\",\"0.00\",false,\n             [],[],undefined,undefined,0,0,undefined,false,[],[],false,\n             \"0.00\",\"0.00\",[],[]},\n     {coupon,138,\"test\",\"fixed_cart\",\"2015-09-14T03:05:14Z\",\n             \"2015-09-14T03:05:14Z\",\"0.00\",false,[],[],undefined,\n             undefined,0,0,undefined,false,[],[],false,\"0.00\",\"0.00\",[],\n             []},\n     {coupon,126,\"test-new-coupn\",\"fixed_cart\",\n             \"2015-09-09T12:45:02Z\",\"2015-09-09T12:45:02Z\",\"0.00\",false,\n             [],[],undefined,undefined,0,0,undefined,false,[],[],false,\n             \"0.00\",\"0.00\",[],[]},\n     {coupon,105,\"test coupon #4\",\"fixed_cart\",\n             \"2015-09-07T19:06:21Z\",\"2015-09-07T19:06:55Z\",\"100.00\",\n             false,[],[],undefined,undefined,0,1,undefined,false,[],[],\n             false,\"0.00\",\"0.00\",[],[]},\n     {coupon,103,\"test coupon #2\",\"percent\",\n             \"2015-09-07T19:02:47Z\",\"2015-09-07T19:03:08Z\",\"25.00\",false,\n             [],[],undefined,undefined,0,3,\"2015-10-31T00:00:00Z\",false,\n             [],[],false,\"0.00\",\"0.00\",[],...},\n     {coupon,102,\"test coupon #1\",\"fixed_cart\",\n             \"2015-09-07T19:02:28Z\",\"2015-09-07T19:02:28Z\",\"100000.00\",\n             false,[],[],undefined,undefined,0,0,\"2015-10-31T00:00:00Z\",\n             false,[],[],false,\"0.00\",\n             [...],...}]}\n```\n\n## Examples\n\n```\n% Include records.\nrr(wc_api).\n\n% Coupons\nget(C, \"coupons\").\nget(C, \"coupons/1\").\nget(C, \"coupons/code/coupon-code\").\nNewCoupon = #coupon{code=\"test-new-coupon\"}.\npost(C, \"coupons\", NewCoupon).\nEditCoupon = NewCoupon#coupon{type=\"percent\", amount=75}.\nput(C, \"coupons/2\", EditCoupon).\ndelete(C, \"coupons/2\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgedex%2Fwc-api-erlang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgedex%2Fwc-api-erlang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgedex%2Fwc-api-erlang/lists"}