Generate Label Webhook Dev

Hi there, I would like to see where the payload of this webhook comes from and where to configure it, specially currency and country, we are using Shiphero from México.

Hello @Jose!
Welcome to the SHipHero Public-API Community!

You will need to set up an endpoint to receive it, and you will need to provide a response with a specific payload.
You can find more information here: Webhooks – Developer Resources | ShipHero. In that link, you will find the payloads and the process to set it up.

What specifics are you looking for regarding currency and country?

Kind regards,
TomasFD

We want to configure MEX for México and MXN for mexican pesos.
Another question is how to get the verification x-shiphero-hmac-sha256 header,
we look for it were the doc points to find it but we didn’t see it.

How can I test it? here is my verification method:

export default function verify(secret, data, hmac_signature){
	const digest = crypto.createHmac('sha256', secret).update(data).digest('hex');
const calculated_signature = digest.toString('base64');
let verified = true;
	console.log("hmac: ", hmac_signature);
	console.log("calculated: ", calculated_signature);
  if(calculated_signature != hmac_signature){
  	verified = false;
  }
	return verified;

};

Hello @jose!

This information comes from the order.

Country comes from the warehouse profile information in the from_address and from the shipping address in the to_address

Currency is also from the order and comes from the default currency of your account. If you need to handle different currencies, you can do so by using Order Tags and automation rules. to set the currency. For example, you could use an order tag named MXN and create an automation rule as follows:

Best,
TomasFD

Hello @Jose!

To test it, you should go to https://app.shiphero.com/dashboard/settings/api and find the API secret corresponding to the default row.

The data you need to pass is the whole payload in raw format, not prettified with enters and/or tabs.

Kind regards,
TomasFD

Whe we call the webhook the method in shiphero is operationName: “PrintLabel”,
we’re receiving the payload but not the header: ‘x-shiphero-hmac-sha256’.
Do we need some extra step to make shiphero send it?

Thanks Tomas,
now we want to generate labels for products where the SKU is present in the barcode.
Here is my question in the community forum:
https://community.shiphero.com/t/inventory-api-labels/1994

1 Like