@@ -178,6 +178,45 @@ data = {
178
178
print (wcapi.post(" customers" , data).text)
179
179
```
180
180
181
+ ``` php
182
+ <?php
183
+ $data = array(
184
+ 'customer' => array(
185
+
186
+ 'first_name' => 'John',
187
+ 'last_name' => 'Doe',
188
+ 'username' => 'john.doe',
189
+ 'billing_address' => array(
190
+ 'first_name' => 'John',
191
+ 'last_name' => 'Doe',
192
+ 'company' => '',
193
+ 'address_1' => '969 Market',
194
+ 'address_2' => '',
195
+ 'city' => 'San Francisco',
196
+ 'state' => 'CA',
197
+ 'postcode' => '94103',
198
+ 'country' => 'US',
199
+
200
+ 'phone' => '(555) 555-5555'
201
+ ),
202
+ 'shipping_address' => array(
203
+ 'first_name' => 'John',
204
+ 'last_name' => 'Doe',
205
+ 'company' => '',
206
+ 'address_1' => '969 Market',
207
+ 'address_2' => '',
208
+ 'city' => 'San Francisco',
209
+ 'state' => 'CA',
210
+ 'postcode' => '94103',
211
+ 'country' => 'US'
212
+ )
213
+ )
214
+ );
215
+
216
+ print_r($woocommerce->customers->create($data));
217
+ ?>
218
+ ```
219
+
181
220
> Response:
182
221
183
222
``` json
@@ -257,6 +296,10 @@ WooCommerce.get('customers/2', function(err, data, res) {
257
296
print (wcapi.get(" customers/2" ).text)
258
297
```
259
298
299
+ ``` php
300
+ <?php print_r($woocommerce->customers->get(2)); ?>
301
+ ```
302
+
260
303
> Response:
261
304
262
305
``` json
@@ -329,6 +372,10 @@ WooCommerce.get('customers', function(err, data, res) {
329
372
print (wcapi.get(" customers" ).text)
330
373
```
331
374
375
+ ``` php
376
+ <?php print_r($woocommerce->customers->get()); ?>
377
+ ```
378
+
332
379
> Response:
333
380
334
381
``` json
@@ -482,6 +529,24 @@ data = {
482
529
print (wcapi.put(" customers/2" , data).text)
483
530
```
484
531
532
+ ``` php
533
+ <?php
534
+ $data = array(
535
+ 'customer' => array(
536
+ 'first_name' => 'James',
537
+ 'billing_address' => array(
538
+ 'first_name' => 'James'
539
+ ),
540
+ 'shipping_address' => array(
541
+ 'first_name' => 'James'
542
+ )
543
+ )
544
+ );
545
+
546
+ print_r($woocommerce->customers->update(2, $data));
547
+ ?>
548
+ ```
549
+
485
550
> Response:
486
551
487
552
``` json
@@ -554,6 +619,10 @@ WooCommerce.delete('customers/2', function(err, data, res) {
554
619
print (wcapi.delete(" customers/2" ).text)
555
620
```
556
621
622
+ ``` php
623
+ <?php print_r($woocommerce->customers->delete(2)); ?>
624
+ ```
625
+
557
626
> Response:
558
627
559
628
``` json
@@ -590,6 +659,10 @@ WooCommerce.get('customers/2/orders', function(err, data, res) {
590
659
print (wcapi.get(" customers/2/orders" ).text)
591
660
```
592
661
662
+ ``` php
663
+ <?php print_r($woocommerce->customers->get_orders(2)); ?>
664
+ ```
665
+
593
666
> Response:
594
667
595
668
``` json
@@ -747,6 +820,10 @@ WooCommerce.get('customers/2/downloads', function(err, data, res) {
747
820
print (wcapi.get(" customers/2/downloads" ).text)
748
821
```
749
822
823
+ ``` php
824
+ <?php print_r($woocommerce->customers->get_downloads(2)); ?>
825
+ ```
826
+
750
827
> Response:
751
828
752
829
``` json
@@ -812,6 +889,10 @@ WooCommerce.get('customers/count', function(err, data, res) {
812
889
print (wcapi.get(" customers/count" ).text)
813
890
```
814
891
892
+ ``` php
893
+ <?php print_r($woocommerce->customers->get_count()); ?>
894
+ ```
895
+
815
896
> Response:
816
897
817
898
``` json
0 commit comments