Repository: VictorAvelar/mollie-api-go
Pull request #353 (2024-03-16 07:40:19)

check shipments resource against api reference
<!--- Provide a general summary of your changes in the Title above -->

# Description

Ensures that the `shipments` resource delivers API parity. 

## Motivation and context

Ensures the library has full API parity.

## How has this been tested?

Please describe in detail how you tested your changes.

Include details of your testing environment, and the tests you ran to
see how your change affects other areas of the code, etc.

- [x] Unit tests added / updated
- [x] The tests run on docker (using `make test`)
- [x] The required `test data` has been added / updated

If you are running the tests locally, please specify:

- OS: macos
- Go version 1.22

## Types of changes

What types of changes does your code introduce? Put an `x` in all the boxes that apply:

- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing functionality to change)
- [x] This change requires a documentation update

## Checklist

Go over all the following points, and put an `x` in all the boxes that apply.

Please, please, please, don't send your pull request until all of the boxes are ticked. Once your pull request is created, it will trigger a build on our continuous integration server to make sure your [tests and code style pass](https://help.github.com/articles/about-required-status-checks/).

- [x] I have read the **[CONTRIBUTING](CONTRIBUTING.md)** document.
- [x] My pull request addresses exactly one patch/feature.
- [x] I have created a branch for this patch/feature.
- [x] Each individual commit in the pull request is meaningful.
- [x] If my change requires a change to the documentation, I have updated it accordingly.

<!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->



