PurchaseOrderPush.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 PurchaseOrderPush
  8. {
  9. class PurchaseOrderPush
  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/purchase_order_push.php";
  18. var purchase_info = new
  19. {
  20. provider_no = "wl00001",
  21. warehouse_no = "001",
  22. outer_no = "34567876543234",
  23. is_use_outer_no = "0",
  24. is_check = "1",
  25. contact = "旺旺",
  26. telno = "1333333333",
  27. receive_address = "天博中润",
  28. logistics_type = "4",
  29. other_fee = "100.01",
  30. post_fee = "100.02",
  31. remark = "测试",
  32. details_list = new[]
  33. {
  34. new
  35. {
  36. spec_no ="1001017308AYS2S",
  37. num ="1",
  38. price ="10.11",
  39. discount ="10.22",
  40. tax ="0.2",
  41. remark ="API测试",
  42. prop1 ="011",
  43. prop2 ="022"
  44. },
  45. new
  46. {
  47. spec_no ="sku002",
  48. num ="1",
  49. price ="10.11",
  50. discount ="10.22",
  51. tax ="0.2",
  52. remark ="API测试",
  53. prop1 ="011",
  54. prop2 ="022"
  55. },
  56. }
  57. };
  58. string json = purchase_info.ToJsonString();
  59. client.putParams("purchase_info", json);
  60. string result = client.wdtOpenapi();
  61. Console.WriteLine(result);
  62. Console.ReadKey();
  63. }
  64. }
  65. }