seller-partner-api-sdk

module
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2026 License: MIT

README

seller-partner-api-sdk

amazon seller partner api by golang

Getting Started

package main

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

	"github.com/aws/aws-sdk-go-v2/aws"
	"github.com/aws/smithy-go/logging"
	"github.com/google/uuid"
	order "github.com/oh0123/seller-partner-api-sdk/codegen/ordersv0"
	sign "github.com/oh0123/seller-partner-api-sdk/pkg/sign"
)

func main() {
	cfg := sign.SignConfig{
		AccessKeyID: "XXXX",
		SecretKey:   "XXXX",
		Region:      "XXXX",
		RoleArn:     "XXXX",
		MaxRetry:    1,
		LogMode:     []aws.ClientLogMode{},
		Logger:      logging.Nop{},
	}

	signer := sign.NewSigner(cfg)

	endpoint := "XXXX"

	reqEditor := order.WithRequestEditorFn(func(ctx context.Context, req *http.Request) error {
		req.Header.Add("X-Amzn-Requestid", uuid.New().String())
		if err := signer.Sign(req); err != nil {
			return fmt.Errorf("sign error: %s", err)
		}
		dump, err := httputil.DumpRequest(req, true)
		if err != nil {
			return fmt.Errorf("dump request error: %s", err)
		}
		log.Printf("DumpRequest = %s", dump)
		return nil
	})

	rsqEditor := order.WithResponseEditorFn(func(ctx context.Context, rsp *http.Response) error {
		dump, err := httputil.DumpResponse(rsp, true)
		if err != nil {
			return fmt.Errorf("dump response error: %s", err)
		}
		log.Printf("DumpResponse = %s", dump)
		return nil
	})

	client, err := order.NewClientWithResponses(endpoint, reqEditor, rsqEditor)
	if err != nil {
		log.Fatal(err)
	}

	p := order.GetOrdersParams{
		MarketplaceIds: []string{"XXXX"},
	}

	response, err := client.GetOrdersWithResponse(context.Background(), &p)
	if err != nil {
		log.Fatal(err)
	}
	log.Println(response.HTTPResponse.StatusCode)
}

Directories

