NEW Feature
API is a new feature for version 16. 1
To create an API key to use PHP POS's API you navigate to store config --> scroll to bottom --> Add API Key. Once you click add API key we generate a key for you that you can save.
You can then use this API information to create requests by following our API document @
https://phppointofsale.com/api.php
Comments
8 comments
I managed to run but getting empty response
<?php
$request = new HttpRequest();
$request->setUrl('https://dukadirect.phppointofsale.com/index.php/api/v1/customers');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'postman-token' => '0d010222-94c3-2cb8-c56d-c3c0210703bf',
'cache-control' => 'no-cache',
'content-type' => 'application/json',
'x-api-key' => 'wssc08gkcg40koc8ck8g0o4scg0gwk8w0808k84c'
));
$request->setBody('{
"first_name": "John",
"last_name": "Doe",
"email": "john@example.com",
"phone_number": "555-555-5555",
"address_1": "123 Nowhere Street",
"address_2": "Apartment 123",
"city": "Rochester",
"state": "New York",
"zip": "14445",
"country": "United States",
"comments": "A great customer",
"custom_fields": {
"secondary phone number": "555-555-5555"
},
"company_name": "PHP Point Of Sale",
"tier_id": 0,
"account_number": "3333",
"taxable": false,
"tax_certificate": "1234",
"internal_notes": "A nice guy",
"override_default_tax": false,
"tax_class_id": 0,
"balance": 22.99,
"credit_limit": 1000,
"points": 333,
"disable_loyalty": true,
"location_id": 1,
"image_url": "http://www.abc.xyz"
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
Please share requests/responses and/or code. Here is example code to get items
In your code makes sure you remove fields you aren't using. For example, tier_id should NOT be in the request
how do i know which fields are not required?
only first_name is required
Any plans of introducing web hook for price inventory sync soon?
As of now there aren’t plans
We have a feedback site where you provide feature requests and see other requests. You can also upvote existing feature requests and get alerts on requests you interact with.
This provides php point of sale with a clear roadmap of what customers want so we develop the right features
The site is:
https://feedback.phppointofsale.com
Please sign in to leave a comment.