diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index ddd19845..26c419a0 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,4 +1,8 @@ +### New Features + + - Implement V2 Get Order and Get all Orders + ### Fixes - - Fixes issue with Product Option Value API + - Fixed error where amount was `int` instead of `float` in price rules diff --git a/docs/classes/BigCommerce-ApiV2-Api-Orders-OrdersApi.html b/docs/classes/BigCommerce-ApiV2-Api-Orders-OrdersApi.html index 68e14751..86ac9e23 100644 --- a/docs/classes/BigCommerce-ApiV2-Api-Orders-OrdersApi.html +++ b/docs/classes/BigCommerce-ApiV2-Api-Orders-OrdersApi.html @@ -99,17 +99,36 @@

Orders v2 API

-

Currently only implements create.

+

Some functionality for Orders is not available in V3, so this V2 API class has been implemented.

+
+ + +
+ Tags + +
+
+
+ see +
+
+ OrdersApi + +

for the V3 API

Example

+

Create an Order

$api = new BigCommerce\ApiV2\V2ApiClient($_ENV['hash'], $_ENV['CLIENT_ID'], $_ENV['ACCESS_TOKEN']);
 
 $order = new BigCommerce\ApiV2\ResourceModels\Order\Order();
+$order->products = [
+    OrderProduct::build('test', 1, 12, 10),
+];
 // set order details...
 
 try {
@@ -119,9 +138,14 @@ 

Example

echo "Unable to update product: {$exception->getMessage()}"; }
+

Get Order Counts

+
$api = new BigCommerce\ApiV2\V2ApiClient($_ENV['hash'], $_ENV['CLIENT_ID'], $_ENV['ACCESS_TOKEN']);
+$ordersAwaitingFulfillmentCount = $api->orders()->count()->statuses['Awaiting Fulfillment'];
+
- +
+
@@ -139,6 +163,13 @@

 : mixed +
+ +
+ count() + +  : OrderCount +
@@ -146,6 +177,20 @@

 : object

+
+ +
+ get() + +  : Order|null +
+
+ +
+ getAll() + +  : array<string|int, Order> +
@@ -255,6 +300,39 @@
Return values
— + +
@@ -299,6 +377,98 @@
Return values
— +
+
+

+ get() + +

+ + + + + public + get() : Order|null + +
+ + + + +
Return values
+ Order|null + — + + +
+
+

+ getAll() + +

+ + + + + public + getAll([array<string|int, mixed> $filters = [] ][, int $page = 1 ][, int $limit = 250 ]) : array<string|int, Order> + + +
Parameters
+
+
+ $filters + : array<string|int, mixed> + = []
+
+
+ +
+
+ $page + : int + = 1
+
+
+ +
+
+ $limit + : int + = 250
+
+
+ +
+
+ + + +
Return values
+ array<string|int, Order> + — + +
@@ -445,7 +615,7 @@

diff --git a/docs/classes/BigCommerce-ApiV2-ResourceModels-Order-Order.html b/docs/classes/BigCommerce-ApiV2-ResourceModels-Order-Order.html index cfb68383..b9135f99 100644 --- a/docs/classes/BigCommerce-ApiV2-ResourceModels-Order-Order.html +++ b/docs/classes/BigCommerce-ApiV2-ResourceModels-Order-Order.html @@ -150,7 +150,7 @@

$cart_id -  : string +  : string|null
@@ -213,7 +213,7 @@

$customer_message -  : string +  : string|null
@@ -395,7 +395,7 @@

$payment_provider_id -  : string +  : string|null
@@ -465,7 +465,7 @@

$staff_notes -  : string +  : string|null
@@ -745,7 +745,7 @@

public - string + string|null $cart_id @@ -1051,7 +1051,7 @@

public - string + string|null $customer_message @@ -1935,7 +1935,7 @@

public - string + string|null $payment_provider_id @@ -2271,7 +2271,7 @@

public - string + string|null $staff_notes diff --git a/docs/classes/BigCommerce-ApiV2-ResourceModels-ResourceReference.html b/docs/classes/BigCommerce-ApiV2-ResourceModels-ResourceReference.html new file mode 100644 index 00000000..33f38712 --- /dev/null +++ b/docs/classes/BigCommerce-ApiV2-ResourceModels-ResourceReference.html @@ -0,0 +1,403 @@ + + + + + Documentation + + + + + + + + + + + + + + + + + + + +
+

Documentation

+ + + + + +
+ +
+
+ + + + +
+ + +
+

+ ResourceReference + + + extends ResourceModel + + + + +

+ + + + +
+ + + + + + + + +

+ Table of Contents + +

+ +
+
+ $resource + +  : string +
+
+ +
+ $url + +  : string +
+
+ +
+ __construct() + +  : mixed +
+
+ +
+ jsonSerialize() + +  : array<string|int, mixed> +
+
+ +
+ + + + + + +
+

+ Properties + +

+
+

+ $resource + + + +

+ + + + + public + string + $resource + + +
+ +
+ + + +
+ +
+ +
+

+ Methods + +

+
+

+ __construct() + +

+ + + + + public + __construct([stdClass|null $optionObject = null ]) : mixed + +
+ +
Parameters
+
+
+ $optionObject + : stdClass|null + = null
+
+
+ +
+
+ + + +
Return values
+ mixed + — + + +
+
+

+ jsonSerialize() + +

+ + + + + public + jsonSerialize() : array<string|int, mixed> + +
+ + + + +
Return values
+ array<string|int, mixed> + — + + +
+
+ + + + +
+
+
+
+

Search results

