Skip to main content

Create Order

warning

We only support the fulfillment of Robux through Game Passes, but may extend this to VIP Servers in the future.

warning

Successfully creating an order does not mean that the order has completed, it simply means that the order is now scheduled for fulfillment in our system and we will notify your callback endpoint (if it's set) once the order completes or fails.

This API endpoint attempts to place a gamepass order for a ROBLOX user by automatically finding and fetching a gamepass that's for sale, meaning you do not need to provide a gamepass ID manually.

Endpoint: /create_order

Request type: POST

Request parameters:

{
// required
"robux": Integer,
"roblox_user_id": LargeInteger,
"universe_id": LargeInteger,
"place_id": LargeInteger

// optional, can be used to provide us your internal ID
"custom_order_id": String(255)
}

Example code:

const axios = require('axios');

const apiKey = 'YOUR_API_KEY';

async function payoutUser(robux, roblox_user_id, universe_id, place_id) {
try {
const headers = {
'rocheap-api-key': apiKey
};

const data = {
"robux": robux,
"roblox_user_id": roblox_user_id,
"universe_id": universe_id,
"place_id": place_id,
"custom_order_id": null
};

const response = await axios.post('https://rocheap.com/business/api/create_order', data, headers);

return response.data;
} catch (error) {
return false;
}
}

(async function(){
let robux = 10;
let roblox_user_id = 1;
let universe_id = 4284924817;
let place_id = 3927852479;

let order = await payoutUser(roblox_user_id, robux, universe_id, place_id);

if (!order) {
console.log('Order request failed');
}

if (order.success) {
console.log('Order created successfully!');
console.log('Order details:', order);
} else {
console.log('Order failed to create!');
console.log(order.status, order.failure_code);
}
})();

Success response:

{
"success": true,
"status": {
"code": "CREATED",
"message": "Order has been created!"
},
"cost": 0.0475,
"robux": 10,
"after_tax_robux": 7,
"order_id": "cz577bf0-d39d-4ebb-9f68-856841c705e4",
"custom_order_id": null, // this will be populated if you provided us a custom_order_id
"universe_id": 5,
"place_id": 6,
"receiver_roblox_user_id": 261,
"receiver_roblox_username": "Shedletsky",
"gamepass_id": 39283,
"gamepass_product_id": 2358259
}

Failure response:

{
"success": false,
"status": {
"code": "FAILED",
"message": "Order creation failed!"
},
"failure_code": {
"code": "GAMEPASS_NOT_FOUND",
"message": "We could not find a gamepass for the universe and Robux amount you entered for the supplied user!"
}
}

List of statuses and failure codes:

const order_creation_status_list = Object.freeze({
CREATED: {
code: "CREATED",
message: "Order has been created!"
},
FAILED: {
code: "FAILED",
message: "Order creation failed!"
}
});

const order_creation_failure_codes = Object.freeze({
API_MAINTENANCE: {
code: "API_MAINTENANCE",
message: "API is currently disabled and under maintenance!"
},
INSUFFICIENT_BALANCE: {
code: "INSUFFICIENT_BALANCE",
message: "You do not have sufficient balance to create this order!"
},
INVALID_AMOUNT: {
code: "INVALID_AMOUNT",
message: "The amount you entered is invalid! It must be at least 10 and at most 5000."
},
VALIDATION_ERROR: {
code: "VALIDATION_ERROR",
message: "Validation error occurred! Please ensure all the fields are of correct type or were inputed if required."
},
USER_DOES_NOT_EXIST: {
code: "USER_DOES_NOT_EXIST",
message: "The user you are trying to create an order for does not exist!"
},
UNIVERSE_DOES_NOT_EXIST: {
code: "UNIVERSE_DOES_NOT_EXIST",
message: "The universe you are trying to create an order for does not exist!"
},
PLACE_DOES_NOT_EXIST: {
code: "PLACE_DOES_NOT_EXIST",
message: "The place you are trying to create an order for does not exist!"
},
GAMEPASS_NOT_FOUND: {
code: "GAMEPASS_NOT_FOUND",
message: "We could not find a gamepass for the universe and Robux amount you entered for the supplied user!"
},
DUPLICATE_CUSTOM_ORDER_ID: {
code: "DUPLICATE_CUSTOM_ORDER_ID",
message: "The custom order ID you entered is already in use! Please create and supply a unique custom order ID."
},
ORDER_FAILED_USER_ERROR: {
code: "ORDER_FAILED_USER_ERROR",
message: "The order failed due to a user error, this is usually due to the user not having enough Robux to purchase the product."
},
INTERNAL_ERROR: {
code: "INTERNAL_ERROR",
message: "An internal error occurred while trying to create the order, this is usually due to proxy errors on our end when communicating with ROBLOX. Please just try again!"
}
});