order APIv1_beta.13.0

updateQuantity

POST
/checkout_session/{checkoutSessionId}/update_quantity

This method changes the quantity of the specified line item in an eBay member checkout session.

To meet security requirements for payments, the URLs for this method are:

  • Production URL: https://apix.ebay.com/buy/order/v1
  • Sandbox URL: https://apix.sandbox.ebay.com/buy/order/v1

Restrictions

For a list of supported sites and other restrictions, see API Restrictions in the Order API overview.

Input

Resource URI (production)

POST https://apix.ebay.com/buy/order/v1/checkout_session/{checkoutSessionId}/update_quantity

URI parameters

ParameterTypeDescription
checkoutSessionIdstringThe eBay-assigned session ID, for a specific eBay marketplace, that is returned by the initiateCheckoutSession method.

Note: When using this ID in this method, the X-EBAY-C-MARKETPLACE-ID value must be the same as what was used when this checkout session was created. See Checkout session restrictions in the Buy Integration Guide.

Occurrence: Required

HTTP request headers

All requests made to eBay REST operations require you to provide the Authorization HTTP header for authentication authorization.

OAuth scope

This request requires an access token created with the authorization code grant flow, using one scope from the following list:

https://api.ebay.com/oauth/api_scope/buy.order

See OAuth access tokens for more information.

Input container/fieldTypeDescription
lineItemIdstringA unique eBay-assigned ID value to identify the line item in a purchase order.

Occurrence: Required

quantityintegerThe number of individual items ordered in this line item, as specified by the buyer.

Occurrence: Required

Output

HTTP response headers

{ /* CheckoutSessionResponse */ }
Output container/fieldTypeDescription
acceptedPaymentMethodsarray of PaymentMethodThe container that returns the payment method that can be used to purchase the items.

Occurrence: Always

acceptedPaymentMethods.labelstringText indicating the payment type. For example, when paying by credit card, this label will be CC . When paying using PayPal Smart Button guest payment flow the label will be WALLET.

Occurrence: Always

acceptedPaymentMethods.logoImageImageThe URL of the image of the payment method logo.

Occurrence: Conditional

acceptedPaymentMethods.logoImage.heightinteger Reserved for future use.

Occurrence: Conditional

acceptedPaymentMethods.logoImage.imageUrlstringThe URL of the image.

Occurrence: Always

acceptedPaymentMethods.logoImage.widthinteger Reserved for future use.

Occurrence: Conditional

acceptedPaymentMethods.paymentMethodBrandsarray of PaymentMethodBrandAn array of credit card brands that can be used as the payment method.

Occurrence: Always

acceptedPaymentMethods.paymentMethodBrands.logoImageImageThe URL of the image of the payment method company (brand).

Occurrence: Conditional

acceptedPaymentMethods.paymentMethodBrands.logoImage.heightinteger Reserved for future use.

Occurrence: Conditional

acceptedPaymentMethods.paymentMethodBrands.logoImage.imageUrlstringThe URL of the image.

Occurrence: Always

acceptedPaymentMethods.paymentMethodBrands.logoImage.widthinteger Reserved for future use.

Occurrence: Conditional

acceptedPaymentMethods.paymentMethodBrands.paymentMethodBrandTypePaymentMethodBrandEnumAn enumeration value that indicates the payment method company, such as Visa.

Occurrence: Always

acceptedPaymentMethods.paymentMethodMessagesarray of PaymentMethodMessageThe type that defines the fields for legal messages and buyer consent verification.

Occurrence: Conditional

acceptedPaymentMethods.paymentMethodMessages.legalMessagestringInformation that eBay is legally obligated to show to the buyer. This field can be null, in which case do nothing. But if this field is not null, the value of this field must appear on the checkout page.

Note: This field is not used for US purchases.

Occurrence: Conditional

acceptedPaymentMethods.paymentMethodMessages.privacyPolicyWebUrlstringReserved for future use.

Occurrence: Conditional

acceptedPaymentMethods.paymentMethodMessages.requiredForUserConfirmationbooleanReserved for future use.

Occurrence: Conditional

acceptedPaymentMethods.paymentMethodMessages.userAgreementWebUrlstringReserved for future use.

