{"id":37161654,"url":"https://github.com/trendhim/commercetools-go-sdk-legacy","last_synced_at":"2026-01-14T19:14:31.283Z","repository":{"id":48652372,"uuid":"382589198","full_name":"trendhim/commercetools-go-sdk-legacy","owner":"trendhim","description":"Go SDK for commercetools","archived":false,"fork":true,"pushed_at":"2024-02-09T22:34:49.000Z","size":757,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"v0","last_synced_at":"2024-06-21T15:30:56.269Z","etag":null,"topics":["client","sdk"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"labd/commercetools-go-sdk","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trendhim.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":"2021-07-03T10:38:42.000Z","updated_at":"2024-02-09T22:16:18.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/trendhim/commercetools-go-sdk-legacy","commit_stats":null,"previous_names":["trendhim/commercetools-go-sdk-legacy"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/trendhim/commercetools-go-sdk-legacy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trendhim%2Fcommercetools-go-sdk-legacy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trendhim%2Fcommercetools-go-sdk-legacy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trendhim%2Fcommercetools-go-sdk-legacy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trendhim%2Fcommercetools-go-sdk-legacy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trendhim","download_url":"https://codeload.github.com/trendhim/commercetools-go-sdk-legacy/tar.gz/refs/heads/v0","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trendhim%2Fcommercetools-go-sdk-legacy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28431878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["client","sdk"],"created_at":"2026-01-14T19:14:30.311Z","updated_at":"2026-01-14T19:14:31.275Z","avatar_url":"https://github.com/trendhim.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Legacy SDK with Trendhim specific changes\nIt's not maintained, and only here to simplify our own migration towards the latest labd release.\n\n# commercetools-go-sdk\n\n[![Build Status](https://github.com/labd/commercetools-go-sdk/workflows/Go%20Tests/badge.svg)](https://github.com/labd/commercetools-go-sdk/workflows/)\n[![codecov](https://codecov.io/gh/LabD/commercetools-go-sdk/branch/master/graph/badge.svg)](https://codecov.io/gh/LabD/commercetools-go-sdk)\n[![Go Report Card](https://goreportcard.com/badge/github.com/labd/commercetools-go-sdk)](https://goreportcard.com/report/github.com/labd/commercetools-go-sdk)\n[![GoDoc](https://godoc.org/github.com/labd/commercetools-go-sdk?status.svg)](https://godoc.org/github.com/labd/commercetools-go-sdk)\n\nThe Commercetools Go SDK is automatically generated based on the official [API specifications](https://github.com/commercetools/commercetools-api-reference) \nof Commercetools. It should therefore be nearly feature complete.\n\nThe SDK was initially created for enabling the creation of the\n[Terraform Provider for Commercetools](https://github.com/labd/terraform-provider-commercetools) \nThat provider enables you to use infrastructure-as-code principles with Commercetools.\n\n\n## Using the SDK\n\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"log\"\n    \"math/rand\"\n    \"time\"\n    \n    \"github.com/labd/commercetools-go-sdk/commercetools\"\n)\n\nfunc main() {\n\n    // Create the new client. When an empty value is passed it will use the CTP_*\n    // environment variables to get the value. The HTTPClient arg is optional,\n    // and when empty will automatically be created using the env values.\n    client, err := commercetools.NewClient(\u0026commercetools.ClientConfig{\n        ProjectKey: \"\u003cproject-key\u003e\",\n        Endpoints:  commercetools.NewClientEndpoints(\"europe-west1\", \"gcp\"),\n        Credentials: \u0026commercetools.ClientCredentials{\n            ClientID:     \"\u003cclient-id\u003e\",\n            ClientSecret: \"\u003cclient-secret\u003e\",\n            Scopes:       []string{\"\u003cscope\u003e\"},\n        },\n    })\n    \n    ctx := context.Background()\n\n    // Get or Createa product type\n    productTypeDraft := commercetools.ProductTypeDraft{\n        Name: \"a-product-type\",\n        Key:  \"a-product-type\",\n    }\n\n    productType, err := client.ProductTypeGetWithKey(ctx, productTypeDraft.Key)\n    if productType == nil {\n        productType, err = client.ProductTypeCreate(ctx, \u0026productTypeDraft)\n        if err != nil {\n            log.Println(err)\n        }\n    }\n\n    r := rand.New(rand.NewSource(time.Now().UnixNano()))\n    randomID := r.Int()\n    productDraft := \u0026commercetools.ProductDraft{\n        Key: fmt.Sprintf(\"test-product-%d\", randomID),\n        Name: \u0026commercetools.LocalizedString{\n            \"nl\": \"Een test product\",\n            \"en\": \"A test product\",\n        },\n        ProductType: \u0026commercetools.ProductTypeResourceIdentifier{\n            ID: productType.ID,\n        },\n        Slug: \u0026commercetools.LocalizedString{\n            \"nl\": fmt.Sprintf(\"een-test-product-%d\", randomID),\n            \"en\": fmt.Sprintf(\"a-test-product-%d\", randomID),\n        },\n    }\n\n    // The last argument is optional for reference expansion\n    product, err := client.ProductCreate(\n        ctx, productDraft, commercetools.WithReferenceExpansion(\"taxCategory\"))\n    if err != nil {\n        log.Fatal(err)\n    }\n    \n    log.Print(product)\n}\n```\n\n## Generating code\n\nTo generate code do the following steps:\n- `pip install pyyaml`\n- install yq (f.e. `brew install yq` on macOS)\n- `git clone https://github.com/commercetools/commercetools-api-reference.git` in the folder on the same level as the commercetools-go-sdk folder\n- `make generate`\n\n\n### TODO for code generating the services:\n- CustomObject service implementation\n- Implement all traits (f.e. priceSelecting)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrendhim%2Fcommercetools-go-sdk-legacy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrendhim%2Fcommercetools-go-sdk-legacy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrendhim%2Fcommercetools-go-sdk-legacy/lists"}