StockTransferPush.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using WdtSdk;
  7. namespace StockTransferPush
  8. {
  9. class StockTransferPush
  10. {
  11. static void Main(string[] args)
  12. {
  13. WdtClient client = new WdtClient();
  14. client.sid = "";
  15. client.appkey = "";
  16. client.appsecret = "";
  17. client.gatewayUrl = "http://121.41.177.115/openapi2/stock_transfer_push.php";
  18. var transfer_info = new
  19. {
  20. outer_no = "5678765432345",
  21. from_warehouse_no = "api_test",
  22. to_warehouse_no = "wh002",
  23. skus = new[]
  24. {
  25. new{
  26. spec_no = "test-ptsd-00002",
  27. num = "1"
  28. },
  29. new{
  30. spec_no = "test-ptsd-00001",
  31. num = "1"
  32. }
  33. }
  34. };
  35. string json = transfer_info.ToJsonString();
  36. client.putParams("transfer_info", json);
  37. string result = client.wdtOpenapi();
  38. Console.WriteLine(result);
  39. Console.ReadKey();
  40. }
  41. }
  42. }