Occurrence: Conditional

acceptedPaymentMethods.paymentMethodTypePaymentMethodTypeEnumAn enumeration value that indicates the method of payment, such as credit card.

Occurrence: Always

appliedCouponsarray of CouponThe container that returns the information for the coupons that were applied in the checkout session.

Occurrence: Conditional

appliedCoupons.redemptionCodestringThe coupon redemption code.

Occurrence: Conditional

checkoutSessionIdstringThe checkoutSessionId submitted in the request.

Occurrence: Always

expirationDatestringThe time the checkout session will end. To purchase the items the order must be placed before this time.

Occurrence: Always

lineItemsarray of LineItemAn array of line items associated with the checkout session.

Occurrence: Always

lineItems.baseUnitPriceAmountThe cost (Buy It Now price) of a single item in this line item. It is a starting point for computing the price during checkout session.

Occurrence: Always

lineItems.baseUnitPrice.currencyCurrencyCodeEnumThe currency involved in a monetary transaction. Generally, this is the currency used by the country of eBay site offering the item.

Occurrence: Always

lineItems.baseUnitPrice.valuestringThe dollar value of the currency specified in the currency field. The value of currency defaults to the standard currency used by the country of the eBay site offering the item.

Occurrence: Always

lineItems.imageImageAn eBay-assigned URL that points to an image of the item. eBay assigns the URL when the seller uploads the image.

Occurrence: Always

lineItems.image.heightinteger Reserved for future use.

Occurrence: Conditional

lineItems.image.imageUrlstringThe URL of the image.

Occurrence: Always

lineItems.image.widthinteger Reserved for future use.

Occurrence: Conditional

lineItems.itemIdstringA unique eBay-assigned ID value that identifies the item.

Occurrence: Always

lineItems.lineItemIdstringA unique eBay-assigned ID value that identifies the line item in a checkout session.

Occurrence: Always

lineItems.netPriceAmountThe total cost for the items in this line item taking into account the quantity and applying any seller item discounts, such as Buy 1 Get 1.

Note: This also does not include any shipping discounts, shipping costs, fees, or seller adjustments.

Occurrence: Always

lineItems.netPrice.currencyCurrencyCodeEnumThe currency involved in a monetary transaction. Generally, this is the currency used by the country of eBay site offering the item.

Occurrence: Always

lineItems.netPrice.valuestringThe dollar value of the currency specified in the currency field. The value of currency defaults to the standard currency used by the country of the eBay site offering the item.

Occurrence: Always

lineItems.promotionsarray of PromotionAn array of promotions associated with the item of this line item.

Occurrence: Conditional

lineItems.promotions.discountAmountThe container that returns the monetary value of the promotional discount.

Note: eBay Bucks are not supported.

Occurrence: Always

lineItems.promotions.discount.currencyCurrencyCodeEnumThe currency involved in a monetary transaction. Generally, this is the currency used by the country of eBay site offering the item.

Occurrence: Always

lineItems.promotions.discount.valuestringThe dollar value of the currency specified in the currency field. The value of currency defaults to the standard currency used by the country of the eBay site offering the item.

Occurrence: Always

lineItems.promotions.discountPercentagestringThe discount percentage of the applied promotional offer.

Occurrence: Conditional

lineItems.promotions.messagestringThe text for the promotion title which is displayed on the page. For example, Buy 1 Get 1.

Occurrence: Always

lineItems.promotions.promotionCodestringAn identifier of the promotion that was generated by the system when the promotion was created.

Occurrence: Always

lineItems.promotions.promotionTypestringThe value of the enumeration used when the promotions was created, which indicates the promotion type. For example, SellerDiscountedPromotionalOffer or COUPON.

Occurrence: Always

lineItems.quantityintegerThe number of individual items ordered for this line item, as specified by the buyer.

Occurrence: Always

lineItems.sellerSellerThe container that returns the information about the seller, such as their eBay user name.

Occurrence: Always

lineItems.seller.feedbackPercentagestringThe percentage of the total positive feedback.

Occurrence: Always

