Cost field in ShippingLabel

In the ShippingLabel schema, what does “cost” represent? Is it actual, margin, or total cost?

All the best,
Colin

Hey @cschouten,

Thanks for reaching out!

I’ll look into this and get back to you shortly.

Best,
RayanP

Thanks @sh-agent.

On a related note, for the Shipment schema, what are the date_to and date_from parameters represent? Does it look at the created_date?

Thanks!

All the best,
Colin

Hey @cschouten,

Thanks for hanging in there!

I can confirm that the cost field represents the actual label cost, and the date_from and date_to correlates with the shipment creation time or this time in the shipping label:
image

Please let me know if you have any questions or concerns.

Best,
RayanP

Thanks for confirming @sh-agent!

All the best,
Colin

1 Like

Hi @sh-agent,

Within the billing profile UI, there’s an option for “Show marked up cost”:

I assume the “cost” field in the ShippingLabel object does not include the mark-up, but is there another way we can calculate the markup?

All the best,
Colin

Hey @cschouten,

Thanks for reaching out!
There’s actually an Engineering Ticket already made regarding this. The Public API should be returning that marked up cost.

Please let me know if you have any questions or concerns.

Best,
RayanP

Ah, okay. Duly noted.

On a related note @sh-agent, we wanted to see if there was a way to get the actual label cost and marked up cost through the API?

For example, we have this sample shipment label in ShipHero:

image

However, when we toggle the “Define Bold” filter in the top right-hand corner (see screenshots below), we see the marked up cost:

image (1)

So it seems like ShipHero can—in theory—provide us with both and allow us to calculate margin (i.e. $4.09 - 3.62 = $0.47).

All the best,
Colin

Hey @cschouten,

Thanks for hanging in there!

You can get both the actual cost and marked-up cost through the API, but it requires switching your bearer token.

If you query in the 3PL Account, the actual cost will be returned, but if you query in a Child Account, the marked-up cost will be returned.

Please let me know if you have any questions or concerns.

Best,
Rayanp

Interesting! @sh-agent Would you mind elaborating a bit more on what you mean by switching our bearer token? Could you give me an example?

Also, I’m unable to query the 3PL account via API. Perhaps I’m misunderstanding the flow.

All the best,
Colin

Hey @cschouten,

Thanks for hanging in there!

I believe you are currently using a developer account associated with a 3PL account at the moment. This means you are using an Authorization Bearer token, that is also also associated with this account. An example bearer token would look like:

 { "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlJUQXlOVU13T0R
rd09ETXhSVVZDUXpBNU5rSkVOVVUxUmtNeU1URTRNMEkzTWpnd05ERkdNdyJ9.aktgc3MiOiJodHRwc
zovL3NoaXBoZXJvLmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHw1YmI3YTI4MjY4YTU2YzRjNTEzMTIx
MWIiLCJhdWQiOiJzaGlwaGVyby1wdWJsaWMtYXBpIiwiaWF0IjoxNTU0OTEwODc0LCJleHAiOjE1NTc
zMzAwNzQsImF6cCI6Im10Y2J3cUkycjYxM0RjT04zOAMRYUhMcVF6UTRka2huIiwic2NvcGUiOiJlbW
FpbCBwcm9maWxlIG9mZmxpbmVfYWNjZXNzIiwiZ3R5IjoicGFzc3dvcmQifQ.lW2UalihR5msHKhJzD
Pvy5SCKxSPyUCMuQ7RXyP2ZNQ2gENjGF2nmdsYlF2CqxH_wITcK10CproQErMK_yAWUSEck8qfC1Fu_
UNc9-xW55ALeCk09ZZD--aB_QFjLVM-ooawby7y4Ysf8H4yEBQpoPwZoQ3DQnu5QBNxd5oOLIP2ezzN
Yvrwjpm-uNN8II5sK9U075Mx1HH31KG14iFt5sEZQmYOz-oSWweVuY6Sd61VFD02sncXOmEZIxu3bda
ZSn1JYaM-ilLce4s748iv75BVDgqj1b2A1lyITeqvFoYWl3PKV56fOlfm8v9QnkSqR0iTGENgV6zZq3
rPRsBLTw", "expires_in": 2419200, "refresh_token": "cBWV3BROyQn_TMxETqr7ALQBaoF
gIzkC-8KkJaIq2HmK_", "scope": "openid profile offline_access", 
"token_type": "Bearer" }

If you were to make a developer user in one of your child accounts, you would generate a separate bearer token for interacting with the API. When using this token, all information returned by the Public API would only pertain to this account. For example, when querying orders, only orders from this account would be returned, whereas when querying orders in a 3PL account (as you are now), orders from all your child accounts would be returned.

So if you were to query using a child account bearer token you would get the marked up cost of a shipping label. If you were to query using your current bearer token the actual cost would be returned.

Please let me know if that was explained clearly, or if you have any questions at all.

Best,
RayanP

Ah, understood. Thank you @sh-agent.