Git Product home page Git Product logo

selling-partner-api-sdk's People

Contributors

alex-korobko avatar dsolonenko avatar gopkg-dev avatar hosnimansour avatar jlorencelim avatar kelnadim avatar mathiasgr avatar viniciusfeitosa avatar wish-master avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

selling-partner-api-sdk's Issues

Use temporary credentials for assume role

Currently, we are requiring static credentials (in the form of access key and secret key). But if we are running in aws (e.g. ec2, ecs, lambda), then we already have temporary credentials (iam role). In these cases, I would like to not use an iam user. See: https://github.com/amzapi/selling-partner-api-sdk/blob/cf9bdde067d8ef6e33eafc1dc3e607ecd05a0b60/pkg/selling-partner/selling-partner.go

Can we use a credential provider chain from the aws-sdk to handle all cases? See: https://docs.aws.amazon.com/sdk-for-go/api/aws/credentials/#NewChainCredentials. Or we make the credentials object configurable.

POST restrictedDataToken

Is there a plan to include the call to restrictedDataToken?
It would be nice to have it, as an option

there are many time serialize and Deserialize problems

GetTransportDetailsWithResponse
parsing time ""Fri Jan 12 00:00:00 GMT 2024"" as ""2006-01-02T15:04:05Z07:00"": cannot parse "Fri Jan 12 00:00:00 GMT 2024"" as "2006"

fbaInbound.DateStringType serialize to string not with YYYY-MM-DD

Working example get report

Hi,
my experience with go is quite limited, since I just moved from python to go.
Is there a chance you could give a working example for a request / download of a report e.g.

GET_FLAT_FILE_ORDER_REPORT_DATA_SHIPPING.

Your first example the markets works, but I cannot retrieve a report yet.

Thank you very much in advance.

Feeds 2021-06-30 Schema Changes Not Implemented

The base path was changed for Feeds to v2021-06-30 from v2020-09-04 but that was the only change that was made. There were changes that were made to the responses from Amazon that are not implemented and make feeds not usable.

The CreateFeedDocumentResult no longer has EncryptionDetails as a parameter.
https://github.com/amzapi/selling-partner-api-sdk/blob/master/feeds/types.gen.go#L35

The CreateFeedResponse no longer has a result of errors and now is just the values of Feeds and nextToken.

Essentially everything that had Payload as a response is no longer there.

NextToken query param encoding error

Hi guys,

The SP API returns the following error while providing a NextToken:

{ "errors": [ { "code": "InvalidInput", "message": "We could not decode your NextToken. Possible reasons include: a transmission error, improper quoting or a truncation problem.", "details": "" } ] }

The NextToken provided by Amazon was : Abjn8igatlp/YYuZQbKv1QafEPREmauvizt1MIhPYZacG7+f+fPp64jrgtdOS1N57G4NpRGNu/aHNkPWD9qzA98ytOVgN7d/KyNtf5fepe1HnywimSSQDRGmrXufpM2ZiOxqNBW1w66S68vI7Bqws+weLxD7b1CV0+mtVKXnPdiRy61Whm3WZuhTmqWGK9KSllhc4XvGqg5e0zIeaOVNezxWEXvdeDL7Zg54wKetRXLQp0zNIsrUkDRYOWseR6JecVkxA+q0fZYwE7+t4NjazyEZY027dXAVTSGshRBy6ZQghiSCZ3PIKk1DNEBSp27+sHmkcG/7LbJaHp4fabNqjZzx3vUsLaRi/IBQt3FQQzIESYt/Ti7LLVglFmAtnnBygOSv44FefAZ4FtaSjjwjko+Dl5QhYGtU3tAf+LbCLV+BA1KyEG2j/Km8ERy2ZulUV3HBz6/4NisG51E48qXehQ==

