Skip to content

Latest commit

 

History

History
121 lines (85 loc) · 3.82 KB

OrderingV1Api.md

File metadata and controls

121 lines (85 loc) · 3.82 KB

AmazonBusinessApi\OrderingV1Api

Method HTTP request Description
orderDetails() GET /ordering/2022-10-30/orders/{externalId}
placeOrder() POST /ordering/2022-10-30/orders

orderDetails()

orderDetails($external_id, $x_amz_user_email): \AmazonBusinessApi\Model\OrderingV1\OrderDetailsResult

Retrieves order details with externalId.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// See README for more information on the Configuration object's options
$config = new AmazonBusinessApi\Configuration([
    "lwaClientId" => "<LWA client ID>",
    "lwaClientSecret" => "<LWA client secret>",
    "lwaRefreshToken" => "<LWA refresh token>",
    "awsAccessKeyId" => "<AWS access key ID>",
    "awsSecretAccessKey" => "<AWS secret access key>",
    "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;
}

Parameters

Name Type Description Notes
external_id string The unique identifier provided by the customer while placing the order.
x_amz_user_email string The email address of the user requesting this resource.

Return type

\AmazonBusinessApi\Model\OrderingV1\OrderDetailsResult

HTTP request headers

  • Content-Type: Not defined
  • Accept: */*

[Top] [API list] [OrderingV1 Model list] [README]

placeOrder()

placeOrder($request): \AmazonBusinessApi\Model\OrderingV1\PlaceOrderResult

Attempts to place an order with the given attributes and expectations from the order request.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// See README for more information on the Configuration object's options
$config = new AmazonBusinessApi\Configuration([
    "lwaClientId" => "<LWA client ID>",
    "lwaClientSecret" => "<LWA client secret>",
    "lwaRefreshToken" => "<LWA refresh token>",
    "awsAccessKeyId" => "<AWS access key ID>",
    "awsSecretAccessKey" => "<AWS secret access key>",
    "endpoint" => AmazonBusinessApi\Endpoint::NA  // or another endpoint from lib/Endpoints.php
]);

$apiInstance = new AmazonBusinessApi\Api\OrderingV1Api($config);
$request = new \AmazonBusinessApi\Model\OrderingV1\PlaceOrderRequest(); // \AmazonBusinessApi\Model\OrderingV1\PlaceOrderRequest | A request to place an order.

try {
    $result = $apiInstance->placeOrder($request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OrderingV1Api->placeOrder: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
request \AmazonBusinessApi\Model\OrderingV1\PlaceOrderRequest A request to place an order.

Return type

\AmazonBusinessApi\Model\OrderingV1\PlaceOrderResult

HTTP request headers

  • Content-Type: Not defined
  • Accept: */*

[Top] [API list] [OrderingV1 Model list] [README]