Beispiel #1
0
        /// <summary>
        /// Ship a single order item within a customer order by providing shipping information.
        /// In case you purchased a shipping label you can add the shippingLabelCode to this message.
        /// In that case the transport element must be left empty.
        /// If you ship the item(s) using your own transporter method you must omit the shippingLabelCode entirely.
        /// </summary>
        /// <param name="orderItemId">The order item being confirmed.</param>
        /// <param name="shippingInfo"></param>
        /// <returns></returns>
        public async Task <StatusResponse> ShipOrderItem(ShippingInfo shippingInfo)
        {
            using (var content = BolApiHelper.BuildContentFromObject(shippingInfo))
            {
                var response = await Put($"/orders/shipment", content).ConfigureAwait(false);

                return(await BolApiHelper.GetContentFromResponse <StatusResponse>(response).ConfigureAwait(false));
            }
        }
Beispiel #2
0
        /// <summary>
        /// Allows the user to handle a return.
        /// This can be to either handle an open return, or change the handlingResult of an already handled return.
        /// The latter is only possible in limited scenarios, please check the returns documentation for a complete list.
        /// </summary>
        /// <param name="rmaId">The RMA (Return Merchandise Authorization) id that identifies this particular return.</param>
        /// <param name="handleReturnContainer">An object that holds the handling result and quantity of the returned product.</param>
        /// <returns></returns>
        public async Task <StatusResponse> HandleReturn(int rmaId, HandleReturnContainer handleReturnContainer)
        {
            using (var content = BolApiHelper.BuildContentFromObject(handleReturnContainer))
            {
                var response = await Put($"/returns/" + rmaId.ToString(), content).ConfigureAwait(false);

                return(await BolApiHelper.GetContentFromResponse <StatusResponse>(response).ConfigureAwait(false));
            }
        }
Beispiel #3
0
        /// <summary>
        /// This endpoint can be used to either confirm a cancellation request by the customer or to cancel an order you yourself are unable to fulfil.
        /// </summary>
        /// <param name="orderItems">Items to cancel (use CancelReason enum)</param>
        /// <returns></returns>
        public async Task <StatusResponse> CancelOrderByOrderItemId(OrderItemCancellationContainer orderItemsContainer)
        {
            using (var content = BolApiHelper.BuildContentFromObject(orderItemsContainer))
            {
                var response = await Put($"/orders/cancellation", content).ConfigureAwait(false);

                return(await BolApiHelper.GetContentFromResponse <StatusResponse>(response).ConfigureAwait(false));
            }
        }
        /// <summary>
        /// Creates a new offer, and adds it to the catalog. After creation, status information can be retrieved to review if the offer is valid and published to the shop.
        /// </summary>
        /// <param name="offer">The offer to create</param>
        /// <returns></returns>
        public async Task <StatusResponse> CreateNewOffer(CreateOffer offer)
        {
            using (var content = BolApiHelper.BuildContentFromObject(offer))
            {
                var response = await Post("/offers", content).ConfigureAwait(false);

                return(await BolApiHelper.GetContentFromResponse <StatusResponse>(response).ConfigureAwait(false));
            }
        }
        /// <summary>
        /// Update stock for offer by id.
        /// </summary>
        /// <param name="offerId">Unique identifier for an offer.</param>
        /// <param name="stock">New stock for the offer.</param>
        /// <returns></returns>
        public async Task <StatusResponse> UpdateOfferStock(string offerId, Stock stock)
        {
            using (var content = BolApiHelper.BuildContentFromObject(stock))
            {
                var response = await Put($"/offers/{offerId}/stock", content).ConfigureAwait(false);

                return(await BolApiHelper.GetContentFromResponse <StatusResponse>(response).ConfigureAwait(false));
            }
        }
        /// <summary>
        /// Use this endpoint to send an offer update. This endpoint returns a process status.
        /// </summary>
        /// <param name="offerId">Unique identifier for an offer.</param>
        /// <param name="updateOffer">Offer update container.</param>
        /// <returns></returns>
        public async Task <StatusResponse> UpdateOffer(string offerId, UpdateOffer updateOffer)
        {
            using (var content = BolApiHelper.BuildContentFromObject(updateOffer))
            {
                var response = await Put("/offers/" + offerId, content).ConfigureAwait(false);

                return(await BolApiHelper.GetContentFromResponse <StatusResponse>(response).ConfigureAwait(false));
            }
        }
