Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inbound Plan Instantly Voided #4207

Open
manikandan26 opened this issue Sep 30, 2024 · 3 comments
Open

Inbound Plan Instantly Voided #4207

manikandan26 opened this issue Sep 30, 2024 · 3 comments
Assignees

Comments

@manikandan26
Copy link

manikandan26 commented Sep 30, 2024

Problem description:

When creating a InboundPlan, I will get the below response without an error
{"operationId":"b606ce09-52be-4079-991f-XXXXXX","inboundPlanId":"wfdcade68d-9449-428a-9879-XXXXXX"}

But this plan will get VOIDED immediately when checking getInboundPlan ( [status] => VOIDED)

Error:

This is the output of getInboundPlan API

Array
(
    [createdAt] => 2024-09-30T10:47:08Z
    [marketplaceIds] => Array
        (
            [0] => APJ6JRA9NG5V4
        )

    [packingOptions] => Array
        (
        )

    [sourceAddress] => Array
        (
            [phoneNumber] => +xxxxxxx
            [city] => Wommelgem
            [countryCode] => BE
            [postalCode] => 2160
            [companyName] => XXXXXXXX
            [name] => XXXXXXXXXXXX
            [addressLine1] => Nijverheidsstraat
        )

    [lastUpdatedAt] => 2024-09-30T10:47:14Z
    [name] => Inbound Plan V2 
    [inboundPlanId] => wfdcade68d-9449-428a-9879-XXXXXX
    [placementOptions] => Array
        (
        )

    [shipments] => Array
        (
        )

    [status] => VOIDED
)

Code

This is the input of createInboundPlan API

 <?php  
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

use SellingPartnerApi\SellingPartnerApi;
use SellingPartnerApi\Enums\Endpoint;
use Saloon\Http\Response;
use Saloon\Http\PendingRequest;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use SellingPartnerApi\Seller\FBAInboundV20240320\Dto;      


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

$connector = SellingPartnerApi::seller(
    clientId: "amzn1.application-oa2-client.XXXXXXXXXXXXXXXXX",
    clientSecret: "amzn1.oa2-cs.v1.XXXXXXXXXXXXXXXXX",
    refreshToken: "Atzr|IwEBIDBG01Oerdyt2ShWLV9jh0SGVP5hg0i0IOnRs_XXXXXXXXXXXXXXXXX",
    endpoint:  Endpoint::EU
);

 
    $inboundApi = $connector->FBAInboundV20240320();
try {
	// Step 1: Create an inbound plan
	$shipFromAddress = new Dto\AddressInput(
    addressLine1: "Nijverheidsstraat",
    addressLine2: null,
    city: "Wommelgem",
    companyName: "XXXXXXXXXXXXXXXXX",
    countryCode: "BE",
    email: null, 
    name: "XXXXXXXXXXXXXXXXX",     
    phoneNumber: "XXXXXXXXXXXXXXXXX",
    postalCode: "2160",
    stateOrProvinceCode: null
	 );

	 
    // Define the items
    $items = [];
    
    $item1 = new Dto\ItemInput('SELLER','101999', 'NONE', 2); 
    $items[] = $item1;
 
    $item2 = new Dto\ItemInput('SELLER','10259','NONE', 5); 
    $items[] = $item2;
	
    $item3 = new Dto\ItemInput('SELLER','102690', 'NONE', 2);
    $items[] = $item3;
 
    // Set the items in the request
  
     $requestParams = new Dto\CreateInboundPlanRequest(
        ['APJ6JRA9NG5V4'],          // destinationMarketplaces IT
        $items,                      // items (now correctly passed as an array)
        $shipFromAddress,            // sourceAddress
        'Inbound Plan V2'       // name (optional)
    );

    $response = $inboundApi->createInboundPlan($requestParams);
    
    echo "<pre>";
    print_r($response->body());
    echo "</pre>";
    
  
} catch (Exception $e) {
    // Handle exceptions
     echo 'Error: ' . $e;
}

?>

@maxim-saltanov-skuvault
Copy link

@manikandan26 seems your InboundPlan wasn't created for some reason (due an error or the creation is in progress). You need to check the operation status to see the status and reason - https://developer-docs.amazon.com/sp-api/docs/fulfillment-inbound-api-v2024-03-20-reference#getinboundoperationstatus

@Prez5er
Copy link

Prez5er commented Oct 3, 2024

I have the same issue but I identified that the capacity storage limit was exceeded, the v0 shows the right error, but the v2024-03-20 shows a generic error. so this error made avoided instantly the inbound plan

@mafge mafge self-assigned this Oct 8, 2024
@mafge
Copy link

mafge commented Oct 8, 2024

Hi @manikandan26,
thanks for reaching out!
As @maxim-saltanov-skuvault mentioned, you need to check the status of the operation as creating the inbound plan is an asynchronous operation. In most cases you will get a error message in the response giving you details about the error.
Best,
Marc
Selling Partner Developer Services

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants