amzn / ads-advanced-tools-docs

Code samples and supplements for the Amazon Ads advanced tools center
https://advertising.amazon.com/API/docs/en-us/index
MIT No Attribution
88 stars 33 forks source link

Billing Statements API: it is not clear which permissions are required to access API #182

Open wolendranh opened 10 months ago

wolendranh commented 10 months ago

Describe the bug New Billing statements API was added to AD API documentation. https://advertising.amazon.com/API/docs/en-us/billing-statements

From API doc page it is not clear which Scope is required for application to access this API

URL of the content Provide the advanced tools center or GitHub URL where you see the bug.

Description of what the documentation currently says No information about permissions/scope

Description of what the documentation should say Information about which scopes are required for API application to have for Billing Statements API

Additional context It would be useful and very helpful to have Documentation page with table mapping each API available to permissions/scopes required and links on how to obtain those permissions, as currently this data is spread across multiple pages of docs and it is hard to find.

jerirose commented 7 months ago

Hi @wolendrah, apologies for the slow response on this issue. I hope the below will answer some of your questions while a user guide for this API remains in development.


Scope

The term "scope" is used two ways in the Ads API:

Headers and account identity

Global account

The billing statements API can instead accept the Amazon-Ads-AccountId header, whose value is the global ID for an advertising account, which may include multiple marketplaces. This ID is in the format amzn1.ads-account.g.123456789abcdefgh and can be found using the recently released account management API:

The value for the Amazon-Ads-AccountId header will be value of the adsAccountId field for a given account returned from the account management API.

A successful request using this header will create a CSV file whose name begins with the account name.

Profile

Alternatively, the billing statements API can be used with the Amazon-Advertising-API-Scope header, using a profile ID similarly to many other endpoints in the Amazon Ads API. A successful request using this header will generate a CSV file that includes the specified profile only and whose filename begins with the entity ID for that profile.

Permissions

The Amazon user account used to generate the authorization grant must have either View or View and Edit permissions for Billing history on the account or profile in question in order to retrieve a billing statement.

Notes


Thank you for submitting this issue! Please let me know if you have any follow-up questions.

I'll leave this issue open until we have published the user guide for this endpoint.