Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.76 KB | None | 0 0
  1. <?php
  2.  
  3. $data = array(
  4.     "UserName" => "sagoropoulos",
  5.     "Email" => "ds@webexpert.gr",
  6.     "PromoCode" => "promo_code_1",
  7.     "CouponCode" => "coupon_code_1",
  8.     "CouponCreatedDt" => "2019-08-07T14:16:32.312493+03:00",
  9.     "CouponDaysActive" => "50",
  10.     "CouponAmount" => "5"
  11. );
  12. $data_string = json_encode($data);
  13.  
  14. $ch = curl_init('https://platform.cleverpoint.gr/api/v1/Shipping/PromoFromShopCleverPoint/');
  15. curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
  16. curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
  17. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  18. curl_setopt($ch, CURLOPT_HTTPHEADER, array(
  19.         'Content-Type: application/json',
  20.         'Content-Length: ' . strlen($data_string))
  21. );
  22.  
  23. $result = curl_exec($ch);
  24.  
  25. print_r($result);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement