> ## 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.

# CreateOrder

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

## Overview

This section describes how to create a replacement order in Global-e.

## CreateOrder (Merchant to Global-e)

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

Key constraints:

* Products must be pre-registered with Global-e.
* Replacement orders inherit shipping service and details from the original unless specified.
* Customers are not charged upgrade costs or remote area fees.
* Destination country cannot change from the original order.
* Orders default to Delivered Duty Paid (DDP) when supported.
* Merchants must validate the original order status independently.
* Billing details are immutable.
* Added value replacement is unsupported.
* Authentication uses Merchant GUID.
* Must be implemented using cart item ID.
* An `OrderReplacementCreated` email is sent upon successful replacement creation.

<div className="api-ref-card">
  <Card title="CreateOrder — full request & response" icon="code" href="/api-reference/create-order">
    Parameters, schema, examples, and the interactive playground for `POST /checkout/CreateOrder`.
  </Card>
</div>

## CreateOrder Specification

The full schema for all request and response objects — `SendOrderData`, `SendCartData`,
`OrderReplacementData`, `ReplacedProduct`, `CartUserDetails`, `CustomProductAttribute`,
`Discount`, and `CreateOrderResponse` — is rendered automatically from the spec on the
[API Reference page](/api-reference/create-order). The narrative sections below cover
logic and lookup tables not part of the schema.

### Hub Selection Logic

Resolution order of precedence:

1. If `HubId` is provided → use that hub.
2. If only `HubCountryCode` is provided and matches the original order → use the original hub.
3. If `HubCountryCode` differs from the original → use the first active merchant hub in that country.
4. If neither `HubId` nor `HubCountryCode` is provided → use the original order hub.
5. Fallback: first active merchant hub in the merchant's country.

### Discount Type Options

| Value | Description                      |
| ----- | -------------------------------- |
| 1     | Cart discount                    |
| 2     | Shipping discount                |
| 3     | Loyalty points discount          |
| 4     | Duties discount                  |
| 5     | Checkout Loyalty Points Discount |
| 6     | Payment Charge                   |