lineItems.seller.feedbackScoreintegerThe feedback score of the seller. This value is based on the ratings from eBay members that bought items from this seller.

Occurrence: Always

lineItems.seller.sellerAccountTypestringIndicates if the seller is a business or an individual. This is determined when the seller registers with eBay. If they register for a business account, this value will be BUSINESS. If they register for a private account, this value will be INDIVIDUAL. This designation is required by the tax laws in some countries.

This field is returned only on the following sites.

EBAY_AT    EBAY_BE    EBAY_CH    EBAY_DE    EBAY_ES    EBAY_FR    EBAY_GB    EBAY_IE     EBAY_IT    EBAY_PL

Valid values:
  • BUSINESS
  • INDIVIDUAL
Code so that your app gracefully handles any future changes to this list.

Occurrence: Conditional

lineItems.seller.usernamestringThe user name created by the seller for use on eBay.

Occurrence: Conditional

lineItems.shippingOptionsarray of ShippingOptionAn array of the shipping methods that are available for the line item. By default, the first one will be selected.

Occurrence: Always

lineItems.shippingOptions.baseDeliveryCostAmountThe shipping cost using this shipping option for this line item before any shipping discounts.

Occurrence: Always

lineItems.shippingOptions.baseDeliveryCost.currencyCurrencyCodeEnumThe currency involved in a monetary transaction. Generally, this is the currency used by the country of eBay site offering the item.

Occurrence: Always

lineItems.shippingOptions.baseDeliveryCost.valuestringThe dollar value of the currency specified in the currency field. The value of currency defaults to the standard currency used by the country of the eBay site offering the item.

Occurrence: Always

lineItems.shippingOptions.deliveryDiscountAmountThe monetary value of any delivery discount.

Occurrence: Always

lineItems.shippingOptions.deliveryDiscount.currencyCurrencyCodeEnumThe currency involved in a monetary transaction. Generally, this is the currency used by the country of eBay site offering the item.

Occurrence: Always

lineItems.shippingOptions.deliveryDiscount.valuestringThe dollar value of the currency specified in the currency field. The value of currency defaults to the standard currency used by the country of the eBay site offering the item.

Occurrence: Always

lineItems.shippingOptions.maxEstimatedDeliveryDatestringThe end of the date range in which the purchase order is expected to be delivered to the shipping address.

Occurrence: Always

lineItems.shippingOptions.minEstimatedDeliveryDatestringThe beginning of the date range in which the purchase order is expected to be delivered to the shipping address.

Occurrence: Always

lineItems.shippingOptions.selectedbooleanIndicates if the shipping method is selected.

Occurrence: Always

lineItems.shippingOptions.shippingCarrierCodestringThe shipping provider, such as FedEx, or USPS for the line item.

Occurrence: Always

lineItems.shippingOptions.shippingOptionIdstringA unique ID for the selected shipping option/method.

Occurrence: Always

lineItems.shippingOptions.shippingServiceCodestringA name of a shipping type. For example, Priority Mail Express (provided by USPS) or FedEx International Priority (Provided by FedEx).

Occurrence: Always

lineItems.shortDescriptionstringThis text string is derived from the item condition and the item aspects (such as size, color, capacity, model, brand, etc.).

Occurrence: Always

lineItems.titlestringThe seller created title of the item.

Occurrence: Always

pricingSummaryPricingSummaryThe container that returns the grand total, costs, discounts, seller fees, and adjustments of all the line items.

Occurrence: Always

pricingSummary.additionalSavingsAmountThe total amount of the coupon discounts in the purchase order.

Occurrence: Conditional

pricingSummary.additionalSavings.currencyCurrencyCodeEnumThe currency involved in a monetary transaction. Generally, this is the currency used by the country of eBay site offering the item.

Occurrence: Always

pricingSummary.additionalSavings.valuestringThe dollar value of the currency specified in the currency field. The value of currency defaults to the standard currency used by the country of the eBay site offering the item.

Occurrence: Always

pricingSummary.adjustmentAdjustmentThe total amount of any seller adjustments. An adjustment can be a credit or debit. This is used to catch any monetary changes to the order that are not already captured in one of the other fields.

Occurrence: Always

