Skip to content

Latest commit

 

History

History
58 lines (47 loc) · 1.38 KB

README.md

File metadata and controls

58 lines (47 loc) · 1.38 KB

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)
}