Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Venclovas committed Apr 29, 2024
1 parent 9701c03 commit 2238db3
Show file tree
Hide file tree
Showing 14 changed files with 538 additions and 396 deletions.
78 changes: 2 additions & 76 deletions Source/FikaAmazonAPI.SampleCode/FulFillmentInboundSample.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
using FikaAmazonAPI.AmazonSpApiSDK.Models.FbaSmallandLight;
using FikaAmazonAPI.AmazonSpApiSDK.Models.MerchantFulfillment;
using FikaAmazonAPI.AmazonSpApiSDK.Models.Sellers;
using FikaAmazonAPI.AmazonSpApiSDK.Models.Shipping;
using FikaAmazonAPI.Parameter.FulFillmentInbound;
using FikaAmazonAPI.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static FikaAmazonAPI.Utils.Constants;

namespace FikaAmazonAPI.SampleCode
namespace FikaAmazonAPI.SampleCode
{
public class FulFillmentInboundSample
{
Expand All @@ -21,68 +8,7 @@ public FulFillmentInboundSample(AmazonConnection amazonConnection)
this.amazonConnection = amazonConnection;
}

public void GetInboundGuidance()
{
var parm = new Parameter.FulFillmentInbound.ParameterGetInboundGuidance() {
MarketplaceId= MarketPlace.UnitedArabEmirates.ID,
ASINList=new List<string> { "B071XVSXRL" }
};
amazonConnection.FulFillmentInbound.GetInboundGuidance(parm);
}

public void GetPrepInstructions()
{
var parm = new Parameter.FulFillmentInbound.ParameterGetPrepInstructions() {
ShipToCountryCode = "AE",
MarketplaceId= MarketPlace.UnitedArabEmirates.ID,
ASINList =new List<string> { "B071XVSXRL" }
};
amazonConnection.FulFillmentInbound.GetPrepInstructions(parm);
}

public void CreateShipmentPlan()
{
FikaAmazonAPI.AmazonSpApiSDK.Models.FulfillmentInbound.CreateInboundShipmentPlanRequest oCreateInboundShipmentPlanRequest = new FikaAmazonAPI.AmazonSpApiSDK.Models.FulfillmentInbound.CreateInboundShipmentPlanRequest();

oCreateInboundShipmentPlanRequest.ShipToCountryCode = "AE";
oCreateInboundShipmentPlanRequest.LabelPrepPreference = FikaAmazonAPI.AmazonSpApiSDK.Models.FulfillmentInbound.LabelPrepPreference.SELLERLABEL;


oCreateInboundShipmentPlanRequest.ShipFromAddress = new FikaAmazonAPI.AmazonSpApiSDK.Models.FulfillmentInbound.Address();
oCreateInboundShipmentPlanRequest.ShipFromAddress.AddressLine1 = "Add";
oCreateInboundShipmentPlanRequest.ShipFromAddress.AddressLine2 = "ADD2";
oCreateInboundShipmentPlanRequest.ShipFromAddress.City = "City";
oCreateInboundShipmentPlanRequest.ShipFromAddress.CountryCode = "AE";
oCreateInboundShipmentPlanRequest.ShipFromAddress.PostalCode = "0000";
oCreateInboundShipmentPlanRequest.ShipFromAddress.Name = "Name";



oCreateInboundShipmentPlanRequest.InboundShipmentPlanRequestItems = new FikaAmazonAPI.AmazonSpApiSDK.Models.FulfillmentInbound.InboundShipmentPlanRequestItemList();
FikaAmazonAPI.AmazonSpApiSDK.Models.FulfillmentInbound.InboundShipmentPlanRequestItem oInboundShipmentPlanRequestItem = new FikaAmazonAPI.AmazonSpApiSDK.Models.FulfillmentInbound.InboundShipmentPlanRequestItem();
oInboundShipmentPlanRequestItem.SellerSKU = "16118";
oInboundShipmentPlanRequestItem.ASIN = "B08BXH6234";
oInboundShipmentPlanRequestItem.Quantity = 1;
oInboundShipmentPlanRequestItem.Condition = FikaAmazonAPI.AmazonSpApiSDK.Models.FulfillmentInbound.Condition.NewItem;

oCreateInboundShipmentPlanRequest.InboundShipmentPlanRequestItems.Add(oInboundShipmentPlanRequestItem);
var oResult = amazonConnection.FulFillmentInbound.CreateInboundShipmentPlan(oCreateInboundShipmentPlanRequest);

}

public void GetFulFillmentInboundLabelsFromWebCreationSample(string shipmentId,int boxCount)
{
var labelParams = new ParameterGetLabels()
{
PageType = PageType.PackageLabel_Letter_6,
shipmentId = shipmentId,
LabelType = LabelType.SELLER_LABEL,
PageSize = boxCount
};

var labels = amazonConnection.FulFillmentInbound.GetLabels(labelParams);

}
// ToDo add new Samples

}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
using FikaAmazonAPI.AmazonSpApiSDK.Models.FulfillmentInbound;
using FikaAmazonAPI.Search;

