### PHP example for searchOffersRequest Source: https://github.com/highsidelabs/amazon-business-api/blob/main/docs/Api/ProductSearchV20200826Api.md Complete example of calling searchOffersRequest with the required configuration and parameters. The configuration requires LWA credentials, AWS credentials, and an endpoint. The example sets all parameters with placeholder values and prints the result or catches exceptions. ```php "", "lwaClientSecret" => "", "lwaRefreshToken" => "", "awsAccessKeyId" => "", "awsSecretAccessKey" => "", "endpoint" => AmazonBusinessApi\Endpoint::NA // or another endpoint from lib/Endpoints.php ]); $apiInstance = new AmazonBusinessApi\Api\ProductSearchV20200826Api($config); $product_id = 'product_id_example'; // string | The Amazon Standard Item Identifier (ASIN) for the product for which to get offers. $product_region = 'product_region_example'; // string | The region where you wish to purchase the product. $locale = 'locale_example'; // string | The locale of the request, in the form of an IETF language tag. Each ProductRegion supports one or more locales. This value should comply with java.util.Locale. $x_amz_user_email = 'x_amz_user_email_example'; // string | Email address of the user requesting this resource $shipping_postal_code = 'shipping_postal_code_example'; // string | The postal/zip code for customer's request. This parameter doesn't hold geocode. $page_number = 56; // int | The zero-based number of the page being requested. If not specified, a default value of 0 will be used. When passed, the value must be equal or greater than zero, and strictly less than the number of pages returned in the response. $page_size = 56; // int | The number of items desired per page in response. If not specified, a default value of 24 will be used. Maximum items that can be fetched in single request is 24. $group_tag = 'group_tag_example'; // string | Group identifier to determine on behalf of which group a customer is performing this operation. This can be found in your Amazon Business account information. Only necessary if the customer account belongs to more than one group. $filter_ids = array('filter_ids_example'); // string[] | A list of filter ids to apply to query results. $quantity = 1; // int | The number of units the customer intends to purchase. This helps Amazon to determine quantity-based discounts if an eligible offer is present. Defaults to 1. $inclusions_for_offers = /path?inclusionsForOffers=FOO,BAR; // string[] | A list specifying the offer fields you want to be included in your response object. If you do not include this query parameter then all inclusions will be returned. try { $result = $apiInstance->searchOffersRequest($product_id, $product_region, $locale, $x_amz_user_email, $shipping_postal_code, $page_number, $page_size, $group_tag, $filter_ids, $quantity, $inclusions_for_offers); print_r($result); } catch (Exception $e) { echo 'Exception when calling ProductSearchV20200826Api->searchOffersRequest: ', $e->getMessage(), PHP_EOL; } ``` -------------------------------- ### PHP example for productsRequest() Source: https://github.com/highsidelabs/amazon-business-api/blob/main/docs/Api/ProductSearchV20200826Api.md Shows how to instantiate the ProductSearchV20200826Api with a Configuration object and call productsRequest() with all required parameters. The example includes a try/catch block that prints the result or an exception message. ```php "", "lwaClientSecret" => "", "lwaRefreshToken" => "", "awsAccessKeyId" => "", "awsSecretAccessKey" => "", "endpoint" => AmazonBusinessApi\Endpoint::NA // or another endpoint from lib/Endpoints.php ]); $apiInstance = new AmazonBusinessApi\Api\ProductSearchV20200826Api($config); $product_id = 'product_id_example'; // string | The Amazon Standard Item Identifier (ASIN) for the product. $product_region = 'product_region_example'; // string | The region where you wish to purchase the product. $locale = 'locale_example'; // string | The locale of the request, in the form of an IETF language tag. Each ProductRegion supports one or more locales. This value should comply with java.util.Locale. $x_amz_user_email = 'x_amz_user_email_example'; // string | Email address of the user requesting this resource $shipping_postal_code = 'shipping_postal_code_example'; // string | The postal/zip code for customer's request. This parameter does not support geocode. $quantity = 1; // int | The number of units the customer intends to purchase. This helps Amazon to determine quantity-based discounts if an eligible offer is present. Defaults to 1. $facets = /path?facets=FOO,BAR; // string[] | A list of data facets to include in the response. If you include more than one facet in your requst separate each facet value with a comma. $inclusions_for_products = /path?inclusionsForProducts=FOO,BAR; // string[] | A list specifying the product fields you want to be included in your response object. If you do not include this query parameter then all inclusions will be returned. $inclusions_for_offers = /path?inclusionsForOffers=FOO,BAR; // string[] | A list specifying the offer fields you want to be included in your response object. If you do not include this query parameter then all inclusions will be returned. $group_tag = 'group_tag_example'; // string | Group identifier to determine on behalf of which group a customer is performing this operation. This can be found in your Amazon Business account information. Only necessary if the customer account belongs to more than one group. try { $result = $apiInstance->productsRequest($product_id, $product_region, $locale, $x_amz_user_email, $shipping_postal_code, $quantity, $facets, $inclusions_for_products, $inclusions_for_offers, $group_tag); print_r($result); } catch (Exception $e) { echo 'Exception when calling ProductSearchV20200826Api->productsRequest: ', $e->getMessage(), PHP_EOL; } ``` -------------------------------- ### Example: getInvoiceDetailsByOrderLineItems() Source: https://github.com/highsidelabs/amazon-business-api/blob/main/docs/Api/ReconciliationV20210108Api.md Example usage of the getInvoiceDetailsByOrderLineItems method. Requires the LWA and AWS credentials in the configuration. The endpoint is set to NA by default. ```php "", "lwaClientSecret" => "", "lwaRefreshToken" => "", "awsAccessKeyId" => "", "awsSecretAccessKey" => "", "endpoint" => AmazonBusinessApi\Endpoint::NA // or another endpoint from lib/Endpoints.php ]); $apiInstance = new AmazonBusinessApi\Api\ReconciliationV20210108Api($config); $invoice_details_by_order_line_items_request = new \AmazonBusinessApi\Model\ReconciliationV20210108\InvoiceDetailsByOrderLineItemsRequest(); // \AmazonBusinessApi\Model\ReconciliationV20210108\InvoiceDetailsByOrderLineItemsRequest try { $result = $apiInstance->getInvoiceDetailsByOrderLineItems($invoice_details_by_order_line_items_request); print_r($result); } catch (Exception $e) { echo 'Exception when calling ReconciliationV20210108Api->getInvoiceDetailsByOrderLineItems: ', $e->getMessage(), PHP_EOL; } ``` -------------------------------- ### PHP example for getOrdersByOrderDate Source: https://github.com/highsidelabs/amazon-business-api/blob/main/docs/Api/ReportingV20210108Api.md Complete PHP example that configures the API client and calls getOrdersByOrderDate. It includes placeholders for LWA and AWS credentials, and demonstrates error handling with a try-catch block. ```php "", "lwaClientSecret" => "", "lwaRefreshToken" => "", "awsAccessKeyId" => "", "awsSecretAccessKey" => "", "endpoint" => AmazonBusinessApi\Endpoint::NA // or another endpoint from lib/Endpoints.php ]); $apiInstance = new AmazonBusinessApi\Api\ReportingV20210108Api($config); $start_date = 'start_date_example'; // string | Lower limit for the search range. This date represents the order date $end_date = 'end_date_example'; // string | Upper limit for the search range, This date represents the order date $next_page_token = 'next_page_token_example'; // string | A page token returned in the response to your previous request when the number of results exceed the page size(100). To get the next page of results, include nextPageToken as the only parameter. When no nextPageToken value is returned there are no more pages to return. This token needs to be encoded $purchase_order_number = 'purchase_order_number_example'; // string | The purchase order number associated with the item of a PPI order. This number is created by the buyer. This is an option param to only get order details for a specific purchase order number. **This is currently under testing** $include_line_items = false; // bool | Option to get all line items associated with the order $include_shipments = false; // bool | Option to get all shipments associated with the order $include_charges = false; // bool | Option to get all charges associated with the order try { $result = $apiInstance->getOrdersByOrderDate($start_date, $end_date, $next_page_token, $purchase_order_number, $include_line_items, $include_shipments, $include_charges); print_r($result); } catch (Exception $e) { echo 'Exception when calling ReportingV20210108Api->getOrdersByOrderDate: ', $e->getMessage(), PHP_EOL; } ``` -------------------------------- ### Example: searchProductsRequest() call Source: https://github.com/highsidelabs/amazon-business-api/blob/main/docs/Api/ProductSearchV20200826Api.md Example usage of the ProductSearchV20200826Api searchProductsRequest method. Configures the client with LWA and AWS credentials, then calls the method with sample parameters. Note the default page size is 24 and the maximum is 24. ```php "", "lwaClientSecret" => "", "lwaRefreshToken" => "", "awsAccessKeyId" => "", "awsSecretAccessKey" => "", "endpoint" => AmazonBusinessApi\Endpoint::NA // or another endpoint from lib/Endpoints.php ]); $apiInstance = new AmazonBusinessApi\Api\ProductSearchV20200826Api($config); $product_region = 'product_region_example'; // string | The region where you wish to purchase the product. $locale = 'locale_example'; // string | The locale of the request, in the form of an IETF language tag. Each ProductRegion supports one or more locales. This value should comply with java.util.Locale. $x_amz_user_email = 'x_amz_user_email_example'; // string | Email address of the user requesting this resource $keywords = 'keywords_example'; // string | A list of keywords to use to find products based on indexed text data. $shipping_postal_code = 'shipping_postal_code_example'; // string | The postal/zip code for customer's request. This parameter doesn't hold geocode. $facets = /path?facets=FOO,BAR; // string[] | A list of data facets to include in the response. If you include more than one facet in your request separate each facet value with a comma. $page_number = 56; // int | The zero-based number of the page being requested. If not specified, a default value of 0 will be used. When passed, the value must be equal or greater than zero, and strictly less than the number of pages returned in the response. $page_size = 56; // int | The number of items desired in SearchProductsResult response. If not specified, a default value of 24 will be used. Maximum items that can be fetched in single request is 24. $group_tag = 'group_tag_example'; // string | Group identifier to determine on behalf of which group a customer is performing this operation. This can be found in your Amazon Business account information. Only necessary if the customer account belongs to more than one group. $category = 'category_example'; // string | The category is used to refine the keyword search results, a keyword search can give results across multiple categories, if category is provided in request, search results will be limited to given category. It is an optional parameter if not provided in request then search results will be across all possible categories the requested keyword belongs. $sub_category = 'sub_category_example'; // string | The search subcategory is used to refine the keyword search results, a keyword search within a particular category can give results across multiple subcategories, if subcategory is provided in request, search results will be limited to given subcategory. It is a optional parameter if not provided in request then search results will be across a particular category if category is provided otherwise results will be across all categories the requested keyword belongs. $availability = 'availability_example'; // string | The availability is used to refine the keyword search results. It is optional and by default, the search should return the results with the option in stock only. So in the returned result refinement part, there should be two availability Ids. One represents the in stock only, and one represents the include out of stock. If user set availability as include out of stock Id, the result will return products including both in stock and out of stock, which also should be shown in products offers. Same logic applies when user set availability equal to in stock only Id. If a random availability id number is provided, the search should return zero matching products. ``` -------------------------------- ### PHP example for createBusinessUserAccount() Source: https://github.com/highsidelabs/amazon-business-api/blob/main/docs/Api/UserManagementV20210830Api.md Example of using the createBusinessUserAccount() method. It sets up the API client with LWA and AWS credentials, creates a request object, and calls the method, printing the result or catching exceptions. ```php "", "lwaClientSecret" => "", "lwaRefreshToken" => "", "awsAccessKeyId" => "", "awsSecretAccessKey" => "", "endpoint" => AmazonBusinessApi\Endpoint::NA // or another endpoint from lib/Endpoints.php ]); $apiInstance = new AmazonBusinessApi\Api\UserManagementV20210830Api($config); $request = new \AmazonBusinessApi\Model\UserManagementV20210830\CreateBusinessUserAccountRequest(); // \AmazonBusinessApi\Model\UserManagementV20210830\CreateBusinessUserAccountRequest | A request for creating a business user account. try { $result = $apiInstance->createBusinessUserAccount($request); print_r($result); } catch (Exception $e) { echo 'Exception when calling UserManagementV20210830Api->createBusinessUserAccount: ', $e->getMessage(), PHP_EOL; } ``` -------------------------------- ### PHP: createReport() usage example Source: https://github.com/highsidelabs/amazon-business-api/blob/main/docs/Api/DocumentV20210930Api.md Example of calling createReport() with a CreateReportSpecification. Requires LWA and AWS credentials in the Configuration. Prints the result or catches exceptions. ```php "", "lwaClientSecret" => "", "lwaRefreshToken" => "", "awsAccessKeyId" => "", "awsSecretAccessKey" => "", "endpoint" => AmazonBusinessApi\Endpoint::NA // or another endpoint from lib/Endpoints.php ]); $apiInstance = new AmazonBusinessApi\Api\DocumentV20210930Api($config); $body = new \AmazonBusinessApi\Model\DocumentV20210930\CreateReportSpecification(); // \AmazonBusinessApi\Model\DocumentV20210930\CreateReportSpecification try { $result = $apiInstance->createReport($body); print_r($result); } catch (Exception $e) { echo 'Exception when calling DocumentV20210930Api->createReport: ', $e->getMessage(), PHP_EOL; } ``` -------------------------------- ### getProductsByAsins() Example Source: https://github.com/highsidelabs/amazon-business-api/blob/main/docs/Api/ProductSearchV20200826Api.md Example usage of the getProductsByAsins method. It configures the API client with LWA and AWS credentials, then calls the method with the required x_amz_user_email and optional parameters. The response is printed or an exception is caught and displayed. ```php "", "lwaClientSecret" => "", "lwaRefreshToken" => "", "awsAccessKeyId" => "", "awsSecretAccessKey" => "", "endpoint" => AmazonBusinessApi\Endpoint::NA // or another endpoint from lib/Endpoints.php ]); $apiInstance = new AmazonBusinessApi\Api\ProductSearchV20200826Api($config); $x_amz_user_email = 'x_amz_user_email_example'; // string | Email address of the user requesting this resource $inclusions_for_products = /path?inclusionsForProducts=FOO,BAR; // string[] | A list specifying the product fields you want to be included in your response object. If you do not include this query parameter then all inclusions will be returned. $inclusions_for_offers = /path?inclusionsForOffers=FOO,BAR; // string[] | A list specifying the offer fields you want to be included in your response object. If you do not include this query parameter then all inclusions will be returned. $group_tag = 'group_tag_example'; // string | Group identifier to determine on behalf of which group a customer is performing this operation. This can be found in your Amazon Business account information. Only necessary if the customer account belongs to more than one group. $products_by_asins = new \AmazonBusinessApi\Model\ProductSearchV20200826\ProductsByAsinsRequest(); // \AmazonBusinessApi\Model\ProductSearchV20200826\ProductsByAsinsRequest try { $result = $apiInstance->getProductsByAsins($x_amz_user_email, $inclusions_for_products, $inclusions_for_offers, $group_tag, $products_by_asins); print_r($result); } catch (Exception $e) { echo 'Exception when calling ProductSearchV20200826Api->getProductsByAsins: ', $e->getMessage(), PHP_EOL; } ``` -------------------------------- ### Get response headers with getHeaders() Source: https://github.com/highsidelabs/amazon-business-api/blob/main/README.md Shows how to retrieve response headers from an SP API response by calling getHeaders() on the response object. The example uses ProductSearchApi->productsRequest and prints the headers array. Requires the vendor autoload and a valid Configuration. ```php productsRequest('B0B96H7LGX', 'US', 'en_US', 'johndoe@acmecorp.com'); $headers = $result->headers; print_r($headers); } catch (Exception $e) { echo 'Exception when calling ProductSearchApi->productsRequest: ', $e->getMessage(), PHP_EOL; } ``` -------------------------------- ### PHP example for getReports() Source: https://github.com/highsidelabs/amazon-business-api/blob/main/docs/Api/DocumentV20210930Api.md Example usage of the getReports operation. It configures the API client with LWA and AWS credentials, then calls getReports with filter parameters and prints the result. The example uses the North America endpoint by default. ```php "", "lwaClientSecret" => "", "lwaRefreshToken" => "", "awsAccessKeyId" => "", "awsSecretAccessKey" => "", "endpoint" => AmazonBusinessApi\Endpoint::NA // or another endpoint from lib/Endpoints.php ]); $apiInstance = new AmazonBusinessApi\Api\DocumentV20210930Api($config); $report_types = array('report_types_example'); // string[] | A list of report types used to filter reports. When reportTypes is provided, the other filter parameters (processingStatuses, marketplaceIds, createdSince, createdUntil) and pageSize may also be provided. Either reportTypes or nextToken is required. $processing_statuses = array('processing_statuses_example'); // string[] | A list of processing statuses used to filter reports. $marketplace_ids = array('marketplace_ids_example'); // string[] | A list of marketplace identifiers used to filter reports. The reports returned will match at least one of the marketplaces that you specify. $page_size = 10; // int | The maximum number of reports to return in a single call. $created_since = 'created_since_example'; // string | The earliest report creation date and time for reports to include in the response, in ISO 8601 date time format. The default is 90 days ago. Reports are retained for a maximum of 90 days. $created_until = 'created_until_example'; // string | The latest report creation date and time for reports to include in the response, in ISO 8601 date time format. The default is now. $next_token = 'next_token_example'; // string | A string token returned in the response to your previous request. nextToken is returned when the number of results exceeds the specified pageSize value. To get the next page of results, call the getReports operation and include this token as the only parameter. Specifying nextToken with any other parameters will cause the request to fail. try { $result = $apiInstance->getReports($report_types, $processing_statuses, $marketplace_ids, $page_size, $created_since, $created_until, $next_token); print_r($result); } catch (Exception $e) { echo 'Exception when calling DocumentV20210930Api->getReports: ', $e->getMessage(), PHP_EOL; } ``` -------------------------------- ### getReportDocument() PHP example Source: https://github.com/highsidelabs/amazon-business-api/blob/main/docs/Api/DocumentV20210930Api.md Example usage of getReportDocument with configuration, API instance, and error handling. Requires LWA and AWS credentials, and an endpoint. ```php "", "lwaClientSecret" => "", "lwaRefreshToken" => "", "awsAccessKeyId" => "", "awsSecretAccessKey" => "", "endpoint" => AmazonBusinessApi\Endpoint::NA // or another endpoint from lib/Endpoints.php ]); $apiInstance = new AmazonBusinessApi\Api\DocumentV20210930Api($config); $report_document_id = 'report_document_id_example'; // string | The identifier for the report document. try { $result = $apiInstance->getReportDocument($report_document_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling DocumentV20210930Api->getReportDocument: ', $e->getMessage(), PHP_EOL; } ``` -------------------------------- ### Call searchProductsRequest with all parameters Source: https://github.com/highsidelabs/amazon-business-api/blob/main/docs/Api/ProductSearchV20200826Api.md Example of calling the searchProductsRequest method of the ProductSearchV20200826Api class. It sets up all optional parameters with example values and then invokes the API, printing the result or catching an exception. The parameters include deliveryDay, eligibleForFreeShipping, primeEligible, UPC, ISBN, SKU, EAN, partNumber, oemPartNumber, searchRefinements, inclusionsForProducts, and inclusionsForOffers. ```php $delivery_day = 'delivery_day_example'; // string | The deliveryDay feature is used to refine the keyword search results. It is optional and by default, the search should return the results with all the available delivery dates. In the returned result refinement part, there should be one Get It Today ID, and one Get It Tomorrow ID. If the user set the deliveryDay with Get It Today ID, then it should return the products that could arrive today, or nothing if no product could arrive today. Same logic goes with Get It Tomorrow ID. $eligible_for_free_shipping = 'eligible_for_free_shipping_example'; // string | The eligibleForFreeShipping is used to refine the keyword search results. It is optional and by default, the search should return the results with both free shipping by Amazon as well as not free Shipping by Amazon. So in the returned result refinement part, there should be one eligibleForFreeShipping Id. It represents Free Shipping by Amazon. If the user set the eligibleForFreeShipping as this ID, then the result will only return the products who will have free shipping by Amazon. $prime_eligible = 'prime_eligible_example'; // string | The prime eligible refinement can be used to filter prime-eligible products. By default, all products (including non-prime eligible) will be returned. $upc = 'upc_example'; // string | UPC (Universal Product Code) is a type of code printed on retail product packaging to aid in identifying a particular item $isbn = 'isbn_example'; // string | International Standard Book Number of the product $sku = 'sku_example'; // string | A SKU short for Stock Keeping Unit is a merchant specific identifier for a purchasable good $ean = 'ean_example'; // string | EAN (European Article Number) is a 13-digit product identifier, often represented on products as a barcode $part_number = 'part_number_example'; // string | value of the Part Number field on the product. It is a unique number that is issued by manufacturers to identify individual products. $oem_part_number = 'oem_part_number_example'; // string | The OEM Part Number is the original part number assigned to this part by the vehicle manufacturer. $search_refinements = brandtextbin#GE,brandtextbin#Sony,review-rating#2661618011; // string[] | A list of search refinements to refine keyword search for relevant results. If you include more than one search refinement in your request separate each refinement value with a comma. $inclusions_for_products = /path?inclusionsForProducts=FOO,BAR; // string[] | A list specifying the product fields you want to be included in your response object. If you do not include this query parameter then all inclusions will be returned. $inclusions_for_offers = /path?inclusionsForOffers=FOO,BAR; // string[] | A list specifying the offer fields you want to be included in your response object. If you do not include this query parameter then all inclusions will be returned. try { $result = $apiInstance->searchProductsRequest($product_region, $locale, $x_amz_user_email, $keywords, $shipping_postal_code, $facets, $page_number, $page_size, $group_tag, $category, $sub_category, $availability, $delivery_day, $eligible_for_free_shipping, $prime_eligible, $upc, $isbn, $sku, $ean, $part_number, $oem_part_number, $search_refinements, $inclusions_for_products, $inclusions_for_offers); print_r($result); } catch (Exception $e) { echo 'Exception when calling ProductSearchV20200826Api->searchProductsRequest: ', $e->getMessage(), PHP_EOL; } ``` -------------------------------- ### PHP example: calling getReport() Source: https://github.com/highsidelabs/amazon-business-api/blob/main/docs/Api/DocumentV20210930Api.md Example usage of the DocumentV20210930Api->getReport() method. It configures the API client with LWA and AWS credentials, sets a report ID, and prints the result or catches an exception. ```php "", "lwaClientSecret" => "", "lwaRefreshToken" => "", "awsAccessKeyId" => "", "awsSecretAccessKey" => "", "endpoint" => AmazonBusinessApi\Endpoint::NA // or another endpoint from lib/Endpoints.php ]); $apiInstance = new AmazonBusinessApi\Api\DocumentV20210930Api($config); $report_id = 'report_id_example'; // string | The identifier for the report. This identifier is unique only in combination with a seller ID. try { $result = $apiInstance->getReport($report_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling DocumentV20210930Api->getReport: ', $e->getMessage(), PHP_EOL; } ``` -------------------------------- ### PHP example: getOrdersByOrderId() Source: https://github.com/highsidelabs/amazon-business-api/blob/main/docs/Api/ReportingV20210108Api.md Complete PHP example that configures the API client and calls getOrdersByOrderId(). Replace the placeholder LWA and AWS credentials with your own. The call returns an OrdersOutput object or throws an exception on failure. ```php "", "lwaClientSecret" => "", "lwaRefreshToken" => "", "awsAccessKeyId" => "", "awsSecretAccessKey" => "", "endpoint" => AmazonBusinessApi\Endpoint::NA // or another endpoint from lib/Endpoints.php ]); $apiInstance = new AmazonBusinessApi\Api\ReportingV20210108Api($config); $order_id = 'order_id_example'; // string | Order identifier to get the corresponding order details $include_line_items = false; // bool | Option to get all line items associated with the order $include_shipments = false; // bool | Option to get all shipments associated with the order $include_charges = false; // bool | Option to get all charges associated with the order try { $result = $apiInstance->getOrdersByOrderId($order_id, $include_line_items, $include_shipments, $include_charges); print_r($result); } catch (Exception $e) { echo 'Exception when calling ReportingV20210108Api->getOrdersByOrderId: ', $e->getMessage(), PHP_EOL; } ``` -------------------------------- ### Example: Calling getTransactions() Source: https://github.com/highsidelabs/amazon-business-api/blob/main/docs/Api/ReconciliationV20210108Api.md Example usage of the getTransactions method. It configures the API client with LWA and AWS credentials, sets the feed date range and optional page token, then calls the method and prints the result or catches exceptions. ```php "", "lwaClientSecret" => "", "lwaRefreshToken" => "", "awsAccessKeyId" => "", "awsSecretAccessKey" => "", "endpoint" => AmazonBusinessApi\Endpoint::NA // or another endpoint from lib/Endpoints.php ]); $apiInstance = new AmazonBusinessApi\Api\ReconciliationV20210108Api($config); $feed_start_date = 'feed_start_date_example'; // string | The lower limit for the search range. $feed_end_date = 'feed_end_date_example'; // string | The upper limit for the search range. $next_page_token = 'next_page_token_example'; // string | A page token returned in the response to your previous request. `nextPageToken` is returned when the number of results exceed the page size. To get the next page of results, include `nextPageToken` as the only parameter. When no `nextPageToken` value is returned there are no more pages to return. try { $result = $apiInstance->getTransactions($feed_start_date, $feed_end_date, $next_page_token); print_r($result); } catch (Exception $e) { echo 'Exception when calling ReconciliationV20210108Api->getTransactions: ', $e->getMessage(), PHP_EOL; } ``` -------------------------------- ### GET /products/2020-08-26/products/{productId} Source: https://github.com/highsidelabs/amazon-business-api/blob/main/docs/Api/ProductSearchV20200826Api.md Retrieve product data based on an ASIN identifier. ```APIDOC ## [GET] /products/2020-08-26/products/{productId} ### Description Retrieve product data based on an ASIN identifier. ### Method GET ### Endpoint /products/2020-08-26/products/{productId} ### Parameters #### Path Parameters - **productId** (string) - Required - The ASIN identifier of the product. #### Header Parameters - **x-amz-user-email** (string) - Required - Email address of the user requesting this resource #### Query Parameters - **inclusionsForProducts** (array of string) - Optional - A list specifying the product fields you want to be included in your response object. If you do not include this query parameter then all inclusions will be returned. - **inclusionsForOffers** (array of string) - Optional - A list specifying the offer fields you want to be included in your response object. If you do not include this query parameter then all inclusions will be returned. - **groupTag** (string) - Optional - Group identifier to determine on behalf of which group a customer is performing this operation. This can be found in your Amazon Business account information. Only necessary if the customer account belongs to more than one group. ### Request Example No request body required. ### Response #### Success Response (200) - **Product** - The product data for the specified ASIN. #### Response Example ```json { "asin": "string" } ``` ``` -------------------------------- ### Initialize Configuration with credentials Source: https://github.com/highsidelabs/amazon-business-api/blob/main/README.md Creates a Configuration instance with required credentials and the North American endpoint. Use this as the base setup for connecting to the Amazon Business API. ```php $config = new AmazonBusinessApi\Configuration([ 'lwaClientId' => '', 'lwaClientSecret' => '', 'lwaRefreshToken' => '', 'awsAccessKeyId' => '', 'awsSecretAccessKey' => '', // If you're not working in the North American marketplace, change // this to another endpoint from lib/Endpoint.php 'endpoint' => AmazonBusinessApi\Endpoint::NA, ]); ``` -------------------------------- ### cancelReport() example Source: https://github.com/highsidelabs/amazon-business-api/blob/main/docs/Api/DocumentV20210930Api.md Example usage of cancelReport() with the AmazonBusinessApi PHP client. Requires vendor/autoload.php and a Configuration object with LWA and AWS credentials. The endpoint is set to AmazonBusinessApi\Endpoint::NA; other endpoints are available in lib/Endpoints.php. ```php "", "lwaClientSecret" => "", "lwaRefreshToken" => "", "awsAccessKeyId" => "", "awsSecretAccessKey" => "", "endpoint" => AmazonBusinessApi\Endpoint::NA // or another endpoint from lib/Endpoints.php ]); $apiInstance = new AmazonBusinessApi\Api\DocumentV20210930Api($config); $report_id = 'report_id_example'; // string | The identifier for the report. This identifier is unique only in combination with a seller ID. try { $apiInstance->cancelReport($report_id); } catch (Exception $e) { echo 'Exception when calling DocumentV20210930Api->cancelReport: ', $e->getMessage(), PHP_EOL; } ?> ``` -------------------------------- ### Initialize Configuration with roleArn Source: https://github.com/highsidelabs/amazon-business-api/blob/main/README.md Configuration setup for applications using an IAM role ARN instead of a user ARN. Adds the 'roleArn' key to the standard configuration array. ```php $config = new AmazonBusinessApi\Configuration([ 'lwaClientId' => '', 'lwaClientSecret' => '', 'lwaRefreshToken' => '', 'awsAccessKeyId' => '', 'awsSecretAccessKey' => '', // If you're not working in the North American marketplace, change // this to another endpoint from lib/Endpoint.php 'endpoint' => AmazonBusinessApi\Endpoint::NA, 'roleArn' => '', ]); ``` -------------------------------- ### Configure and call ProductSearchApi->productsRequest Source: https://github.com/highsidelabs/amazon-business-api/blob/main/README.md Shows how to configure the Amazon Business API client with LWA and AWS credentials and call the Product Search API's productsRequest method. Requires the Product Search role and uses the North American endpoint by default. ```php 'amzn1.application-oa2-client.....', 'lwaClientSecret' => 'abcd....', 'lwaRefreshToken' => 'Aztr|IwEBI....', 'awsAccessKeyId' => 'AKIA....', 'awsSecretAccessKey' => 'ABCD....', // If you're not working in the North American marketplace, change // this to another endpoint from lib/Endpoint.php 'endpoint' => Endpoint::NA ]); $api = new ProductSearchApi($config); try { $result = $api->productsRequest('B0B96H7LGX', 'US', 'en_US', 'johndoe@acmecorp.com'); print_r($result); } catch (Exception $e) { echo 'Exception when calling ProductSearchApi->productsRequest: ', $e->getMessage(), PHP_EOL; } ?> ``` -------------------------------- ### Initialize AccountHolder model with constructor Source: https://github.com/highsidelabs/amazon-business-api/blob/main/README.md Create an AccountHolder model instance by passing all attributes in the constructor. The model has three attributes: email, given_name, and family_name. ```php $accountHolder = new AmazonBusinessApi\Model\UserManagementV20210830Api\AccountHolder([ 'email' => 'janedoe@acmecorp.com', 'given_name' => 'Jane', 'family_name' => 'Doe' ]); ``` -------------------------------- ### GET /reconciliation/2021-01-08/transactions Source: https://github.com/highsidelabs/amazon-business-api/blob/main/docs/Api/ReconciliationV20210108Api.md Retrieves transactions for reconciliation purposes. ```APIDOC ## GET /reconciliation/2021-01-08/transactions ### Description Retrieves transactions for reconciliation purposes. ### Method GET ### Endpoint /reconciliation/2021-01-08/transactions ### Parameters No parameters are documented for this endpoint. ### Response #### Success Response (200) - **TransactionResponse** (TransactionResponse) - The transactions data. #### Response Example ```json { "transactions": [] } ``` ### HTTP Request Headers - **Accept**: `application/json` ``` -------------------------------- ### POST /products/2020-08-26/products/getProductsByAsins Source: https://github.com/highsidelabs/amazon-business-api/blob/main/docs/Api/ProductSearchV20200826Api.md Retrieve products for a list of ASINs. ```APIDOC ## [POST] /products/2020-08-26/products/getProductsByAsins ### Description Retrieve products for the ASIN identifier present in the list of ASINs. ### Method POST ### Endpoint /products/2020-08-26/products/getProductsByAsins ### Parameters #### Header Parameters - **x-amz-user-email** (string) - Required - Email address of the user requesting this resource #### Query Parameters - **inclusionsForProducts** (array of string) - Optional - A list specifying the product fields you want to be included in your response object. If you do not include this query parameter then all inclusions will be returned. - **inclusionsForOffers** (array of string) - Optional - A list specifying the offer fields you want to be included in your response object. If you do not include this query parameter then all inclusions will be returned. - **groupTag** (string) - Optional - Group identifier to determine on behalf of which group a customer is performing this operation. This can be found in your Amazon Business account information. Only necessary if the customer account belongs to more than one group. #### Request Body - **productsByAsins** (ProductsByAsinsRequest) - Optional - The request body containing the list of ASINs. ### Request Example ```json { "productsByAsins": {} } ``` ### Response #### Success Response (200) - **ProductsByAsinsResponse** - The response containing product and offer data for the requested ASINs. #### Response Example ```json { "products": [] } ``` ``` -------------------------------- ### GET /ordering/2022-10-30/orders/{externalId} Source: https://github.com/highsidelabs/amazon-business-api/blob/main/docs/Api/OrderingV1Api.md Retrieves order details with externalId. ```APIDOC ## GET /ordering/2022-10-30/orders/{externalId} ### Description Retrieves order details with externalId. ### Method GET ### Endpoint /ordering/2022-10-30/orders/{externalId} ### Parameters #### Path Parameters - **externalId** (string) - Required - The unique identifier provided by the customer while placing the order. #### Header Parameters - **x-amz-user-email** (string) - Required - The email address of the user requesting this resource. ### Request Example ```php "", "lwaClientSecret" => "", "lwaRefreshToken" => "", "awsAccessKeyId" => "", "awsSecretAccessKey" => "", "endpoint" => AmazonBusinessApi\Endpoint::NA // or another endpoint from lib/Endpoints.php ]); $apiInstance = new AmazonBusinessApi\Api\OrderingV1Api($config); $external_id = 'external_id_example'; // string | The unique identifier provided by the customer while placing the order. $x_amz_user_email = 'x_amz_user_email_example'; // string | The email address of the user requesting this resource. try { $result = $apiInstance->orderDetails($external_id, $x_amz_user_email); print_r($result); } catch (Exception $e) { echo 'Exception when calling OrderingV1Api->orderDetails: ', $e->getMessage(), PHP_EOL; } ``` ### Response #### Success Response (200) - **OrderDetailsResult** - The order details result. #### Response Example ```json { "orderDetailsResult": {} } ``` ``` -------------------------------- ### GET /reports/2021-09-30/reports/{reportId} Source: https://github.com/highsidelabs/amazon-business-api/blob/main/docs/Api/DocumentV20210930Api.md Retrieves details of a specific report by its ID. ```APIDOC ## [GET] /reports/2021-09-30/reports/{reportId} ### Description Returns report details for the report that you specify. ### Method GET ### Endpoint /reports/2021-09-30/reports/{reportId} ### Parameters #### Path Parameters - **reportId** (string) - Required - The identifier for the report. This identifier is unique only in combination with a seller ID. ### Response No response details documented in the source. ### HTTP Request Headers - **Content-Type**: Not defined - **Accept**: `application/json` ```