The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network.
This PHP package is automatically generated by the Swagger Codegen project:
- API version: v1
- Build package: io.swagger.codegen.languages.PhpClientCodegen For more information, please visit https://sellercentral.amazon.com/gp/mws/contactus.html
PHP 5.5 and later
To install the bindings via Composer, add the following to composer.json
:
{
"repositories": [
{
"type": "git",
"url": "https://github.com//.git"
}
],
"require": {
"/": "*@dev"
}
}
Then run composer install
Download the files and include autoload.php
:
require_once('/path/to/SwaggerClient-php/vendor/autoload.php');
To run the unit tests:
composer install
./vendor/bin/phpunit
Please follow the installation procedure and then run the following:
A method within aclass to get the API instance (via config DI) -- You need to upddate the config source as you wish. It will automatically handle your request and signing your request using https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html
/**
* Get authenticated FBA Inbound API Instance using
* credential from the configuration
*
* @return FbaInboundApi
*/
public function getFbaInboundApiInstance(): FbaInboundApi
{
$tokenStorage = new FsTokenStorage($this->config->get('application')->get('cacheDir') . DS . '.aws-tokens');
$stsAuthenticationConfiguration = new Configuration();
$stsConfig = $this->config->get('aws')->get('sts');
$lwaConfig = $this->config->get('amazon')->get('lwa');
$spApiConfig = $this->config->get('amazon')->get('selling_partner_api');
$stsAuthenticationConfiguration->setApiKey('refresh_token', $lwaConfig['refresh_token']);
$stsAuthenticationConfiguration->setApiKey('client_id', $lwaConfig['client_id']);
$stsAuthenticationConfiguration->setApiKey('client_secret', $lwaConfig['client_secret']);
$stsAuthenticationConfiguration->setApiKey('access_key', $stsConfig['access_key']);
$stsAuthenticationConfiguration->setApiKey('secret_key', $stsConfig['secret_key']);
$stsAuthenticationConfiguration->setApiKey('role_arn', $stsConfig['role_arn']);
$stsAuthenticationConfiguration->setDebug(false);
$credential = new Credentials($tokenStorage, $stsAuthenticationConfiguration);
// Cache and retrieve both LWA tokens and assumeRole via sts tokens
$tokens = $credential->getCredentials();
$config = Configuration::getDefaultConfiguration();
$config->setAccessToken($tokens['lwa_access_token']);
$config->setApiKey('accessKey', $tokens['sts_credentials']['access_key']);
$config->setApiKey('secretKey', $tokens['sts_credentials']['secret_key']);
$config->setApiKey('region', $spApiConfig['region']);
$config->setApiKey('securityToken', $tokens['sts_credentials']['session_token']);
$config->setDebug(false);
$config->setHost($spApiConfig['host']);
return new FbaInboundApi(
new Client(),
$config
);
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = ....... // Instantiate it from the above method getFbaInboundApiInstance
$shipment_id = "shipment_id_example"; // string | A shipment identifier originally returned by the createInboundShipmentPlan operation.
$need_by_date = new \DateTime("2013-10-20"); // \DateTime | Date that the shipment must arrive at the Amazon fulfillment center to avoid delivery promise breaks for pre-ordered items. Must be in YYYY-MM-DD format. The response to the getPreorderInfo operation returns this value.
$marketplace_id = "marketplace_id_example"; // string | A marketplace identifier. Specifies the marketplace the shipment is tied to.
try {
$result = $apiInstance->confirmPreorder($shipment_id, $need_by_date, $marketplace_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling FbaInboundApi->confirmPreorder: ', $e->getMessage(), PHP_EOL;
}
?>
All URIs are relative to https://sellingpartnerapi-na.amazon.com
Class | Method | HTTP request | Description |
---|---|---|---|
FbaInboundApi | confirmPreorder | PUT /fba/inbound/v0/shipments/{shipmentId}/preorder/confirm | |
FbaInboundApi | confirmTransport | POST /fba/inbound/v0/shipments/{shipmentId}/transport/confirm | |
FbaInboundApi | createInboundShipment | POST /fba/inbound/v0/shipments/{shipmentId} | |
FbaInboundApi | createInboundShipmentPlan | POST /fba/inbound/v0/plans | |
FbaInboundApi | estimateTransport | POST /fba/inbound/v0/shipments/{shipmentId}/transport/estimate | |
FbaInboundApi | getBillOfLading | GET /fba/inbound/v0/shipments/{shipmentId}/billOfLading | |
FbaInboundApi | getInboundGuidance | GET /fba/inbound/v0/itemsGuidance | |
FbaInboundApi | getLabels | GET /fba/inbound/v0/shipments/{shipmentId}/labels | |
FbaInboundApi | getPreorderInfo | GET /fba/inbound/v0/shipments/{shipmentId}/preorder | |
FbaInboundApi | getPrepInstructions | GET /fba/inbound/v0/prepInstructions | |
FbaInboundApi | getShipmentItems | GET /fba/inbound/v0/shipmentItems | |
FbaInboundApi | getShipmentItemsByShipmentId | GET /fba/inbound/v0/shipments/{shipmentId}/items | |
FbaInboundApi | getShipments | GET /fba/inbound/v0/shipments | |
FbaInboundApi | getTransportDetails | GET /fba/inbound/v0/shipments/{shipmentId}/transport | |
FbaInboundApi | putTransportDetails | PUT /fba/inbound/v0/shipments/{shipmentId}/transport | |
FbaInboundApi | updateInboundShipment | PUT /fba/inbound/v0/shipments/{shipmentId} | |
FbaInboundApi | voidTransport | POST /fba/inbound/v0/shipments/{shipmentId}/transport/void |
- ASINInboundGuidance
- ASINInboundGuidanceList
- ASINPrepInstructions
- ASINPrepInstructionsList
- Address
- AmazonPrepFeesDetails
- AmazonPrepFeesDetailsList
- Amount
- BarcodeInstruction
- BigDecimalType
- BillOfLadingDownloadURL
- BoxContentsFeeDetails
- BoxContentsSource
- CommonTransportResult
- Condition
- ConfirmPreorderResponse
- ConfirmPreorderResult
- ConfirmTransportResponse
- Contact
- CreateInboundShipmentPlanRequest
- CreateInboundShipmentPlanResponse
- CreateInboundShipmentPlanResult
- CurrencyCode
- DateStringType
- Dimensions
- Error
- ErrorList
- ErrorReason
- EstimateTransportResponse
- GetBillOfLadingResponse
- GetInboundGuidanceResponse
- GetInboundGuidanceResult
- GetLabelsResponse
- GetPreorderInfoResponse
- GetPreorderInfoResult
- GetPrepInstructionsResponse
- GetPrepInstructionsResult
- GetShipmentItemsResponse
- GetShipmentItemsResult
- GetShipmentsResponse
- GetShipmentsResult
- GetTransportDetailsResponse
- GetTransportDetailsResult
- GuidanceReason
- GuidanceReasonList
- InboundGuidance
- InboundShipmentHeader
- InboundShipmentInfo
- InboundShipmentItem
- InboundShipmentItemList
- InboundShipmentList
- InboundShipmentPlan
- InboundShipmentPlanItem
- InboundShipmentPlanItemList
- InboundShipmentPlanRequestItem
- InboundShipmentPlanRequestItemList
- InboundShipmentRequest
- InboundShipmentResponse
- InboundShipmentResult
- IntendedBoxContentsSource
- InvalidASIN
- InvalidASINList
- InvalidSKU
- InvalidSKUList
- LabelDownloadURL
- LabelPrepPreference
- LabelPrepType
- NonPartneredLtlDataInput
- NonPartneredLtlDataOutput
- NonPartneredSmallParcelDataInput
- NonPartneredSmallParcelDataOutput
- NonPartneredSmallParcelPackageInput
- NonPartneredSmallParcelPackageInputList
- NonPartneredSmallParcelPackageOutput
- NonPartneredSmallParcelPackageOutputList
- PackageStatus
- Pallet
- PalletList
- PartneredEstimate
- PartneredLtlDataInput
- PartneredLtlDataOutput
- PartneredSmallParcelDataInput
- PartneredSmallParcelDataOutput
- PartneredSmallParcelPackageInput
- PartneredSmallParcelPackageInputList
- PartneredSmallParcelPackageOutput
- PartneredSmallParcelPackageOutputList
- PrepDetails
- PrepDetailsList
- PrepGuidance
- PrepInstruction
- PrepInstructionList
- PrepOwner
- ProNumber
- PutTransportDetailsRequest
- PutTransportDetailsResponse
- Quantity
- SKUInboundGuidance
- SKUInboundGuidanceList
- SKUPrepInstructions
- SKUPrepInstructionsList
- SellerFreightClass
- ShipmentStatus
- ShipmentType
- TimeStampStringType
- TrackingId
- TransportContent
- TransportDetailInput
- TransportDetailOutput
- TransportHeader
- TransportResult
- TransportStatus
- UnitOfMeasurement
- UnitOfWeight
- UnsignedIntType
- VoidTransportResponse
- Weight
All endpoints do not require authorization.