{"id":51460990,"url":"https://github.com/bilalyasin1616/ebaysharp","last_synced_at":"2026-07-06T05:30:27.915Z","repository":{"id":45826293,"uuid":"372846026","full_name":"bilalyasin1616/ebaysharp","owner":"bilalyasin1616","description":"EbaySharp is a .NET library that helps developers easily manage their commerce account through Ebay API","archived":false,"fork":false,"pushed_at":"2021-08-13T19:02:59.000Z","size":54,"stargazers_count":11,"open_issues_count":6,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-01T04:36:45.014Z","etag":null,"topics":["api","csharp","dotnet","dotnet-core","ebay","ebay-api","ebay-sdk"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bilalyasin1616.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-01T13:47:39.000Z","updated_at":"2025-04-29T03:11:47.000Z","dependencies_parsed_at":"2022-09-14T08:41:39.699Z","dependency_job_id":null,"html_url":"https://github.com/bilalyasin1616/ebaysharp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bilalyasin1616/ebaysharp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilalyasin1616%2Febaysharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilalyasin1616%2Febaysharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilalyasin1616%2Febaysharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilalyasin1616%2Febaysharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bilalyasin1616","download_url":"https://codeload.github.com/bilalyasin1616/ebaysharp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bilalyasin1616%2Febaysharp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35179683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-06T02:00:07.184Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","csharp","dotnet","dotnet-core","ebay","ebay-api","ebay-sdk"],"created_at":"2026-07-06T05:30:26.528Z","updated_at":"2026-07-06T05:30:27.908Z","avatar_url":"https://github.com/bilalyasin1616.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ebaysharp .Net Library for Ebay API\n\nGoal of this library is to make life easy for developers who are looking to use Ebay's API for development. This library contains models and services that will wrap the communication logic to make your life easy.\n\n**Note:** Ebay API tends to be quite unstable, lot of services, difficult to implement a flow as a 3rd party integrator and very questionable design decisions for Ebay's team. I have tried my best to cover the commerce part here. There is huge room for improvement and still a number of uncovered routes. Suggestions or contributions are always welcome.\n\n## Contributors\n\nIf anyone would like to contribute to this package, email me at [bilalyasin1616@gmail.com](mailto:bilalyasin1616@gmail.com).\nI would love to get some help so we can increase the API coverage and make it great package.\n\n# Installation\n\nEbaysharp is [available on NuGet](https://www.nuget.org/packages/Ebaysharp/). Use the package manager\nconsole in Visual Studio to install it:\n\n```pwsh\nInstall-Package Ebaysharp\n```\n\nIf you're using .NET Core, you can use the `dotnet` command from your favorite shell:\n\n```sh\ndotnet add package Ebaysharp\n```\n\nIf you're using Paket with an F# project, use this command:\n\n```sh\npaket add Ebaysharp --project /path/to/project.fsproj\n```\n\n# Topics\n\n## Environments\n\nBy default the environment is set to Production but you can change it for testing to sandbox\n**Import note:** It is recommended to use production environment even for testing, Ebay's sandbox is absolutely crap, very unstable and useless. Pretty much most of the calls will fail without any reason of its sandbox and there are a lot of issues created on Ebay forums regarding that.\n\n### Possible Environments\n\n```cs\npublic enum Environments\n{\n    Sandbox, Production\n}\n```\n\n### Setting environment\n\nYou need to setup the environment once in your project before calling the services\n\n```cs\nEnvironmentManager.Environment = Environments.Sandbox;\n```\n\n## Creating ClientToken object\n\nClientToken object is used to initialize all services, so make sure all the information in this are correct.\nOtherwise call to the API will not work.\n\n```cs\nvar clientToken = new ClientToken()\n{\n    clientId = \"Your clientId\",\n    clientSecret = \"Your clientSecret\",\n    devId = \"Your devId\",\n    oauthCredentials = \"Your clientId:clientSecret base64 encoded\",\n    ruName = \"Your ruName from developer portal\",\n    scopes = \"Space separated scopes from Ebay API\"\n};\n```\n**oauthCredentials** is clientId:clientSecret base64 encoded string. Will refactored and remove this requirement soon as it can be done internally.\n**ruName** is unique identifier for your redirect url, that can be found in your developer portal\n**scopes** string of scopes separated by a space each. [more on oauth scopes](https://developer.ebay.com/api-docs/static/oauth-scopes.html)\n\n## Getting access tokens\n\n### Generating redirect url\n\n```cs\nvar state=\"Your application/user state encoded url safe\";\nvar redirectUrl = new OauthService(clientToken).GetRedirectUrl(state);\n```\n\nRedirect user to this url for getting access to their account with specified scopes\n\n### Exchange temporary token for access tokens\n\n```cs\nvar authService = new OauthService(clientToken);\nvar token = await authService.GetAccessTokenAsync(code);\n```\n\nYou can store these access tokens in your database and later use them to access the resources specified in the scopes\n\n## Refreshing the access token\n\nAccess tokens provided by Ebay Api will expire after the time specified in **AccessToken.expires_in** property, but it can be refreshed by using the long term refresh token provided in **AccessToken.refresh_token** property.\nEbaysharp implements the token refresh internally given that the refresh_token is valid. After performing certain operation(s) you might expect that the token is refreshed by the respective service and would like to update it in your database. You can use the following code snippet.\n\n```cs\nvar accessToken = GetAccessToken(); //assuming this function returns AccessToken object with valid tokens\nvar service = new Service(clientToken, accessToken);\n//after performing operation(s)\nif(service.IsAccessTokenRefreshed(accessToken.date_last_updated))\n    service.AccessToken; //you can use this access token object to update tokens in your store\n```\n\n## Sample for getting a list of all objects from a resource while managing pagination\n\n```cs\nvar limit = 10; //getting 10 records at a time\nvar orderService = new OrderService(clientToken, accessToken);\nEbayList\u003cOrder, EbayFilter\u003e orders = null;\ndo\n{\n    var filter = orders != null ? orders.GetNextPageFilter() : new EbayFilter(limit);\n    orders = await orderService.GetAllAsync(filter);\n} while (orders.HasNextPage());\n```\n\nYou can set the limit to how many records you want in each call.\n**Note:** I know this is not the best way to do this, but at the time it served me the purpose. Will try to refactor the code soon to make it better and intuitive\n\n# Resources\n\n-   [Fulfillment Policy Service](#fulfillment-policy-service)\n-   [Payment Policy Service](#payment-policy-service)\n-   [Return Policy Service](#return-policy-service)\n-   [Privileges Service](#privilages-service)\n-   [Identity Service](#identity-service)\n-   [Order Service](#order-service)\n-   [Inventory Item Group Service](#inventory-item-group-service)\n-   [Inventory Item Service](#inventory-item-service)\n-   [Location Service](#location-service)\n-   [Catalog Service](#category-service)\n-   [Ebay Meta Service](#Ebay-meta-service)\n-   [Offer Service](#offer-service)\n-   [Meta Service](#meta-service)\n\n## \u003ca name=\"fulfillment-policy-service\"\u003e\u003c/a\u003eFulfillment Policy Service\n\n### Get all fulfillment policies\n\n```cs\nvar limit = 10; //getting 10 records at a time\nvar fulfillmentService = new FulfillmentPolicyService(clientToken, accessToken);\nEbayList\u003cOrder, EbayFilter\u003e fulfillmentPolicies = null;\ndo\n{\n    var filter = fulfillmentPolicies != null ? fulfillmentPolicies.GetNextPageFilter() : new EbayFilter(limit);\n    fulfillmentPolicies = await fulfillmentPolicies.GetAllAsync(filter);\n} while (fulfillmentPolicies.HasNextPage());\n```\n\n### Add fulfillment policy\n\n```cs\nvar fulfillmentPolicy = new FulfillmentPolicy();\nvar fulfillmentService = new FulfillmentPolicyService(clientToken, accessToken);\nfulfillmentPolicy = await fulfillmentService.AddAsync(fulfillmentPolicy);\n```\n\n### Update fulfillment policy\n\n```cs\nvar fulfillmentPolicy = new FulfillmentPolicy();\nvar fulfillmentService = new FulfillmentPolicyService(clientToken, accessToken);\nfulfillmentPolicy = await fulfillmentService.UpdateAsync(fulfillmentPolicy);\n```\n\n### Delete fulfillment policy\n\n```cs\nvar fulfillmentPolicyId = 123456;\nvar fulfillmentService = new FulfillmentPolicyService(clientToken, accessToken);\nawait fulfillmentService.DeleteAsync(fulfillmentPolicyId);\n```\n\n## \u003ca name=\"payment-policy-service\"\u003e\u003c/a\u003ePayment Policy Service\n\n### Get all payment policies\n\n```cs\nvar limit = 10; //getting 10 records at a time\nvar paymentService = new PaymentPolicyService(clientToken, accessToken);\nEbayList\u003cOrder, EbayFilter\u003e paymentPolicies = null;\ndo\n{\n    var filter = paymentPolicies != null ? paymentPolicies.GetNextPageFilter() : new EbayFilter(limit);\n    paymentPolicies = await paymentPolicies.GetAllAsync(filter);\n} while (paymentPolicies.HasNextPage());\n```\n\n### Add payment policy\n\n```cs\nvar paymentPolicy = new PaymentPolicy();\nvar paymentService = new PaymentPolicyService(clientToken, accessToken);\npaymentPolicy = await paymentService.AddAsync(paymentPolicy);\n```\n\n### Update payment policy\n\n```cs\nvar paymentPolicy = new PaymentPolicy();\nvar paymentService = new PaymentPolicyService(clientToken, accessToken);\npaymentPolicy = await paymentService.UpdateAsync(paymentPolicy);\n```\n\n### Delete payment policy\n\n```cs\nvar paymentPolicyId = 123456;\nvar paymentService = new PaymentPolicyService(clientToken, accessToken);\nawait paymentService.DeleteAsync(paymentPolicyId);\n```\n\n## \u003ca name=\"return-policy-service\"\u003e\u003c/a\u003eReturn Policy Service\n\n### Get all return policies\n\n```cs\nvar limit = 10; //getting 10 records at a time\nvar returnService = new returnPolicyService(clientToken, accessToken);\nEbayList\u003cOrder, EbayFilter\u003e returnPolicies = null;\ndo\n{\n    var filter = returnPolicies != null ? returnPolicies.GetNextPageFilter() : new EbayFilter(limit);\n    returnPolicies = await returnPolicies.GetAllAsync(filter);\n} while (returnPolicies.HasNextPage());\n```\n\n### Add return policy\n\n```cs\nvar returnPolicy = new returnPolicy();\nvar returnService = new ReturnPolicyService(clientToken, accessToken);\nreturnPolicy = await returnService.AddAsync(returnPolicy);\n```\n\n### Update return policy\n\n```cs\nvar returnPolicy = new returnPolicy();\nvar returnService = new ReturnPolicyService(clientToken, accessToken);\nreturnPolicy = await returnService.UpdateAsync(returnPolicy);\n```\n\n### Delete return policy\n\n```cs\nvar returnPolicyId = 123456;\nvar returnService = new ReturnPolicyService(clientToken, accessToken);\nawait returnService.DeleteAsync(returnPolicyId);\n```\n\n## \u003ca name=\"privileges-service\"\u003e\u003c/a\u003ePrivileges Service\n\n### Get user privileges\n\n```cs\nvar privilegesService = new PrivilegesService(clientToken, accessToken);\nvar privileges = await privilegesService.GetPrivilegeAsync();\n```\n\n## \u003ca name=\"identity-service\"\u003e\u003c/a\u003eIdentity Service\n\n### Get user\n\n```cs\nvar identityService = new IdentityService(clientToken, accessToken);\nvar user = await identityService.GetUserAsync();\n```\n\n## \u003ca name=\"order-service\"\u003e\u003c/a\u003eOrder Service\n\n### Get all orders\n\n```cs\nvar limit = 10; //getting 10 records at a time\nvar orderService = new OrderService(clientToken, accessToken);\nEbayList\u003cOrder, EbayFilter\u003e orders = null;\ndo\n{\n    var filter = orders != null ? orders.GetNextPageFilter() : new EbayFilter(limit);\n    orders = await orderService.GetAllAsync(filter);\n} while (orders.HasNextPage());\n```\n\n### Create order fulfillment\n\n```cs\nvar orderId = \"12121\";\nvar shippingFulfillment = new ShippingFulfillment();\nvar orderService = new OrderService(clientToken, accessToken);\nvar fulfillmentId = await orderService.CreateFulfillmentAsync(shippingFulfillment, orderId);\n```\n\n## \u003ca name=\"inventory-item-group-service\"\u003e\u003c/a\u003eInventory Item Group Service\n\n### Create or replace inventory item group\n\n```cs\nvar inventoryItemGroupKey = \"test-group\";\nvar inventoryItemGroup = new InventoryItemGroup();\nvar inventoryItemGroupService = new InventoryItemGroupService(clientToken, accessToken);\nawait inventoryItemGroupService.CreateOrReplaceInventoryItemGroupAsync(inventoryItemGroup, inventoryItemGroupKey);\n```\n\n### Get inventory item group\n\n```cs\nvar inventoryItemGroupKey = \"test-group\";\nvar inventoryItemGroupService = new InventoryItemGroupService(clientToken, accessToken);\nvar inventoryItemGroup = await inventoryItemGroupService.GetInventoryItemsGroupAsync(inventoryItemGroupKey);\n```\n\n### Delete inventory item group\n\n```cs\nvar inventoryItemGroupKey = \"test-group\";\nvar inventoryItemGroupService = new InventoryItemGroupService(clientToken, accessToken);\nawait inventoryItemGroupService.DeleteGroupInventoryItemsAsync(inventoryItemGroupKey);\n```\n\n## \u003ca name=\"inventory-item-service\"\u003e\u003c/a\u003eInventory Item Service\n\n### Create or replace inventory item\n\n```cs\nvar sku = \"test-sku\";\nvar inventoryItem = new InventoryItem();\nvar inventoryItemService = new InventoryItemService(clientToken, accessToken);\nawait inventoryItemService.CreateOrReplaceAsync(inventoryItem, sku);\n```\n\n### Bulk create or replace inventory items\n\n```cs\nvar bulkInventoryItem = new BulkInventoryItem();\nvar inventoryItemService = new InventoryItemService(clientToken, accessToken);\nvar bulkInventoryItemResponses = await inventoryItemService.BulkCreateOrReplaceAsync(bulkInventoryItem);\n```\n\n### Get inventory item\n\n```cs\nvar sku = \"test-sku\";\nvar inventoryItemService = new InventoryItemService(clientToken, accessToken);\nvar inventoryItem = await inventoryItemService.GetAsync(sku);\n```\n\n### Get all inventory items\n\n```cs\nvar limit = 10; //getting 10 records at a time\nvar inventoryItemService = new InventoryItemService(clientToken, accessToken);\nEbayList\u003cInventoryItem, EbayFilter\u003e inventoryItems = null;\ndo\n{\n    var filter = inventoryItems != null ? inventoryItems.GetNextPageFilter() : new EbayFilter(limit);\n    inventoryItems = await inventoryItemService.GetAllAsync(filter);\n} while (inventoryItems.HasNextPage());\n```\n\n### Delete inventory item\n\n```cs\nvar sku = \"test-sku\";\nvar inventoryItemService = new InventoryItemService(clientToken, accessToken);\nawait inventoryItemService.DeleteAsync(sku);\n```\n\n## \u003ca name=\"location-service\"\u003e\u003c/a\u003eLocation Service\n\n### Add location\n\n```cs\nvar merchantLocationKey = \"unique-location-identifier\";\nvar inventoryLocation = new InventoryLocation();\nvar locationService = new LocationService(clientToken, accessToken);\nawait locationService.AddAsync(merchantLocationKey, inventoryLocation);\n```\n\n### Delete location\n\n```cs\nvar merchantLocationKey = \"unique-location-identifier\";\nvar locationService = new LocationService(clientToken, accessToken);\nawait locationService.DeleteAsync(merchantLocationKey);\n```\n\n### Get all locations\n\n```cs\nvar limit = 10; //getting 10 records at a time\nvar locationService = new LocationService(clientToken, accessToken);\nEbayList\u003cInventoryLocation, EbayFilter\u003e locations = null;\ndo\n{\n    var filter = locations != null ? locations.GetNextPageFilter() : new EbayFilter(limit);\n    locations = await locationService.GetAllAsync(filter);\n} while (locations.HasNextPage());\n```\n\n### Get location\n\n```cs\nvar merchantLocationKey = \"unique-location-identifier\";\nvar locationService = new LocationService(clientToken, accessToken);\nvar inventoryLocation = await locationService.GetAsync(merchantLocationKey);\n```\n\n## \u003ca name=\"offer-service\"\u003e\u003c/a\u003eOffer Service\n\n### Add offer\n\n```cs\nvar offer = new Offer();\nvar offerService = new OfferService(clientToken, accessToken);\nvar offerResponse = await offerService.AddAsync(offer);\n```\n\n### Add offer bulk\n\n```cs\nvar bulkOffers = new BulkOffer();\nvar offerService = new OfferService(clientToken, accessToken);\nvar offersResponse = await offerService.AddBulkAsync(bulkOffers);\n```\n\n### Delete offer\n\n```cs\nvar offerId = \"offer id\";\nvar offerService = new OfferService(clientToken, accessToken);\nawait offerService.DeleteAsync(offerId);\n```\n\n### Get offer\n\n```cs\nvar offerId = \"offer id\";\nvar offerService = new OfferService(clientToken, accessToken);\nvar offer = await offerService.GetAsync(offerId);\n```\n\n### Get all offer\n\n```cs\nvar limit = 10; //getting 10 records at a time\nvar offerService = new OfferService(clientToken, accessToken);\nEbayList\u003cInventoryLocation, EbayFilter\u003e offers = null;\ndo\n{\n    var filter = offers != null ? offers.GetNextPageFilter() : new EbayFilter(limit);\n    offers = await offerService.GetAllAsync(filter);\n} while (offers.HasNextPage());\n```\n\n### Publish inventory items group\n\n```cs\nvar inventoryItemGroupKey = \"inventory item group key\";\nvar offerService = new OfferService(clientToken, accessToken);\nvar offerPublishByInventoryGroupResponse = await offerService.PublishByInventoryItemGroupAsync(inventoryItemGroupKey);\n```\n\n### Publish bulk offers\n\n```cs\nvar bulkOfferPublish = new BulkOfferPublish();\nvar offerService = new OfferService(clientToken, accessToken);\nvar bulkPublishResponse = await offerService.PublishBulkAsync(bulkOfferPublish);\n```\n\n### Update offer\n\n```cs\nvar offer = new Offer();\nvar offerService = new OfferService(clientToken, accessToken);\nawait offerService.UpdateAsync(offer);\n```\n\n### Withdraw offers by inventory item group\n\n```cs\nvar inventoryItemGroupKey = \"inventory item group key\";\nvar offerService = new OfferService(clientToken, accessToken);\nawait offerService.WithdrawByInventoryItemGroupAsync(inventoryItemGroupKey);\n```\n\n## \u003ca name=\"meta-service\"\u003e\u003c/a\u003eMeta Service\n\n```cs\nvar detailName = \"detail name\";\nvar ebayMetaService = new EbayMetaService(clientToken, accessToken);\nvar geteBayDetailsResponse = await ebayMetaService.GetEbayDetailsAsync(detailName);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbilalyasin1616%2Febaysharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbilalyasin1616%2Febaysharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbilalyasin1616%2Febaysharp/lists"}