Patch:
diff --git a/docs/README.md b/docs/README.md
index e59246d..61e9d49 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -120,7 +120,7 @@ REST also implies a nice and clean structure for URLs or endpoints. This means y
 - [type CreatePaymentRefund](<#CreatePaymentRefund>)
 - [type CreatePreAuthorizedPaymentFields](<#CreatePreAuthorizedPaymentFields>)
 - [type CreateRecurrentPaymentFields](<#CreateRecurrentPaymentFields>)
-- [type CreateShipmentRequest](<#CreateShipmentRequest>)
+- [type CreateShipment](<#CreateShipment>)
 - [type CreateSubscription](<#CreateSubscription>)
 - [type Customer](<#Customer>)
 - [type CustomerLinks](<#CustomerLinks>)
@@ -341,14 +341,15 @@ REST also implies a nice and clean structure for URLs or endpoints. This means y
   - [func \(ss \*SettlementsService\) Next\(ctx context.Context\) \(res \*Response, s \*Settlement, err error\)](<#SettlementsService.Next>)
   - [func \(ss \*SettlementsService\) Open\(ctx context.Context\) \(res \*Response, s \*Settlement, err error\)](<#SettlementsService.Open>)
 - [type Shipment](<#Shipment>)
+- [type ShipmentAccessTokenFields](<#ShipmentAccessTokenFields>)
 - [type ShipmentLinks](<#ShipmentLinks>)
 - [type ShipmentTracking](<#ShipmentTracking>)
 - [type ShipmentsList](<#ShipmentsList>)
 - [type ShipmentsService](<#ShipmentsService>)
-  - [func \(ss \*ShipmentsService\) Create\(ctx context.Context, oID string, cs CreateShipmentRequest\) \(res \*Response, s \*Shipment, err error\)](<#ShipmentsService.Create>)
-  - [func \(ss \*ShipmentsService\) Get\(ctx context.Context, oID string, sID string\) \(res \*Response, s \*Shipment, err error\)](<#ShipmentsService.Get>)
-  - [func \(ss \*ShipmentsService\) List\(ctx context.Context, oID string\) \(res \*Response, sl \*ShipmentsList, err error\)](<#ShipmentsService.List>)
-  - [func \(ss \*ShipmentsService\) Update\(ctx context.Context, oID string, sID string, st ShipmentTracking\) \(res \*Response, s \*Shipment, err error\)](<#ShipmentsService.Update>)
+  - [func \(ss \*ShipmentsService\) Create\(ctx context.Context, order string, cs CreateShipment\) \(res \*Response, s \*Shipment, err error\)](<#ShipmentsService.Create>)
+  - [func \(ss \*ShipmentsService\) Get\(ctx context.Context, order string, shipment string\) \(res \*Response, s \*Shipment, err error\)](<#ShipmentsService.Get>)
+  - [func \(ss \*ShipmentsService\) List\(ctx context.Context, order string\) \(res \*Response, sl \*ShipmentsList, err error\)](<#ShipmentsService.List>)
+  - [func \(ss \*ShipmentsService\) Update\(ctx context.Context, order string, shipment string, us UpdateShipment\) \(res \*Response, s \*Shipment, err error\)](<#ShipmentsService.Update>)
 - [type ShortDate](<#ShortDate>)
   - [func \(d \*ShortDate\) MarshalJSON\(\) \(\[\]byte, error\)](<#ShortDate.MarshalJSON>)
   - [func \(d \*ShortDate\) UnmarshalJSON\(b \[\]byte\) error](<#ShortDate.UnmarshalJSON>)
@@ -380,6 +381,7 @@ REST also implies a nice and clean structure for URLs or endpoints. This means y
 - [type UpdateOrder](<#UpdateOrder>)
 - [type UpdateOrderLine](<#UpdateOrderLine>)
 - [type UpdatePayment](<#UpdatePayment>)
+- [type UpdateShipment](<#UpdateShipment>)
 - [type UpdateSubscription](<#UpdateSubscription>)
 - [type UsedGiftCard](<#UsedGiftCard>)
 - [type UserAgentToken](<#UserAgentToken>)
@@ -2099,16 +2101,16 @@ type CreateRecurrentPaymentFields struct {
 }
 ```
 
-<a name="CreateShipmentRequest"></a>
-## type [CreateShipmentRequest](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/shipments.go#L61-L65>)
+<a name="CreateShipment"></a>
+## type [CreateShipment](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/shipments.go#L11-L15>)
 
-CreateShipmentRequest defines information required to create a new shipment.
+CreateShipment contains information required to create a new shipment.
 
 ```go
-type CreateShipmentRequest struct {
-    Lines    []OrderLine      `json:"lines,omitempty"`
-    Tracking ShipmentTracking `json:"tracking,omitempty"`
-    TestMode bool             `json:"testmode,omitempty"`
+type CreateShipment struct {
+    Lines    []*OrderLine      `json:"lines,omitempty"`
+    Tracking *ShipmentTracking `json:"tracking,omitempty"`
+    ShipmentAccessTokenFields
 }
 ```
 
@@ -5396,7 +5398,7 @@ Open retrieves the details of the open balance of the organization. This will re
 See: https://docs.mollie.com/reference/v2/settlements-api/get-open-settlement
 
 <a name="Shipment"></a>
-## type [Shipment](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/shipments.go#L16-L25>)
+## type [Shipment](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/shipments.go#L25-L34>)
 
 Shipment contains information about a user service/product delivery and is used in the figurative sense here. It can also mean that a service was provided or digital content was delivered.
 
@@ -5405,16 +5407,27 @@ type Shipment struct {
     Resource  string            `json:"resource,omitempty"`
     ID        string            `json:"id,omitempty"`
     OrderID   string            `json:"orderId,omitempty"`
-    TestMode  bool              `json:"testmode,omitempty"`
     CreatedAt *time.Time        `json:"createdAt,omitempty"`
     Tracking  *ShipmentTracking `json:"tracking,omitempty"`
     Lines     []*OrderLine      `json:"lines,omitempty"`
     Links     ShipmentLinks     `json:"_links,omitempty"`
+    ShipmentAccessTokenFields
+}
+```
+
+<a name="ShipmentAccessTokenFields"></a>
+## type [ShipmentAccessTokenFields](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/shipments.go#L18-L20>)
+
+ShipmentAccessTokenFields describes the fields available when using an access token.
+
+```go
+type ShipmentAccessTokenFields struct {
+    Testmode bool `json:"testmode,omitempty"`
 }
 ```
 
 <a name="ShipmentLinks"></a>
-## type [ShipmentLinks](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/shipments.go#L36-L40>)
+## type [ShipmentLinks](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/shipments.go#L51-L55>)
 
 ShipmentLinks contains URL objects with shipment relevant information for the user.
 
@@ -5427,7 +5440,7 @@ type ShipmentLinks struct {
 ```
 
 <a name="ShipmentTracking"></a>
-## type [ShipmentTracking](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/shipments.go#L28-L32>)
+## type [ShipmentTracking](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/shipments.go#L43-L47>)
 
 ShipmentTracking contains shipment tracking details.
 
@@ -5440,7 +5453,7 @@ type ShipmentTracking struct {
 ```
 
 <a name="ShipmentsList"></a>
-## type [ShipmentsList](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/shipments.go#L94-L100>)
+## type [ShipmentsList](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/shipments.go#L58-L64>)
 
 ShipmentsList describes how a list of payments will be retrieved by Mollie.
 
@@ -5455,7 +5468,7 @@ type ShipmentsList struct {
 ```
 
 <a name="ShipmentsService"></a>
-## type [ShipmentsService](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/shipments.go#L11>)
+## type [ShipmentsService](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/shipments.go#L67>)
 
 ShipmentsService operates on shipments endpoints.
 
@@ -5464,10 +5477,10 @@ type ShipmentsService service
 ```
 
 <a name="ShipmentsService.Create"></a>
-### func \(\*ShipmentsService\) [Create](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/shipments.go#L70-L74>)
+### func \(\*ShipmentsService\) [Create](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/shipments.go#L94-L98>)
 
 ```go
-func (ss *ShipmentsService) Create(ctx context.Context, oID string, cs CreateShipmentRequest) (res *Response, s *Shipment, err error)
+func (ss *ShipmentsService) Create(ctx context.Context, order string, cs CreateShipment) (res *Response, s *Shipment, err error)
 ```
 
 Create can be used to ship order lines.
@@ -5475,10 +5488,10 @@ Create can be used to ship order lines.
 See: https://docs.mollie.com/reference/v2/shipments-api/create-shipment
 
 <a name="ShipmentsService.Get"></a>
-### func \(\*ShipmentsService\) [Get](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/shipments.go#L45>)
+### func \(\*ShipmentsService\) [Get](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/shipments.go#L72-L76>)
 
 ```go
-func (ss *ShipmentsService) Get(ctx context.Context, oID string, sID string) (res *Response, s *Shipment, err error)
+func (ss *ShipmentsService) Get(ctx context.Context, order string, shipment string) (res *Response, s *Shipment, err error)
 ```
 
 Get retrieves a single shipment and the order lines shipped by a shipment’s ID.
@@ -5486,10 +5499,10 @@ Get retrieves a single shipment and the order lines shipped by a shipment’s ID
 See: https://docs.mollie.com/reference/v2/shipments-api/get-shipment#
 
 <a name="ShipmentsService.List"></a>
-### func \(\*ShipmentsService\) [List](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/shipments.go#L105>)
+### func \(\*ShipmentsService\) [List](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/shipments.go#L120>)
 
 ```go
-func (ss *ShipmentsService) List(ctx context.Context, oID string) (res *Response, sl *ShipmentsList, err error)
+func (ss *ShipmentsService) List(ctx context.Context, order string) (res *Response, sl *ShipmentsList, err error)
 ```
 
 List retrieves all shipments for an order.
@@ -5497,10 +5510,10 @@ List retrieves all shipments for an order.
 See: https://docs.mollie.com/reference/v2/shipments-api/list-shipments
 
 <a name="ShipmentsService.Update"></a>
-### func \(\*ShipmentsService\) [Update](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/shipments.go#L123-L127>)
+### func \(\*ShipmentsService\) [Update](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/shipments.go#L138-L142>)
 
 ```go
-func (ss *ShipmentsService) Update(ctx context.Context, oID string, sID string, st ShipmentTracking) (res *Response, s *Shipment, err error)
+func (ss *ShipmentsService) Update(ctx context.Context, order string, shipment string, us UpdateShipment) (res *Response, s *Shipment, err error)
 ```
 
 Update can be used to update the tracking information of a shipment
@@ -5974,6 +5987,18 @@ type UpdatePayment struct {
 }
 ```
 
+<a name="UpdateShipment"></a>
+## type [UpdateShipment](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/shipments.go#L37-L40>)
+
+UpdateShipment contains information required to update a shipment.
+
+```go
+type UpdateShipment struct {
+    Tracking *ShipmentTracking `json:"tracking,omitempty"`
+    ShipmentAccessTokenFields
+}
+```
+
 <a name="UpdateSubscription"></a>
 ## type [UpdateSubscription](<https://github.com/VictorAvelar/mollie-api-go/blob/master/mollie/subscriptions.go#L44-L55>)
 
diff --git a/mollie/shipments.go b/mollie/shipments.go
index eaee09f..3ef8df8 100644
--- a/mollie/shipments.go
+++ b/mollie/shipments.go
@@ -7,8 +7,17 @@ import (
 	"time"
 )
 
-// ShipmentsService operates on shipments endpoints.
-type ShipmentsService service
+// CreateShipment contains information required to create a new shipment.
+type CreateShipment struct {
+	Lines    []*OrderLine      `json:"lines,omitempty"`
+	Tracking *ShipmentTracking `json:"tracking,omitempty"`
+	ShipmentAccessTokenFields
+}
+
+// ShipmentAccessTokenFields describes the fields available when using an access token.
+type ShipmentAccessTokenFields struct {
+	Testmode bool `json:"testmode,omitempty"`
+}
 
 // Shipment contains information about a user service/product delivery and
 // is used in the figurative sense here.
@@ -17,11 +26,17 @@ type Shipment struct {
 	Resource  string            `json:"resource,omitempty"`
 	ID        string            `json:"id,omitempty"`
 	OrderID   string            `json:"orderId,omitempty"`
-	TestMode  bool              `json:"testmode,omitempty"`
 	CreatedAt *time.Time        `json:"createdAt,omitempty"`
 	Tracking  *ShipmentTracking `json:"tracking,omitempty"`
 	Lines     []*OrderLine      `json:"lines,omitempty"`
 	Links     ShipmentLinks     `json:"_links,omitempty"`
+	ShipmentAccessTokenFields
+}
+
+// UpdateShipment contains information required to update a shipment.
+type UpdateShipment struct {
+	Tracking *ShipmentTracking `json:"tracking,omitempty"`
+	ShipmentAccessTokenFields
 }
 
 // ShipmentTracking contains shipment tracking details.
@@ -39,11 +54,27 @@ type ShipmentLinks struct {
 	Documentation *URL `json:"documentation,omitempty"`
 }
 
+// ShipmentsList describes how a list of payments will be retrieved by Mollie.
+type ShipmentsList struct {
+	Count    int `json:"count,omitempty"`
+	Embedded struct {
+		Shipments []Shipment
+	} `json:"_embedded,omitempty"`
+	Links PaginationLinks `json:"_links,omitempty"`
+}
+
+// ShipmentsService operates on shipments endpoints.
+type ShipmentsService service
+
 // Get retrieves a single shipment and the order lines shipped by a shipment’s ID.
 //
 // See: https://docs.mollie.com/reference/v2/shipments-api/get-shipment#
-func (ss *ShipmentsService) Get(ctx context.Context, oID string, sID string) (res *Response, s *Shipment, err error) {
-	u := fmt.Sprintf("v2/orders/%s/shipments/%s", oID, sID)
+func (ss *ShipmentsService) Get(ctx context.Context, order string, shipment string) (
+	res *Response,
+	s *Shipment,
+	err error,
+) {
+	u := fmt.Sprintf("v2/orders/%s/shipments/%s", order, shipment)
 
 	res, err = ss.client.get(ctx, u, nil)
 	if err != nil {
@@ -57,25 +88,18 @@ func (ss *ShipmentsService) Get(ctx context.Context, oID string, sID string) (re
 	return
 }
 
-// CreateShipmentRequest defines information required to create a new shipment.
-type CreateShipmentRequest struct {
-	Lines    []OrderLine      `json:"lines,omitempty"`
-	Tracking ShipmentTracking `json:"tracking,omitempty"`
-	TestMode bool             `json:"testmode,omitempty"`
-}
-
 // Create can be used to ship order lines.
 //
 // See: https://docs.mollie.com/reference/v2/shipments-api/create-shipment
-func (ss *ShipmentsService) Create(ctx context.Context, oID string, cs CreateShipmentRequest) (
+func (ss *ShipmentsService) Create(ctx context.Context, order string, cs CreateShipment) (
 	res *Response,
 	s *Shipment,
 	err error,
 ) {
-	uri := fmt.Sprintf("v2/orders/%s/shipments", oID)
+	uri := fmt.Sprintf("v2/orders/%s/shipments", order)
 
 	if ss.client.HasAccessToken() && ss.client.config.testing {
-		cs.TestMode = true
+		cs.Testmode = true
 	}
 
 	res, err = ss.client.post(ctx, uri, cs, nil)
@@ -90,20 +114,11 @@ func (ss *ShipmentsService) Create(ctx context.Context, oID string, cs CreateShi
 	return
 }
 
-// ShipmentsList describes how a list of payments will be retrieved by Mollie.
-type ShipmentsList struct {
-	Count    int `json:"count,omitempty"`
-	Embedded struct {
-		Shipments []Shipment
-	} `json:"_embedded,omitempty"`
-	Links PaginationLinks `json:"_links,omitempty"`
-}
-
 // List retrieves all shipments for an order.
 //
 // See: https://docs.mollie.com/reference/v2/shipments-api/list-shipments
-func (ss *ShipmentsService) List(ctx context.Context, oID string) (res *Response, sl *ShipmentsList, err error) {
-	u := fmt.Sprintf("v2/orders/%s/shipments", oID)
+func (ss *ShipmentsService) List(ctx context.Context, order string) (res *Response, sl *ShipmentsList, err error) {
+	u := fmt.Sprintf("v2/orders/%s/shipments", order)
 
 	res, err = ss.client.get(ctx, u, nil)
 	if err != nil {
@@ -120,14 +135,14 @@ func (ss *ShipmentsService) List(ctx context.Context, oID string) (res *Response
 // Update can be used to update the tracking information of a shipment
 //
 // See: https://docs.mollie.com/reference/v2/shipments-api/update-shipment
-func (ss *ShipmentsService) Update(ctx context.Context, oID string, sID string, st ShipmentTracking) (
+func (ss *ShipmentsService) Update(ctx context.Context, order string, shipment string, us UpdateShipment) (
 	res *Response,
 	s *Shipment,
 	err error,
 ) {
-	u := fmt.Sprintf("v2/orders/%s/shipments/%s", oID, sID)
+	u := fmt.Sprintf("v2/orders/%s/shipments/%s", order, shipment)
 
-	res, err = ss.client.patch(ctx, u, st, nil)
+	res, err = ss.client.patch(ctx, u, us, nil)
 	if err != nil {
 		return
 	}


Test patch:
diff --git a/mollie/shipments_test.go b/mollie/shipments_test.go
index f14003c..3cf6a22 100644
--- a/mollie/shipments_test.go
+++ b/mollie/shipments_test.go
@@ -209,7 +209,7 @@ func TestShipmentsService_Create(t *testing.T) {
 	type args struct {
 		ctx      context.Context
 		order    string
-		shipment CreateShipmentRequest
+		shipment CreateShipment
 	}
 	cases := []struct {
 		name    string
@@ -224,8 +224,12 @@ func TestShipmentsService_Create(t *testing.T) {
 			args{
 				context.Background(),
 				"ord_kEn1PlbGa",
-				CreateShipmentRequest{
-					TestMode: true,
+				CreateShipment{
+					Tracking: &ShipmentTracking{
+						Carrier: "fedex",
+						Code:    "3wmsgCJN4U",
+						URL:     "https://www.example.fedex.com/apps/fedextrack/?tracknumbers=3wmsgCJN4U",
+					},
 				},
 			},
 			false,
@@ -246,8 +250,12 @@ func TestShipmentsService_Create(t *testing.T) {
 			args{
 				context.Background(),
 				"ord_kEn1PlbGa",
-				CreateShipmentRequest{
-					TestMode: true,
+				CreateShipment{
+					Tracking: &ShipmentTracking{
+						Carrier: "fedex",
+						Code:    "3wmsgCJN4U",
+						URL:     "https://www.example.fedex.com/apps/fedextrack/?tracknumbers=3wmsgCJN4U",
+					},
 				},
 			},
 			false,
@@ -269,9 +277,7 @@ func TestShipmentsService_Create(t *testing.T) {
 			args{
 				context.Background(),
 				"ord_kEn1PlbGa",
-				CreateShipmentRequest{
-					TestMode: true,
-				},
+				CreateShipment{},
 			},
 			true,
 			fmt.Errorf("500 Internal Server Error: An internal server error occurred while processing your request."),
@@ -283,9 +289,7 @@ func TestShipmentsService_Create(t *testing.T) {
 			args{
 				context.Background(),
 				"ord_kEn1PlbGa",
-				CreateShipmentRequest{
-					TestMode: true,
-				},
+				CreateShipment{},
 			},
 			true,
 			fmt.Errorf("invalid character 'h' looking for beginning of object key string"),
@@ -297,9 +301,7 @@ func TestShipmentsService_Create(t *testing.T) {
 			args{
 				context.Background(),
 				"ord_kEn1PlbGa",
-				CreateShipmentRequest{
-					TestMode: true,
-				},
+				CreateShipment{},
 			},
 			true,
 			errBadBaseURL,
@@ -337,7 +339,7 @@ func TestShipmentsService_Update(t *testing.T) {
 		ctx      context.Context
 		order    string
 		shipment string
-		st       ShipmentTracking
+		st       UpdateShipment
 	}
 	cases := []struct {
 		name    string
@@ -353,8 +355,12 @@ func TestShipmentsService_Update(t *testing.T) {
 				context.Background(),
 				"ord_kEn1PlbGa",
 				"shp_3wmsgCJN4U",
-				ShipmentTracking{
-					Carrier: "fedex",
+				UpdateShipment{
+					Tracking: &ShipmentTracking{
+						Carrier: "dhl",
+						Code:    "3wmsgCJN4U",
+						URL:     "https://www.example.dhl.com/apps/dhltrack/?tracknumbers=3wmsgCJN4U",
+					},
 				},
 			},
 			false,
@@ -376,8 +382,12 @@ func TestShipmentsService_Update(t *testing.T) {
 				context.Background(),
 				"ord_kEn1PlbGa",
 				"shp_3wmsgCJN4U",
-				ShipmentTracking{
-					Carrier: "fedex",
+				UpdateShipment{
+					Tracking: &ShipmentTracking{
+						Carrier: "dhl",
+						Code:    "3wmsgCJN4U",
+						URL:     "https://www.example.dhl.com/apps/dhltrack/?tracknumbers=3wmsgCJN4U",
+					},
 				},
 			},
 			false,
@@ -400,9 +410,7 @@ func TestShipmentsService_Update(t *testing.T) {
 				context.Background(),
 				"ord_kEn1PlbGa",
 				"shp_3wmsgCJN4U",
-				ShipmentTracking{
-					Carrier: "fedex",
-				},
+				UpdateShipment{},
 			},
 			true,
 			fmt.Errorf("500 Internal Server Error: An internal server error occurred while processing your request."),
@@ -415,9 +423,7 @@ func TestShipmentsService_Update(t *testing.T) {
 				context.Background(),
 				"ord_kEn1PlbGa",
 				"shp_3wmsgCJN4U",
-				ShipmentTracking{
-					Carrier: "fedex",
-				},
+				UpdateShipment{},
 			},
 			true,
 			fmt.Errorf("invalid character 'h' looking for beginning of object key string"),
@@ -430,9 +436,7 @@ func TestShipmentsService_Update(t *testing.T) {
 				context.Background(),
 				"ord_kEn1PlbGa",
 				"shp_3wmsgCJN4U",
-				ShipmentTracking{
-					Carrier: "fedex",
-				},
+				UpdateShipment{},
 			},
 			true,
 			errBadBaseURL,