namespace FikaAmazonAPI.Parameter.FulFillmentInbound
{
public class ParameterGetListInboundPlans : ParameterBased
public class ParameterGetListInboundPlans : PaginationParameter
{
public int? PageSize { get; set; }
public string PaginationToken { get; set; }
public Status? Status { get; set; }
public SortBy? SortBy { get; set; }
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
using FikaAmazonAPI.Search;

namespace FikaAmazonAPI.Parameter.FulFillmentInbound
namespace FikaAmazonAPI.Parameter.FulFillmentInbound
{
public class ParameterListInboundPlan : ParameterBased
public class ParameterListInboundPlan : PaginationParameter
{
public string InboundPlanId { get; set; }
public int? PageSize { get; set; }
public string PaginationToken { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using FikaAmazonAPI.Search;

namespace FikaAmazonAPI.Parameter.FulFillmentInbound
{
public class ParameterListPackingGroupItems : PaginationParameter
{
public string InboundPlanId { get; set; }
public string PackingOptionId { get; set; }
public string PackingGroupId { get; set; }
public string PaginationToken { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace FikaAmazonAPI.Parameter.FulFillmentInbound
{
public class ParameterListTransportationOptions : PaginationParameter
{
public string PlacementOptionId { get; set; }
public string ShipmentId { get; set; }
public string PaginationToken { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using FikaAmazonAPI.Search;

namespace FikaAmazonAPI.Parameter.FulFillmentInbound
{
public class ParameterUpdateItemComplianceDetails : ParameterBased
{
public string MarketplaceId { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using FikaAmazonAPI.Search;
using System.Collections.Generic;

namespace FikaAmazonAPI.Parameter.FulFillmentInbound
{
public class ParematerListItemComplianceDetails : ParameterBased
{
public ICollection<string> MSkus { get; set; }
public string MarketplaceId { get; set; }
}
}
25 changes: 22 additions & 3 deletions Source/FikaAmazonAPI/Services/ApiUrls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,28 @@ public static string CreateInboundPlan
public static string ListPackingOptions(string inboundPlanId) => $"{_resourceBaseUrl}/inboundPlans/{inboundPlanId}/packingOptions";
public static string GeneratePackingOptions(string inboundPlanId) => $"{_resourceBaseUrl}/inboundPlans/{inboundPlanId}/packingOptions";
public static string ConfirmPackingOption(string inboundPlanId, string packingOptionId) => $"{_resourceBaseUrl}/inboundPlans/{inboundPlanId}/packingOptions/{packingOptionId}/confirmation";



public static string ListPackingGroupItems(string inboundPlanId, string packingOptionId, string packingGroupId) => $"{_resourceBaseUrl}/inboundPlans/{inboundPlanId}/packingOptions/{packingOptionId}/packingGroups/{packingGroupId}/items";
public static string ListInboundPlanPallets(string inboundPlanId) => $"{_resourceBaseUrl}/inboundPlans/{inboundPlanId}/pallets";
public static string ListPlacementOptions(string inboundPlanId) => $"{_resourceBaseUrl}/inboundPlans/{inboundPlanId}/placementOptions";
public static string GeneratePlacementOptions(string inboundPlanId) => $"{_resourceBaseUrl}/inboundPlans/{inboundPlanId}/placementOptions";
public static string ConfirmPlacementOption(string inboundPlanId, string placementOptionId) => $"{_resourceBaseUrl}/inboundPlans/{inboundPlanId}/placementOptions/{placementOptionId}/confirmation";
public static string GetShipment(string inboundPlanId, string shipmentId) => $"{_resourceBaseUrl}/inboundPlans/{inboundPlanId}/shipments/{shipmentId}";
public static string GetDeliveryChallanDocument(string inboundPlanId, string shipmentId) => $"{_resourceBaseUrl}/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/deliveryChallanDocument";
public static string UpdateShipmentDeliveryWindow(string inboundPlanId, string shipmentId) => $"{_resourceBaseUrl}/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/deliveryWindow";
public static string GetSelfShipAppointmentSlots(string inboundPlanId, string shipmentId) => $"{_resourceBaseUrl}/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/selfShipAppointmentSlots";
public static string GenerateSelfShipAppointmentSlots(string inboundPlanId, string shipmentId) => $"{_resourceBaseUrl}/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/selfShipAppointmentSlots";
public static string CancelSelfShipAppointment(string inboundPlanId, string shipmentId, string slotId) => $"{_resourceBaseUrl}/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/selfShipAppointmentSlots/{slotId}/cancellation";
public static string ScheduleSelfShipAppointment(string inboundPlanId, string shipmentId, string slotId) => $"{_resourceBaseUrl}/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/selfShipAppointmentSlots/{slotId}/schedule";
public static string UpdateShipmentTrackingDetails(string inboundPlanId, string shipmentId) => $"{_resourceBaseUrl}/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/trackingDetails";
public static string ListTransportationOptions(string inboundPlanId) => $"{_resourceBaseUrl}/inboundPlans/{inboundPlanId}/transportationOptions";
public static string GenerateTransportationOptions(string inboundPlanId) => $"{_resourceBaseUrl}/inboundPlans/{inboundPlanId}/transportationOptions";
public static string ConfirmTransportationOptions(string inboundPlanId) => $"{_resourceBaseUrl}/inboundPlans/{inboundPlanId}/transportationOptions/confirmation";
public static string ListItemComplianceDetails() => $"{_resourceBaseUrl}/items/compliance";
public static string UpdateItemComplianceDetails() => $"{_resourceBaseUrl}/items/compliance";
public static string GetInboundOperationStatus(string operationId) => $"{_resourceBaseUrl}/operations/{operationId}";



public static string GetInboundGuidance
{
get => $"{_resourceBaseUrl}/itemsGuidance";
Expand Down
Loading

0 comments on commit 2238db3

Please sign in to comment.