{"id":29215216,"url":"https://github.com/pronamic/twinfield","last_synced_at":"2026-03-06T18:03:22.743Z","repository":{"id":7668923,"uuid":"9030889","full_name":"pronamic/twinfield","owner":"pronamic","description":"✗ [DEPRECATED] Library for using the Twinfield API","archived":false,"fork":false,"pushed_at":"2017-11-13T09:14:18.000Z","size":326,"stargazers_count":19,"open_issues_count":0,"forks_count":37,"subscribers_count":13,"default_branch":"develop","last_synced_at":"2025-12-27T20:10:34.303Z","etag":null,"topics":["api","deprecated","php","twinfield"],"latest_commit_sha":null,"homepage":"https://github.com/php-twinfield/twinfield","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/pronamic.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":"2013-03-26T13:31:34.000Z","updated_at":"2023-09-13T09:37:04.000Z","dependencies_parsed_at":"2022-08-24T22:11:53.643Z","dependency_job_id":null,"html_url":"https://github.com/pronamic/twinfield","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/pronamic/twinfield","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pronamic%2Ftwinfield","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pronamic%2Ftwinfield/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pronamic%2Ftwinfield/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pronamic%2Ftwinfield/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pronamic","download_url":"https://codeload.github.com/pronamic/twinfield/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pronamic%2Ftwinfield/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30189483,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T17:33:53.563Z","status":"ssl_error","status_checked_at":"2026-03-06T17:33:51.678Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["api","deprecated","php","twinfield"],"created_at":"2025-07-03T00:08:26.637Z","updated_at":"2026-03-06T18:03:22.721Z","avatar_url":"https://github.com/pronamic.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [DEPRECATED] Twinfield  [![Build Status](https://secure.travis-ci.org/pronamic/twinfield.png?branch=develop)](http://travis-ci.org/pronamic/twinfield)\n\n**This library is moved to https://github.com/php-twinfield/twinfield.**\n\nA PHP library for Twinfield Integration. Developed by [Remco Tolsma](http://remcotolsma.nl/) and [Leon Rowland](http://leon.rowland.nl/) from [Pronamic](http://pronamic.nl/).\nUse the Twinfield SOAP Service to have your PHP application communicate directly with your Twinfield account.\n\n---\n\n## Autoloading\n\nThe classes follow the PSR2 naming convention.\n\n\n## Usage\n\n### General Usage Information\nComponents will have Factories to simplify the request and send process of Twinfield.\nEach factory will require just the \\Pronamic\\Twinfield\\Secure\\Config() class with\nthe filled in details.\n\nAn example of the usage of the Configuration class.\n\n```php\n$config = new \\Pronamic\\Twinfield\\Secure\\Config();\n$config-\u003esetCredentials('Username', 'Password', 'Organization', 'Office');\n```\n\n* or, when using OAuth:\n\n```php\n$config = new \\Pronamic\\Twinfield\\Secure\\Config();\n$config-\u003esetOAuthParameters('clientID', 'clientSecret', 'returnURL', 'Organization', 'Office', true);\n//the true parameter at the end tells the system to automatically redirect to twinfield to login\n```\n\n\n\nNow, to the current modules\n\nIn the following example, we will use the Customer component as showcase. Although \nthis will be the method for all components ( including Invoice currently )\n\nTypically it is as follows, if using the Factories\n\n* Add/Edit: Make Object, Make Factory, Give object in Submit method of related factory.\n* Retrieve: Make Factory, Supply all required params to respective listAll() and get() methods\n\n#### Add/Edit\n\nMake your Customer object\n\n```php\n$customer = new \\Pronamic\\Twinfield\\Customer\\Customer();\n$customer\n\t-\u003esetID(10666)\n\t-\u003esetName('Leon Rowland')\n\t-\u003esetType('DEB')\n\t-\u003esetWebsite('http://leon.rowland.nl')\n\t-\u003esetEBilling(true)\n\t-\u003esetEBillMail('leon@rowland.nl')\n\t-\u003esetVatCode('VL')\n\t-\u003esetDueDays(10)\n\t-\u003esetCocNumber('12341234');\n```\n\nCustomers can have addresses associated with them\n\n```php\n$customerAddress = new \\Pronamic\\Twinfield\\Customer\\CustomerAddress();\n$customerAddress\n\t-\u003esetDefault(false)\n\t-\u003esetType('invoice')\n\t-\u003esetField1('Testing field 1')\n\t-\u003esetField2('Testing field 2')\n\t-\u003esetField3('Testing field 3')\n\t-\u003esetPostcode('1212 AB')\n\t-\u003esetCity('TestCity')\n\t-\u003esetCountry('NL')\n\t-\u003esetTelephone('010-12345')\n\t-\u003esetFax('010-1234')\n\t-\u003esetEmail('test@email.com');\n```\n\nAssign that address to the customer\n\n```php\n$customer-\u003eaddAddress($customerAddress);\n```\n\nNow lets submit it!\n\n```php\nuse \\Pronamic\\Twinfield\\Customer as TwinfieldCustomer;\n\n// Config object prepared and passed to the CustomerFactory\n$customerFactory = new TwinfieldCustomer\\CustomerFactory($config);\n\n//$customer = new TwinfieldCustomer\\Customer();\n\n// Attempt to send the Customer document\nif($customerFactory-\u003esend($customer)){\n\t// Use the Mapper to turn the response back into a TwinfieldCustomer\\Customer\n\t$successfulCustomer = TwinfieldCustomer\\Mapper\\CustomerMapper::map($customerFactory-\u003egetResponse());\n}\n```\n\n#### Retrieve/Request\n\nYou can get all customers or get a single one currently.\n\n```php\nuse \\Pronamic\\Twinfield\\Customer as TwinfieldCustomer;\n\n// Config object prepared and passed into the CustomerFactory\n$customerFactory = new TwinfieldCustomer\\CustomerFactory($config);\n\n$customers = $customerFactory-\u003elistAll();\n```\n\nAt the moment, listAll will return an array of just name and short name.\n\n```php\n\n$customer = $customerFactory-\u003eget('customerCode', 'office[optional]');\n```\n\nThe response from get() will be a \\Pronamic\\Twinfield\\Customer\\Customer object.\n\n\n#### Notes\n\nAdvanced documentation coming soon. Detailing usage without the Factory class. Giving you more control\nwith the response and data as well as more in-depth examples and usage recommendations.\n\n\n## Contribute\n\nYou can contribute to the development of this project. Try and keep to the way of doing things as\nthe other 2 components have implemented.\n\nA large requirement is to maintain backwards compatibility so if you have any plans for large\nrestructure or alteration please bring up in an issue first.\n\n| Component                                                                                                       | get()              | listAll()          | send()             | Mapper             | Namespace                                                                                                               |\n| --------------------------------------------------------------------------------------------------------------- | :----------------: | :----------------: | :----------------: | :----------------: | ----------------------------------------------------------------------------------------------------------------------- |\n| [Customer](https://c1.twinfield.com/webservices/documentation/#/ApiReference/Masters/Customers)                 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | [Pronamic/Twinfield/Customer](https://github.com/pronamic/twinfield/tree/develop/src/Pronamic/Twinfield/Customer)       |\n| [Sales Invoices](https://c1.twinfield.com/webservices/documentation/#/ApiReference/SalesInvoices)               | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | [Pronamic/Twinfield/Invoice](https://github.com/pronamic/twinfield/tree/develop/src/Pronamic/Twinfield/Invoice)         |\n| Transactions: [Purchase](https://c1.twinfield.com/webservices/documentation/#/ApiReference/PurchaseTransactions) [Sale](https://c1.twinfield.com/webservices/documentation/#/ApiReference/SalesTransactions) |                    |                    | :white_check_mark: |                    | [Pronamic/Twinfield/Transaction](https://github.com/pronamic/twinfield/tree/develop/src/Pronamic/Twinfield/Transaction) |\n| [Articles](https://c1.twinfield.com/webservices/documentation/#/ApiReference/Masters/Articles)                  |                    |                    |                    |                    | Pronamic/Twinfield/Article                                                                                              |\n| [Balance Sheets](https://c1.twinfield.com/webservices/documentation/#/ApiReference/Masters/BalanceSheets)       |                    |                    |                    |                    | Pronamic/Twinfield/BalanceSheet                                                                                         |\n| [Suppliers](https://c1.twinfield.com/webservices/documentation/#/ApiReference/Masters/Suppliers)                | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | Pronamic/Twinfield/Supplier                                                                                             |\n| [Dimension Groups](https://c1.twinfield.com/webservices/documentation/#/ApiReference/Masters/DimensionGroups)   |                    |                    |                    |                    | Pronamic/Twinfield/Dimension/Group                                                                                      |\n| [Dimension Types](https://c1.twinfield.com/webservices/documentation/#/ApiReference/Masters/DimensionTypes)     |                    |                    |                    |                    | Pronamic/Twinfield/Dimension/Type                                                                                       |\n| [Offices](https://c1.twinfield.com/webservices/documentation/#/ApiReference/Masters/Offices)                    |                    | :white_check_mark: |                    |                    | Pronamic/Twinfield/Office                                                                                               |\n| [Vat types](https://c3.twinfield.com/webservices/documentation/#/ApiReference/Miscellaneous/Finder)             |                    | :white_check_mark: |                    |                    | Pronamic/Twinfield/VatCode                                                                                              |\n\n\n## Build\n\n*\tnpm install\n*\tcomposer install\n\n\n## Links\n\n* [Twinfield API Documentation site](https://c1.twinfield.com/webservices/documentation/)\n* [Twinfield Library for Python](https://bitbucket.org/vanschelven/twinfield)\n* [Using Grunt for PHP](https://chrsm.org/post/using-grunt-for-php/)\n* [Using Grunt with PHP Quality Assurance Tools](http://mariehogebrandt.se/articles/using-grunt-php-quality-assurance-tools/)\n\n\n## Authors\n\n*\t[Pronamic](http://pronamic.nl/)\n*\t[Remco Tolsma](http://remcotolsma.nl/)\n*   [Emile Bons](http://www.emilebons.nl)\n\n\n## License\n\nCopyright 2009-2013 Pronamic.\n\nThis program is free software; you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation; either version 2 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program; if not, write to the Free Software\nFoundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpronamic%2Ftwinfield","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpronamic%2Ftwinfield","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpronamic%2Ftwinfield/lists"}