+ +
+
+
    +
    +
    +
    +
    +
    + + +
    + + + + + + + + diff --git a/docs/classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html b/docs/classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html new file mode 100644 index 00000000..3e7518f8 --- /dev/null +++ b/docs/classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html @@ -0,0 +1,2905 @@ + + + + + Documentation + + + + + + + + + + + + + + + + + + + +
    +

    Documentation

    + + + + + +
    + +
    +
    + + + + +
    + + +
    +

    + Order + + + extends ResourceModel + + + + +

    + + + + +
    + + + + + + + + +

    + Table of Contents + +

    + +
    +
    + $base_handling_cost + +  : string +
    +
    + +
    + $base_shipping_cost + +  : string +
    +
    + +
    + $base_wrapping_cost + +  : string +
    +
    + +
    + $billing_address + +  : OrderBillingAddress +
    +
    + +
    + $cart_id + +  : string|null +
    +
    + +
    + $channel_id + +  : int +
    +
    + +
    + $coupon_discount + +  : string +
    +
    + +
    + $coupons + +  : object +
    +
    + +
    + $currency_code + +  : string +
    +
    + +
    + $currency_exchange_rate + +  : string +
    +
    + +
    + $currency_id + +  : int +
    +
    + +
    + $customer_id + +  : int +
    +
    + +
    + $customer_locale + +  : string +
    +
    + +
    + $customer_message + +  : string|null +
    +
    + +
    + $date_created + +  : string +
    +
    + +
    + $date_modified + +  : string +
    +
    + +
    + $date_shipped + +  : string +
    +
    + +
    + $default_currency_code + +  : string +
    +
    + +
    + $default_currency_id + +  : int +
    +
    + +
    + $discount_amount + +  : string +
    +
    + +
    + $ebay_order_id + +  : string +
    +
    + +
    + $external_id + +  : string|null +
    +
    + +
    + $external_source + +  : string|null +
    +
    + +
    + $geoip_country + +  : string +
    +
    + +
    + $geoip_country_iso2 + +  : string +
    +
    + +
    + $gift_certificate_amount + +  : string +
    +
    + +
    + $handling_cost_ex_tax + +  : string +
    +
    + +
    + $handling_cost_inc_tax + +  : string +
    +
    + +
    + $handling_cost_tax + +  : string +
    +
    + +
    + $handling_cost_tax_class_id + +  : int +
    +
    + +
    + $id + +  : int|null +
    +
    + +
    + $ip_address + +  : string +
    +
    + +
    + $is_deleted + +  : bool +
    +
    + +
    + $is_email_opt_in + +  : bool +
    +
    + +
    + $items_shipped + +  : int +
    +
    + +
    + $items_total + +  : int +
    +
    + +
    + $order_is_digital + +  : bool +
    +
    + +
    + $order_source + +  : string +
    +
    + +
    + $payment_method + +  : string +
    +
    + +
    + $payment_provider_id + +  : string|null +
    +
    + +
    + $payment_status + +  : string +
    +
    + +
    + $products + +  : ResourceReference +
    +
    + +
    + $refunded_amount + +  : string +
    +
    + +
    + $shipping_address_count + +  : int +
    +
    + +
    + $shipping_addresses + +  : ResourceReference +
    +
    + +
    + $shipping_cost_ex_tax + +  : string +
    +
    + +
    + $shipping_cost_inc_tax + +  : string +
    +
    + +
    + $shipping_cost_tax + +  : string +
    +
    + +
    + $shipping_cost_tax_class_id + +  : int +
    +
    + +
    + $staff_notes + +  : string|null +
    +
    + +
    + $status + +  : string +
    +
    + +
    + $status_id + +  : int +
    +
    + +
    + $store_credit_amount + +  : string +
    +
    + +
    + $subtotal_ex_tax + +  : string +
    +
    + +
    + $subtotal_inc_tax + +  : string +
    +
    + +
    + $subtotal_tax + +  : string +
    +
    + +
    + $tax_provider_id + +  : string +
    +
    + +
    + $total_ex_tax + +  : string +
    +
    + +
    + $total_inc_tax + +  : string +
    +
    + +
    + $wrapping_cost_ex_tax + +  : string +
    +
    + +
    + $wrapping_cost_inc_tax + +  : string +
    +
    + +
    + $wrapping_cost_tax + +  : string +
    +
    + +
    + $wrapping_cost_tax_class_id + +  : int +
    +
    + +
    + __construct() + +  : mixed +
    +
    + +
    + jsonSerialize() + +  : array<string|int, mixed> +
    +
    + +
    + + + + + + +
    +

    + Properties + +

    +
    +

    + $base_handling_cost + + + +

    + + + + + public + string + $base_handling_cost + + +
    + +
    + + + +
    +
    +

    + $base_shipping_cost + + + +

    + + + + + public + string + $base_shipping_cost + + +
    + +
    + + + +
    +
    +

    + $base_wrapping_cost + + + +

    + + + + + public + string + $base_wrapping_cost + + +
    + +
    + + + +
    + +
    +

    + $cart_id + + + +

    + + + + + public + string|null + $cart_id + + +
    + +
    + + + +
    +
    +

    + $channel_id + + + +

    + + + + + public + int + $channel_id + + +
    + +
    + + + +
    +
    +

    + $coupon_discount + + + +

    + + + + + public + string + $coupon_discount + + +
    + +
    + + + +
    +
    +

    + $coupons + + + +

    + + + + + public + object + $coupons + + +
    + +
    + + + +
    +
    +

    + $currency_code + + + +

    + + + + + public + string + $currency_code + + +
    + +
    + + + +
    +
    +

    + $currency_exchange_rate + + + +

    + + + + + public + string + $currency_exchange_rate + + +
    + +
    + + + +
    +
    +

    + $currency_id + + + +

    + + + + + public + int + $currency_id + + +
    + +
    + + + +
    +
    +

    + $customer_id + + + +

    + + + + + public + int + $customer_id + + +
    + +
    + + + +
    +
    +

    + $customer_locale + + + +

    + + + + + public + string + $customer_locale + + +
    + +
    + + + +
    +
    +

    + $customer_message + + + +

    + + + + + public + string|null + $customer_message + + +
    + +
    + + + +
    +
    +

    + $date_created + + + +

    + + + + + public + string + $date_created + + +
    + +
    + + + +
    +
    +

    + $date_modified + + + +

    + + + + + public + string + $date_modified + + +
    + +
    + + + +
    +
    +

    + $date_shipped + + + +

    + + + + + public + string + $date_shipped + + +
    + +
    + + + +
    +
    +

    + $default_currency_code + + + +

    + + + + + public + string + $default_currency_code + + +
    + +
    + + + +
    +
    +

    + $default_currency_id + + + +

    + + + + + public + int + $default_currency_id + + +
    + +
    + + + +
    +
    +

    + $discount_amount + + + +

    + + + + + public + string + $discount_amount + + +
    + +
    + + + +
    +
    +

    + $ebay_order_id + + + +

    + + + + + public + string + $ebay_order_id + + +
    + +
    + + + +
    +
    +

    + $external_id + + + +

    + + + + + public + string|null + $external_id + + +
    + +
    + + + +
    +
    +

    + $external_source + + + +

    + + + + + public + string|null + $external_source + + +
    + +
    + + + +
    +
    +

    + $geoip_country + + + +

    + + + + + public + string + $geoip_country + + +
    + +
    + + + +
    +
    +

    + $geoip_country_iso2 + + + +

    + + + + + public + string + $geoip_country_iso2 + + +
    + +
    + + + +
    +
    +

    + $gift_certificate_amount + + + +

    + + + + + public + string + $gift_certificate_amount + + +
    + +
    + + + +
    +
    +

    + $handling_cost_ex_tax + + + +

    + + + + + public + string + $handling_cost_ex_tax + + +
    + +
    + + + +
    +
    +

    + $handling_cost_inc_tax + + + +

    + + + + + public + string + $handling_cost_inc_tax + + +
    + +
    + + + +
    +
    +

    + $handling_cost_tax + + + +

    + + + + + public + string + $handling_cost_tax + + +
    + +
    + + + +
    +
    +

    + $handling_cost_tax_class_id + + + +

    + + + + + public + int + $handling_cost_tax_class_id + + +
    + +
    + + + +
    +
    +

    + $id + + + +

    + + + + + public + int|null + $id + + +
    + +
    + + + +
    +
    +

    + $ip_address + + + +

    + + + + + public + string + $ip_address + + +
    + +
    + + + +
    +
    +

    + $is_deleted + + + +

    + + + + + public + bool + $is_deleted + + +
    + +
    + + + +
    +
    +

    + $is_email_opt_in + + + +

    + + + + + public + bool + $is_email_opt_in + + +
    + +
    + + + +
    +
    +

    + $items_shipped + + + +

    + + + + + public + int + $items_shipped + + +
    + +
    + + + +
    +
    +

    + $items_total + + + +

    + + + + + public + int + $items_total + + +
    + +
    + + + +
    +
    +

    + $order_is_digital + + + +

    + + + + + public + bool + $order_is_digital + + +
    + +
    + + + +
    +
    +

    + $order_source + + + +

    + + + + + public + string + $order_source + + +
    + +
    + + + +
    +
    +

    + $payment_method + + + +

    + + + + + public + string + $payment_method + + +
    + +
    + + + +
    +
    +

    + $payment_provider_id + + + +

    + + + + + public + string|null + $payment_provider_id + + +
    + +
    + + + +
    +
    +

    + $payment_status + + + +

    + + + + + public + string + $payment_status + + +
    + +
    + + + +
    + +
    +

    + $refunded_amount + + + +

    + + + + + public + string + $refunded_amount + + +
    + +
    + + + +
    +
    +

    + $shipping_address_count + + + +

    + + + + + public + int + $shipping_address_count + + +
    + +
    + + + +
    +
    +

    + $shipping_addresses + + + +

    + + + + + public + ResourceReference + $shipping_addresses + + +
    + +
    + + + +
    +
    +

    + $shipping_cost_ex_tax + + + +

    + + + + + public + string + $shipping_cost_ex_tax + + +
    + +
    + + + +
    +
    +

    + $shipping_cost_inc_tax + + + +

    + + + + + public + string + $shipping_cost_inc_tax + + +
    + +
    + + + +
    +
    +

    + $shipping_cost_tax + + + +

    + + + + + public + string + $shipping_cost_tax + + +
    + +
    + + + +
    +
    +

    + $shipping_cost_tax_class_id + + + +

    + + + + + public + int + $shipping_cost_tax_class_id + + +
    + +
    + + + +
    +
    +

    + $staff_notes + + + +

    + + + + + public + string|null + $staff_notes + + +
    + +
    + + + +
    +
    +

    + $status + + + +

    + + + + + public + string + $status + + +
    + +
    + + + +
    +
    +

    + $status_id + + + +

    + + + + + public + int + $status_id + + +
    + +
    + + + +
    +
    +

    + $store_credit_amount + + + +

    + + + + + public + string + $store_credit_amount + + +
    + +
    + + + +
    +
    +

    + $subtotal_ex_tax + + + +

    + + + + + public + string + $subtotal_ex_tax + + +
    + +
    + + + +
    +
    +

    + $subtotal_inc_tax + + + +

    + + + + + public + string + $subtotal_inc_tax + + +
    + +
    + + + +
    +
    +

    + $subtotal_tax + + + +

    + + + + + public + string + $subtotal_tax + + +
    + +
    + + + +
    +
    +

    + $tax_provider_id + + + +

    + + + + + public + string + $tax_provider_id + + +
    + +
    + + + +
    +
    +

    + $total_ex_tax + + + +

    + + + + + public + string + $total_ex_tax + + +
    + +
    + + + +
    +
    +

    + $total_inc_tax + + + +

    + + + + + public + string + $total_inc_tax + + +
    + +
    + + + +
    +
    +

    + $wrapping_cost_ex_tax + + + +

    + + + + + public + string + $wrapping_cost_ex_tax + + +
    + +
    + + + +
    +
    +

    + $wrapping_cost_inc_tax + + + +

    + + + + + public + string + $wrapping_cost_inc_tax + + +
    + +
    + + + +
    +
    +

    + $wrapping_cost_tax + + + +

    + + + + + public + string + $wrapping_cost_tax + + +
    + +
    + + + +
    +
    +

    + $wrapping_cost_tax_class_id + + + +

    + + + + + public + int + $wrapping_cost_tax_class_id + + +
    + +
    + + + +
    +
    + +
    +

    + Methods + +

    +
    +

    + __construct() + +

    + + + + + public + __construct([stdClass|null $optionObject = null ]) : mixed + +
    + +
    Parameters
    +
    +
    + $optionObject + : stdClass|null + = null
    +
    +
    + +
    +
    + + + +
    Return values
    + mixed + — + + +
    +
    +

    + jsonSerialize() + +

    + + + + + public + jsonSerialize() : array<string|int, mixed> + +
    + + + + +
    Return values
    + array<string|int, mixed> + — + + +
    +
    + + + + +
    +
    +
    +
    +

    Search results

    + +
    +
    +
      +
      +
      +
      +
      +
      + + +
      + + + + + + + + diff --git a/docs/classes/BigCommerce-ApiV2-ResponseModels-Order-OrderCount.html b/docs/classes/BigCommerce-ApiV2-ResponseModels-Order-OrderCount.html new file mode 100644 index 00000000..efa768b4 --- /dev/null +++ b/docs/classes/BigCommerce-ApiV2-ResponseModels-Order-OrderCount.html @@ -0,0 +1,404 @@ + + + + + Documentation + + + + + + + + + + + + + + + + + + + +
      +

      Documentation

      + + + + + +
      + +
      +
      + + + + +
      + + +
      +

      + OrderCount + + + extends ResourceModel + + + + +

      + + + + +
      + + + + + + + + +

      + Table of Contents + +

      + +
      +
      + $count + +  : int +
      +
      + +
      + $statuses + +  : array<string|int, mixed> +
      +
      + +
      + __construct() + +  : mixed +
      +
      + +
      + jsonSerialize() + +  : array<string|int, mixed> +
      +
      + +
      + + + + + + +
      +

      + Properties + +

      +
      +

      + $count + + + +

      + + + + + public + int + $count + + +
      + +
      + + + +
      +
      +

      + $statuses + + + +

      + + + + + public + array<string|int, mixed> + $statuses + + + +

      with name as the key

      +
      + + + +
      +
      + +
      +

      + Methods + +

      +
      +

      + __construct() + +

      + + + + + public + __construct([stdClass|null $optionObject = null ]) : mixed + +
      + +
      Parameters
      +
      +
      + $optionObject + : stdClass|null + = null
      +
      +
      + +
      +
      + + + +
      Return values
      + mixed + — + + +
      +
      +

      + jsonSerialize() + +

      + + + + + public + jsonSerialize() : array<string|int, mixed> + +
      + + + + +
      Return values
      + array<string|int, mixed> + — + + +
      +
      + + + + +
      +
      +
      +
      +

      Search results

      + +
      +
      +
        +
        +
        +
        +
        +
        + + +
        + + + + + + + + diff --git a/docs/classes/BigCommerce-ApiV2-ResponseModels-Order-OrderStatusCount.html b/docs/classes/BigCommerce-ApiV2-ResponseModels-Order-OrderStatusCount.html new file mode 100644 index 00000000..f8254334 --- /dev/null +++ b/docs/classes/BigCommerce-ApiV2-ResponseModels-Order-OrderStatusCount.html @@ -0,0 +1,609 @@ + + + + + Documentation + + + + + + + + + + + + + + + + + + + +
        +

        Documentation

        + + + + + +
        + +
        +
        + + + + +
        + + +
        +

        + OrderStatusCount + + + extends ResourceModel + + + + +

        + + + + +
        + + + + + + + + +

        + Table of Contents + +

        + +
        +
        + $count + +  : int +
        +
        + +
        + $custom_label + +  : string +
        +
        + +
        + $id + +  : int +
        +
        + +
        + $name + +  : string +
        +
        + +
        + $sort_order + +  : int +
        +
        + +
        + $system_description + +  : string +
        +
        + +
        + $system_label + +  : string +
        +
        + +
        + __construct() + +  : mixed +
        +
        + +
        + jsonSerialize() + +  : array<string|int, mixed> +
        +
        + +
        + + + + + + +
        +

        + Properties + +

        +
        +

        + $count + + + +

        + + + + + public + int + $count + + +
        + +
        + + + +
        +
        +

        + $custom_label + + + +

        + + + + + public + string + $custom_label + + +
        + +
        + + + +
        + +
        +

        + $name + + + +

        + + + + + public + string + $name + + +
        + +
        + + + +
        +
        +

        + $sort_order + + + +

        + + + + + public + int + $sort_order + + +
        + +
        + + + +
        +
        +

        + $system_description + + + +

        + + + + + public + string + $system_description + + +
        + +
        + + + +
        +
        +

        + $system_label + + + +

        + + + + + public + string + $system_label + + +
        + +
        + + + +
        +
        + +
        +

        + Methods + +

        +
        +

        + __construct() + +

        + + + + + public + __construct([stdClass|null $optionObject = null ]) : mixed + +
        + +
        Parameters
        +
        +
        + $optionObject + : stdClass|null + = null
        +
        +
        + +
        +
        + + + +
        Return values
        + mixed + — + + +
        +
        +

        + jsonSerialize() + +

        + + + + + public + jsonSerialize() : array<string|int, mixed> + +
        + + + + +
        Return values
        + array<string|int, mixed> + — + + +
        +
        + + + + +
        +
        +
        +
        +

        Search results

        + +
        +
        +
          +
          +
          +
          +
          +
          + + +
          + + + + + + + + diff --git a/docs/classes/BigCommerce-ApiV2-V2ApiClient.html b/docs/classes/BigCommerce-ApiV2-V2ApiClient.html index 266304cf..0601e509 100644 --- a/docs/classes/BigCommerce-ApiV2-V2ApiClient.html +++ b/docs/classes/BigCommerce-ApiV2-V2ApiClient.html @@ -173,6 +173,13 @@

           : Client

          +
          + +
          + order() + +  : OrdersApi +
          @@ -456,6 +463,50 @@
          Return values
          — + +
          +

          + order() + +

          + + + + + public + order(int $orderId) : OrdersApi + +
          + +
          Parameters
          +
          +
          + $orderId + : int +
          +
          +
          + +
          +
          + + + +
          Return values
          + OrdersApi + — + +
          diff --git a/docs/classes/BigCommerce-ApiV3-Api-Generic-GetAllResources.html b/docs/classes/BigCommerce-ApiV3-Api-Generic-GetAllResources.html index 2f426704..2cb6d054 100644 --- a/docs/classes/BigCommerce-ApiV3-Api-Generic-GetAllResources.html +++ b/docs/classes/BigCommerce-ApiV3-Api-Generic-GetAllResources.html @@ -115,7 +115,7 @@

          getClient() -  : Client +  : BaseApiClient
          @@ -157,7 +157,7 @@

          public - abstract getClient() : Client + abstract getClient() : BaseApiClient
          @@ -165,7 +165,7 @@

          Return values
          - Client + BaseApiClient — diff --git a/docs/classes/BigCommerce-ApiV3-Api-Orders-OrdersApi.html b/docs/classes/BigCommerce-ApiV3-Api-Orders-OrdersApi.html index 53699198..d834a588 100644 --- a/docs/classes/BigCommerce-ApiV3-Api-Orders-OrdersApi.html +++ b/docs/classes/BigCommerce-ApiV3-Api-Orders-OrdersApi.html @@ -99,17 +99,30 @@

          -

          V3ApiBase

          +

          V3 Orders API

          -

          Add constructors and some basic scaffolding that will work for all API classes -regardless of which endpoints they implement

          +

          V3 API for Orders is quite limited, so a V2 API client is provided.

          +
          + Tags + +
          +
          +
          + see +
          +
          + OrdersApi + + +
          +
          @@ -370,7 +383,7 @@

          @@ -414,7 +427,7 @@

          @@ -447,7 +460,7 @@

          @@ -480,7 +493,7 @@

          @@ -513,7 +526,7 @@

          diff --git a/docs/classes/BigCommerce-ApiV3-ResourceModels-Catalog-Product-ProductBulkPricingRule.html b/docs/classes/BigCommerce-ApiV3-ResourceModels-Catalog-Product-ProductBulkPricingRule.html index e1982484..282346b6 100644 --- a/docs/classes/BigCommerce-ApiV3-ResourceModels-Catalog-Product-ProductBulkPricingRule.html +++ b/docs/classes/BigCommerce-ApiV3-ResourceModels-Catalog-Product-ProductBulkPricingRule.html @@ -144,7 +144,7 @@

          $amount -  : int +  : float
          @@ -318,7 +318,7 @@

          public - int + float $amount diff --git a/docs/files/bigcommerce-api-orders-ordersapi.html b/docs/files/bigcommerce-api-orders-ordersapi.html index 0d214ba5..c2d6ec1f 100644 --- a/docs/files/bigcommerce-api-orders-ordersapi.html +++ b/docs/files/bigcommerce-api-orders-ordersapi.html @@ -99,7 +99,7 @@

          OrdersApi
          -
          V3ApiBase
          +
          V3 Orders API
          diff --git a/docs/files/bigcommercelegacyapi-resourcemodels-resourcereference.html b/docs/files/bigcommercelegacyapi-resourcemodels-resourcereference.html new file mode 100644 index 00000000..55a625c9 --- /dev/null +++ b/docs/files/bigcommercelegacyapi-resourcemodels-resourcereference.html @@ -0,0 +1,139 @@ + + + + + Documentation + + + + + + + + + + + + + + + + + + + +
          +

          Documentation

          + + + + + +
          + +
          +
          + + + + +
          +
            +
          + +
          +

          ResourceReference.php

          + + +
          + + + + + + +

          + Interfaces, Classes and Traits + +

          + +
          + +
          ResourceReference
          +
          + +
          + + + + + + + + +
          +
          +
          +
          +

          Search results

          + +
          +
          +
            +
            +
            +
            +
            +
            + + +
            + + + + + + + + diff --git a/docs/files/bigcommercelegacyapi-responsemodels-order-order.html b/docs/files/bigcommercelegacyapi-responsemodels-order-order.html new file mode 100644 index 00000000..681b6f18 --- /dev/null +++ b/docs/files/bigcommercelegacyapi-responsemodels-order-order.html @@ -0,0 +1,139 @@ + + + + + Documentation + + + + + + + + + + + + + + + + + + + +
            +

            Documentation

            + + + + + +
            + +
            +
            + + + + +
            +
              +
            + +
            +

            Order.php

            + + +
            + + + + + + +

            + Interfaces, Classes and Traits + +

            + +
            + +
            Order
            +
            + +
            + + + + + + + + +
            +
            +
            +
            +

            Search results

            + +
            +
            +
              +
              +
              +
              +
              +
              + + +
              + + + + + + + + diff --git a/docs/files/bigcommercelegacyapi-responsemodels-order-ordercount.html b/docs/files/bigcommercelegacyapi-responsemodels-order-ordercount.html new file mode 100644 index 00000000..63a416d6 --- /dev/null +++ b/docs/files/bigcommercelegacyapi-responsemodels-order-ordercount.html @@ -0,0 +1,139 @@ + + + + + Documentation + + + + + + + + + + + + + + + + + + + +
              +

              Documentation

              + + + + + +
              + +
              +
              + + + + +
              +
                +
              + +
              +

              OrderCount.php

              + + +
              + + + + + + +

              + Interfaces, Classes and Traits + +

              + +
              + +
              OrderCount
              +
              + +
              + + + + + + + + +
              +
              +
              +
              +

              Search results

              + +
              +
              +
                +
                +
                +
                +
                +
                + + +
                + + + + + + + + diff --git a/docs/files/bigcommercelegacyapi-responsemodels-order-orderstatuscount.html b/docs/files/bigcommercelegacyapi-responsemodels-order-orderstatuscount.html new file mode 100644 index 00000000..857537ee --- /dev/null +++ b/docs/files/bigcommercelegacyapi-responsemodels-order-orderstatuscount.html @@ -0,0 +1,139 @@ + + + + + Documentation + + + + + + + + + + + + + + + + + + + +
                +

                Documentation

                + + + + + +
                + +
                +
                + + + + +
                +
                  +
                + +
                +

                OrderStatusCount.php

                + + +
                + + + + + + +

                + Interfaces, Classes and Traits + +

                + +
                + +
                OrderStatusCount
                +
                + +
                + + + + + + + + +
                +
                +
                +
                +

                Search results

                + +
                +
                +
                  +
                  +
                  +
                  +
                  +
                  + + +
                  + + + + + + + + diff --git a/docs/indices/files.html b/docs/indices/files.html index 85d245be..4fa18c89 100644 --- a/docs/indices/files.html +++ b/docs/indices/files.html @@ -215,10 +215,12 @@

                  O

                • OptionResponse.php
                • OptionsApi.php
                • OptionsResponse.php
                • -
                • Order.php
                • Order.php
                • +
                • Order.php
                • +
                • Order.php
                • OrderAddress.php
                • OrderBillingAddress.php
                • +
                • OrderCount.php
                • OrderMetafield.php
                • OrderMetafieldResponse.php
                • OrderMetafieldsApi.php
                • @@ -226,6 +228,7 @@

                  O

                • OrderProduct.php
                • OrderRefundItem.php
                • OrderShippingAddress.php
                • +
                • OrderStatusCount.php
                • OrdersApi.php
                • OrdersApi.php
                • @@ -319,6 +322,7 @@

                  R

                • ResourceApiNoDelete.php
                • ResourceImageApi.php
                • ResourceModel.php
                • +
                • ResourceReference.php
                • ResourceWithBatchUpdateApi.php
                • S

                  diff --git a/docs/js/searchIndex.js b/docs/js/searchIndex.js index 80f3a62a..6db9c07a 100644 --- a/docs/js/searchIndex.js +++ b/docs/js/searchIndex.js @@ -1763,7 +1763,7 @@ Search.appendIndex( }, { "fqsen": "\\BigCommerce\\ApiV3\\Api\\Orders\\OrdersApi", "name": "OrdersApi", - "summary": "V3ApiBase", + "summary": "V3\u0020Orders\u0020API", "url": "classes/BigCommerce-ApiV3-Api-Orders-OrdersApi.html" }, { "fqsen": "\\BigCommerce\\ApiV3\\Api\\Orders\\OrdersApi\u003A\u003Atransactions\u0028\u0029", @@ -7160,6 +7160,21 @@ Search.appendIndex( "name": "create", "summary": "", "url": "classes/BigCommerce-ApiV2-Api-Orders-OrdersApi.html#method_create" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\Api\\Orders\\OrdersApi\u003A\u003Aget\u0028\u0029", + "name": "get", + "summary": "", + "url": "classes/BigCommerce-ApiV2-Api-Orders-OrdersApi.html#method_get" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\Api\\Orders\\OrdersApi\u003A\u003AgetAll\u0028\u0029", + "name": "getAll", + "summary": "", + "url": "classes/BigCommerce-ApiV2-Api-Orders-OrdersApi.html#method_getAll" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\Api\\Orders\\OrdersApi\u003A\u003Acount\u0028\u0029", + "name": "count", + "summary": "", + "url": "classes/BigCommerce-ApiV2-Api-Orders-OrdersApi.html#method_count" }, { "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\Order\\Order", "name": "Order", @@ -7620,6 +7635,11 @@ Search.appendIndex( "name": "orders", "summary": "", "url": "classes/BigCommerce-ApiV2-V2ApiClient.html#method_orders" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\V2ApiClient\u003A\u003Aorder\u0028\u0029", + "name": "order", + "summary": "", + "url": "classes/BigCommerce-ApiV2-V2ApiClient.html#method_order" }, { "fqsen": "\\BigCommerce\\ApiV2\\V2ApiClient\u003A\u003AstoreInformation\u0028\u0029", "name": "storeInformation", @@ -7820,6 +7840,406 @@ Search.appendIndex( "name": "features", "summary": "", "url": "classes/BigCommerce-ApiV2-ResourceModels-StoreInformation-StoreInformation.html#property_features" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\ResourceReference", + "name": "ResourceReference", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-ResourceReference.html" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\ResourceReference\u003A\u003A\u0024url", + "name": "url", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-ResourceReference.html#property_url" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResourceModels\\ResourceReference\u003A\u003A\u0024resource", + "name": "resource", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResourceModels-ResourceReference.html#property_resource" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order", + "name": "Order", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A__construct\u0028\u0029", + "name": "__construct", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#method___construct" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024id", + "name": "id", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_id" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024date_modified", + "name": "date_modified", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_date_modified" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024date_shipped", + "name": "date_shipped", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_date_shipped" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024cart_id", + "name": "cart_id", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_cart_id" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024status", + "name": "status", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_status" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024subtotal_tax", + "name": "subtotal_tax", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_subtotal_tax" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024shipping_cost_tax", + "name": "shipping_cost_tax", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_shipping_cost_tax" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024shipping_cost_tax_class_id", + "name": "shipping_cost_tax_class_id", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_shipping_cost_tax_class_id" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024handling_cost_tax", + "name": "handling_cost_tax", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_handling_cost_tax" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024handling_cost_tax_class_id", + "name": "handling_cost_tax_class_id", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_handling_cost_tax_class_id" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024wrapping_cost_tax", + "name": "wrapping_cost_tax", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_wrapping_cost_tax" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024wrapping_cost_tax_class_id", + "name": "wrapping_cost_tax_class_id", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_wrapping_cost_tax_class_id" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024payment_status", + "name": "payment_status", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_payment_status" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024store_credit_amount", + "name": "store_credit_amount", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_store_credit_amount" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024gift_certificate_amount", + "name": "gift_certificate_amount", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_gift_certificate_amount" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024currency_id", + "name": "currency_id", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_currency_id" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024currency_code", + "name": "currency_code", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_currency_code" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024currency_exchange_rate", + "name": "currency_exchange_rate", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_currency_exchange_rate" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024default_currency_id", + "name": "default_currency_id", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_default_currency_id" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024coupon_discount", + "name": "coupon_discount", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_coupon_discount" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024shipping_address_count", + "name": "shipping_address_count", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_shipping_address_count" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024is_email_opt_in", + "name": "is_email_opt_in", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_is_email_opt_in" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024order_source", + "name": "order_source", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_order_source" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024products", + "name": "products", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_products" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024shipping_addresses", + "name": "shipping_addresses", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_shipping_addresses" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024coupons", + "name": "coupons", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_coupons" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024status_id", + "name": "status_id", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_status_id" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024base_handling_cost", + "name": "base_handling_cost", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_base_handling_cost" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024base_shipping_cost", + "name": "base_shipping_cost", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_base_shipping_cost" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024base_wrapping_cost", + "name": "base_wrapping_cost", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_base_wrapping_cost" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024billing_address", + "name": "billing_address", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_billing_address" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024channel_id", + "name": "channel_id", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_channel_id" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024customer_id", + "name": "customer_id", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_customer_id" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024customer_message", + "name": "customer_message", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_customer_message" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024date_created", + "name": "date_created", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_date_created" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024default_currency_code", + "name": "default_currency_code", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_default_currency_code" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024discount_amount", + "name": "discount_amount", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_discount_amount" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024ebay_order_id", + "name": "ebay_order_id", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_ebay_order_id" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024external_id", + "name": "external_id", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_external_id" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024external_source", + "name": "external_source", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_external_source" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024geoip_country", + "name": "geoip_country", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_geoip_country" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024geoip_country_iso2", + "name": "geoip_country_iso2", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_geoip_country_iso2" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024handling_cost_ex_tax", + "name": "handling_cost_ex_tax", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_handling_cost_ex_tax" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024handling_cost_inc_tax", + "name": "handling_cost_inc_tax", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_handling_cost_inc_tax" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024ip_address", + "name": "ip_address", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_ip_address" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024is_deleted", + "name": "is_deleted", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_is_deleted" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024items_shipped", + "name": "items_shipped", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_items_shipped" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024items_total", + "name": "items_total", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_items_total" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024order_is_digital", + "name": "order_is_digital", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_order_is_digital" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024payment_method", + "name": "payment_method", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_payment_method" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024payment_provider_id", + "name": "payment_provider_id", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_payment_provider_id" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024refunded_amount", + "name": "refunded_amount", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_refunded_amount" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024shipping_cost_ex_tax", + "name": "shipping_cost_ex_tax", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_shipping_cost_ex_tax" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024shipping_cost_inc_tax", + "name": "shipping_cost_inc_tax", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_shipping_cost_inc_tax" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024staff_notes", + "name": "staff_notes", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_staff_notes" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024subtotal_ex_tax", + "name": "subtotal_ex_tax", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_subtotal_ex_tax" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024subtotal_inc_tax", + "name": "subtotal_inc_tax", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_subtotal_inc_tax" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024tax_provider_id", + "name": "tax_provider_id", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_tax_provider_id" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024customer_locale", + "name": "customer_locale", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_customer_locale" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024total_ex_tax", + "name": "total_ex_tax", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_total_ex_tax" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024total_inc_tax", + "name": "total_inc_tax", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_total_inc_tax" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024wrapping_cost_ex_tax", + "name": "wrapping_cost_ex_tax", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_wrapping_cost_ex_tax" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\Order\u003A\u003A\u0024wrapping_cost_inc_tax", + "name": "wrapping_cost_inc_tax", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-Order.html#property_wrapping_cost_inc_tax" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\OrderCount", + "name": "OrderCount", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-OrderCount.html" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\OrderCount\u003A\u003A__construct\u0028\u0029", + "name": "__construct", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-OrderCount.html#method___construct" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\OrderCount\u003A\u003A\u0024statuses", + "name": "statuses", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-OrderCount.html#property_statuses" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\OrderCount\u003A\u003A\u0024count", + "name": "count", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-OrderCount.html#property_count" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\OrderStatusCount", + "name": "OrderStatusCount", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-OrderStatusCount.html" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\OrderStatusCount\u003A\u003A\u0024id", + "name": "id", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-OrderStatusCount.html#property_id" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\OrderStatusCount\u003A\u003A\u0024name", + "name": "name", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-OrderStatusCount.html#property_name" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\OrderStatusCount\u003A\u003A\u0024system_label", + "name": "system_label", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-OrderStatusCount.html#property_system_label" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\OrderStatusCount\u003A\u003A\u0024custom_label", + "name": "custom_label", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-OrderStatusCount.html#property_custom_label" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\OrderStatusCount\u003A\u003A\u0024system_description", + "name": "system_description", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-OrderStatusCount.html#property_system_description" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\OrderStatusCount\u003A\u003A\u0024count", + "name": "count", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-OrderStatusCount.html#property_count" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order\\OrderStatusCount\u003A\u003A\u0024sort_order", + "name": "sort_order", + "summary": "", + "url": "classes/BigCommerce-ApiV2-ResponseModels-Order-OrderStatusCount.html#property_sort_order" }, { "fqsen": "\\", "name": "\\", @@ -8135,6 +8555,16 @@ Search.appendIndex( "name": "StoreInformation", "summary": "", "url": "namespaces/bigcommerce-apiv2-resourcemodels-storeinformation.html" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels\\Order", + "name": "Order", + "summary": "", + "url": "namespaces/bigcommerce-apiv2-responsemodels-order.html" + }, { + "fqsen": "\\BigCommerce\\ApiV2\\ResponseModels", + "name": "ResponseModels", + "summary": "", + "url": "namespaces/bigcommerce-apiv2-responsemodels.html" }, { "fqsen": "\\BigCommerce\\ApiV2", "name": "ApiV2", diff --git a/docs/namespaces/bigcommerce-apiv2-resourcemodels.html b/docs/namespaces/bigcommerce-apiv2-resourcemodels.html index 4fae66d6..c5b3b0f8 100644 --- a/docs/namespaces/bigcommerce-apiv2-resourcemodels.html +++ b/docs/namespaces/bigcommerce-apiv2-resourcemodels.html @@ -96,6 +96,17 @@

                  StoreInformation
                  +

                  + Interfaces, Classes and Traits + +

                  + +
                  + +
                  ResourceReference
                  +
                  + +
                  diff --git a/docs/namespaces/bigcommerce-apiv2-responsemodels-order.html b/docs/namespaces/bigcommerce-apiv2-responsemodels-order.html new file mode 100644 index 00000000..961c0eeb --- /dev/null +++ b/docs/namespaces/bigcommerce-apiv2-responsemodels-order.html @@ -0,0 +1,138 @@ + + + + + Documentation + + + + + + + + + + + + + + + + + + + +
                  +

                  Documentation

                  + + + + + +
                  + +
                  +
                  + + + + +
                  + + + +
                  +
                  +
                  +

                  Search results

                  + +
                  +
                  +
                    +
                    +
                    +
                    +
                    +
                    + + +
                    + + + + + + + + diff --git a/docs/namespaces/bigcommerce-apiv2-responsemodels.html b/docs/namespaces/bigcommerce-apiv2-responsemodels.html new file mode 100644 index 00000000..dfa24099 --- /dev/null +++ b/docs/namespaces/bigcommerce-apiv2-responsemodels.html @@ -0,0 +1,130 @@ + + + + + Documentation + + + + + + + + + + + + + + + + + + + +
                    +

                    Documentation

                    + + + + + +
                    + +
                    +
                    + + + + +
                    + + +
                    +

                    ResponseModels

                    + + +

                    + Namespaces + +

                    + +
                    +
                    Order
                    +
                    + + + + + + + +
                    +
                    +
                    +
                    +

                    Search results

                    + +
                    +
                    +
                      +
                      +
                      +
                      +
                      +
                      + + +
                      + + + + + + + + diff --git a/docs/namespaces/bigcommerce-apiv2.html b/docs/namespaces/bigcommerce-apiv2.html index c601f7ab..5efbb1cc 100644 --- a/docs/namespaces/bigcommerce-apiv2.html +++ b/docs/namespaces/bigcommerce-apiv2.html @@ -93,6 +93,7 @@

                      Api
                      ResourceModels
                      +
                      ResponseModels

                      diff --git a/docs/namespaces/bigcommerce-apiv3-api-orders.html b/docs/namespaces/bigcommerce-apiv3-api-orders.html index 9904c846..ed8f28be 100644 --- a/docs/namespaces/bigcommerce-apiv3-api-orders.html +++ b/docs/namespaces/bigcommerce-apiv3-api-orders.html @@ -98,7 +98,7 @@

                      OrderMetafieldsApi
                      V3ApiBase
                      OrdersApi
                      -
                      V3ApiBase
                      +
                      V3 Orders API
                      RefundsApi
                      V3ApiBase
                      diff --git a/docs/packages/BigCommerce.html b/docs/packages/BigCommerce.html index 87546a22..816b7c32 100644 --- a/docs/packages/BigCommerce.html +++ b/docs/packages/BigCommerce.html @@ -189,7 +189,7 @@

                      OrderMetafieldsApi
                      V3ApiBase
                      OrdersApi
                      -
                      V3ApiBase
                      +
                      V3 Orders API
                      RefundsApi
                      V3ApiBase
                      PaymentsProcessingApi
                      @@ -579,6 +579,14 @@

                      StoreInformation
                      +
                      ResourceReference
                      +
                      +
                      Order
                      +
                      +
                      OrderCount
                      +
                      +
                      OrderStatusCount
                      +
                      ProductsSubResourceApi
                      diff --git a/docs/reports/markers.html b/docs/reports/markers.html index db898414..010e6d81 100644 --- a/docs/reports/markers.html +++ b/docs/reports/markers.html @@ -363,7 +363,7 @@

                      OrdersApi.php - 20 + 31 set order details... diff --git a/src/BigCommerce/Api/Generic/GetAllResources.php b/src/BigCommerce/Api/Generic/GetAllResources.php index 67ce5ca2..36d85363 100644 --- a/src/BigCommerce/Api/Generic/GetAllResources.php +++ b/src/BigCommerce/Api/Generic/GetAllResources.php @@ -2,14 +2,14 @@ namespace BigCommerce\ApiV3\Api\Generic; -use BigCommerce\ApiV3\Client; +use BigCommerce\ApiV3\BaseApiClient; use GuzzleHttp\RequestOptions; use Psr\Http\Message\ResponseInterface; trait GetAllResources { abstract public function multipleResourceUrl(): string; - abstract public function getClient(): Client; + abstract public function getClient(): BaseApiClient; protected function getAllResources(array $filters = [], int $page = 1, int $limit = 250): ResponseInterface { diff --git a/src/BigCommerce/Api/Orders/OrdersApi.php b/src/BigCommerce/Api/Orders/OrdersApi.php index 929422bf..26855bd7 100644 --- a/src/BigCommerce/Api/Orders/OrdersApi.php +++ b/src/BigCommerce/Api/Orders/OrdersApi.php @@ -5,6 +5,14 @@ use BigCommerce\ApiV3\Api\Generic\V3ApiBase; use BigCommerce\ApiV3\ResponseModels\Order\TransactionsResponse; +/** + * V3 Orders API + * + * V3 API for Orders is quite limited, so a V2 API client is provided. + * + * @see \BigCommerce\ApiV2\Api\Orders\OrdersApi + * + */ class OrdersApi extends V3ApiBase { private const ORDER_ENDPOINT = 'orders/%d'; diff --git a/src/BigCommerce/ResourceModels/Catalog/Product/ProductBulkPricingRule.php b/src/BigCommerce/ResourceModels/Catalog/Product/ProductBulkPricingRule.php index de831552..19c9bdb9 100644 --- a/src/BigCommerce/ResourceModels/Catalog/Product/ProductBulkPricingRule.php +++ b/src/BigCommerce/ResourceModels/Catalog/Product/ProductBulkPricingRule.php @@ -14,5 +14,5 @@ class ProductBulkPricingRule extends ResourceModel public int $quantity_min; public int $quantity_max; public string $type; - public int $amount; + public float $amount; } diff --git a/src/BigCommerceLegacyApi/Api/Orders/OrdersApi.php b/src/BigCommerceLegacyApi/Api/Orders/OrdersApi.php index 244c97aa..5bd5188a 100644 --- a/src/BigCommerceLegacyApi/Api/Orders/OrdersApi.php +++ b/src/BigCommerceLegacyApi/Api/Orders/OrdersApi.php @@ -4,19 +4,30 @@ use BigCommerce\ApiV2\Api\Generic\V2ApiBase; use BigCommerce\ApiV2\ResourceModels\Order\Order; +use BigCommerce\ApiV2\ResourceModels\Order\OrderProduct; +use BigCommerce\ApiV2\ResponseModels\Order\OrderCount; use BigCommerce\ApiV3\Api\Generic\CreateResource; +use BigCommerce\ApiV3\Api\Generic\GetAllResources; +use BigCommerce\ApiV3\Api\Generic\GetResource; +use BigCommerce\ApiV2\ResponseModels\Order\Order as OrderResponse; /** * Orders v2 API * - * Currently only implements _create_. + * Some functionality for Orders is not available in V3, so this V2 API class has been implemented. + * + * @see \BigCommerce\ApiV3\Api\Orders\OrdersApi for the V3 API * * ### Example * + * #### Create an Order * ```php * $api = new BigCommerce\ApiV2\V2ApiClient($_ENV['hash'], $_ENV['CLIENT_ID'], $_ENV['ACCESS_TOKEN']); * * $order = new BigCommerce\ApiV2\ResourceModels\Order\Order(); + * $order->products = [ + * OrderProduct::build('test', 1, 12, 10), + * ]; * // set order details... * * try { @@ -26,13 +37,23 @@ * echo "Unable to update product: {$exception->getMessage()}"; * } * ``` + * + * #### Get Order Counts + * + * ```php + * $api = new BigCommerce\ApiV2\V2ApiClient($_ENV['hash'], $_ENV['CLIENT_ID'], $_ENV['ACCESS_TOKEN']); + * $ordersAwaitingFulfillmentCount = $api->orders()->count()->statuses['Awaiting Fulfillment']; + * ``` */ class OrdersApi extends V2ApiBase { use CreateResource; + use GetResource; + use GetAllResources; private const ORDERS_ENDPOINT = 'orders'; private const ORDER_ENDPOINT = 'orders/%d'; + private const ORDER_COUNT_ENDPOINT = '/orders/count'; public function singleResourceUrl(): string { @@ -50,4 +71,30 @@ public function create(Order $order): object return json_decode($response->getBody()); } + + public function get(): ?OrderResponse + { + $response = $this->getResource(); + + return new OrderResponse(json_decode($response->getBody())); + } + + /** + * @return OrderResponse[] + */ + public function getAll(array $filters = [], int $page = 1, int $limit = 250): array + { + $response = $this->getAllResources($filters, $page, $limit); + + return array_map(fn($r) => new OrderResponse($r), json_decode($response->getBody())); + } + + public function count(): OrderCount + { + $response = $this->getClient()->getRestClient()->get( + self::ORDER_COUNT_ENDPOINT + ); + + return new OrderCount(json_decode($response->getBody())); + } } diff --git a/src/BigCommerceLegacyApi/ResourceModels/Order/Order.php b/src/BigCommerceLegacyApi/ResourceModels/Order/Order.php index 734c2d50..1fa9827d 100644 --- a/src/BigCommerceLegacyApi/ResourceModels/Order/Order.php +++ b/src/BigCommerceLegacyApi/ResourceModels/Order/Order.php @@ -9,7 +9,7 @@ class Order extends ResourceModel public ?int $id; public string $date_modified; public string $date_shipped; - public string $cart_id; + public ?string $cart_id; public string $status; public string $subtotal_tax; public string $shipping_cost_tax; @@ -51,7 +51,7 @@ class Order extends ResourceModel public int $channel_id; public int $customer_id; - public string $customer_message; + public ?string $customer_message; public string $date_created; public string $default_currency_code; public string $discount_amount; @@ -68,11 +68,11 @@ class Order extends ResourceModel public int $items_total; public bool $order_is_digital; public string $payment_method; - public string $payment_provider_id; + public ?string $payment_provider_id; public string $refunded_amount; public string $shipping_cost_ex_tax; public string $shipping_cost_inc_tax; - public string $staff_notes; + public ?string $staff_notes; public string $subtotal_ex_tax; public string $subtotal_inc_tax; public string $tax_provider_id; diff --git a/src/BigCommerceLegacyApi/ResourceModels/ResourceReference.php b/src/BigCommerceLegacyApi/ResourceModels/ResourceReference.php new file mode 100644 index 00000000..7bc6454f --- /dev/null +++ b/src/BigCommerceLegacyApi/ResourceModels/ResourceReference.php @@ -0,0 +1,11 @@ +billing_address)) { + $this->billing_address = new OrderBillingAddress($optionObject->billing_address); + unset($optionObject->billing_address); + } + + if (isset($optionObject->products)) { + $this->products = new ResourceReference($optionObject->products); + unset($optionObject->products); + } + + if (isset($optionObject->shipping_addresses)) { + $this->shipping_addresses = new ResourceReference($optionObject->shipping_addresses); + unset($optionObject->shipping_addresses); + } + + parent::__construct($optionObject); + } +} diff --git a/src/BigCommerceLegacyApi/ResponseModels/Order/OrderCount.php b/src/BigCommerceLegacyApi/ResponseModels/Order/OrderCount.php new file mode 100644 index 00000000..7b3d0a39 --- /dev/null +++ b/src/BigCommerceLegacyApi/ResponseModels/Order/OrderCount.php @@ -0,0 +1,27 @@ +statuses = []; + foreach ($optionObject->statuses as $status) { + $statusCount = new OrderStatusCount($status); + $this->statuses[$statusCount->name] = $statusCount; + } + unset($optionObject->statuses); + + parent::__construct($optionObject); + } +} diff --git a/src/BigCommerceLegacyApi/ResponseModels/Order/OrderStatusCount.php b/src/BigCommerceLegacyApi/ResponseModels/Order/OrderStatusCount.php new file mode 100644 index 00000000..c22eae7c --- /dev/null +++ b/src/BigCommerceLegacyApi/ResponseModels/Order/OrderStatusCount.php @@ -0,0 +1,16 @@ +assertEquals(218, $response->id); $this->assertEquals('orders', $this->getLastRequestPath()); } + + public function testCanGetOrder() + { + $this->setReturnData('orders_v2__101__get.json'); + $orderResponse = $this->getApi()->order(101)->get(); + + $this->assertEquals(101, $orderResponse->id); + $this->assertEquals('321 Main Street', $orderResponse->billing_address->street_1); + } + + public function testCanGetOrders() + { + $this->setReturnData('orders_v2__get_all.json'); + $orders = $this->getApi()->orders()->getAll([], 1, 3); + + $this->assertEquals('123 Main Street', $orders[2]->billing_address->street_1); + } + + public function testCanGetOrderCount() + { + $this->setReturnData('orders_v2__get_order_count.json'); + $orderCount = $this->getApi()->orders()->count(); + $this->assertEquals(1, $orderCount->statuses['Shipped']->count); + $this->assertEquals(13, $orderCount->count); + } } diff --git a/tests/BigCommerceLegacyApi/responses/orders_v2__101__get.json b/tests/BigCommerceLegacyApi/responses/orders_v2__101__get.json new file mode 100644 index 00000000..e7d5200c --- /dev/null +++ b/tests/BigCommerceLegacyApi/responses/orders_v2__101__get.json @@ -0,0 +1,95 @@ +{ + "id": 101, + "customer_id": 0, + "date_created": "Thu, 27 Aug 2020 23:47:22 +0000", + "date_modified": "Tue, 19 Jan 2021 08:50:25 +0000", + "date_shipped": "", + "status_id": 1, + "status": "Pending", + "subtotal_ex_tax": "109.0000", + "subtotal_inc_tax": "109.0000", + "subtotal_tax": "0.0000", + "base_shipping_cost": "0.0000", + "shipping_cost_ex_tax": "0.0000", + "shipping_cost_inc_tax": "0.0000", + "shipping_cost_tax": "0.0000", + "shipping_cost_tax_class_id": 0, + "base_handling_cost": "0.0000", + "handling_cost_ex_tax": "0.0000", + "handling_cost_inc_tax": "0.0000", + "handling_cost_tax": "0.0000", + "handling_cost_tax_class_id": 0, + "base_wrapping_cost": "0.0000", + "wrapping_cost_ex_tax": "0.0000", + "wrapping_cost_inc_tax": "0.0000", + "wrapping_cost_tax": "0.0000", + "wrapping_cost_tax_class_id": 0, + "total_ex_tax": "109.0000", + "total_inc_tax": "109.0000", + "total_tax": "0.0000", + "items_total": 1, + "items_shipped": 0, + "payment_method": "Manual", + "payment_provider_id": null, + "payment_status": "", + "refunded_amount": "0.0000", + "order_is_digital": false, + "store_credit_amount": "0.0000", + "gift_certificate_amount": "0.0000", + "ip_address": "", + "ip_address_v6": "", + "geoip_country": "", + "geoip_country_iso2": "", + "currency_id": 1, + "currency_code": "AUD", + "currency_exchange_rate": "1.0000000000", + "default_currency_id": 1, + "default_currency_code": "AUD", + "staff_notes": null, + "customer_message": null, + "discount_amount": "0.0000", + "coupon_discount": "0.0000", + "shipping_address_count": 1, + "is_deleted": false, + "ebay_order_id": "0", + "cart_id": null, + "billing_address": { + "first_name": "Jane", + "last_name": "Doe", + "company": "", + "street_1": "321 Main Street", + "street_2": "", + "city": "Austin", + "state": "Texas", + "zip": "78751", + "country": "United States", + "country_iso2": "US", + "phone": "", + "email": "janedoe@email.com", + "form_fields": [] + }, + "is_email_opt_in": false, + "credit_card_type": null, + "order_source": "external", + "channel_id": 1, + "external_source": null, + "products": { + "url": "https://api.bigcommerce.com/stores/xxazhvt7gd/v2/orders/101/products", + "resource": "/orders/101/products" + }, + "shipping_addresses": { + "url": "https://api.bigcommerce.com/stores/xxazhvt7gd/v2/orders/101/shipping_addresses", + "resource": "/orders/101/shipping_addresses" + }, + "coupons": { + "url": "https://api.bigcommerce.com/stores/xxazhvt7gd/v2/orders/101/coupons", + "resource": "/orders/101/coupons" + }, + "external_id": null, + "external_merchant_id": null, + "tax_provider_id": "", + "customer_locale": "", + "store_default_currency_code": "AUD", + "store_default_to_transactional_exchange_rate": "1.0000000000", + "custom_status": "Pending" +} diff --git a/tests/BigCommerceLegacyApi/responses/orders_v2__get_all.json b/tests/BigCommerceLegacyApi/responses/orders_v2__get_all.json new file mode 100644 index 00000000..072fc12c --- /dev/null +++ b/tests/BigCommerceLegacyApi/responses/orders_v2__get_all.json @@ -0,0 +1,287 @@ +[ + { + "id": 100, + "customer_id": 0, + "date_created": "Thu, 27 Aug 2020 01:58:28 +0000", + "date_modified": "Thu, 27 Aug 2020 01:58:28 +0000", + "date_shipped": "", + "status_id": 0, + "status": "Incomplete", + "subtotal_ex_tax": "1815.0000", + "subtotal_inc_tax": "1996.5000", + "subtotal_tax": "181.5000", + "base_shipping_cost": "0.0000", + "shipping_cost_ex_tax": "0.0000", + "shipping_cost_inc_tax": "0.0000", + "shipping_cost_tax": "0.0000", + "shipping_cost_tax_class_id": 2, + "base_handling_cost": "0.0000", + "handling_cost_ex_tax": "0.0000", + "handling_cost_inc_tax": "0.0000", + "handling_cost_tax": "0.0000", + "handling_cost_tax_class_id": 2, + "base_wrapping_cost": "0.0000", + "wrapping_cost_ex_tax": "0.0000", + "wrapping_cost_inc_tax": "0.0000", + "wrapping_cost_tax": "0.0000", + "wrapping_cost_tax_class_id": 3, + "total_ex_tax": "1815.0000", + "total_inc_tax": "1996.5000", + "total_tax": "181.5000", + "items_total": 33, + "items_shipped": 0, + "payment_method": "testingthegateway.credit_card", + "payment_provider_id": "", + "payment_status": "declined", + "refunded_amount": "0.0000", + "order_is_digital": false, + "store_credit_amount": "0.0000", + "gift_certificate_amount": "0.0000", + "ip_address": "", + "ip_address_v6": "", + "geoip_country": "", + "geoip_country_iso2": "", + "currency_id": 1, + "currency_code": "AUD", + "currency_exchange_rate": "1.0000000000", + "default_currency_id": 1, + "default_currency_code": "AUD", + "staff_notes": "", + "customer_message": "", + "discount_amount": "0.0000", + "coupon_discount": "0.0000", + "shipping_address_count": 1, + "is_deleted": false, + "ebay_order_id": "0", + "cart_id": "09eaff9a-0307-4417-bcf7-d5561de4ffcc", + "billing_address": { + "first_name": "Jarrod", + "last_name": "Swift", + "company": "", + "street_1": "14 Stamford Court", + "street_2": "", + "city": "Adelaide", + "state": "South Australia", + "zip": "5000", + "country": "Australia", + "country_iso2": "AU", + "phone": "", + "email": "jarrod.swift@aligent.com.au", + "form_fields": [] + }, + "is_email_opt_in": false, + "credit_card_type": "visa", + "order_source": "checkout_api", + "channel_id": 1, + "external_source": null, + "products": { + "url": "https://api.bigcommerce.com/stores/xxazhvt7gd/v2/orders/100/products", + "resource": "/orders/100/products" + }, + "shipping_addresses": { + "url": "https://api.bigcommerce.com/stores/xxazhvt7gd/v2/orders/100/shipping_addresses", + "resource": "/orders/100/shipping_addresses" + }, + "coupons": { + "url": "https://api.bigcommerce.com/stores/xxazhvt7gd/v2/orders/100/coupons", + "resource": "/orders/100/coupons" + }, + "external_id": null, + "external_merchant_id": null, + "tax_provider_id": "BasicTaxProvider", + "customer_locale": "", + "store_default_currency_code": "AUD", + "store_default_to_transactional_exchange_rate": "1.0000000000", + "custom_status": "Incomplete" + }, + { + "id": 101, + "customer_id": 0, + "date_created": "Thu, 27 Aug 2020 23:47:22 +0000", + "date_modified": "Tue, 19 Jan 2021 08:50:25 +0000", + "date_shipped": "", + "status_id": 1, + "status": "Pending", + "subtotal_ex_tax": "109.0000", + "subtotal_inc_tax": "109.0000", + "subtotal_tax": "0.0000", + "base_shipping_cost": "0.0000", + "shipping_cost_ex_tax": "0.0000", + "shipping_cost_inc_tax": "0.0000", + "shipping_cost_tax": "0.0000", + "shipping_cost_tax_class_id": 0, + "base_handling_cost": "0.0000", + "handling_cost_ex_tax": "0.0000", + "handling_cost_inc_tax": "0.0000", + "handling_cost_tax": "0.0000", + "handling_cost_tax_class_id": 0, + "base_wrapping_cost": "0.0000", + "wrapping_cost_ex_tax": "0.0000", + "wrapping_cost_inc_tax": "0.0000", + "wrapping_cost_tax": "0.0000", + "wrapping_cost_tax_class_id": 0, + "total_ex_tax": "109.0000", + "total_inc_tax": "109.0000", + "total_tax": "0.0000", + "items_total": 1, + "items_shipped": 0, + "payment_method": "Manual", + "payment_provider_id": null, + "payment_status": "", + "refunded_amount": "0.0000", + "order_is_digital": false, + "store_credit_amount": "0.0000", + "gift_certificate_amount": "0.0000", + "ip_address": "", + "ip_address_v6": "", + "geoip_country": "", + "geoip_country_iso2": "", + "currency_id": 1, + "currency_code": "AUD", + "currency_exchange_rate": "1.0000000000", + "default_currency_id": 1, + "default_currency_code": "AUD", + "staff_notes": null, + "customer_message": null, + "discount_amount": "0.0000", + "coupon_discount": "0.0000", + "shipping_address_count": 1, + "is_deleted": false, + "ebay_order_id": "0", + "cart_id": null, + "billing_address": { + "first_name": "Jane", + "last_name": "Doe", + "company": "", + "street_1": "321 Main Street", + "street_2": "", + "city": "Austin", + "state": "Texas", + "zip": "78751", + "country": "United States", + "country_iso2": "US", + "phone": "", + "email": "janedoe@email.com", + "form_fields": [] + }, + "is_email_opt_in": false, + "credit_card_type": null, + "order_source": "external", + "channel_id": 1, + "external_source": null, + "products": { + "url": "https://api.bigcommerce.com/stores/xxazhvt7gd/v2/orders/101/products", + "resource": "/orders/101/products" + }, + "shipping_addresses": { + "url": "https://api.bigcommerce.com/stores/xxazhvt7gd/v2/orders/101/shipping_addresses", + "resource": "/orders/101/shipping_addresses" + }, + "coupons": { + "url": "https://api.bigcommerce.com/stores/xxazhvt7gd/v2/orders/101/coupons", + "resource": "/orders/101/coupons" + }, + "external_id": null, + "external_merchant_id": null, + "tax_provider_id": "", + "customer_locale": "", + "store_default_currency_code": "AUD", + "store_default_to_transactional_exchange_rate": "1.0000000000", + "custom_status": "Pending" + }, + { + "id": 102, + "customer_id": 0, + "date_created": "Fri, 28 Aug 2020 00:36:16 +0000", + "date_modified": "Tue, 06 Jul 2021 06:45:23 +0000", + "date_shipped": "", + "status_id": 11, + "status": "Awaiting Fulfillment", + "subtotal_ex_tax": "10.0000", + "subtotal_inc_tax": "10.8300", + "subtotal_tax": "0.8300", + "base_shipping_cost": "1000.0000", + "shipping_cost_ex_tax": "0.0000", + "shipping_cost_inc_tax": "0.0000", + "shipping_cost_tax": "0.0000", + "shipping_cost_tax_class_id": 0, + "base_handling_cost": "0.0000", + "handling_cost_ex_tax": "0.0000", + "handling_cost_inc_tax": "0.0000", + "handling_cost_tax": "0.0000", + "handling_cost_tax_class_id": 0, + "base_wrapping_cost": "0.0000", + "wrapping_cost_ex_tax": "0.0000", + "wrapping_cost_inc_tax": "0.0000", + "wrapping_cost_tax": "0.0000", + "wrapping_cost_tax_class_id": 0, + "total_ex_tax": "10.0000", + "total_inc_tax": "10.8300", + "total_tax": "0.8300", + "items_total": 1, + "items_shipped": 0, + "payment_method": "Manual", + "payment_provider_id": null, + "payment_status": "", + "refunded_amount": "0.0000", + "order_is_digital": false, + "store_credit_amount": "0.0000", + "gift_certificate_amount": "0.0000", + "ip_address": "", + "ip_address_v6": "", + "geoip_country": "", + "geoip_country_iso2": "", + "currency_id": 1, + "currency_code": "AUD", + "currency_exchange_rate": "1.0000000000", + "default_currency_id": 1, + "default_currency_code": "AUD", + "staff_notes": null, + "customer_message": null, + "discount_amount": "0.0000", + "coupon_discount": "0.0000", + "shipping_address_count": 1, + "is_deleted": false, + "ebay_order_id": "0", + "cart_id": null, + "billing_address": { + "first_name": "John", + "last_name": "Smith", + "company": "", + "street_1": "123 Main Street", + "street_2": "", + "city": "Austin", + "state": "Texas", + "zip": "78704", + "country": "United States", + "country_iso2": "US", + "phone": "5555555555", + "email": "jsmith@email.com", + "form_fields": [] + }, + "is_email_opt_in": false, + "credit_card_type": null, + "order_source": "external", + "channel_id": 1, + "external_source": null, + "products": { + "url": "https://api.bigcommerce.com/stores/xxazhvt7gd/v2/orders/102/products", + "resource": "/orders/102/products" + }, + "shipping_addresses": { + "url": "https://api.bigcommerce.com/stores/xxazhvt7gd/v2/orders/102/shipping_addresses", + "resource": "/orders/102/shipping_addresses" + }, + "coupons": { + "url": "https://api.bigcommerce.com/stores/xxazhvt7gd/v2/orders/102/coupons", + "resource": "/orders/102/coupons" + }, + "external_id": null, + "external_merchant_id": null, + "tax_provider_id": "", + "customer_locale": "", + "store_default_currency_code": "AUD", + "store_default_to_transactional_exchange_rate": "1.0000000000", + "custom_status": "Awaiting Fulfillment" + } +] \ No newline at end of file diff --git a/tests/BigCommerceLegacyApi/responses/orders_v2__get_order_count.json b/tests/BigCommerceLegacyApi/responses/orders_v2__get_order_count.json new file mode 100644 index 00000000..2087cca5 --- /dev/null +++ b/tests/BigCommerceLegacyApi/responses/orders_v2__get_order_count.json @@ -0,0 +1,140 @@ +{ + "statuses": [ + { + "id": 0, + "name": "Incomplete", + "system_label": "Incomplete", + "custom_label": "Incomplete", + "system_description": "An incomplete order happens when a shopper reached the payment page, but did not complete the transaction.", + "count": 6, + "sort_order": 0 + }, + { + "id": 1, + "name": "Pending", + "system_label": "Pending", + "custom_label": "Pending", + "system_description": "Customer started the checkout process, but did not complete it.", + "count": 2, + "sort_order": 1 + }, + { + "id": 7, + "name": "Awaiting Payment", + "system_label": "Awaiting Payment", + "custom_label": "Awaiting Payment", + "system_description": "Customer has completed checkout process, but payment has yet to be confirmed.", + "count": 0, + "sort_order": 2 + }, + { + "id": 11, + "name": "Awaiting Fulfillment", + "system_label": "Awaiting Fulfillment", + "custom_label": "Awaiting Fulfillment", + "system_description": "Customer has completed the checkout process and payment has been confirmed.", + "count": 4, + "sort_order": 3 + }, + { + "id": 9, + "name": "Awaiting Shipment", + "system_label": "Awaiting Shipment", + "custom_label": "Awaiting Shipment", + "system_description": "Order has been pulled and packaged, and is awaiting collection from a shipping provider.", + "count": 0, + "sort_order": 4 + }, + { + "id": 8, + "name": "Awaiting Pickup", + "system_label": "Awaiting Pickup", + "custom_label": "Awaiting Pickup", + "system_description": "Order has been pulled, and is awaiting customer pickup from a seller-specified location.", + "count": 0, + "sort_order": 5 + }, + { + "id": 3, + "name": "Partially Shipped", + "system_label": "Partially Shipped", + "custom_label": "Partially Shipped", + "system_description": "Only some items in the order have been shipped, due to some products being pre-order only or other reasons.", + "count": 0, + "sort_order": 6 + }, + { + "id": 10, + "name": "Completed", + "system_label": "Completed", + "custom_label": "Completed", + "system_description": "Client has paid for their digital product and their file(s) are available for download.", + "count": 0, + "sort_order": 7 + }, + { + "id": 2, + "name": "Shipped", + "system_label": "Shipped", + "custom_label": "Shipped", + "system_description": "Order has been shipped, but receipt has not been confirmed; seller has used the Ship Items action.", + "count": 1, + "sort_order": 8 + }, + { + "id": 5, + "name": "Cancelled", + "system_label": "Cancelled", + "custom_label": "Cancelled", + "system_description": "Seller has cancelled an order, due to a stock inconsistency or other reasons.", + "count": 0, + "sort_order": 9 + }, + { + "id": 6, + "name": "Declined", + "system_label": "Declined", + "custom_label": "Declined", + "system_description": "Seller has marked the order as declined for lack of manual payment, or other reasons.", + "count": 0, + "sort_order": 10 + }, + { + "id": 4, + "name": "Refunded", + "system_label": "Refunded", + "custom_label": "Refunded", + "system_description": "Seller has used the Refund action.", + "count": 0, + "sort_order": 11 + }, + { + "id": 13, + "name": "Disputed", + "system_label": "Disputed", + "custom_label": "Disputed", + "system_description": "Customer has initiated a dispute resolution process for the PayPal transaction that paid for the order.", + "count": 0, + "sort_order": 12 + }, + { + "id": 12, + "name": "Manual Verification Required", + "system_label": "Manual Verification Required", + "custom_label": "Manual Verification Required", + "system_description": "Order on hold while some aspect needs to be manually confirmed.", + "count": 0, + "sort_order": 13 + }, + { + "id": 14, + "name": "Partially Refunded", + "system_label": "Partially Refunded", + "custom_label": "Partially Refunded", + "system_description": "Seller has partially refunded the order.", + "count": 0, + "sort_order": 14 + } + ], + "count": 13 +}