Skip to content

ingrammicro-xvantage/xi-sdk-resellers-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go API client for xi_sdk_resellers

For resellers seeking to innovate with Ingram Micro's API solutions, automate your eCommerce experience with our array of API's and webhooks to craft a seamless journey for your customers.

Installation

To install the package use:

go get -u github.com/ingrammicro-xvantage/xi-sdk-resellers-go

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import xi_sdk_resellers "github.com/ingrammicro-xvantage/xi-sdk-resellers-go"

To use a proxy, set the environment variable `HTTP_PROXY`:

```go
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value xi_sdk_resellers.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), xi_sdk_resellers.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value xi_sdk_resellers.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), xi_sdk_resellers.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using xi_sdk_resellers.ContextOperationServerIndices and xi_sdk_resellers.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), xi_sdk_resellers.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), xi_sdk_resellers.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Getting Started

Quickstart on creating an application can be found here

Documentation for API Endpoints

All URIs are relative to https://api.ingrammicro.com:443

Class Method HTTP request Description
AccesstokenAPI GetAccesstoken Get /oauth/oauth20/token Accesstoken
AsyncOrderCreateAPI PostAsyncOrderCreateV7 Post /resellers/v7/orders Async Order Create
DealsAPI GetResellersV6Dealsdetails Get /resellers/v6/deals/{dealId} Deals Details
DealsAPI GetResellersV6Dealssearch Get /resellers/v6/deals/search Deals Search
FreightEstimateAPI PostFreightestimate Post /resellers/v6/freightestimate Freight Estimate
InvoicesAPI GetInvoicedetailsV61 Get /resellers/v6.1/invoices/{invoiceNumber} Get Invoice Details v6.1
InvoicesAPI GetResellersV6Invoicesearch Get /resellers/v6/invoices Search your invoice
OrderStatusAPI ResellersV1WebhooksOrderstatuseventPost Post /resellers/v1/webhooks/orderstatusevent Order Status
OrdersAPI DeleteOrdercancel Delete /resellers/v6/orders/{OrderNumber} Cancel your Order
OrdersAPI GetOrderdetailsV61 Get /resellers/v6.1/orders/{ordernumber} Get Order Details v6.1
OrdersAPI GetResellersV6Ordersearch Get /resellers/v6/orders/search Search your Orders
OrdersAPI PostCreateorderV6 Post /resellers/v6/orders Create your Order
OrdersAPI PutOrdermodify Put /resellers/v6/orders/{orderNumber} Modify your Order
ProductCatalogAPI GetResellerV6Productdetail Get /resellers/v6/catalog/details/{ingramPartNumber} Product Details
ProductCatalogAPI GetResellerV6Productsearch Get /resellers/v6/catalog Search Products
ProductCatalogAPI PostPriceandavailability Post /resellers/v6/catalog/priceandavailability Price and Availability
QuotesAPI GetQuotessearchV6 Get /resellers/v6/quotes/search Quote Search
QuotesAPI GetResellerV6ValidateQuote Get /resellers/v6/q2o/validatequote Validate Quote
QuotesAPI GetResellersV6Quotes Get /resellers/v6/quotes/{quoteNumber} Get Quote Details
RenewalsAPI GetResellersV6Renewalsdetails Get /resellers/v6/renewals/{renewalId} Renewals Details
RenewalsAPI PostRenewalssearch Post /resellers/v6/renewals/search Renewals Search
ReturnsAPI GetResellersV6Returnsdetails Get /resellers/v6/returns/{caseRequestNumber} Returns Details
ReturnsAPI GetResellersV6Returnssearch Get /resellers/v6/returns/search Returns Search
ReturnsAPI PostReturnscreate Post /resellers/v6/returns/create Returns Create
StockUpdateAPI ResellersV1WebhooksAvailabilityupdatePost Post /resellers/v1/webhooks/availabilityupdate Stock Update

Documentation For Models

Documentation for Authorization

Authentication schemes defined for the API:

application

Example

auth := context.WithValue(context.Background(), xi_sdk_resellers.ContextAccessToken, "ACCESSTOKENSTRING")
r, err := client.Service.Operation(auth, args)

Or via OAuth2 module to automatically refresh tokens and perform user authentication.

import "golang.org/x/oauth2"

/* Perform OAuth2 round trip request and obtain a token */

tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token)
auth := context.WithValue(oauth2.NoContext, xi_sdk_resellers.ContextOAuth2, tokenSource)
r, err := client.Service.Operation(auth, args)

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author

-Ingram Micro Xvantage

Contact

For any inquiries or support, please feel free to contact us at:

<<<<<<< HEAD

=======

main