And the encoded NextToken passed in the query param by the SDK is :
NextToken=Abjn8igatlp%2FYYuZQbKv1QafEPREmauvizt1MIhPYZacG7%20f%20fPp64jrgtdOS1N57G4NpRGNu%2FaHNkPWD9qzA98ytOVgN7d%2FKyNtf5fepe1HnywimSSQDRGmrXufpM2ZiOxqNBW1w66S68vI7Bqws%20weLxD7b1CV0%20mtVKXnPdiRy61Whm3WZuhTmqWGK9KSllhc4XvGqg5e0zIeaOVNezxWEXvdeDL7Zg54wKetRXLQp0zNIsrUkDRYOWseR6JecVkxA%20q0fZYwE7%20t4NjazyEZY027dXAVTSGshRBy6ZQghiSCZ3PIKk1DNEBSp27%20sHmkcG%2F7LbJaHp4fabNqjZzx3vUsLaRi%2FIBQt3FQQzIESYt%2FTi7LLVglFmAtnnBygOSv44FefAZ4FtaSjjwjko%20Dl5QhYGtU3tAf%20LbCLV%20BA1KyEG2j%2FKm8ERy2ZulUV3HBz6%2F4NisG51E48qXehQ%3D%3D

A URL decode of the encoded token returns :
Abjn8igatlp/YYuZQbKv1QafEPREmauvizt1MIhPYZacG7 f fPp64jrgtdOS1N57G4NpRGNu/aHNkPWD9qzA98ytOVgN7d/KyNtf5fepe1HnywimSSQDRGmrXufpM2ZiOxqNBW1w66S68vI7Bqws weLxD7b1CV0 mtVKXnPdiRy61Whm3WZuhTmqWGK9KSllhc4XvGqg5e0zIeaOVNezxWEXvdeDL7Zg54wKetRXLQp0zNIsrUkDRYOWseR6JecVkxA q0fZYwE7 t4NjazyEZY027dXAVTSGshRBy6ZQghiSCZ3PIKk1DNEBSp27 sHmkcG/7LbJaHp4fabNqjZzx3vUsLaRi/IBQt3FQQzIESYt/Ti7LLVglFmAtnnBygOSv44FefAZ4FtaSjjwjko Dl5QhYGtU3tAf LbCLV BA1KyEG2j/Km8ERy2ZulUV3HBz6/4NisG51E48qXehQ==

As you can see the + characters have been converted to spaces... destroying the token.

Any idea to solve this please?

Thanks

Unable to get BuyerCustomizedInfo in GetOrderItemsBuyerInfoWithResponse

Hey team.
I try to get buyer customer infomation but it not work
The result always return empty

This is my code testing:

package main

import (
	"context"
	"fmt"
	"net/http"

	"github.com/amzapi/selling-partner-api-sdk/ordersV0"
	sp "github.com/amzapi/selling-partner-api-sdk/pkg/selling-partner"

	"github.com/google/uuid"
	"github.com/pkg/errors"
)


var (
	ClientID     = "Your ClientID"
	ClientSecret = "Your ClientSecret"
	RefreshToken = "Your RefreshToken"
	orderId = "Your OrderId"
)


func main() {

	sellingPartner, err := sp.NewSellingPartner(&sp.Config{
		ClientID:     ClientID,
		ClientSecret: ClientSecret,
		RefreshToken: RefreshToken,
	})

	if err != nil {
		panic(err)
	}

	endpoint := "https://sellingpartnerapi-na.amazon.com"

	seller, err := ordersV0.NewClientWithResponses(endpoint,
		ordersV0.WithRequestBefore(func(ctx context.Context, req *http.Request) error {
			req.Header.Add("X-Amzn-Requestid", uuid.New().String()) //tracking requests
			err = sellingPartner.AuthorizeRequest(req)
			if err != nil {
				return errors.Wrap(err, "sign error")
			}

			return nil
		}),
	)

	if err != nil {
		panic(err)
	}

	ctx := context.Background()
	resp, err := seller.GetOrderItemsBuyerInfoWithResponse(ctx, orderId, &ordersV0.GetOrderItemsBuyerInfoParams{})


	if err != nil {
		fmt.Println("[GetOrderItemsBuyerInfoWithResponse] err : ", err)
		panic(err)
	}

	
	fmt.Println(string(resp.Body))
}

The example result . BuyerCustomizedInfo always is empty

{"payload":{"OrderItems":[{"OrderItemId":"98587589265001","BuyerCustomizedInfo":{}}],"AmazonOrderId":"113-8246998-1524200"}}

Go version: go version go1.22.2 linux/amd64
amzapi/selling-partner-api-sdk latest
Permission:
image

InvalidInput The input you have submitted is not valid. Please check your input and try again.

REQ:

GET /orders/v0/orders?CreatedAfter=2022-04-14T15%3A43%3A01Z&CreatedBefore=2022-04-19T15%3A43%3A01Z&FulfillmentChannels=AFN&MarketplaceIds=A1AM78C64UM0Y8&MaxResultsPerPage=20&OrderStatuses=Unshipped HTTP/1.1
Host: sellingpartnerapi-na.amazon.com
Authorization: ***
User-Agent: selling-partner-api-sdk/v1.0 (Language=go/1.17.6; Platform=darwin-amd64)
X-Amz-Access-Token: ***
X-Amz-Date: 20220419T154306Z
X-Amz-Security-Token:  ***
X-Amzn-Requestid: f4400f7e-d0eb-4112-accf-96d5cbf1e5b0

RES:

HTTP/2.0 400 Bad Request
Content-Length: 185
Content-Type: application/json
Date: Tue, 19 Apr 2022 15:43:03 GMT
X-Amz-Apigw-Id: Q1bFNEjKoAMFpwQ=
X-Amzn-Ratelimit-Limit: 0.0167
X-Amzn-Requestid: f4400f7e-d0eb-4112-accf-96d5cbf1e5b0
X-Amzn-Trace-Id: Root=1-625ed887-1ef8fa3b43d1674d231133e6

{
  "errors": [
    {
      "code": "InvalidInput",
      "message": "The input you have submitted is not valid. Please check your input and try again.",
      "details": ""
    }
  ]
}

Please provide some examples to get Catalogue Items

Hi @gopkg-dev

Can you please provide some examples how to fetch the catalogue items with your library.
I hardly see any examples. There is only one example to GetMarketplaceParticipationsWithResponse.

Please provide some more examples how to use the SDK.

Thanks

Sandbox - POST /fba/outbound/2020-07-01/fulfillmentOrders 400 bad request

DumpRequest = POST /fba/outbound/2020-07-01/fulfillmentOrders HTTP/1.1
Host: sandbox.sellingpartnerapi-na.amazon.com
Authorization: AWS4-HMAC-SHA256 Credential=ASIA43E7AIHHOTY4FBL5/20210113/us-east-1/execute-api/aws4_request, SignedHeaders=content-type;host;x-amz-access-token;x-amz-date;x-amz-security-token;x-amzn-requestid, Signature=4d57cabf3695d4f186399783dadddc2f6a37325569d7902d7ad0decf7b42c605
Content-Type: application/json
X-Amz-Access-Token: Atza|IwEBIMhY3hqnYQrMvu_VlJ5euqXQS4iuH_jGdOoYsG--e6CzIJPa3Y2x73td6JY7kKwAz94-WcLLGCrfHo1L5qH98nbk1O09duX1we46PtXAz_Vcqk3Vk59UuUPG9fwHLo96eKookLHdVmEqzW8xu2A9Khvlxb9Rs6TrPCtOnEOHtIkKTBm2XBGikTjgusUxHG1yAJCTPyT3CJZBMSh6EMEe_uGHQ8oj4LrAKfA4IPMq46F3IRDW2JUUhrPDS6YJ-zBRIyPHD6tF71vqpYZWl32yvDV6wKlIsrsawkEY9p1300V0Qhme47JJXcy78PLuE1qpajFpaG1VKztCcP1hRXVMi-Ey
X-Amz-Date: 20210113T155956Z
X-Amz-Security-Token: FwoGZXIvYXdzECEaDKS+Gh0KHu4uEWEQXSLIAZPUpb2G+yUr12mM1KN5y/pp+x6037Q7k79haXFBayGckwRqXcDsELHkFi9e2Ssj6mZj0jNeq5zT5S8Fystai0KX5wEU/nVeKJVe/KbQxgTOzARcDaiqnp9R02aO/0xSzB9iWvXj+C7kfa/rkVCUJeWbcat88ggayLTZ/xDPL9spk2PIxQ3AFjL0fgCz1KiolQQIC7u/liNqDbhTCqU7rFN1nnMpnl75uqDxIN/SGirHgB2YeT5eXMmW9TrWw9qJ8Lvg6N3hBjHsKPyx/P8FMi2W6NqFml69e2Qhc9m9NcF/fU6+s3OaXuaFLQM01I0+eQmvVCYiYueMQSWBN80=
X-Amzn-Requestid: 7f72891d-50a2-4cfa-8357-b6bec7c46f22

{"codSettings":{"codCharge":{"currencyCode":"USD","value":"10.00"},"codChargeTax":{"currencyCode":"USD","value":"2.00"},"isCodRequired":false,"shippingCharge":{"currencyCode":"USD","value":"5.00"},"shippingChargeTax":{"currencyCode":"USD","value":"3.00"}},"destinationAddress":{"addressLine1":"1234 Amazon Way","addressLine2":"Suite 123","addressLine3":"Lane1","countryCode":"US","districtOrCounty":"","name":"Amazon","stateOrRegion":"MI"},"displayableOrderComment":"TestOrder","displayableOrderDate":"2020-01-09T19:46:45.809Z","displayableOrderId":"TestOrder-FBAOutbound","fulfillmentAction":"Ship","items":[{"quantity":3,"sellerFulfillmentOrderItemId":"OrderItemID1","sellerSku":"CR-47K6-H6QN"},{"quantity":1,"sellerFulfillmentOrderItemId":"OrderItemID2","sellerSku":"PSMM-TEST-SKU-Jan-21_19_59_44-0738"}],"marketplaceId":"ATVPDKIKX0DER","notificationEmails":["test1%40amazon.com","test2%40amazon.com"],"sellerFulfillmentOrderId":"FBATestOrder-1","shippingSpeedCategory":"Standard"}

Response:
err 400 Bad Request

Code:

func (s service) CreateOrder(request fbaOutbound.CreateFulfillmentOrderJSONRequestBody) error {
	ctx := context.Background()
	order, err := s.amazonService.CreateFulfillmentOrderWithResponse(ctx, request)
	if err != nil {
		log.Println("err", err)
		return err
	}
	log.Println("order", order)
	return nil
}

go-sdk-codegen

hello, i googled " go-sdk-codegen" found nothing. What tool did u use to make this project? i wanna learn and use it on listings service sp-api. thank you

可否分享一下生成API代码的工具?

你好,请问是如何通过json文件生成代码库中的代码模版的?我觉得十分简洁,清爽,可否分享一下工具?或者有什么学习途径吗?作为菜鸟十分好奇,感激!

There are APIs where ResponseAfter is not called

Hello, thank you for the useful SDK.
I think there may be some APIs where ResponseAfter is not called.

example 1: https://github.com/amzapi/selling-partner-api-sdk/blob/master/fees/api.gen.go#L179

func (c *Client) GetMyFeesEstimateForASIN(ctx context.Context, asin string, body GetMyFeesEstimateForASINJSONRequestBody) (*http.Response, error) {
	req, err := NewGetMyFeesEstimateForASINRequest(c.Endpoint, asin, body)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if c.RequestBefore != nil {
		err = c.RequestBefore(ctx, req)
		if err != nil {
			return nil, err
		}
	}
	return c.Client.Do(req)
}

example 2: https://github.com/amzapi/selling-partner-api-sdk/blob/master/fbaOutbound/api.gen.go#L373

func (c *Client) GetFulfillmentPreview(ctx context.Context, body GetFulfillmentPreviewJSONRequestBody) (*http.Response, error) {
	req, err := NewGetFulfillmentPreviewRequest(c.Endpoint, body)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if c.RequestBefore != nil {
		err = c.RequestBefore(ctx, req)
		if err != nil {
			return nil, err
		}
	}
	return c.Client.Do(req)
}

I don't know why this happens because I think the code is automatically generated, but I think these are not the your intended implementation.
Please let me know if there is anything I can do to help fix it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.