Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Property 'carrieraccount' does not exist on type 'Shippo' #77

Open
ohabash opened this issue Feb 22, 2022 · 2 comments
Open

Property 'carrieraccount' does not exist on type 'Shippo' #77

ohabash opened this issue Feb 22, 2022 · 2 comments

Comments

@ohabash
Copy link

ohabash commented Feb 22, 2022

I am having trouble reaching carrieraccount. Ive notice several situations where @types might be out-of-date?

import * as shippoClient from 'shippo';
shippoClient('**').carrieraccount;

results in the following error

Property 'carrieraccount' does not exist on type 'Shippo'.

"@types/shippo": "^1.5.1",
"shippo": "^1.7.1",
@bobbyhalljr
Copy link

Hi @ohabash, You are using an open source library called @types/shippo that is not owned nor maintained by Shippo. The open source library you are using is not extensive nor does it cover all types in shippo including carrieraccount. The current types supported by this open source library can be found here: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/shippo/index.d.ts

Unfortunately, Shippo does not have Typescript support for our Node.js library at this time. You can use the JavaScript examples in our API docs here - https://goshippo.com/docs/reference/js#carrier-accounts

Example usage:

const shippo = require('shippo')('<YOUR_PRIVATE_KEY>')

// EXAMPLE | Create carrier account
shippo.carrieraccount.create({
    "carrier":"fedex", 
    "account_id":"<YOUR_FEDEX_ACCOUNT_NUMBER>", 
    "parameters":{"meter":"<YOUR_FEDEX_METER_NUMBER>"},
    "test":true,
    "active":true
}, function(err, account) {
  // asynchronously called
});

// EXAMPLE | Retrieve carrier account
shippo.carrieraccount.retrieve('<OBJECT_ID_OF_CARRIER_ACCOUNT>')

@peterb0yd
Copy link

peterb0yd commented Apr 28, 2022

Unfortunately those types are missing Transaction which is imperative for creating a label ☹️
@bobbyhalljr

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants