For Amazon selling partners, programmatically access data on your orders, shipments, payments, and much more. Applications using the SP-API can increase selling efficiency, reduce labor requirements, and improve response time to customers, helping selling partners grow their businesses.
Go to siteimport { axios } from "@pipedream/platform"
export default defineComponent({
props: {
amazon_selling_partner: {
type: "app",
app: "amazon_selling_partner",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://sellingpartnerapi-na.amazon.com/inbound/fba/2024-03-20/inboundPlans`,
headers: {
"x-amz-access-token": `${this.amazon_selling_partner.$auth.oauth_access_token}`,
},
})
},
})
Amazon Selling Partner uses OAuth authentication. When you connect your Amazon Selling Partner account, Pipedream will open a popup window where you can sign into Amazon Selling Partner and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Amazon Selling Partner API.
Pipedream requests the following authorization scopes when you connect your account:
GET
{{custom_fields.marketplace}}/apps/authorize/consent
?
application_id=amzn1.sp.solution.b94814bf-a133-46bf-af1c-439f0ede5661
&
state={{oauth.state}}
&
redirect_uri={{oauth.redirect_uri}}
&
response_type=code
&
scope={{oauth.space_separated_scopes}}
&
version=beta
&
client_id={{oauth.client_id}}
POST
https://api.amazon.com/auth/o2/token
?
grant_type=authorization_code
&
code={{oauth.code}}
&
redirect_uri={{oauth.redirect_uri}}
&
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
content-type: application/x-www-form-urlencoded
accept: application/json
POST
https://api.amazon.com/auth/o2/token
?
grant_type=refresh_token
&
refresh_token={{oauth.refresh_token}}
&
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
content-type: application/x-www-form-urlencoded
accept: application/json