StockinPurchasePush.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 StockinPurchasePush
  8. {
  9. class StockinPurchasePush
  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/stockin_purchase_push.php";
  18. var purchase_info = new
  19. {
  20. purchase_no = "34567876543234",
  21. warehouse_no = "api_test",
  22. outer_no = "4567765433",
  23. details_list = new[]
  24. {
  25. new
  26. {
  27. spec_no ="1001017308AYS2S",
  28. stockin_price = "10",
  29. tax_price = "5.5",
  30. tax = "0.1",
  31. stockin_num = "1",
  32. },
  33. new
  34. {
  35. spec_no ="sku002",
  36. stockin_price = "10",
  37. tax_price = "5.5",
  38. tax = "0.1",
  39. stockin_num = "1",
  40. },
  41. }
  42. };
  43. string json = purchase_info.ToJsonString();
  44. client.putParams("purchase_info", json);
  45. string result = client.wdtOpenapi();
  46. Console.WriteLine(result);
  47. Console.ReadKey();
  48. }
  49. }
  50. }