ScaleLeap / selling-partner-api-sdk

A fully typed TypeScript and Node.js SDK library for Amazon Selling Partner API
https://npm.im/@scaleleap/selling-partner-api-sdk
MIT License
68 stars 28 forks source link

[Vendor Orders API] includeDetails flag in getPurchaseOrders not working #171

Closed asongate closed 3 years ago

asongate commented 3 years ago

Hi,

I just wanted say this is a fantastic module. Thank you for this!

When includeDetails is set to false, order details are always returned when I call the getPurchaseOrders.

Here is my configuration.

import { VendorOrdersApiClient } from '@scaleleap/selling-partner-api-sdk'

const client = new VendorOrdersApiClient({ accessToken: 'Atza|.....',

// Or use amazonMarketplaces.CA.sellingPartner.region.endpoint // from @scaleleap/amazon-marketplaces package basePath: 'https://sandbox.sellingpartnerapi-na.amazon.com',

credentials: { accessKeyId: 'XXXXXX', secretAccessKey: 'XXXXXXX', },

// Or use amazonMarketplaces.CA.sellingPartner.region.awsRegion // from @scaleleap/amazon-marketplaces package region: 'us-east-1', })

const purchaseOrderOptions = { createdBefore: '2019-09-21T00:00:00', createdAfter: '2019-08-20T14:00:00', includeDetails: false, nextToken: 'MDAwMDAwMDAwMQ==', sortOrder: 'DESC' } const purchaseOrders = await client.getPurchaseOrders(purchaseOrderOptions); console.log(nextToken: ${purchaseOrders.data.payload.pagination.nextToken}); console.log(purchaseOrders.data.payload.orders);

According to the docs, I should be getting just the Purchase Order Numbers but the order details are included.

Thanks in advance.

moltar commented 3 years ago

Hi @asongate,

The package is generated from OpenAPI models provided by the SP API repo. We don't have any control over the functionality.

Please raise the issues with the SP API team.