Beispiel #7
0
        public async Task <StatusResponse> AddTransportInformation(string transportId, Transport transport)
        {
            using (var content = BolApiHelper.BuildContentFromObject(transport))
            {
                var response = await Put($"/transports/{transportId}", content).ConfigureAwait(false);

                return(await BolApiHelper.GetContentFromResponse <StatusResponse>(response).ConfigureAwait(false));
            }
        }
        /// <summary>
        /// V4 BETA: Update push notification subscription
        /// Update an existing push notification subscription with the supplied id. The configured URL has to support https scheme.
        /// </summary>
        /// <param name="subscriptionId">A unique identifier for the subscription</param>
        /// <param name="notificationSubscription"></param>
        /// <returns></returns>
        public async Task <StatusResponse> UpdatePushNotificationSubscription(int subscriptionId, CreateNotificationSubscription notificationSubscription)
        {
            using (var content = BolApiHelper.BuildContentFromObject(notificationSubscription, AcceptHeaders.V5Json))
            {
                var response = await Put($"/subscriptions/{subscriptionId}", content, acceptHeader : AcceptHeaders.V5Json).ConfigureAwait(false);

                return(await BolApiHelper.GetContentFromResponse <StatusResponse>(response).ConfigureAwait(false));
            }
        }
        /// <summary>
        /// V4 BETA: Send test push notification for subscriptions
        /// Send a test push notification to all subscriptions for the provided event.
        /// </summary>
        /// <returns></returns>
        public async Task <StatusResponse> SendTestPushNotification()
        {
            using (var content = BolApiHelper.BuildContentFromObject(new object { }, AcceptHeaders.V5Json))
            {
                var response = await Post("/subscriptions/test", content, acceptHeader : AcceptHeaders.V5Json).ConfigureAwait(false);

                return(await BolApiHelper.GetContentFromResponse <StatusResponse>(response).ConfigureAwait(false));
            }
        }
        /// <summary>
        /// Gets all commissions and possible reductions by EAN, condition and optionally price.
        /// No more than 100 EAN`s can be sent in a single request.
        /// </summary>
        /// <param name="queries">Object that holds properties which get queried</param>
        /// <returns></returns>
        public async Task <CommissionsContainer> GetCommissions(CommissionQueriesContainer queries)
        {
            using (var content = BolApiHelper.BuildContentFromObject(queries))
            {
                var response = await Post("/commission", content);

                return(await BolApiHelper.GetContentFromResponse <CommissionsContainer>(response).ConfigureAwait(false));
            }
        }
        /// <summary>
        /// Update price for offer by id. The flow is designed to facilitate the planned offering of bundle discounts. This is not yet available. Therefore, the ‘quantity’ field should always contain the value ‘1’, and the price should represent the single unit price.
        /// </summary>
        /// <param name="offerId">Unique identifier for an offer.</param>
        /// <param name="pricing">New pricing for the offer.</param>
        /// <returns></returns>
        public async Task <StatusResponse> UpdateOfferPrice(string offerId, PricingContainer pricing)
        {
            var pricingContainer = new UpdatePriceContainer(pricing);

            using (var content = BolApiHelper.BuildContentFromObject(pricingContainer))
            {
                var response = await Put($"/offers/{offerId}/price", content).ConfigureAwait(false);

                return(await BolApiHelper.GetContentFromResponse <StatusResponse>(response).ConfigureAwait(false));
            }
        }
        /// <summary>
        /// Request an offer export file containing all offers.
        /// </summary>
        /// <param name="exportConfiguration">The file format in which to return the export. Defaults to "CSV"</param>
        /// <returns></returns>
        public async Task <StatusResponse> RequestOfferExportFile(OfferExportConfiguration exportConfiguration = null)
        {
            if (exportConfiguration == null)
            {
                exportConfiguration = new OfferExportConfiguration();
            }
            using (var content = BolApiHelper.BuildContentFromObject(exportConfiguration))
            {
                var response = await Post("/offers/export", content).ConfigureAwait(false);

                return(await BolApiHelper.GetContentFromResponse <StatusResponse>(response).ConfigureAwait(false));
            }
        }
        /// <summary>
        /// Request an unpublished offer report containing all unpublished offers and reasons.
        /// </summary>
        /// <param name="fileFormatContainer">File format container defaults to "CSV"</param>
        public async Task <StatusResponse> RequestUnpublishedOfferReport(FileFormatContainer fileFormatContainer = null)
        {
            if (fileFormatContainer == null)
            {
                fileFormatContainer = new FileFormatContainer("CSV");
            }
            using (var content = BolApiHelper.BuildContentFromObject(fileFormatContainer, AcceptHeaders.V5Json))
            {
                var response = await Post($"/offers/unpublished", content, acceptHeader : AcceptHeaders.V5Json).ConfigureAwait(false);

                return(await BolApiHelper.GetContentFromResponse <StatusResponse>(response).ConfigureAwait(false));
            }
        }
Beispiel #14
0
        /// <summary>
        /// Retrieve a list of process statuses, which shows information regarding previously executed PUT/POST/DELETE requests.
        /// No more than 1000 process status id's can be sent in a single request.
        /// </summary>
        /// <param name="processStatusIds">Array of objects (ProcessStatusId)</param>
        /// <returns></returns>
        public async Task <ProcessStatusesContainer> GetProcessStatusesByIds(string[] processStatusIds)
        {
            var processStatusQueries = new ProcessStatusQuery[processStatusIds.Length];

            for (int i = 0; i < processStatusIds.Length; i++)
            {
                processStatusQueries[i] = new ProcessStatusQuery()
                {
                    ProcessStatusId = processStatusIds[i]
                };
            }
            var newObject = new
            {
                processStatusQueries = processStatusQueries
            };

            using (var content = BolApiHelper.BuildContentFromObject(newObject))
            {
                var response = await Post("/process-status", content).ConfigureAwait(false);

                return(await BolApiHelper.GetContentFromResponse <ProcessStatusesContainer>(response).ConfigureAwait(false));
            }
        }