Skip to main content

CreateOrder

API Playground

Create an order for 3D printed models. This endpoint allows you to place an order with multiple models, each with specified quantities. The order will be processed and production orders (POs) will be created for each model.

Your authentication token will be sent as: Authorization: Bearer <token>
Customer's first name
Customer's last name
Street address
Postal/ZIP code
Phone number
Email address
City
Country code (2-3 characters, ISO format)
State or province (optional)
JSON array of models. Example: [{"modelId":"123e4567-e89b-12d3-a456-426614174000","quantity":1}]
Shipping method ID. See Shipping Methods for available IDs. Use GetShippingMethods to get methods by country.

Endpoint

POST https://devapi.marketiger3d.com/v2/Order/CreateOrder

Authentication

This endpoint requires a Bearer token. Include the token in the Authorization header:

Authorization: Bearer <your_access_token>

Request Body

{
"firstName": "string",
"lastName": "string",
"streetAddress": "string",
"postal": "string",
"phoneNumber": "string",
"email": "string",
"city": "string",
"country": "string",
"countryState": "string",
"models": [
{
"modelId": "123e4567-e89b-12d3-a456-426614174000",
"quantity": 1
}
],
"shippingMethod": 0
}

Request Body Schema

FieldTypeRequiredDescription
firstNamestringYesCustomer's first name
lastNamestringYesCustomer's last name
streetAddressstringYesStreet address
postalstringYesPostal/ZIP code
phoneNumberstringYesPhone number
emailstringYesEmail address
citystringYesCity
countrystringYesCountry code (2-3 characters, ISO format)
countryStatestringNoState or province (optional)
modelsarrayYesArray of model orders
models[].modelIdstringYesUUID of the model to order
models[].quantitynumberYesQuantity of this model to order (minimum 1)
shippingMethodnumberYesShipping method ID. See Shipping Methods for available IDs. Use GetShippingMethods to get methods by country.

Example Request

curl -X POST "https://devapi.marketiger3d.com/v2/Order/CreateOrder" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-d '{
"firstName": "John",
"lastName": "Doe",
"streetAddress": "123 Main St",
"postal": "10001",
"phoneNumber": "+1234567890",
"email": "customer@example.com",
"city": "New York",
"country": "US",
"countryState": "NY",
"models": [
{
"modelId": "123e4567-e89b-12d3-a456-426614174000",
"quantity": 2
},
{
"modelId": "223e4567-e89b-12d3-a456-426614174000",
"quantity": 1
}
],
"shippingMethod": 2503
}'
fetch('https://devapi.marketiger3d.com/v2/Order/CreateOrder', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
},
body: JSON.stringify({
firstName: 'John',
lastName: 'Doe',
streetAddress: '123 Main St',
postal: '10001',
phoneNumber: '+1234567890',
email: 'customer@example.com',
city: 'New York',
country: 'US',
countryState: 'NY',
models: [
{
modelId: '123e4567-e89b-12d3-a456-426614174000',
quantity: 2
},
{
modelId: '223e4567-e89b-12d3-a456-426614174000',
quantity: 1
}
],
shippingMethod: 2503
})
})
.then(response => response.json())
.then(data => {
if (data.success) {
const orderId = data.data.orderId;
console.log('Order created:', orderId);
}
})
.catch(error => console.error('Error:', error));
var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", "YOUR_ACCESS_TOKEN");

var orderRequest = new {
firstName = "John",
lastName = "Doe",
streetAddress = "123 Main St",
postal = "10001",
phoneNumber = "+1234567890",
email = "customer@example.com",
city = "New York",
country = "US",
countryState = "NY",
models = new[] {
new { modelId = "123e4567-e89b-12d3-a456-426614174000", quantity = 2 },
new { modelId = "223e4567-e89b-12d3-a456-426614174000", quantity = 1 }
},
shippingMethod = 2503
};

var request = new HttpRequestMessage(HttpMethod.Post, "https://devapi.marketiger3d.com/v2/Order/CreateOrder");
request.Content = new StringContent(JsonSerializer.Serialize(orderRequest), Encoding.UTF8, "application/json");

var response = await client.SendAsync(request);
var responseContent = await response.Content.ReadAsStringAsync();
var result = JsonSerializer.Deserialize<APIResponse<CreateOrderResponse>>(responseContent);

if (result.Success)
{
var orderId = result.Data.OrderId;
}

Response

Success Response (200 OK)

{
"success": true,
"data": {
"message": "Successfully ordered items",
"orderId": "123e4567-e89b-12d3-a456-426614174000",
"paymentUrl": "https://checkout.stripe.com/pay/cs_test_123"
}
}

Response Schema

FieldTypeDescription
successbooleanIndicates if the request succeeded
dataobjectResponse data
data.messagestringSuccess message
data.orderIdstringUnique identifier (GUID) of the created order
data.paymentUrlstringPayment URL when Stripe Checkout is enabled; omitted otherwise

Error Response (400 Bad Request)

{
"success": false,
"error": {
"type": "AUTHENTICATION",
"message": "User email not found"
}
}
{
"success": false,
"error": {
"type": "AUTHENTICATION",
"message": "User not found"
}
}
{
"success": false,
"error": {
"type": "INCORRECT_PARAMETERS",
"message": "OrderDetails are missing"
}
}
{
"success": false,
"error": {
"type": "INCORRECT_PARAMETERS",
"message": "No firstName specified"
}
}
{
"success": false,
"error": {
"type": "INCORRECT_PARAMETERS",
"message": "No models provided in the order."
}
}
{
"success": false,
"error": {
"type": "OPERATION_FAILED",
"message": "Order not found after creation."
}
}
{
"success": false,
"error": {
"type": "OPERATION_FAILED",
"message": "Model not found"
}
}
{
"success": false,
"error": {
"type": "OPERATION_FAILED",
"message": "Models belong to different projects"
}
}
{
"success": false,
"error": {
"type": "OPERATION_FAILED",
"message": "Email not confirmed, confirm your email before creating a order"
}
}

Error Response (No permission)

When receiving this error contact us so we can give your project permission to place orders.

{
"success": false,
"error": {
"type": "NO_PERMISSION",
"message": "This project is not setup for creating orders with the api contact us."
}
}

Error Codes

Error TypeStatusDescription
AUTHENTICATION400User not found or email not confirmed
INCORRECT_PARAMETERS400Missing required fields or invalid values
OPERATION_FAILED400Model not found, models from different projects, or other operation errors
NO_PERMISSION400Project doesn't allow API orders

Notes

  • Email confirmation: The user's email must be confirmed before creating orders
  • Model requirements: All models in each order must belong to the same project - you cannot mix models from different projects in a single order
  • Country codes: Use ISO country codes (2-3 characters, e.g., "US", "GB", "NL")
  • Shipping method: You must provide a valid shipping method ID. See the Shipping Methods page for available IDs, or use GetShippingMethods to get methods by country
  • Payment URL: paymentUrl is returned only when Stripe Checkout is enabled for the project; otherwise the field is omitted from the response

Best Practices

  1. Validate input: Validate all required fields before sending the request
  2. Get shipping methods: See the Shipping Methods page for available shipping method IDs, or call GetShippingMethods to retrieve available shipping methods for the destination country before creating an order
  3. Check model availability: Verify models exist and are processed before ordering
  4. Handle errors: Implement comprehensive error handling for all error types
  5. Store order ID: Save the returned order ID for tracking and reference
  6. Email confirmation: Ensure user email is confirmed before allowing order creation
  7. Model validation: Ensure all models belong to the same project - mixing models from different projects in a single order will result in an error