Skip to main content

Get Order Info

There are two endpoints you can use:

Endpoint: /get_order_info/:id (Using ROCheap's order ID)

Endpoint: /get_order_info_by_custom_id/:id (Using your custom order ID)

Request type: GET

const axios = require('axios');

const apiKey = 'YOUR_API_KEY';

let order_id = 'f57a275z-a5bd-4123-b5fe-12d9a6ab8a5f';

axios.get(`https://rocheap.com/business/api/get_order_info/${order_id}`, {
headers: {
'rocheap-api-key': apiKey
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error:', error);
});

Success response:

{
"success": true,
"status": {
"code": "COMPLETED",
"message": "Order has been completed!"
},
"cost": 0.0475,
"robux": 10,
"after_tax_robux": 7,
"order_id": "cz577bf0-d39d-4ebb-9f68-856841c705e4",
"custom_order_id": null,
"universe_id": 5,
"place_id": 6,
"receiver_roblox_user_id": 261,
"receiver_roblox_username": "Shedletsky",
"gamepass_id": 39283,
"gamepass_product_id": 2358259
}

Failure responses:

If the request fails because it couldn't find the order, it will return an object with success and error values

{
"success": false,
"error": { "code": 'ORDER_NOT_FOUND', "message": 'Order not found!' }
}

This is how it looks like if the order failed to complete. status specifies the state of the order.

In the case an order fails, a failure_code will also be included in the response object. You can look at the bottom of the page for a full list of the possible states and failure codes.

{
"success": true,
"status": { code: 'FAILED', message: 'Order has failed!' },
"cost": 0.044,
"robux": 8,
"after_tax_robux": 6,
"order_id": "38d7e48a-74e2-4022-b018-4cd1431599cf",
"custom_order_id": null,
"universe_id": 25,
"place_id": 366,
"receiver_roblox_user_id": 261,
"receiver_roblox_username": 'Shedletsky',
"gamepass_id": 424,
"gamepass_product_id": 242536,
"failure_code": {
"code": "ORDER_FAILED_USER_ERROR",
"message": "You did not put a public gamepass for sale for the required price."
}
}

List of statuses and failure codes:

const order_status_list = Object.freeze({
PROCESSING: {
code: "PROCESSING",
message: "Order is processing!"
},
COMPLETED: {
code: "COMPLETED",
message: "Order has been completed!"
},
FAILED: {
code: "FAILED",
message: "Order has failed!"
}
});

const order_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 and refunded due to a user error."
},
ORDER_REFUNDED: {
code: "ORDER_REFUNDED",
message: "The order was failed and refunded due to a user error."
},
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!"
},
});