Skip to content

API2Cart SDK for go makes it easy to interact with API2Cart API from your go application and build a robust integration with eCommerce platforms

Notifications You must be signed in to change notification settings

api2cart/go-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go API client for openapi

API2Cart

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 1.1
  • Package version: 1.0.0
  • Generator version: 7.11.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen

Installation

Install the following dependencies:

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

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

import openapi "github.com/GIT_USER_ID/GIT_REPO_ID"

To use a proxy, set the environment variable HTTP_PROXY:

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 openapi.ContextServerIndex of type int.

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

Templated Server URL

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

ctx := context.WithValue(context.Background(), openapi.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 openapi.ContextOperationServerIndices and openapi.ContextOperationServerVariables context maps.

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

Documentation for API Endpoints

All URIs are relative to https://api.api2cart.com/v1.1

Class Method HTTP request Description
AccountAPI AccountCartAdd Post /account.cart.add.json account.cart.add
AccountAPI AccountCartList Get /account.cart.list.json account.cart.list
AccountAPI AccountConfigUpdate Put /account.config.update.json account.config.update
AccountAPI AccountFailedWebhooks Get /account.failed_webhooks.json account.failed_webhooks
AccountAPI AccountSupportedPlatforms Get /account.supported_platforms.json account.supported_platforms
AttributeAPI AttributeAdd Post /attribute.add.json attribute.add
AttributeAPI AttributeAssignGroup Post /attribute.assign.group.json attribute.assign.group
AttributeAPI AttributeAssignSet Post /attribute.assign.set.json attribute.assign.set
AttributeAPI AttributeAttributesetList Get /attribute.attributeset.list.json attribute.attributeset.list
AttributeAPI AttributeCount Get /attribute.count.json attribute.count
AttributeAPI AttributeDelete Delete /attribute.delete.json attribute.delete
AttributeAPI AttributeGroupList Get /attribute.group.list.json attribute.group.list
AttributeAPI AttributeInfo Get /attribute.info.json attribute.info
AttributeAPI AttributeList Get /attribute.list.json attribute.list
AttributeAPI AttributeTypeList Get /attribute.type.list.json attribute.type.list
AttributeAPI AttributeUnassignGroup Post /attribute.unassign.group.json attribute.unassign.group
AttributeAPI AttributeUnassignSet Post /attribute.unassign.set.json attribute.unassign.set
AttributeAPI AttributeUpdate Put /attribute.update.json attribute.update
AttributeAPI AttributeValueAdd Post /attribute.value.add.json attribute.value.add
AttributeAPI AttributeValueDelete Delete /attribute.value.delete.json attribute.value.delete
AttributeAPI AttributeValueUpdate Put /attribute.value.update.json attribute.value.update
BasketAPI BasketInfo Get /basket.info.json basket.info
BasketAPI BasketItemAdd Post /basket.item.add.json basket.item.add
BasketAPI BasketLiveShippingServiceCreate Post /basket.live_shipping_service.create.json basket.live_shipping_service.create
BasketAPI BasketLiveShippingServiceDelete Delete /basket.live_shipping_service.delete.json basket.live_shipping_service.delete
BasketAPI BasketLiveShippingServiceList Get /basket.live_shipping_service.list.json basket.live_shipping_service.list
BatchAPI BatchJobList Get /batch.job.list.json batch.job.list
BatchAPI BatchJobResult Get /batch.job.result.json batch.job.result
BridgeAPI BridgeDelete Post /bridge.delete.json bridge.delete
BridgeAPI BridgeDownload Get /bridge.download.file bridge.download
BridgeAPI BridgeUpdate Post /bridge.update.json bridge.update
CartAPI CartBridge Get /cart.bridge.json cart.bridge
CartAPI CartCatalogPriceRulesCount Get /cart.catalog_price_rules.count.json cart.catalog_price_rules.count
CartAPI CartCatalogPriceRulesList Get /cart.catalog_price_rules.list.json cart.catalog_price_rules.list
CartAPI CartClearCache Post /cart.clear_cache.json cart.clear_cache
CartAPI CartConfig Get /cart.config.json cart.config
CartAPI CartConfigUpdate Put /cart.config.update.json cart.config.update
CartAPI CartCouponAdd Post /cart.coupon.add.json cart.coupon.add
CartAPI CartCouponConditionAdd Post /cart.coupon.condition.add.json cart.coupon.condition.add
CartAPI CartCouponCount Get /cart.coupon.count.json cart.coupon.count
CartAPI CartCouponDelete Delete /cart.coupon.delete.json cart.coupon.delete
CartAPI CartCouponList Get /cart.coupon.list.json cart.coupon.list
CartAPI CartCreate Post /cart.create.json cart.create
CartAPI CartDelete Delete /cart.delete.json cart.delete
CartAPI CartDisconnect Get /cart.disconnect.json cart.disconnect
CartAPI CartGiftcardAdd Post /cart.giftcard.add.json cart.giftcard.add
CartAPI CartGiftcardCount Get /cart.giftcard.count.json cart.giftcard.count
CartAPI CartGiftcardDelete Delete /cart.giftcard.delete.json cart.giftcard.delete
CartAPI CartGiftcardList Get /cart.giftcard.list.json cart.giftcard.list
CartAPI CartInfo Get /cart.info.json cart.info
CartAPI CartList Get /cart.list.json cart.list
CartAPI CartMetaDataList Get /cart.meta_data.list.json cart.meta_data.list
CartAPI CartMetaDataSet Post /cart.meta_data.set.json cart.meta_data.set
CartAPI CartMetaDataUnset Delete /cart.meta_data.unset.json cart.meta_data.unset
CartAPI CartMethods Get /cart.methods.json cart.methods
CartAPI CartPluginList Get /cart.plugin.list.json cart.plugin.list
CartAPI CartScriptAdd Post /cart.script.add.json cart.script.add
CartAPI CartScriptDelete Delete /cart.script.delete.json cart.script.delete
CartAPI CartScriptList Get /cart.script.list.json cart.script.list
CartAPI CartShippingZonesList Get /cart.shipping_zones.list.json cart.shipping_zones.list
CartAPI CartValidate Get /cart.validate.json cart.validate
CategoryAPI CategoryAdd Post /category.add.json category.add
CategoryAPI CategoryAddBatch Post /category.add.batch.json category.add.batch
CategoryAPI CategoryAssign Post /category.assign.json category.assign
CategoryAPI CategoryCount Get /category.count.json category.count
CategoryAPI CategoryDelete Delete /category.delete.json category.delete
CategoryAPI CategoryFind Get /category.find.json category.find
CategoryAPI CategoryImageAdd Post /category.image.add.json category.image.add
CategoryAPI CategoryImageDelete Delete /category.image.delete.json category.image.delete
CategoryAPI CategoryInfo Get /category.info.json category.info
CategoryAPI CategoryList Get /category.list.json category.list
CategoryAPI CategoryUnassign Post /category.unassign.json category.unassign
CategoryAPI CategoryUpdate Put /category.update.json category.update
CustomerAPI CustomerAdd Post /customer.add.json customer.add
CustomerAPI CustomerAddressAdd Post /customer.address.add.json customer.address.add
CustomerAPI CustomerAttributeList Get /customer.attribute.list.json customer.attribute.list
CustomerAPI CustomerCount Get /customer.count.json customer.count
CustomerAPI CustomerDelete Delete /customer.delete.json customer.delete
CustomerAPI CustomerFind Get /customer.find.json customer.find
CustomerAPI CustomerGroupAdd Post /customer.group.add.json customer.group.add
CustomerAPI CustomerGroupList Get /customer.group.list.json customer.group.list
CustomerAPI CustomerInfo Get /customer.info.json customer.info
CustomerAPI CustomerList Get /customer.list.json customer.list
CustomerAPI CustomerUpdate Put /customer.update.json customer.update
CustomerAPI CustomerWishlistList Get /customer.wishlist.list.json customer.wishlist.list
MarketplaceAPI MarketplaceProductFind Get /marketplace.product.find.json marketplace.product.find
OrderAPI OrderAbandonedList Get /order.abandoned.list.json order.abandoned.list
OrderAPI OrderAdd Post /order.add.json order.add
OrderAPI OrderCount Get /order.count.json order.count
OrderAPI OrderFinancialStatusList Get /order.financial_status.list.json order.financial_status.list
OrderAPI OrderFind Get /order.find.json order.find
OrderAPI OrderFulfillmentStatusList Get /order.fulfillment_status.list.json order.fulfillment_status.list
OrderAPI OrderInfo Get /order.info.json order.info
OrderAPI OrderList Get /order.list.json order.list
OrderAPI OrderPreestimateShippingList Post /order.preestimate_shipping.list.json order.preestimate_shipping.list
OrderAPI OrderRefundAdd Post /order.refund.add.json order.refund.add
OrderAPI OrderReturnAdd Post /order.return.add.json order.return.add
OrderAPI OrderReturnDelete Delete /order.return.delete.json order.return.delete
OrderAPI OrderReturnUpdate Put /order.return.update.json order.return.update
OrderAPI OrderShipmentAdd Post /order.shipment.add.json order.shipment.add
OrderAPI OrderShipmentAddBatch Post /order.shipment.add.batch.json order.shipment.add.batch
OrderAPI OrderShipmentDelete Delete /order.shipment.delete.json order.shipment.delete
OrderAPI OrderShipmentInfo Get /order.shipment.info.json order.shipment.info
OrderAPI OrderShipmentList Get /order.shipment.list.json order.shipment.list
OrderAPI OrderShipmentTrackingAdd Post /order.shipment.tracking.add.json order.shipment.tracking.add
OrderAPI OrderShipmentUpdate Put /order.shipment.update.json order.shipment.update
OrderAPI OrderStatusList Get /order.status.list.json order.status.list
OrderAPI OrderTransactionList Get /order.transaction.list.json order.transaction.list
OrderAPI OrderUpdate Put /order.update.json order.update
ProductAPI ProductAdd Post /product.add.json product.add
ProductAPI ProductAddBatch Post /product.add.batch.json product.add.batch
ProductAPI ProductAttributeList Get /product.attribute.list.json product.attribute.list
ProductAPI ProductAttributeValueSet Post /product.attribute.value.set.json product.attribute.value.set
ProductAPI ProductAttributeValueUnset Post /product.attribute.value.unset.json product.attribute.value.unset
ProductAPI ProductBrandList Get /product.brand.list.json product.brand.list
ProductAPI ProductChildItemFind Get /product.child_item.find.json product.child_item.find
ProductAPI ProductChildItemInfo Get /product.child_item.info.json product.child_item.info
ProductAPI ProductChildItemList Get /product.child_item.list.json product.child_item.list
ProductAPI ProductCount Get /product.count.json product.count
ProductAPI ProductCurrencyAdd Post /product.currency.add.json product.currency.add
ProductAPI ProductCurrencyList Get /product.currency.list.json product.currency.list
ProductAPI ProductDelete Delete /product.delete.json product.delete
ProductAPI ProductDeleteBatch Post /product.delete.batch.json product.delete.batch
ProductAPI ProductFields Get /product.fields.json product.fields
ProductAPI ProductFind Get /product.find.json product.find
ProductAPI ProductImageAdd Post /product.image.add.json product.image.add
ProductAPI ProductImageDelete Delete /product.image.delete.json product.image.delete
ProductAPI ProductImageUpdate Put /product.image.update.json product.image.update
ProductAPI ProductInfo Get /product.info.json product.info
ProductAPI ProductList Get /product.list.json product.list
ProductAPI ProductManufacturerAdd Post /product.manufacturer.add.json product.manufacturer.add
ProductAPI ProductOptionAdd Post /product.option.add.json product.option.add
ProductAPI ProductOptionAssign Post /product.option.assign.json product.option.assign
ProductAPI ProductOptionDelete Delete /product.option.delete.json product.option.delete
ProductAPI ProductOptionList Get /product.option.list.json product.option.list
ProductAPI ProductOptionValueAdd Post /product.option.value.add.json product.option.value.add
ProductAPI ProductOptionValueAssign Post /product.option.value.assign.json product.option.value.assign
ProductAPI ProductOptionValueDelete Delete /product.option.value.delete.json product.option.value.delete
ProductAPI ProductOptionValueUpdate Put /product.option.value.update.json product.option.value.update
ProductAPI ProductPriceAdd Post /product.price.add.json product.price.add
ProductAPI ProductPriceDelete Delete /product.price.delete.json product.price.delete
ProductAPI ProductPriceUpdate Put /product.price.update.json product.price.update
ProductAPI ProductReviewList Get /product.review.list.json product.review.list
ProductAPI ProductStoreAssign Post /product.store.assign.json product.store.assign
ProductAPI ProductTaxAdd Post /product.tax.add.json product.tax.add
ProductAPI ProductUpdate Put /product.update.json product.update
ProductAPI ProductUpdateBatch Post /product.update.batch.json product.update.batch
ProductAPI ProductVariantAdd Post /product.variant.add.json product.variant.add
ProductAPI ProductVariantAddBatch Post /product.variant.add.batch.json product.variant.add.batch
ProductAPI ProductVariantCount Get /product.variant.count.json product.variant.count
ProductAPI ProductVariantDelete Delete /product.variant.delete.json product.variant.delete
ProductAPI ProductVariantDeleteBatch Post /product.variant.delete.batch.json product.variant.delete.batch
ProductAPI ProductVariantImageAdd Post /product.variant.image.add.json product.variant.image.add
ProductAPI ProductVariantImageDelete Delete /product.variant.image.delete.json product.variant.image.delete
ProductAPI ProductVariantInfo Get /product.variant.info.json product.variant.info
ProductAPI ProductVariantList Get /product.variant.list.json product.variant.list
ProductAPI ProductVariantPriceAdd Post /product.variant.price.add.json product.variant.price.add
ProductAPI ProductVariantPriceDelete Delete /product.variant.price.delete.json product.variant.price.delete
ProductAPI ProductVariantPriceUpdate Put /product.variant.price.update.json product.variant.price.update
ProductAPI ProductVariantUpdate Put /product.variant.update.json product.variant.update
ProductAPI ProductVariantUpdateBatch Post /product.variant.update.batch.json product.variant.update.batch
ReturnAPI ReturnActionList Get /return.action.list.json return.action.list
ReturnAPI ReturnCount Get /return.count.json return.count
ReturnAPI ReturnInfo Get /return.info.json return.info
ReturnAPI ReturnList Get /return.list.json return.list
ReturnAPI ReturnReasonList Get /return.reason.list.json return.reason.list
ReturnAPI ReturnStatusList Get /return.status.list.json return.status.list
SubscriberAPI SubscriberList Get /subscriber.list.json subscriber.list
TaxAPI TaxClassInfo Get /tax.class.info.json tax.class.info
TaxAPI TaxClassList Get /tax.class.list.json tax.class.list
WebhookAPI WebhookCount Get /webhook.count.json webhook.count
WebhookAPI WebhookCreate Post /webhook.create.json webhook.create
WebhookAPI WebhookDelete Delete /webhook.delete.json webhook.delete
WebhookAPI WebhookEvents Get /webhook.events.json webhook.events
WebhookAPI WebhookList Get /webhook.list.json webhook.list
WebhookAPI WebhookUpdate Put /webhook.update.json webhook.update

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

ApiKeyAuth

  • Type: API key
  • API key parameter name: x-api-key
  • Location: HTTP header

Note, each API key must be added to a map of map[string]APIKey where the key is: ApiKeyAuth and passed in as the auth context for each request.

Example

auth := context.WithValue(
		context.Background(),
		openapi.ContextAPIKeys,
		map[string]openapi.APIKey{
			"ApiKeyAuth": {Key: "API_KEY_STRING"},
		},
	)
r, err := client.Service.Operation(auth, args)

StoreKeyAuth

  • Type: API key
  • API key parameter name: x-store-key
  • Location: HTTP header

Note, each API key must be added to a map of map[string]APIKey where the key is: StoreKeyAuth and passed in as the auth context for each request.

Example

auth := context.WithValue(
		context.Background(),
		openapi.ContextAPIKeys,
		map[string]openapi.APIKey{
			"StoreKeyAuth": {Key: "API_KEY_STRING"},
		},
	)
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

contact@api2cart.com

About

API2Cart SDK for go makes it easy to interact with API2Cart API from your go application and build a robust integration with eCommerce platforms

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages