Giter Site home page Giter Site logo

marketvision / shipstation4net Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 12.0 214 KB

A .NET Standard Library using System.Net.HttpClient and NewtonSoft.Json which provides access to the ShipStation API.

License: Apache License 2.0

C# 99.16% PowerShell 0.84%

shipstation4net's People

Contributors

bohdanivaniichuk avatar boylec avatar dependabot[bot] avatar intoccabil avatar johnh-fugu avatar mv-vlad-kurdesov avatar mynkow avatar nla-brandonjames avatar saylis avatar sinstraliz avatar umedbisht avatar vlad-kurdesov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

shipstation4net's Issues

OverflowException: Value was either too large or too small for an Int32.

Getting the following error when calling Orders.GetAllPagesAsync

Newtonsoft.Json.JsonReaderException: 'Could not convert to integer: 1202147746409. Path 'orders[10].items[0].orderItemId', line 1, position 26119.'

OverflowException: Value was either too large or too small for an Int32.

Getting resources for order shipped notifications not working

Looks like getting the data from a resource url via a shipped order notification isn't working.

Method: GetResourcesResponsesAsync

Error:
System.Exception: Object of type 'System.Collections.Generic.List1[ShipStation4Net.Domain.Entities.Shipment]' cannot be converted to type 'System.Collections.Generic.IList1[ShipStation4Net.Domain.Entities.Order]

Maintaining this Library

Hey contributors, I will not be maintaining this library any more since I am ending my employment with my company on July 20. Would MarketVision like to take over the reins on this project? Thanks. @mynkow @vlad-kurdesov. You guys were a great support in the development of ShipStation4Net.

Store Refresh does not work for refresh all as stated in the documentation

store refresh states that if no store id or date is specified then it will update all stores. however store id and date are not nullable therefore you always need to pass in a store id.

If you pass in a 0 and a new DateTime() you get an internal Server error. Therefor you always need to iterate through each store and call a refresh on each store to get this to work.

Issue Getting Async Data

Very strange issue. On any call to get data, I get no expectations and it just fails out to calling method.

Unit test execution

Hello,

How should I execute the tests? There are some files missing in the solution. Could you please provide short explanation?

Feature: Creating/Updating multiple orders

Hi,
I was recently working on a project that required us to update multiple orders. Due to throttling limits, we were going over our allotted quota frequently. After speaking to the ShipStation technical team, we were advised to use the bulk update/create endpoint to create/update orders. This seems to be the preferred way of update/creating orders in bulk.
Here is the doc link to this API

Since I was unable to find the implementation of this API in this project, I wrote my own implementation of it.
I forked the repo and committed my changes here .

If you are satisfied with this addition I can create a pull request.

Kudos to your team for writing this great library. It was very intuitive to use and modify. ๐Ÿฅ‡ ๐Ÿ‘ ๐Ÿฅณ

Regards

Shipments.VoidLabelAsync return value issue

ShipStation API returns

{
"approved": true,
"message": "Label voided successfully"
}

But VoidLabelAsync method is using SuccessResponse as response

{
"success": true,
"message": "The requested order has been deleted."
}

Due to "approved" vs "success" property difference, this method will always result false even though given label is Voided.

Orders.GetAllPages() errors because of new insurance provider

Error Message: "One or more errors occurred. (Error converting value "parcelguard" to type 'System.Nullable`1[ShipStation4Net.Domain.Enumerations.InsuranceOptionProviders]'. Path 'orders[88].insuranceOptions.provider', line 1, position 268260.)"

Example to reproduce error:

public List GetShipStationOrders()
{
var ret = new List();
var filter = new OrdersFilter
{
CreateDateStart = DateTime.Now.AddDays(-90),
CreateDateEnd = DateTime.Now
};

        var pages = _shipStationClient.Orders.GetAllPages(filter);
        foreach (var page in pages)
        {
            ret.AddRange(page);
        }

        return ret;
    }

product length, width, height, weight change form int to double

Hi,

In the product entities the length, width, height and weightOz is of type int. I know in the api documentation it says it's type of number https://www.shipstation.com/docs/api/models/product/ and doesn't really specify if it's int or double. However I can confirm that from the UI you can enter decimal values and when you do a GET product via the API it returns the decimals as well.

Are we able to change the variable types from int to double for those fields?

Thanks

Bug in pagination of orders

Current implementation of Orders.GetAllPagesAsync method doesn't really give you a way to work around any exception in process - if you received 10 pages and then you hit api limit, you will loose all data because ClientBase.ExecuteRequest will throw ApiLimitReachedException.

I think having these options might be helpful:

  • return exception with already received data, so at least you would have some data returned
  • have a way to tell client to retry multiple times (if ApiLimitReached, client could wait till next minute and try get same page again).

When I was trying to research problem, I found that GetPageAsync has critical bug. Page = 1 always.
please look at line 75 of https://github.com/nla-brandonjames/ShipStation4Net/blob/master/ShipStation4Net/Clients/Orders.cs

  • I was trying to see if I could work around doing pagination via GetPageAsync method and I was expected to get error when I try to access page 1,000,000 with page size 500.. I was surprised to get 500 items.

Also, I have some other questions that I would like to ask:

  1. do you plan to add integration with Create/Update multiple orders? (if I'm not mistaken, it's not in place currently) this functionality could help to work around api limitations for clients that have higher volume of orders.

.NET 4.5+ compatibiltiy

It seems that I am not able to use this project in a .NET 4.5.1 project. Do you plan on releasing an update that will be supported in .NET 4.5+?

Question: Suggested improvements

Hey,
wanted to ask your opinion about couple things:

  1. what do you think about adding RetryPolicy to the client? e.g. current handling would be 'No Retry', and then we could add 'RetryOnApiLimit' or something which would wait required time until time limit is reset & try 3-4 times to get same api call thru. This would help to make methods like GetAllPages more stable, because these methods need to make multiple api calls in a sequence. This also would help to prevent ApiLimitExceeded exceptions in tests that currently failing on master branch. I researched it a little bit, and there is Microsoft package TransientFaultHandling.Core which defines some base classes for RetyPolicies, but I'm not sure if this package supports 2.0 .net standard. + in our case, retry policy will be very specific to ApiLimitException, so I think that only 'No Retry' policy could be reused in this case...
  2. what do you think about making all properties nullable for objects we're sending & receiving from ShipStation? I looked thru documentation of ShipStation and they don't really tell what is optional and what is always present in response. One of current issues is that shipDate on order is nullable in some cases, and it's required in model, so deserialization breaks. Another approach is to see where it breaks and make only specific fields nullable, and hope that ShipStation doesn't change flow or specification.

If you are good with these changes, I will apply them & send pull request. I will start looking at it today/tomorrow.
And last, but not least, question.. After these changes are done, could you please compile and publish new nuget package? I'm trying to help my team with one improvement project, and part of the change we're trying to make is to remove internal sdk we built in past to communicate with ShipStation, and replace it with package that available on nuget. We tried to use one of nuget packages in past, but that package was missing pagination and good error handling, so we went with our own 'bicycle' which we're trying to deprecate. We have clients on production which use ShipStation heavily in multiple countries, so I will possibly look at other model objects and add any if missing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.