Path Synopsis
codegen
InvoicesApiModel20240619
Package InvoicesApiModel20240619 provides primitives to interact with the openapi HTTP API.
Package InvoicesApiModel20240619 provides primitives to interact with the openapi HTTP API.
aplusContent20201101
Package aplusContent20201101 provides primitives to interact with the openapi HTTP API.
Package aplusContent20201101 provides primitives to interact with the openapi HTTP API.
appIntegrations20240401
Package appIntegrations20240401 provides primitives to interact with the openapi HTTP API.
Package appIntegrations20240401 provides primitives to interact with the openapi HTTP API.
application20231130
Package application20231130 provides primitives to interact with the openapi HTTP API.
Package application20231130 provides primitives to interact with the openapi HTTP API.
awd20240509
Package awd20240509 provides primitives to interact with the openapi HTTP API.
Package awd20240509 provides primitives to interact with the openapi HTTP API.
catalogItems20201201
Package catalogItems20201201 provides primitives to interact with the openapi HTTP API.
Package catalogItems20201201 provides primitives to interact with the openapi HTTP API.
catalogItems20220401
Package catalogItems20220401 provides primitives to interact with the openapi HTTP API.
Package catalogItems20220401 provides primitives to interact with the openapi HTTP API.
catalogItemsV0
Package catalogItemsV0 provides primitives to interact with the openapi HTTP API.
Package catalogItemsV0 provides primitives to interact with the openapi HTTP API.
customerFeedback20240601
Package customerFeedback20240601 provides primitives to interact with the openapi HTTP API.
Package customerFeedback20240601 provides primitives to interact with the openapi HTTP API.
dataKiosk20231115
Package dataKiosk20231115 provides primitives to interact with the openapi HTTP API.
Package dataKiosk20231115 provides primitives to interact with the openapi HTTP API.
definitionsProductTypes20200901
Package definitionsProductTypes20200901 provides primitives to interact with the openapi HTTP API.
Package definitionsProductTypes20200901 provides primitives to interact with the openapi HTTP API.
deliveryShipmentInvoiceV20220701
Package deliveryShipmentInvoiceV20220701 provides primitives to interact with the openapi HTTP API.
Package deliveryShipmentInvoiceV20220701 provides primitives to interact with the openapi HTTP API.
easyShip20220323
Package easyShip20220323 provides primitives to interact with the openapi HTTP API.
Package easyShip20220323 provides primitives to interact with the openapi HTTP API.
externalFulfillmentInventory20240911
Package externalFulfillmentInventory20240911 provides primitives to interact with the openapi HTTP API.
Package externalFulfillmentInventory20240911 provides primitives to interact with the openapi HTTP API.
externalFulfillmentReturns20240911
Package externalFulfillmentReturns20240911 provides primitives to interact with the openapi HTTP API.
Package externalFulfillmentReturns20240911 provides primitives to interact with the openapi HTTP API.
externalFulfillmentShipments20240911
Package externalFulfillmentShipments20240911 provides primitives to interact with the openapi HTTP API.
Package externalFulfillmentShipments20240911 provides primitives to interact with the openapi HTTP API.
fbaInbound
Package fbaInbound provides primitives to interact with the openapi HTTP API.
Package fbaInbound provides primitives to interact with the openapi HTTP API.
fbaInventory
Package fbaInventory provides primitives to interact with the openapi HTTP API.
Package fbaInventory provides primitives to interact with the openapi HTTP API.
feeds20210630
Package feeds20210630 provides primitives to interact with the openapi HTTP API.
Package feeds20210630 provides primitives to interact with the openapi HTTP API.
finances20240619
Package finances20240619 provides primitives to interact with the openapi HTTP API.
Package finances20240619 provides primitives to interact with the openapi HTTP API.
financesv0
Package financesV0 provides primitives to interact with the openapi HTTP API.
Package financesV0 provides primitives to interact with the openapi HTTP API.
fulfillmentInbound20240320
Package fulfillmentInbound20240320 provides primitives to interact with the openapi HTTP API.
Package fulfillmentInbound20240320 provides primitives to interact with the openapi HTTP API.
fulfillmentInboundv0
Package fulfillmentInboundV0 provides primitives to interact with the openapi HTTP API.
Package fulfillmentInboundV0 provides primitives to interact with the openapi HTTP API.
fulfillmentOutbound20200701
Package fulfillmentOutbound20200701 provides primitives to interact with the openapi HTTP API.
Package fulfillmentOutbound20200701 provides primitives to interact with the openapi HTTP API.
listingsItems20200901
Package listingsItems20200901 provides primitives to interact with the openapi HTTP API.
Package listingsItems20200901 provides primitives to interact with the openapi HTTP API.
listingsItems20210801
Package listingsItems20210801 provides primitives to interact with the openapi HTTP API.
Package listingsItems20210801 provides primitives to interact with the openapi HTTP API.
listingsRestrictions20210801
Package listingsRestrictions20210801 provides primitives to interact with the openapi HTTP API.
Package listingsRestrictions20210801 provides primitives to interact with the openapi HTTP API.
merchantFulfillmentv0
Package merchantFulfillmentV0 provides primitives to interact with the openapi HTTP API.
Package merchantFulfillmentV0 provides primitives to interact with the openapi HTTP API.
messaging
Package messaging provides primitives to interact with the openapi HTTP API.
Package messaging provides primitives to interact with the openapi HTTP API.
notifications
Package notifications provides primitives to interact with the openapi HTTP API.
Package notifications provides primitives to interact with the openapi HTTP API.
orders20260101
Package orders20260101 provides primitives to interact with the openapi HTTP API.
Package orders20260101 provides primitives to interact with the openapi HTTP API.
ordersv0
Package ordersV0 provides primitives to interact with the openapi HTTP API.
Package ordersV0 provides primitives to interact with the openapi HTTP API.
productFeesv0
Package productFeesV0 provides primitives to interact with the openapi HTTP API.
Package productFeesV0 provides primitives to interact with the openapi HTTP API.
productPricing20220501
Package productPricing20220501 provides primitives to interact with the openapi HTTP API.
Package productPricing20220501 provides primitives to interact with the openapi HTTP API.
productPricingV0
Package productPricingV0 provides primitives to interact with the openapi HTTP API.
Package productPricingV0 provides primitives to interact with the openapi HTTP API.
replenishment20221107
Package replenishment20221107 provides primitives to interact with the openapi HTTP API.
Package replenishment20221107 provides primitives to interact with the openapi HTTP API.
reports20210630
Package reports20210630 provides primitives to interact with the openapi HTTP API.
Package reports20210630 provides primitives to interact with the openapi HTTP API.
sales
Package sales provides primitives to interact with the openapi HTTP API.
Package sales provides primitives to interact with the openapi HTTP API.
sellerWallet20240301
Package sellerWallet20240301 provides primitives to interact with the openapi HTTP API.
Package sellerWallet20240301 provides primitives to interact with the openapi HTTP API.
sellers
Package sellers provides primitives to interact with the openapi HTTP API.
Package sellers provides primitives to interact with the openapi HTTP API.
services
Package services provides primitives to interact with the openapi HTTP API.
Package services provides primitives to interact with the openapi HTTP API.
shipmentInvoicingv0
Package shipmentInvoicingV0 provides primitives to interact with the openapi HTTP API.
Package shipmentInvoicingV0 provides primitives to interact with the openapi HTTP API.
shipping
Package shipping provides primitives to interact with the openapi HTTP API.
Package shipping provides primitives to interact with the openapi HTTP API.
shippingv2
Package shippingV2 provides primitives to interact with the openapi HTTP API.
Package shippingV2 provides primitives to interact with the openapi HTTP API.
solicitations
Package solicitations provides primitives to interact with the openapi HTTP API.
Package solicitations provides primitives to interact with the openapi HTTP API.
supplySources20200701
Package supplySources20200701 provides primitives to interact with the openapi HTTP API.
Package supplySources20200701 provides primitives to interact with the openapi HTTP API.
tokens20210301
Package tokens20210301 provides primitives to interact with the openapi HTTP API.
Package tokens20210301 provides primitives to interact with the openapi HTTP API.
transfers20240601
Package transfers20240601 provides primitives to interact with the openapi HTTP API.
Package transfers20240601 provides primitives to interact with the openapi HTTP API.
uploads20201101
Package uploads20201101 provides primitives to interact with the openapi HTTP API.
Package uploads20201101 provides primitives to interact with the openapi HTTP API.
vehicles20241101
Package vehicles20241101 provides primitives to interact with the openapi HTTP API.
Package vehicles20241101 provides primitives to interact with the openapi HTTP API.
vendorDirectFulfillmentInventoryV1
Package vendorDirectFulfillmentInventoryV1 provides primitives to interact with the openapi HTTP API.
Package vendorDirectFulfillmentInventoryV1 provides primitives to interact with the openapi HTTP API.
vendorDirectFulfillmentOrders20211228
Package vendorDirectFulfillmentOrders20211228 provides primitives to interact with the openapi HTTP API.
Package vendorDirectFulfillmentOrders20211228 provides primitives to interact with the openapi HTTP API.
vendorDirectFulfillmentOrdersV1
Package vendorDirectFulfillmentOrdersV1 provides primitives to interact with the openapi HTTP API.
Package vendorDirectFulfillmentOrdersV1 provides primitives to interact with the openapi HTTP API.
vendorDirectFulfillmentPaymentsV1
Package vendorDirectFulfillmentPaymentsV1 provides primitives to interact with the openapi HTTP API.
Package vendorDirectFulfillmentPaymentsV1 provides primitives to interact with the openapi HTTP API.
vendorDirectFulfillmentSandboxData20211028
Package vendorDirectFulfillmentSandboxData20211028 provides primitives to interact with the openapi HTTP API.
Package vendorDirectFulfillmentSandboxData20211028 provides primitives to interact with the openapi HTTP API.
vendorDirectFulfillmentShipping20211228
Package vendorDirectFulfillmentShipping20211228 provides primitives to interact with the openapi HTTP API.
Package vendorDirectFulfillmentShipping20211228 provides primitives to interact with the openapi HTTP API.
vendorDirectFulfillmentShippingV1
Package vendorDirectFulfillmentShippingV1 provides primitives to interact with the openapi HTTP API.
Package vendorDirectFulfillmentShippingV1 provides primitives to interact with the openapi HTTP API.
vendorDirectFulfillmentTransactions20211228
Package vendorDirectFulfillmentTransactions20211228 provides primitives to interact with the openapi HTTP API.
Package vendorDirectFulfillmentTransactions20211228 provides primitives to interact with the openapi HTTP API.
vendorDirectFulfillmentTransactionsV1
Package vendorDirectFulfillmentTransactionsV1 provides primitives to interact with the openapi HTTP API.
Package vendorDirectFulfillmentTransactionsV1 provides primitives to interact with the openapi HTTP API.
vendorInvoices
Package vendorInvoices provides primitives to interact with the openapi HTTP API.
Package vendorInvoices provides primitives to interact with the openapi HTTP API.
vendorOrders
Package vendorOrders provides primitives to interact with the openapi HTTP API.
Package vendorOrders provides primitives to interact with the openapi HTTP API.
vendorShipments
Package vendorShipments provides primitives to interact with the openapi HTTP API.
Package vendorShipments provides primitives to interact with the openapi HTTP API.
vendorTransactionStatus
Package vendorTransactionStatus provides primitives to interact with the openapi HTTP API.
Package vendorTransactionStatus provides primitives to interact with the openapi HTTP API.
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL