> ## Documentation Index
> Fetch the complete documentation index at: https://enterprise-docs.bglobale.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create order

> The CreateOrder API is used to create a replacement order in Global-e.

<Note>
  Part of the [CreateOrder](/createorder) integration guide — see it for when and how to use this endpoint.
</Note>


## OpenAPI

````yaml api-reference/specs/createorder.yaml POST /checkout/CreateOrder
openapi: 3.0.3
info:
  title: CreateOrder
  version: 1.0.0
  description: The CreateOrder API is used to create a replacement order in Global-e.
servers:
  - url: https://{globale_api_domain}
    variables:
      globale_api_domain:
        default: globale_api_domain
        description: Global-e API host, supplied to the merchant by Global-e.
security: []
tags:
  - name: CreateOrder
    x-page-title: CreateOrder
  - name: 'Direction: Merchant → Global-e'
  - name: 'Domain: Orders'
paths:
  /checkout/CreateOrder:
    post:
      tags:
        - CreateOrder
      summary: Create a replacement order
      description: The CreateOrder API is used to create a replacement order in Global-e.
      operationId: createOrder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendOrderData'
            example:
              orderReplacement:
                replacedProducts:
                  - quantity: 1
                    cartItemId: '1'
                originalOrderId: GE10097473894NL
              cartData:
                products:
                  - productCode: '460011778068'
                    isFixedPrice: true
                    orderedQuantity: 1
                    salePrice: '17.90'
                    cartItemId: ''
                    parentCartItemId: '1'
                userDetails:
                  addressDetails:
                    - email: customer@example.com
                discounts:
                  - productCartItemId: ''
                    discountType: 1
                    discountValue: 1.79
                shippingMethodCode: ''
                merchantOrderId: Y73186844546755
      responses:
        '200':
          description: Replacement order created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateOrderResponse'
              example:
                OrderId: GE10098224286NL
                MerchantOrderId: Y73186844546755
                MerchantInternalOrderId: null
                IsReplacementOrder: true
                OriginalOrder:
                  OrderId: GE10097473894NL
                  MerchantOrderId: EUQA1116048
                  MerchantInternalOrderId: EUQA1116048
                CurrencyCode: EUR
                CurrencyName: Euro
                IsFreeShipping: true
                ShippingMethodCode: globaleintegration_standard
                HubId: 1001034
                InternationalDetails:
                  CurrencyCode: EUR
                  TotalPrice: 16.11
                  TotalShippingPrice: -19.9
                  ShippingMethodCode: GLOBALE
                  ShippingMethodName: DHL api Express Worldwide
                  PaymentMethodCode: '39'
                  PaymentMethodName: CouponPayment
                  DutiesGuaranteed: false
                  ShippingMethodTypeCode: Standard
                  ShippingMethodTypeName: Standard Courier
                  DeliveryDaysFrom: 1
                  DeliveryDaysTo: 2
                OrderDocuments:
                  - URL: >-
                      https://connect2.bglobale.com/Document/VATInvoice?documentParam=...
                    DocumentTypeCode: '5'
                    DocumentTypeName: VATInvoice
                    DocumentExtension: pdf
                    ErrorMessage: null
components:
  schemas:
    SendOrderData:
      type: object
      title: SendOrderData
      required:
        - CartData
        - OrderReplacement
      properties:
        CartData:
          $ref: '#/components/schemas/SendCartData'
          description: Cart data for the new replacement order creation.
        OrderReplacement:
          $ref: '#/components/schemas/OrderReplacementData'
          description: Replaced order and product information.
        ShippingMethodCode:
          type: string
          description: >-
            Replacement shipping method code; if empty, the original service
            level is used.
    CreateOrderResponse:
      type: object
      title: CreateOrderResponse
      description: >-
        Response to a successful CreateOrder call. No response field table is
        documented on the page — top-level fields are modeled from the response
        JSON example; nested objects are typed where their structure is evident.
      properties:
        OrderId:
          type: string
          description: Global-e order identifier.
        MerchantOrderId:
          type: string
          description: Merchant order identifier.
        MerchantInternalOrderId:
          type: string
          nullable: true
          description: Merchant internal order identifier.
        IsReplacementOrder:
          type: boolean
          description: Indicates this is a replacement order.
        OriginalOrder:
          type: object
          description: The original order this replaces.
          properties:
            OrderId:
              type: string
            MerchantOrderId:
              type: string
            MerchantInternalOrderId:
              type: string
              nullable: true
        CurrencyCode:
          type: string
          description: 3-character ISO currency code.
        CurrencyName:
          type: string
          description: Currency name.
        Products:
          type: array
          nullable: true
          description: Products in the replacement order.
          items:
            type: object
        Discounts:
          type: array
          nullable: true
          description: Discounts applied to the order.
          items:
            type: object
        Markups:
          type: array
          nullable: true
          description: Markups applied to the order (e.g. replacement shipping discount).
          items:
            type: object
        IsFreeShipping:
          type: boolean
          description: Indicates whether shipping is free for this order.
        ShippingMethodCode:
          type: string
          description: Shipping method code.
        HubId:
          type: number
          format: decimal
          nullable: true
          description: Global-e hub identifier.
        InternationalDetails:
          type: object
          nullable: true
          description: International shipping, payment, and tracking details.
          properties:
            CurrencyCode:
              type: string
            TotalPrice:
              type: number
              format: float
            TotalShippingPrice:
              type: number
              format: float
            ShippingMethodCode:
              type: string
            ShippingMethodName:
              type: string
            PaymentMethodCode:
              type: string
            PaymentMethodName:
              type: string
            DutiesGuaranteed:
              type: boolean
            ShippingMethodTypeCode:
              type: string
            ShippingMethodTypeName:
              type: string
            DeliveryDaysFrom:
              type: integer
            DeliveryDaysTo:
              type: integer
        OrderDocuments:
          type: array
          nullable: true
          description: Documents generated for the order (e.g. VAT invoice).
          items:
            type: object
            properties:
              URL:
                type: string
                format: uri
              DocumentTypeCode:
                type: string
              DocumentTypeName:
                type: string
              DocumentExtension:
                type: string
              ErrorMessage:
                type: string
                nullable: true
    SendCartData:
      type: object
      title: SendCartData
      required:
        - Name
        - Products
      properties:
        Discounts:
          type: array
          nullable: true
          description: List of applicable discounts (cart, shipping, etc.).
          items:
            $ref: '#/components/schemas/Discount'
        HubCountryCode:
          type: string
          description: 2-character ISO country code for hub selection.
        HubId:
          type: number
          format: decimal
          description: Global-e Local Hub identifier from ActiveHubDetails.
        MerchantOrderId:
          type: string
          description: Unique Merchant order identifier.
        MerchantPriceForDuties:
          type: string
          description: Amended Merchant price for duties/customs declaration.
        Name:
          type: string
          description: Product name (minimum 1 character).
        OriginalMerchantPriceForDuties:
          type: string
          description: Original Merchant price for duties/customs declaration.
        Products:
          type: array
          description: >-
            List of Product objects. Full Product schema at
            https://docs.global-e.com/enterprise/en/endpoints.html#product-261905
          items:
            $ref: '#/components/schemas/Product'
        UrlParameters:
          type: string
          description: JSON-serialized KeyValuePairs for Merchant RESTful API URLs.
        UserDetails:
          $ref: '#/components/schemas/CartUserDetails'
          description: User details including addresses.
        WebStoreCode:
          type: string
          description: Code identifying web store (for multi-store setup).
        WebStoreInstanceCode:
          type: string
          description: Code identifying web store instance (for multi-domain setup).
    OrderReplacementData:
      type: object
      title: OrderReplacementData
      required:
        - OriginalOrderId
        - ReplacedProducts
      properties:
        OrderReplacementType:
          type: number
          format: decimal
          description: 1 = Repair Service; 0 = Regular replacement (default).
        OriginalOrderId:
          type: string
          description: Original Order ID.
        ReplacedProducts:
          type: array
          description: List of replaced products.
          items:
            $ref: '#/components/schemas/ReplacedProduct'
    Discount:
      type: object
      title: Discount
      required:
        - DiscountType
        - DiscountValue
        - Name
      properties:
        CouponCode:
          type: string
          nullable: true
          description: Merchant coupon code for coupon-based discounts.
        Description:
          type: string
          description: Textual discount description.
        DiscountCode:
          type: string
          description: Discount identifier on the Merchant's site.
        DiscountType:
          type: number
          format: decimal
          description: >-
            Discount type: 1 = Cart discount, 2 = Shipping discount, 3 = Loyalty
            points discount, 4 = Duties discount, 5 = Checkout Loyalty Points
            Discount, 6 = Payment Charge.
        DiscountValue:
          type: number
          format: decimal
          description: Discount value post-FX and country coefficient.
        LoyaltyVoucherCode:
          type: string
          nullable: true
          description: Code identifying a Loyalty Voucher.
        Name:
          type: string
          description: Discount name.
        ProductCartItemId:
          type: string
          nullable: true
          description: Related product cart item identifier.
    Product:
      type: object
      title: Product
      description: >-
        Product object. The fields below are those used in the CreateOrder
        request example. Full Product schema:
        https://docs.global-e.com/enterprise/en/endpoints.html#product-261905
      properties:
        ProductCode:
          type: string
          description: SKU code used to identify the product on the Merchant's site.
        IsFixedPrice:
          type: boolean
          description: Indicates if the product's price is fixed by the Merchant.
        OrderedQuantity:
          type: number
          format: decimal
          description: Ordered quantity for the product.
        SalePrice:
          type: string
          description: >-
            Product sale price as displayed to the customer, after applying
            country coefficient and FX conversion.
        CartItemId:
          type: string
          description: Identifier of the cart item on the Merchant's site.
        ParentCartItemId:
          type: string
          description: >-
            Identifier of the current item's parent cart item on the Merchant's
            site.
    CartUserDetails:
      type: object
      title: CartUserDetails
      properties:
        AddressDetails:
          type: array
          nullable: true
          description: >-
            All available addresses from the customer's address book or
            replacement addresses.
          items:
            type: object
        UserId:
          type: string
          description: Internal User identifier on the Merchant's site.
    ReplacedProduct:
      type: object
      title: ReplacedProduct
      required:
        - Quantity
      properties:
        CartItemId:
          type: string
          description: Cart item ID.
        Quantity:
          type: number
          format: decimal
          description: Item quantity.
        SKU:
          type: string
          description: SKU of the product if cart item ID is not available.

````