pricingSummary.adjustment.amountAmountThe container that returns the amount and currency of an adjustment.

Occurrence: Always

pricingSummary.adjustment.amount.currencyCurrencyCodeEnumThe currency involved in a monetary transaction. Generally, this is the currency used by the country of eBay site offering the item.

Occurrence: Always

pricingSummary.adjustment.amount.valuestringThe dollar value of the currency specified in the currency field. The value of currency defaults to the standard currency used by the country of the eBay site offering the item.

Occurrence: Always

pricingSummary.adjustment.labelstringText indicating what the adjustment was for.

Occurrence: Always

pricingSummary.deliveryCostAmountThe shipping cost for all the line items before any shipping discounts are applied.

Let's say there were 4 line items and the shipping cost for each line items is $5. One of the line items qualifies for free shipping and two line items qualify for a Buy 1 Get 1 offer, which would be a $6 and a $15 discount. The deliveryCost value would be 20, which is the total cost for shipping all the line items before discounts.

Occurrence: Always

pricingSummary.deliveryCost.currencyCurrencyCodeEnumThe currency involved in a monetary transaction. Generally, this is the currency used by the country of eBay site offering the item.

Occurrence: Always

pricingSummary.deliveryCost.valuestringThe dollar value of the currency specified in the currency field. The value of currency defaults to the standard currency used by the country of the eBay site offering the item.

Occurrence: Always

pricingSummary.deliveryDiscountAmountThe total amount of the shipping discounts for the all line items, which include promotional shipping discounts, such as free shipping if you buy two or more.

Let's say there were 4 line items and the shipping cost for each line items is $5. One of the line items qualifies for free shipping and two line items qualify for a Buy 1 Get 1 offer, which would be a $6 and a $15 discount. The deliveryDiscounts value would be 5, which is the value of the free shipping discount.

Note: This will always be a negative number.

Occurrence: Always

pricingSummary.deliveryDiscount.currencyCurrencyCodeEnumThe currency involved in a monetary transaction. Generally, this is the currency used by the country of eBay site offering the item.

Occurrence: Always

pricingSummary.deliveryDiscount.valuestringThe dollar value of the currency specified in the currency field. The value of currency defaults to the standard currency used by the country of the eBay site offering the item.

Occurrence: Always

pricingSummary.feeAmountThe total amount of any fees for all the line items, such as a recycling fee.

Occurrence: Always

pricingSummary.fee.currencyCurrencyCodeEnumThe currency involved in a monetary transaction. Generally, this is the currency used by the country of eBay site offering the item.

Occurrence: Always

pricingSummary.fee.valuestringThe dollar value of the currency specified in the currency field. The value of currency defaults to the standard currency used by the country of the eBay site offering the item.

Occurrence: Always

pricingSummary.priceDiscountAmountThe total amount of all the item specific discounts for all line items, such as Buy 1 Get 1 free.

Let's say there were 4 line items and the shipping cost for each line items is $5. One of the line items qualifies for free shipping and two line items qualify for a Buy 1 Get 1 offer, which would be a $6 and a $15 discount. The priceDiscount value would be 21, which is the total of the two Buy 1 Get 1 discounts.

Note: This will always be a negative number.

Occurrence: Always

pricingSummary.priceDiscount.currencyCurrencyCodeEnumThe currency involved in a monetary transaction. Generally, this is the currency used by the country of eBay site offering the item.

Occurrence: Always

pricingSummary.priceDiscount.valuestringThe dollar value of the currency specified in the currency field. The value of currency defaults to the standard currency used by the country of the eBay site offering the item.

Occurrence: Always

pricingSummary.priceSubtotalAmountThe total amount for all the line items before adding in taxes and shipping costs, or applying discounts, fees, and adjustments.

Occurrence: Always

pricingSummary.priceSubtotal.currencyCurrencyCodeEnumThe currency involved in a monetary transaction. Generally, this is the currency used by the country of eBay site offering the item.

Occurrence: Always

pricingSummary.priceSubtotal.valuestringThe dollar value of the currency specified in the currency field. The value of currency defaults to the standard currency used by the country of the eBay site offering the item.

Occurrence: Always

pricingSummary.taxAmountThe total amount of the taxes for all the line items.

Occurrence: Always

pricingSummary.tax.currencyCurrencyCodeEnumThe currency involved in a monetary transaction. Generally, this is the currency used by the country of eBay site offering the item.

Occurrence: Always

pricingSummary.tax.valuestringThe dollar value of the currency specified in the currency field. The value of currency defaults to the standard currency used by the country of the eBay site offering the item.

Occurrence: Always

pricingSummary.totalAmountThe total of the purchase order.

      total = priceSubtotal + baseDeliveryCost + taxes + deliveryDiscounts + priceDiscount + adjustments

Note: deliveryDiscounts and priceDiscount are negative numbers.

Occurrence: Always

pricingSummary.total.currencyCurrencyCodeEnumThe currency involved in a monetary transaction. Generally, this is the currency used by the country of eBay site offering the item.

Occurrence: Always

pricingSummary.total.valuestringThe dollar value of the currency specified in the currency field. The value of currency defaults to the standard currency used by the country of the eBay site offering the item.

Occurrence: Always

providedPaymentInstrumentProvidedPaymentInstrumentThe container that returns the payment methods that can be used for the checkout. This is returned only if you have used the updatePaymentInfo method to change the payment method.

Occurrence: Conditional

providedPaymentInstrument.paymentInstrumentReferencePaymentInstrumentReferenceThe container that returns the payment reference, such as last four digits of a credit card.

Occurrence: Conditional

providedPaymentInstrument.paymentInstrumentReference.externalReferenceIdstringThe identifier of the buyer's PayPal cart, which is returned by the initiateGuestPayment method. This ID is generated by PayPal and required for the PayPal Smart Button guest payment flow.

Occurrence: Conditional

providedPaymentInstrument.paymentInstrumentReference.lastFourDigitForCreditCardstringThe last four digits of the credit card number being used to pay for the items.

Occurrence: Conditional

providedPaymentInstrument.paymentMethodBrandPaymentMethodBrandThe container that returns the name and logo of the payment company (brand), such as Visa.

Occurrence: Conditional

providedPaymentInstrument.paymentMethodBrand.logoImageImageThe URL of the image of the payment method company (brand).

Occurrence: Conditional

providedPaymentInstrument.paymentMethodBrand.logoImage.heightinteger Reserved for future use.

Occurrence: Conditional

providedPaymentInstrument.paymentMethodBrand.logoImage.imageUrlstringThe URL of the image.

Occurrence: Always

providedPaymentInstrument.paymentMethodBrand.logoImage.widthinteger Reserved for future use.

Occurrence: Conditional

providedPaymentInstrument.paymentMethodBrand.paymentMethodBrandTypePaymentMethodBrandEnumAn enumeration value that indicates the payment method company, such as Visa.

Occurrence: Always

providedPaymentInstrument.paymentMethodTypePaymentMethodTypeEnumAn enumeration value that indicates the method of payment, such as CREDIT_CARD.

Occurrence: Conditional

shippingAddressShippingAddressThe container that returns the address to which the purchase order will be shipped.

Note: If the address cannot be validated, a warning message is be returned along with the response.

Occurrence: Always

shippingAddress.addressLine1stringThe first line of the street address where the item is being shipped.

Occurrence: Always

shippingAddress.addressLine2stringThe second line of the street address where the item is being shipped. This optional field can be used for information such as 'Suite Number' or 'Apt Number'.

Occurrence: Conditional

shippingAddress.citystringThe city of the address where the item is being shipped.

Occurrence: Always

shippingAddress.countryCountryCodeEnumThe two letter code representing the country of the address.

Restrictions: Currently, the only country supported for a shipping address is US.

Occurrence: Always

shippingAddress.countystringThe county of the address where the item is being shipped.

Occurrence: Always

shippingAddress.phoneNumberstringThe phone number of the person receiving the package.

Occurrence: Always

shippingAddress.postalCodestringThe postal code of the address where the item is being shipped.

Occurrence: Always

shippingAddress.recipientstringThe name of the person receiving the package.

Occurrence: Always

shippingAddress.stateOrProvincestringThe state or province of the address where the item is being shipped.

Occurrence: Always

warningsarray of ErrorDetailV3An array of any process errors or warnings that were generated during the method processing.

Occurrence: Conditional

warnings.categorystringThis string value indicates the error category. There are three categories of errors: request errors, application errors, and system errors.

Occurrence: Conditional

warnings.domainstringThe name of the primary system where the error occurred. This is relevant for application errors.

Occurrence: Conditional

warnings.errorIdintegerA unique code that identifies the particular error or warning that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms.

Occurrence: Conditional

warnings.inputRefIdsarray of stringAn array of reference IDs that identify the specific request elements most closely associated to the error or warning, if any.

Occurrence: Conditional

warnings.longMessagestringA detailed description of the condition that caused the error or warning, and information on what to do to correct the problem.

Occurrence: Conditional

warnings.messagestringA description of the condition that caused the error or warning.

Occurrence: Conditional

warnings.outputRefIdsarray of stringAn array of reference IDs that identify the specific response elements most closely associated to the error or warning, if any.

Occurrence: Conditional

warnings.parametersarray of ErrorParameterV3An array of warning and error messages that return one or more variables contextual information about the error or warning. This is often the field or value that triggered the error or warning.

Occurrence: Conditional

warnings.parameters.namestringThis is the name of input field that caused an issue with the method request.

Occurrence: Conditional

warnings.parameters.valuestringThis is the actual value that was passed in for the element specified in the name field.

Occurrence: Conditional

warnings.subdomainstringThe name of the subdomain in which the error or warning occurred.

Occurrence: NA

HTTP status codes

This call can return one of the following HTTP status codes. For an overview of the status codes, see HTTP status codes in Using eBay RESTful APIs.

StatusMeaning
200OK
400Bad Request
403Access Forbidden
404Resource Not Found
409Conflict
500Internal Error

Error codes

CodeDomainCategoryMeaning
15000API_ORDERAPPLICATIONThere was a problem with an eBay internal system or process. Contact eBay developer support for assistance.
15001API_ORDERREQUESTMissing field: {fieldName}. The indicated field is required for this request. Add the field and resubmit the call.
15002API_ORDERREQUESTInvalid field: {fieldName}. The indicated field contains an invalid value. Correct the value and resubmit the call.
15003API_ORDERREQUESTThe checkout session requested does not exist.
15012API_ORDERBUSINESSThere is a limit on the quantity of this item that can be purchased. Reduce the quantity and resubmit the call.
15013API_ORDERBUSINESSThe quantity value is greater than the quantity available. Correct the quantity value and resubmit the call.
15014API_ORDERBUSINESSThe quantity submitted for this item is invalid. Correct the quantity value and resubmit the call.
15019API_ORDERBUSINESSTo place an order, you must have at least one line item. Use the initiateCheckoutSession call to add line items (maximum of 4) and create a new checkout session.
15021API_ORDERBUSINESSThis checkout session cannot be updated because the order has already been placed.
15025API_ORDERREQUESTThe App is not authorized to access this resource.
15027API_ORDERBUSINESSThe value {fieldValue} is not supported for the {fieldName}. The supported values are: {supportedValues}.
15029API_ORDERREQUESTThe X-EBAY-C-MARKETPLACE-ID value {fieldValue} is invalid for this checkout session because it is different from the X-EBAY-C-MARKETPLACE-ID header value used to create the session. For all calls in this checkout session, you must use X-EBAY-C-MARKETPLACE-ID {supportedValues}.

Samples

New to making API calls? Please see Making a Call.

Note: Identifiers, such as order IDs or user IDs, and personal data in these samples might be anonymized or may no longer be active on eBay. If necessary, substitute current, relevant eBay data in your requests.

Sample 1: Update the Quantity

This call is used when your buyer wants to change the quantity of one of the items they are purchasing.

Input

The inputs are checkoutSessionId as a URI parameter and the line item ID and new quantity in the payload.
POST
https://apix.ebay.com/buy/order/v1/checkout_session/100008000651370/update_quantity

Output

The output contains the checkout session information. You can verify that the quantity is correct by checking the lineItems container.