Skip to content

radulucut/coleteonline

Repository files navigation

coleteonline

Go (golang) client library for accessing the Colete Online API.

Go Reference Test

Install

go get github.com/radulucut/coleteonline

Endpoints

  • /search/country/{needle}
  • /search/location/{countryCode}/{needle}
  • /search/city/{countryCode}/{county}/{needle}
  • /search/street/{countryCode}/{city}/{county}/{needle}
  • /search/postal-code/{countryCode}/{city}/{county}/{street}
  • /search/validate-postal-code/{countryCode}/{city}/{county}/{street}/{postalCode}
  • /search/postal-code-reverse/{countryCode}/{postalCode}
  • /address
  • /service/list
  • /order
  • /order/price
  • /order/status/{uniqueId}
  • /order/awb/{uniqueId}
  • /user/balance

Usage

package main

import (
	"fmt"
	"log"
	"time"

	"github.com/radulucut/coleteonline"
)

func main() {
	client := coleteonline.NewClient(coleteonline.Config{
		ClientId:      "<ClientId>",
		ClientSecret:  "<ClientSecret>",
		UseProduction: true,
		Timeout:       10 * time.Second,
	})
	order := &coleteonline.Order{
		// ...
	}
	res, err := client.CreateOrder(order)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", res)
}

About

Go client library for accessing colete-online.ro

Topics

Resources

License

Stars

Watchers

Forks

Languages