Advertisement
MChaos

smartbill invoice

Feb 22nd, 2023
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1. POST https://ws.smartbill.ro/SBORO/api/invoice
  2.  
  3. $curl = curl_init();
  4.  
  5. curl_setopt_array($curl, array(
  6. CURLOPT_URL => 'https://ws.smartbill.ro/SBORO/api/invoice',
  7. CURLOPT_RETURNTRANSFER => true,
  8. CURLOPT_ENCODING => '',
  9. CURLOPT_MAXREDIRS => 10,
  10. CURLOPT_TIMEOUT => 0,
  11. CURLOPT_FOLLOWLOCATION => true,
  12. CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  13. CURLOPT_CUSTOMREQUEST => 'POST',
  14. CURLOPT_POSTFIELDS =>' {
  15. "companyVatCode": "41144780",
  16. "client": {
  17. "name": "ILAB24 STUDIO S.R.L.",
  18. "vatCode": "41144780",
  19. "address": "Sos. Salaj, Nr.353a, Bl.7, Sc.2, Et.4, Ap.86",
  20. "isTaxPayer": false,
  21. "city": "Salaj",
  22. "county": "Salaj",
  23. "country": "Romania",
  24. "saveToDb": false
  25. },
  26. "isDraft": false,
  27. "issueDate": "2023-01-24",
  28. "seriesName": "FCT",
  29. "currency": "RON",
  30. "language": "RO",
  31. "precision": 2,
  32. "dueDate": "2023-01-30",
  33. "useEstimateDetails": false,
  34. "products": [
  35. {
  36. "name": "EM-MARINE 0.9 mm",
  37. "code": "000-213",
  38. "productDescription": "EM-MARINE 0.9 mm",
  39. "isDiscount": false,
  40. "measuringUnitName": "buc",
  41. "currency": "RON",
  42. "quantity": 1,
  43. "price": 1.1,
  44. "isTaxIncluded": true,
  45. "taxName": "Normala",
  46. "taxPercentage": 9,
  47. "saveToDb": false,
  48. "isService": false
  49. }
  50. ],
  51. "payment": {
  52. "value": 10.1,
  53. "type": "Ordin plata",
  54. "isCash": false
  55. }
  56. }',
  57. CURLOPT_HTTPHEADER => array(
  58. 'Authorization: Basic c2FsZXNAY2hpcC11YS5jb206MDAyfDc1YzA4NzU2NWY5ZmUxZjlmYjhlNDRlZGRjYzQ5OTg1',
  59. 'Content-Type: application/json',
  60. 'Cookie: JSESSIONID=95115597ba48064452532ce54702'
  61. ),
  62. ));
  63.  
  64. $response = curl_exec($curl);
  65.  
  66. curl_close($curl);
  67. echo $response;
  68.  
  69.  
  70. Получаю ответ
  71. {
  72. "key": "!.oresp@&",
  73. "successfully": false,
  74. "errorText": "Firma la care incercati sa va conectati nu mai este disponibila in Cloud.",
  75. "message": "",
  76. "id": "",
  77. "documentNumber": "",
  78. "auxDocumentNumber": "",
  79. "auxData": {},
  80. "operationExecuted": false,
  81. "nextStep": "",
  82. "cooldown": 0,
  83. "needsConsent": false,
  84. "validationInfo": {
  85. "productsWithNegativeProfit": 0,
  86. "documentsWithNegativeProfit": 0,
  87. "firstDateWithNegativeProfit": null
  88. },
  89. "messageList": [],
  90. "validationMessages": {
  91. "productsWithNegativeProfit": 0,
  92. "documentsWithNegativeProfit": 0,
  93. "firstDateWithNegativeProfit": null
  94. }
  95. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement