33 lines
629 B
Go
33 lines
629 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
"log"
|
|
|
|
"github.com/debyltech/go-snipcart/snipcart"
|
|
)
|
|
|
|
func main() {
|
|
snipcartApiKey := flag.String("key", "", "Snipcart API Key")
|
|
flag.Parse()
|
|
|
|
if *snipcartApiKey == "" {
|
|
log.Fatal("missing -key flag")
|
|
}
|
|
|
|
Client := snipcart.NewClient(*snipcartApiKey)
|
|
|
|
updateOrder := snipcart.SnipcartOrderUpdate{
|
|
ShippingRateId: "b1f5a5bca34d4e9ea7a55c011b22644f;5677a809435d46cbbb5dda2485295326",
|
|
}
|
|
|
|
response, err := Client.UpdateOrder("e6e72c95-31df-4594-b9a3-8603ce3914c8", &updateOrder)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
|
|
for k, v := range response.Items {
|
|
log.Printf("%v: %v\n", k, v)
|
|
}
|
|
}
|