Skip to content

Commit c5c7d45

Browse files
committed
Add RegisterCarrierAccount which serves the same purpose as CreateCarrierAccount but has a different endpoint
1 parent 0960d2b commit c5c7d45

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

client/carrier_account.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ func (c *Client) CreateCarrierAccount(input *models.CarrierAccountInput, shippoS
2020
return output, err
2121
}
2222

23+
func (c *Client) RegisterCarrierAccount(input *models.CarrierAccountInput, shippoSubAccountID string) (*models.CarrierAccount, error) {
24+
if input == nil {
25+
return nil, errors.New("nil input")
26+
}
27+
28+
output := &models.CarrierAccount{}
29+
err := c.doWithoutVersion(http.MethodPost, "/carrier_accounts/register/new", input, output, c.subAccountHeader(shippoSubAccountID))
30+
return output, err
31+
}
32+
2333
// RetrieveCarrierAccount retrieves an existing carrier account by object id.
2434
func (c *Client) RetrieveCarrierAccount(objectID string, shippoSubAccountID string) (*models.CarrierAccount, error) {
2535
if objectID == "" {

0 commit comments

Comments
 (0)