Skip to content

Latest commit

 

History

History
760 lines (723 loc) · 59.3 KB

README.md

File metadata and controls

760 lines (723 loc) · 59.3 KB

Org.OpenAPITools - the C# library for the API2Cart OpenAPI

API2Cart

This C# SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.1
  • SDK version: 1.0.0
  • Generator version: 7.11.0
  • Build package: org.openapitools.codegen.languages.CSharpClientCodegen

Frameworks supported

Dependencies

The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:

Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742. NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See RestSharp#1406.

Installation

Run the following command to generate the DLL

  • [Mac/Linux] /bin/sh build.sh
  • [Windows] build.bat

Then include the DLL (under the bin folder) in the C# project, and use the namespaces:

using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

Packaging

A .nuspec is included with the project. You can follow the Nuget quickstart to create and publish packages.

This .nuspec uses placeholders from the .csproj, so build the .csproj directly:

nuget pack -Build -OutputDirectory out Org.OpenAPITools.csproj

Then, publish to a local feed or other host and consume the new package via Nuget as usual.

Usage

To use the API client with a HTTP proxy, setup a System.Net.WebProxy

Configuration c = new Configuration();
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
c.Proxy = webProxy;

Getting Started

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class Example
    {
        public static void Main()
        {

            Configuration config = new Configuration();
            config.BasePath = "https://api.api2cart.com/v1.1";
            // Configure API key authorization: ApiKeyAuth
            config.ApiKey.Add("x-api-key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.ApiKeyPrefix.Add("x-api-key", "Bearer");

            var apiInstance = new AccountApi(config);
            var accountCartAdd = new AccountCartAdd(); // AccountCartAdd | 

            try
            {
                // account.cart.add
                AccountCartAdd200Response result = apiInstance.AccountCartAdd(accountCartAdd);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling AccountApi.AccountCartAdd: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }

        }
    }
}

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

StoreKeyAuth

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