Whether you want to let go of running your own warehouse, or run your warehouse better, you can do both – and so much more – with ShipHero.
Go to siteimport { axios } from "@pipedream/platform"
export default defineComponent({
props: {
shiphero: {
type: "app",
app: "shiphero",
}
},
async run({steps, $}) {
const data = {
"query": `{
products {
request_id
data(first: 100) {
edges {
node {
id
sku
name
}
}
}
}
}
`,
}
return await axios($, {
method: "post",
url: `https://public-api.shiphero.com/graphql`,
headers: {
Authorization: `Bearer ${this.shiphero.$auth.oauth_access_token}`,
"Content-Type": `application/json`,
},
data,
})
},
})
ShipHero uses OAuth authentication. When you connect your ShipHero account, Pipedream will open a popup window where you can sign into ShipHero and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any ShipHero API.
Pipedream requests the following authorization scopes when you connect your account:
POST
https://public-api.shiphero.com/auth/token
content-type: application/x-www-form-urlencoded
accept: application/json
username={{custom_fields.email}}
&
password={{custom_fields.password}}
POST
https://public-api.shiphero.com/auth/refresh
content-type: application/x-www-form-urlencoded
accept: application/json
refresh_token={{oauth.refresh_token}}