Skip to content

markwunsch/roadie-go-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Roadie Go SDK

GoDoc Go Report Card

roadie-go-sdk is a client library for accessing the Roadie API

Installation

go get github.com/markwunsch/roadie-go-sdk/roadie

Usage

The roadie package provides a Client for accessing the Roadie API. Authentication is handled by including your access token in the WithAccessToken function, as shown below.

client, err := roadie.NewClient(roadie.WithAccessToken(context.Background(), "YOUR-ACCESS-TOKEN"))

// Get shipment by ID
shipment, err := client.Shipments.Get(context.Background(), 413042)

// Create an estimate and get the response from the roadie API
response, err := client.Estimates.Create(context.Background(), roadie.CreateEstimateRequest{
    Items: []roadie.Item{
        roadie.Item{
            Length:      4.3,
            Width:       1.0,
            Height:      4.2,
            Weight:      1.1,
            Quantity:    1,
            Value:       25.00,
            Description: "Item description",
            ReferenceId: "UUID",
        },
    },
    PickupLocation: roadie.Location{
        Address: roadie.Address{
            Street1: "7778 McGinnis Ferry Rd #270",
            City: "Suwanee",
            State: "GA",
            Zip: "30024",
        },
    },
    DeliveryLocation: roadie.Location{
        Address: roadie.Address{
            Street1: "100 North Ave",
            City: "Atlanta",
            State: "GA",
            Zip: "30332",
        },
    },
    PickupAfter: time.Now(),
    DeliverBetween: roadie.TimeWindow{
        Start: time.Now(),
        End: time.Now().Add(time.Hour * 4),
    },
})

Supported Endpoints

Method HTTP request Description
Create Estimate POST /estimate Create an estimate
Create Shipment POST /shipments Create a shipment
Retrieve Shipment GET /shipments/{shipment-id} Retrieve a shipment
Retrieve List of Shipments GET /shipments/reference_ids={reference-ids} Retrieve a list of shipments
Update Shipment PATCH /shipments/{shipment-id} Update a shipment
Cancel Shipment DELETE /shipments/{shipment-id} Cancel a shipment
Tip the driver POST /shipments/{shipment-id}/tips Leave a tip for the driver
Rate the driver POST /shipments/{shipment-id}/ratings Rate the driver

About

Go client library for accessing the Roadie API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages