### Installing EbaySharp NuGet Package Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet demonstrates how to install the EbaySharp library using the PowerShell Package Manager Console in Visual Studio. It adds the necessary NuGet package to your project, enabling access to the eBay REST API wrapper. ```pwsh Install-Package CMS365.EbaySharp ``` -------------------------------- ### Getting eBay Category Suggestions using Taxonomy API in C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This C# example shows how to get category suggestions for a product title using the Taxonomy API. It takes a category tree ID and a product title as input, returning a CategorySuggestionsList object with relevant category recommendations. ```C# CategorySuggestionsList categorySuggestionsList = await ebayController.GetCategorySuggestions(15, "I am a table, look for me"); ``` -------------------------------- ### Getting All Signing Keys with EbaySharp in C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet illustrates how to fetch all available signing keys using the EbaySharp library. It initializes the EbayController with an access token and calls the GetSigningKeys method to retrieve a collection of signing keys. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); SigningKeys signingKeys = await ebayController.GetSigningKeys(); ``` -------------------------------- ### Getting Payout List with EbaySharp in C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet demonstrates how to retrieve a list of payouts using the EbaySharp library. It provides examples of calling the method with and without a signing key, and with a filter for payout status. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); PayoutList payoutList = await ebayController.GetPayouts(signingKey, "payoutStatus:{SUCCEEDED}"); ``` ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); PayoutList payoutList = await ebayController.GetPayouts("payoutStatus:{SUCCEEDED}"); ``` -------------------------------- ### Getting Payout Summary with EbaySharp in C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet shows how to retrieve a summary of payouts using the EbaySharp library. It includes examples of calling the method with and without a signing key, and with a date range filter for payouts. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); PayoutSummary payoutSummary = await ebayController.GetPayoutSummary(signingKey, "payoutDate:[2025-02-01T00:00:01.000Z..2025-03-20T00:00:01.000Z]"); ``` ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); PayoutSummary payoutSummary = await ebayController.GetPayoutSummary("payoutDate:[2025-02-01T00:00:01.000Z..2025-03-20T00:00:01.000Z]"); ``` -------------------------------- ### Ending Listing - Step 1: Get Offer and Set Quantity - EbaySharp - C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This is the first step in ending an eBay listing. It retrieves an existing offer by SKU and optionally sets its available quantity to zero, preparing it for withdrawal. ```C# Offers offers = await ebayController.GetOffers(SKU); Offer offer = offers.OfferList.FirstOrDefault(); offer.AvailableQuantity = 0; //optional ``` -------------------------------- ### Getting Transaction Summary with EbaySharp in C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet demonstrates how to retrieve a summary of financial transactions using the EbaySharp library. It provides examples of calling the method with and without a signing key, and with a filter for transaction status. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); TransactionSummary transactionSummary = await ebayController.GetTransactionSummary(signingKey, "transactionStatus:{PAYOUT}"); ``` ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); TransactionSummary transactionSummary = await ebayController.GetTransactionSummary("transactionStatus:{PAYOUT}"); ``` -------------------------------- ### Getting Rate Limits with EbaySharp in C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet demonstrates how to retrieve API rate limits using the EbaySharp library. It initializes the EbayController with an access token and then calls the GetRateLimits method to fetch the current rate limit information. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); RateLimits rateLimits = await ebayController.GetRateLimits(); ``` -------------------------------- ### Revising Listing - Step 2: Get Existing Offer - EbaySharp - C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This is the second step in revising an eBay listing. It retrieves existing offers associated with a product SKU and selects the first offer from the list for modification. ```C# Offers offers = await ebayController.GetOffers(product.SKU); Offer offer = offers.OfferList.FirstOrDefault(); ``` -------------------------------- ### Getting User Rate Limits with EbaySharp in C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet shows how to retrieve user-specific API rate limits using the EbaySharp library. It initializes the EbayController and then invokes the GetUserRateLimits method to obtain the user's rate limit details. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); RateLimits rateLimits = await ebayController.GetUserRateLimits(); ``` -------------------------------- ### Updating Active Listing - Step 2: Get Existing Offer - EbaySharp - C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This is the second step in updating an active eBay listing. It retrieves existing offers associated with a product SKU and selects the first offer from the list for modification. ```C# Offers offers = await ebayController.GetOffers(product.SKU); Offer offer = offers.OfferList.FirstOrDefault(); ``` -------------------------------- ### Getting a Specific Payout with EbaySharp in C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet shows how to retrieve details for a specific payout by its ID using the EbaySharp library. It includes examples of calling the method with and without a signing key, along with the payout ID. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); Payout payout = await ebayController.GetPayout(signingKey, 6801425208); ``` ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); Payout payout = await ebayController.GetPayout(6801425208); ``` -------------------------------- ### Getting a Specific Signing Key with EbaySharp in C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet demonstrates how to retrieve a specific signing key by its ID using the EbaySharp library. It initializes the EbayController and then calls the GetSigningKey method, passing the required signing key ID. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); SigningKeys signingKeys = await ebayController.GetSigningKey(string signinKeyId); ``` -------------------------------- ### Getting Transactions with EbaySharp in C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet illustrates how to retrieve financial transactions using the EbaySharp library. It shows two overloaded methods: one requiring a signing key for regulatory compliance and another without, depending on the context. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); Transactions transactions = await ebayController.GetTransactions(signingKey); ``` ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); Transactions transactions = await ebayController.GetTransactions(); ``` -------------------------------- ### Getting Orders by Order Numbers with EbaySharp in C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet demonstrates how to retrieve specific orders by providing an array of order numbers using the EbaySharp library. It initializes the EbayController and then calls GetOrders with the list of order IDs. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); Orders orders = await ebayController.GetOrders(new string[] { "ORDERNUMBER", "ORDERNUMBER" }); ``` -------------------------------- ### Getting All Shipping Fulfillments for an Order with EbaySharp in C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet demonstrates how to retrieve all shipping fulfillments associated with a specific order using the EbaySharp library. It initializes the EbayController and then calls GetShippingFulfillments, providing the order number. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); Fulfillments fulfillments = await ebayController.GetShippingFulfillments("Order Number"); ``` -------------------------------- ### Getting Default eBay Category Tree ID using Taxonomy API in C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This C# example shows how to obtain the default category tree ID for a given eBay marketplace. It takes the marketplace ID (e.g., 'EBAY_US') as input and returns a CategoryTreeId object, which can then be used for other Taxonomy API calls. ```C# CategoryTreeId categoryTreeId = await ebayController.GetDefaultCategoryTreeId("EBAY_US"); ``` -------------------------------- ### Getting a Specific Shipping Fulfillment with EbaySharp in C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet shows how to retrieve details for a specific shipping fulfillment by its ID and associated order number using the EbaySharp library. It initializes the EbayController and then calls GetShippingFulfillment. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); Fulfillment fulfillment = await ebayController.GetShippingFulfillment("Order Number", "Fulfillment Id"); ``` -------------------------------- ### Getting User Identity Details with EbaySharp in C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet demonstrates how to retrieve the current user's identity details using the EbaySharp library. It initializes the EbayController with an access token and then calls the GetUser method to fetch user information. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); User user = await ebayController.GetUser(); ``` -------------------------------- ### Getting Orders by Filter with EbaySharp in C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet illustrates how to retrieve orders using various filters such as creation date range, last modified date range, or fulfillment status. It shows flexible querying of orders via the EbaySharp library. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); string dateRange = $"{(DateTime.UtcNow.AddDays(-10).ToString("yyyy-MM-ddThh:mm:00.0Z"))}..{(DateTime.UtcNow.ToString("yyyy-MM-ddThh:mm:00.0Z"))}"; Orders orders = await ebayController.GetOrders($"creationdate:[{dateRange}]",50); ``` ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); string dateRange = $"{(DateTime.UtcNow.AddDays(-10).ToString("yyyy-MM-ddThh:mm:00.0Z"))}..{(DateTime.UtcNow.ToString("yyyy-MM-ddThh:mm:00.0Z"))}"; orders = await ebayController.GetOrders($"lastmodifieddate:[{dateRange}]"); ``` ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); string dateRange = $"{(DateTime.UtcNow.AddDays(-10).ToString("yyyy-MM-ddThh:mm:00.0Z"))}..{(DateTime.UtcNow.ToString("yyyy-MM-ddThh:mm:00.0Z"))}"; orders = await ebayController.GetOrders("orderfulfillmentstatus:{NOT_STARTED|IN_PROGRESS}"); ``` -------------------------------- ### Creating an Offer on eBay using EbaySharp (C#) Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet demonstrates how to create a new offer on eBay using the EbaySharp library. It initializes an `Offer` object with details like SKU, marketplace, pricing, location, category, and listing policies, then calls `CreateOffer` to submit it. Dependencies include `EbaySharp.Controllers.EbayController` and `Offer` related models. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); Offer offer = new Offer() { SKU = SKU, MarketplaceId = MarketplaceEnum.EBAY_AU, Format = FormatTypeEnum.FIXED_PRICE, PricingSummary = new PricingSummary() { Price = new Amount() { Currency = "AUD", Value = "75" } }, MerchantLocationKey = inventoryLocation.MerchantLocationKey, CategoryId = "162480", ListingPolicies = new ListingPolicies() { FulfillmentPolicyId = "ReplaceYourFulfillmentPolicyId", PaymentPolicyId = "ReplaceYourPaymentPolicyId", ReturnPolicyId = "ReplaceYourReturnPolicyId" } }; OfferCreated offerCreated = await ebayController.CreateOffer(offer, "en-AU"); ``` -------------------------------- ### Initializing EbaySharp Controller with Access Token in C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This C# line initializes an instance of the EbayController using the previously obtained access token. This controller serves as the primary entry point for making various eBay REST API calls. ```C# EbayController ebayController = new EbayController(clientCredentials.AccessToken); ``` -------------------------------- ### Retrieving Offers by SKU - EbaySharp - C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet demonstrates how to retrieve a list of offers associated with a specific SKU from eBay. It initializes the controller and then calls GetOffers with the provided SKU. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); OffersList offersList = await ebayController.GetOffers(SKU); ``` -------------------------------- ### Publishing an Offer on eBay using EbaySharp (C#) Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet illustrates how to publish an offer to make it live on eBay. It uses the `PublishOffer` method, requiring the `offerId` and the marketplace locale (e.g., 'en-AU'). Publishing makes the offer visible to buyers. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); OfferPublished offerPublished = await ebayController.PublishOffer(offerId, "en-AU"); ``` -------------------------------- ### Retrieving a Single Offer by ID - EbaySharp - C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet shows how to fetch a specific offer by its offerId using the EbaySharp library. It initializes the controller and then calls GetOffer with the provided offerId. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); Offer offer = await ebayController.GetOffer(offerId); ``` -------------------------------- ### Creating New Listing - Step 1: Create Inventory Item - EbaySharp - C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This is the first step in creating a new eBay listing. It involves constructing an InventoryItem object with product details like condition, availability, title, aspects, brand, MPN, and image URLs, then using CreateOrReplaceInventoryItem to save it. ```C# MarketplaceEnum? marketplaceId = MarketplaceEnum.EBAY_AU (for example) CurrencyCodeEnum? CurrencyCodeId = CurrencyCodeEnum.AUD (for example) EbaySharp.Entities.Sell.Inventory.InventoryItem.InventoryItem inventoryItem = new EbaySharp.Entities.Sell.Inventory.InventoryItem.InventoryItem() { Condition = ConditionEnum.NEW, Availability = new Availability() { ShipToLocationAvailability = new ShipToLocationAvailability() { Quantity = 3, AllocationByFormat = new AllocationByFormat() { FixedPrice = 3 } } }, Product = new EbaySharp.Entities.Sell.Inventory.InventoryItem.Product() { Title = YOUR PRODCT TITLE, Aspects = DICTIONARY OF ASPECTS IN Dictionary FORMAT, Brand = PRODUCT BRAND, MPN = SKU/MPN, ImageUrls = ARRAY OF IMAGE URLS }, Locale = LOCALE OF YOUR STORE }; CreatedOrReplacedInventoryItem createdOrReplacedInventoryItem = await ebayController.CreateOrReplaceInventoryItem(UNIQUE SKU OF THE PRODUCT, inventoryItem); ``` -------------------------------- ### Bulk Migrating Listings - EbaySharp - C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet shows how to bulk migrate existing listings created with older APIs to the new eBay REST API. It constructs a BulkMigrateListingRequest with an array of ListingIds and then calls BulkMigrate on the controller. ```C# BulkMigrateListingRequest bulkMigrateListingRequest = new BulkMigrateListingRequest() { Requests = new BulkMigrateListingRequestItem[] { new BulkMigrateListingRequestItem(){ListingId = "21432432432" }, new BulkMigrateListingRequestItem(){ListingId = "78658678678" } } }); EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); BulkMigrateListingResponse bulkMigrateListingResponse = await ebayController.BulkMigrate(bulkMigrateListingRequest); ``` -------------------------------- ### Creating Signing Key for EU/UK Finances API Calls in C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet demonstrates creating a signing key, which is crucial for making certain API calls on behalf of EU/UK sellers due to regulatory requirements. It uses the EbaySharp library to generate an ED25519 signing key. ```C# SigningKey signingKey = await ebayController.CreateSigningKey(SigningKeyCipher.ED25519); ``` -------------------------------- ### Creating a Signing Key with EbaySharp in C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet shows how to create a new signing key using the EbaySharp library. It initializes the EbayController and then invokes the CreateSigningKey method, specifying the desired cipher type (e.g., ED25519). ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); signingKey = await ebayController.CreateSigningKey(SigningKeyCipher.ED25519); ``` -------------------------------- ### Creating or Replacing Inventory Item - EbaySharp - C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet illustrates how to create a new inventory item or replace an existing one on eBay. It defines product aspects, availability, condition, and product details, then uses CreateOrReplaceInventoryItem with a unique SKU and the constructed InventoryItem object. ```C# Dictionary aspects = new() { { "Brand", new[] { "GoPro" } }, { "Type", new[] { "Helmet/Action" } } }; CreatedOrReplacedInventoryItem createdOrReplacedInventoryItem = await ebayController.CreateOrReplaceInventoryItem("test-sku-api", new InventoryItem() { Availability = new Availability() { ShipToLocationAvailability = new ShipToLocationAvailability() { Quantity = 3 } }, Condition = ConditionEnum.NEW, Product = new Product() { Title = "Creating from REST API, please don't buy", Description = "I am created by the REST API", Aspects = aspects, Brand = "GoPro", MPN = "CHDHX-401", ImageUrls = new[] { "https://i.ebayimg.com/images/g/OKsAAOSwr2VlsUPx/s-l1600.jpg", "https://i.ebayimg.com/images/g/a9AAAOSw2IVlsUPz/s-l1600.jpg" } }, //Find locale information here https://developer.ebay.com/api-docs/static/rest-request-components.html#marketpl Locale = "en-AU" }); ``` -------------------------------- ### Revising Listing - Step 4: Publish Offer - EbaySharp - C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This is the final step in revising an eBay listing. It publishes the updated offer to make the changes live on the eBay marketplace using the PublishOffer method. ```C# OfferPublished offerPublished = await ebayController.PublishOffer(offer.OfferId, locale); ``` -------------------------------- ### Retrieving a Single Inventory Item - EbaySharp - C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet shows how to fetch a specific inventory item by its Stock Keeping Unit (SKU) using the EbaySharp library. It initializes the controller and then calls GetInventoryItem with the provided SKU. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); InventoryItem inventoryItem = await ebayController.GetInventoryItem(SKU); ``` -------------------------------- ### Retrieving Inventory Items - EbaySharp - C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet demonstrates how to retrieve a list of inventory items from eBay using the EbaySharp library. It initializes the controller with an access token and then calls GetInventoryItems with optional limit and offset parameters for pagination. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); InventoryItemsList inventoryItemsList = await ebayController.GetInventoryItems(limit, offset); ``` -------------------------------- ### Retrieving an eBay Item using Browse API in C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This C# snippet demonstrates how to fetch details of a specific eBay item using the Browse API. It requires an initialized EbayController and the unique item ID. The method returns an Item object containing the item's information. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); Item item = await ebayController.GetItem("355731616267"); ``` -------------------------------- ### Retrieving Return Policies from eBay Metadata API (C#) Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet demonstrates how to fetch return policies using the eBay Metadata API. It requires a `MarketplaceId` (e.g., 'EBAY_US') to specify which marketplace's policies to retrieve. The `GetReturnPolicies` method returns a list of available return policies. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); ReturnPoliciesList returnPoliciesList = await ebayController.GetReturnPolicies("EBAY_US"); ``` -------------------------------- ### Creating Shipping Fulfillment with EbaySharp in C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This comprehensive snippet demonstrates how to create a shipping fulfillment for an order using the EbaySharp library. It first retrieves orders based on fulfillment status, then identifies a specific order, and finally creates the fulfillment with tracking details, carrier, and shipped date. It highlights handling multiple tracking numbers within a loop. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); List allOrders = new List(); int totalCount = 0; do { var eBayOrders = await ebayController.GetOrders("orderfulfillmentstatus:{NOT_STARTED|IN_PROGRESS}", 50, totalCount); totalCount = eBayOrders.Total; allOrders.AddRange(eBayOrders.OrderList); } while (allOrders.Count < totalCount); EbaySharp.Entities.Develop.SellingApps.OrderManagement.Fulfillment.Order.Order order = allOrders.Where(x => x.OrderId == orderTracking.OrderNumber).FirstOrDefault(); //Execute the following block in a loop If you have multiple tracking numbers. await ebayController.CreateShippingFulfillment("Order Number", new EbaySharp.Entities.Develop.SellingApps.OrderManagement.Fulfillment.Order.ShippingFulfillment.Fulfillment() { LineItems = order.LineItems.Select(x => new EbaySharp.Entities.Develop.SellingApps.OrderManagement.Fulfillment.Order.ShippingFulfillment.LineItem() { LineItemId = x.LineItemId, Quantity = x.Quantity }).ToList(), TrackingNumber = "Tracking Number", ShippingCarrierCode = "Courier Name", ShippedDate = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.0Z") }); ``` -------------------------------- ### Generating eBay Access Token with Client Credentials in C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This C# snippet demonstrates how to obtain an access token using the AuthenticationController. It takes the client ID, client secret, a valid refresh token, and required API scopes as parameters. The returned ClientCredentialsResponse object contains the access token necessary for subsequent API calls. ```C# AuthenticationController authenticationController=new AuthenticationController(); var clientCredentials = await authenticationController.GetClientCredentials(ReplaceYourClientId, ReplaceYourClientSecret, ReplaceWithRefreshToken , ReplaceWithScopes); ``` -------------------------------- ### Creating Inventory Location - EbaySharp - C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet illustrates how to create a new inventory location on eBay. It constructs an InventoryLocation object with details like MerchantLocationKey, LocationTypes, MerchantLocationStatus, and Address, then uses CreateInventoryLocation. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); await ebayController.CreateInventoryLocation(new InventoryLocation() { MerchantLocationKey = merchantLocationKey, LocationTypes = new List() { StoreTypeEnum.WAREHOUSE }, MerchantLocationStatus = StatusEnum.ENABLED, Location = new Location() { Address = new Address() { PostalCode = "3698", Country = CountryCodeEnum.AU } } }); ``` -------------------------------- ### Retrieving Inventory Locations - EbaySharp - C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet shows how to retrieve a list of inventory locations from eBay. It initializes the controller and then calls GetInventoryLocations with optional limit and offset parameters for pagination. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); InventoryLocations inventoryLocations = await ebayController.GetInventoryLocations(limit, offset); ``` -------------------------------- ### Retrieving a Single Inventory Location - EbaySharp - C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet demonstrates how to fetch a specific inventory location by its merchantLocationKey. It initializes the controller and then calls GetInventoryLocation with the provided key. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); InventoryLocation inventoryLocation = await ebayController.GetInventoryLocation(merchantLocationKey); ``` -------------------------------- ### Updating an Existing Offer on eBay using EbaySharp (C#) Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet shows how to update an existing eBay offer. It first retrieves the offer by its ID, modifies the `Price.Value` within the `PricingSummary`, and then calls `UpdateOffer` to persist the changes. This requires an existing `offerId`. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); Offer offer = await ebayController.GetOffer(offerId); offer.PricingSummary.Price.Value = "100"; OfferUpdated offerUpdated = await ebayController.UpdateOffer(offerId, offer, "en-AU"); ``` -------------------------------- ### Revising Listing - Step 3: Make Changes to Item/Offer - EbaySharp - C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This is the third step in revising an eBay listing. It demonstrates how to update the inventory item's title and the offer's price and available quantity, then persists these changes using CreateOrReplaceInventoryItem and UpdateOffer. ```C# string locale = "en-AU" //FOR EXAMPLE inventoryItem.Product.Title = UPDATED TITLE; offer.PricingSummary.Price.Value = NEW PRICE; offer.AvailableQuantity = NEW STOCK; await ebayController.CreateOrReplaceInventoryItem(product.SKU, inventoryItem); await ebayController.UpdateOffer(offer.OfferId, offer, locale); ``` -------------------------------- ### Deleting Inventory Item - EbaySharp - C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet demonstrates how to delete an inventory item from eBay using its SKU. It initializes the controller and then calls DeleteInventoryItem with the specified SKU. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); await ebayController.DeleteInventoryItem(SKU); ``` -------------------------------- ### Retrieving and Saving a Result File with EbaySharp in C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet demonstrates how to retrieve a result file from a feed task and save it locally using EbaySharp. It calls GetResultFile with a task ID and then uses SaveUncompressed to store the file. ```C# ResultFile resultFile = await ebayController.GetResultFile([TASK_ID]); await resultFile.SaveUncompressed("C:\\Work"); ``` -------------------------------- ### Retrieving Account Information using eBay Trading API (C#) Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet shows how to retrieve account information, including transactions, payouts, and invoice data, using the legacy eBay Trading API's `GetAccount` call. It constructs an XML request payload and can optionally use a `SigningKey` for EU regions. The Finances API is recommended as a modern alternative. ```C# //FOR EU SigningKey signingKey = await ebayController.CreateSigningKey(SigningKeyCipher.ED25519); int siteId = 3; //For AU //int siteId=15 XNamespace ns = "urn:ebay:apis:eBLBaseComponents"; XDocument xmlDocument = new XDocument( new XDeclaration("1.0", "utf-8", "yes"), new XElement(ns + "GetAccountRequest", new XAttribute("xmlns", ns), new XElement("RequesterCredentials", new XElement("eBayAuthToken", accessToken) ), new XElement("AccountEntrySortType", "AccountEntryFeeTypeAscending"), new XElement("AccountHistorySelection", "LastInvoice"), new XElement("Pagination", new XElement("EntriesPerPage", 10), new XElement("PageNumber", 1) ) ) ); var memory = new MemoryStream(); xmlDocument.Save(memory); string inputXml = Encoding.UTF8.GetString(memory.ToArray()).Replace("xmlns=\"\"", ""); GetAccountResponse getAccountResponse = await ebayController.GetAccount(siteId, inputXml, signingKey); or GetAccountResponse getAccountResponse = await ebayController.GetAccount(siteId, inputXml); ``` -------------------------------- ### Ending Listing - Step 2: Withdraw Offer - EbaySharp - C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This is the final step in ending an eBay listing. It withdraws the offer, effectively ending the listing on the eBay marketplace, using the WithdrawOffer method. ```C# OfferWithdrawn offerWithdrawn = await ebayController.WithdrawOffer(offer.OfferId); ``` -------------------------------- ### Updating Active Listing - Step 3: Make Changes to Item/Offer - EbaySharp - C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This is the third step in updating an active eBay listing. It demonstrates how to modify the inventory item's title and the offer's price and available quantity, then persists these changes using CreateOrReplaceInventoryItem and UpdateOffer. ```C# string locale = "en-AU" //FOR EXAMPLE inventoryItem.Product.Title = UPDATED TITLE; offer.PricingSummary.Price.Value = NEW PRICE; offer.AvailableQuantity = NEW STOCK; await ebayController.CreateOrReplaceInventoryItem(product.SKU, inventoryItem); await ebayController.UpdateOffer(offer.OfferId, offer, locale); ``` -------------------------------- ### Withdrawing an Offer on eBay using EbaySharp (C#) Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet demonstrates how to withdraw a published offer from eBay. It calls the `WithdrawOffer` method, passing the `offerId` to remove the offer from public view. This effectively unpublishes the offer. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); OfferWithdrawn offerWithdrawn = await ebayController.WithdrawOffer(offerId); ``` -------------------------------- ### Retrieving Seller's Item List using eBay Trading API (C#) Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet demonstrates how to retrieve a list of active and ended items for a seller using the legacy eBay Trading API's `GetSellerList` call. It iterates through paginated results, fetching items within a specified date range. This method is considered legacy. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); int pageNumber = 0; bool hasMoreResults = true; while (hasMoreResults) { GetSellerListResponse getSellerListResponse = await ebayController.GetItems(siteId, ++pageNumber, 200, DateTime.Now.AddDays(-87).ToString("O"), DateTime.Now.AddDays(33).ToString("O")); hasMoreResults = getSellerListResponse.HasMoreItems; //Process items response here. } ``` -------------------------------- ### Deleting an Offer on eBay using EbaySharp (C#) Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet shows how to permanently delete an offer from eBay. It invokes the `DeleteOffer` method with the `offerId`. This action removes the offer record entirely. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); await ebayController.DeleteOffer(offerId); ``` -------------------------------- ### Retrieving eBay Category Tree using Taxonomy API in C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This C# snippet demonstrates how to retrieve a complete category tree from eBay's Taxonomy API. It requires a specific category tree ID and returns a CategoryTree object, providing the hierarchical structure of categories. ```C# CategoryTree categoryTree = await ebayController.GetCategoryTree(15); ``` -------------------------------- ### Deleting Inventory Location - EbaySharp - C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet demonstrates how to delete an inventory location from eBay using its merchantLocationKey. It initializes the controller and then calls DeleteInventoryLocation with the specified key. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); await ebayController.DeleteInventoryLocation(merchantLocationKey); ``` -------------------------------- ### Retrieving Store Categories from eBay Stores API (C#) Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This snippet illustrates how to retrieve a seller's custom store categories using the eBay Stores API. It calls the `GetStoreCategories` method, which returns a hierarchical list of categories defined for the seller's eBay store. ```C# EbaySharp.Controllers.EbayController ebayController = new EbaySharp.Controllers.EbayController(clientCredentials.AccessToken); StoreCategories storeCategories = await ebayController.GetStoreCategories(); ``` -------------------------------- ### Obtaining eBay Refresh Token in C# Source: https://github.com/cms365-pty-ltd/ebaysharp/blob/main/readme.md This C# function illustrates how to retrieve a refresh token from eBay. It requires the secure URL obtained after user consent, client ID, client secret, and the redirect URL (RU). The refresh token is valid for 18 months and is used to generate access tokens. ```C# public async Task GetRefreshToken() { string secureURL="replace with the URL of the thank you page"; EbaySharp.Controllers.AuthenticationController authenticationController = new EbaySharp.Controllers.AuthenticationController(); string refreshToken = await authenticationController.GetRefreshToken(ReplaceYourClientId, ReplaceYourClientSecret, , secureURL, Replace with RU); } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.