Skip to content

alexpalyan/prom-golang-sdk

Repository files navigation

Prom.ua SDK library for Go

Install

go get github.com/freedayko/prom-golang-sdk

Usage

import "github.com/freedayko/prom-golang-sdk"

Get Products

	p := prom.NewClient("<abcdef0123456789-you-prom-api-key>")

	var request = prom.ProductsRequest{
		GroupId: 0,
		Limit:   2000,
	}

	products, err := p.GetProducts(request)
	if err != nil {
		fmt.Printf("Error when requesting: %s", err)
		return
	}

Update Products

	var editProducts []prom.ProductEdit
	
	editProduct := prom.NewProductEdit(product)
	editProduct.Discount.Value = 300

	editProducts = append(editProducts, editProduct)
	
	ids, err = p.UpdateProducts(editProducts)

About

Prom.ua CMS SDK library for Go

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages