{"id":23346158,"url":"https://github.com/tpmanc/crm-client","last_synced_at":"2025-04-07T17:19:07.807Z","repository":{"id":57072248,"uuid":"144468237","full_name":"tpmanc/crm-client","owner":"tpmanc","description":null,"archived":false,"fork":false,"pushed_at":"2019-08-27T11:39:15.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-13T19:29:01.499Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tpmanc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-12T13:18:23.000Z","updated_at":"2019-08-27T11:39:17.000Z","dependencies_parsed_at":"2022-08-24T14:54:34.133Z","dependency_job_id":null,"html_url":"https://github.com/tpmanc/crm-client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpmanc%2Fcrm-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpmanc%2Fcrm-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpmanc%2Fcrm-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpmanc%2Fcrm-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tpmanc","download_url":"https://codeload.github.com/tpmanc/crm-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247694881,"owners_count":20980733,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-21T07:12:57.888Z","updated_at":"2025-04-07T17:19:07.724Z","avatar_url":"https://github.com/tpmanc.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CRM Client\n\n## Install via Composer\n\nRun the following command\n\n```bash\n$ composer require tpmanc/crmclient \"*\"\n```\n\nor add\n\n```bash\n$ \"tpmanc/crmclient\": \"*\"\n```\n\nto the require section of your `composer.json` file.\n\n## Send orders\n\n```php\nuse tpmanc\\crmclient\\ApiClient;\nuse tpmanc\\crmclient\\Client;\nuse tpmanc\\crmclient\\Order;\nuse tpmanc\\crmclient\\OrderProduct;\nuse tpmanc\\crmclient\\OrderProducts;\n\n...\n\n$client = new Client(\n    'Name 8', // name\n    '+7 (952) 268-97-23' // phone\n);\n$client-\u003esetEmail('email@email.test');\n$client-\u003esetAddress('Address');\n$client-\u003esetDelivery('Delivery Type');\n$client-\u003esetPayment('Payment Type');\n$client-\u003esetComment('Comment');\n\n$orderProducts = new OrderProducts();\n$orderProducts-\u003eaddProduct(new OrderProduct(\n    1982, // product id\n    5000 // product price\n));\n$orderProducts-\u003eaddProduct(new OrderProduct(\n    6571, // product id\n    1000, // product price\n    5 // amount\n));\n\n$orderMethod = 1;\n$order = new Order(\n    '5317263', // id\n    $orderMethod,\n    $client\n);\n$timestamp = time();\n$order-\u003esetDate($timestamp);\n$order-\u003esetStatus(3);\n$order-\u003esetProducts($orderProducts);\n\n\n$apiUrl = 'http://localhost:8080';\n$token = '5XG2qsuKriI6Cq6sYX9krZb622rQ9w6O6XW833HZ';\n$api = new ApiClient($apiUrl, $token);\n$api-\u003eaddOrder($order);\n\n$result = $api-\u003esendOrders();\n```\n\n## Response\n\n```json\n{\n    \"result\":\"ok\",\n    \"orders\":[\n        {\"crmId\":51,\"orderId\":107256},\n        {\"crmId\":52,\"orderId\":107257},\n        {\"crmId\":53,\"orderId\":107258},\n        {\"crmId\":54,\"orderId\":107259},\n        {\"crmId\":55,\"orderId\":107260}\n    ]\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpmanc%2Fcrm-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftpmanc%2Fcrm-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpmanc%2Fcrm-client/lists"}