order APIv1_beta.13.0

placeProxyGuestOrder

POST
/proxy_guest_checkout_session/{checkoutSessionId}/place_order

This method creates the proxy guest purchase order, pays for the items, and terminates the specified guest checkout session. The checkoutSessionId is passed in as a URI parameter and is required. Although there is not a request payload, for this method you must pass in { } in the request body.

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

    Note: This method is not available in the eBay API Explorer.

Also see Negative Testing Using Stubs for information on how to emulate error conditions for this method using stubs.

Restrictions

  • This method is used only when the eBay partner is using a payment vault service, such as Braintree, to process payments.
  • This payment flow is supported only for the EBAY_US marketplace.
  • 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/proxy_guest_checkout_session/{checkoutSessionId}/place_order

URI parameters

ParameterTypeDescription
checkoutSessionIdstringThe eBay-assigned session ID, for a specific eBay marketplace, that is returned by the initiateProxyGuestCheckoutSession 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.

This method also requires the following headers:
  • X-EBAY-C-ENDUSERCTX with the risk correlation ID. This ID is generated by the vault service provider (VSP).
  • X-EBAY-C-ENDUSERCTX header with affiliateCampaignId and optionally affiliateReferenceId. For more details see about this header, Request headers.
For example:
X-EBAY-C-ENDUSERCTX: deviceId=riskCorrelationId,affiliateCampaignId=ePNCampaignId,affiliateReferenceId=referenceId.

OAuth scope

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

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

See OAuth access tokens for more information.

Note: Although there is not a request payload, for this method you must pass in { } in the request body.

Input container/fieldTypeDescription
marketingTermsarray of MarketingTermsThe container for the marketing channels and types of messages the buyer can choose to receive and the field to indicate whether the buyer wants to receive marketing materials from eBay.

Important: Although the marketingChannels, marketingTermsAccepted, and marketingTypes fields are optional, for all marketplaces except the US, you must show the marketing legal message and a checkbox below the "Buy" button. See Marketing Consent requirements for details.

Occurrence: Optional

marketingTerms.marketingChannelsarray of MarketingChannelEnumAn enumeration value representing the available marketing channels, such as EMAIL. Currently, the only marketing channel available is EMAIL.

Occurrence: Optional

marketingTerms.marketingTermsAcceptedbooleanA boolean that indicates whether the buyer wants to receive marketing messages. Note: This is an optional field. If it is left null, the defaults are:
  • US marketplace: true
  • Any other marketplace: false

Occurrence: Optional

marketingTerms.marketingTypesarray of MarketingTypeEnumAn enumeration value representing the available types of marketing messages. Currently, if the buyer opts-in, they will receive all the available marketing types (OFFER, PROMOTION, and SURVEY).

Occurrence: Optional

Output

HTTP response headers

Output container/fieldTypeDescription
purchaseOrderHrefstringThe URI of the purchase order.

Occurrence: Conditional

purchaseOrderIdstringA unique identifier of the purchase order. When a checkout session completes, a purchase order ID is generated.

Occurrence: Conditional

purchaseOrderPaymentStatusPurchaseOrderPaymentStatusEnumAn enumeration value that indicates the payment status for the purchase order.

Occurrence: Conditional

warningsarray of ErrorDetailV3An array of warning messages.

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.
15003API_ORDERREQUESTThe checkout session requested does not exist.
15004API_ORDERREQUESTIf this is a eBay member checkout, this error indicates that the buyer does not have a PayPal account linked to their eBay account. If this is a guest checkout, this indicates that the buyer's credit card information is missing. In both cases, submit the buyer's credit card information.
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.
15020API_ORDERBUSINESSDuring the checkout process the item has been changed. Create a new checkout session for this item using the initiateCheckoutSession call.
15023API_ORDERBUSINESSThe credit card was declined, which means you cannot use the current checkout session to complete this order. Use the initiateCheckoutSession call to create a new checkout session and provide new payment information.
15024API_ORDERBUSINESSThere is a problem with the buyer's PayPal account. The buyer should check their account or provide a credit card to pay for the order.
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}.
15030API_ORDERBUSINESSTo place the order, the user must have accepted the PayPal User Agreement and Privacy Policy. If they have explicitly accepted these, pass in true in the paymentTermsAccepted field. For more information, see the documentation for this call.
17000API_ORDERBUSINESSThe payment cannot be processed at this time.

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: Place the Order

This call generates the purchase order ID and starts the process that pays for the line items for a proxy guest checkout. Be sure to store this ID because it is passed as a URI parameter in the getGuestPurchaseOrder call.

Input

The input is the checkoutSessionId.

Note: Although there is not a request payload, for this call you must pass in { } in the request body.
POST
https://apix.ebay.com/buy/order/v1/proxy_guest_checkout_session/v1|5018578757|63iqkv_LQQy/place_order

Output

The output is the purchase order ID, the purchase order URL, and order payment status.