Custom Developer Products

Providing a backend for donation centers, product shops and the like. This gives you the ability to have developer products of any price added on request.

Using either the example place provided, the example module provided, or your own Roblox frontend, you can use this to add developer products any price whenever it’s required! Sending a POST request to the backend server’s /requestProduct page with the required headers will return 1 of 2 possible results - both in JSON format. If the request is successful, the server will respond with a message (string) and productId (integer). If the request is unsuccessful, the server will respond with an error (string) message.

The way it’s currently set up is so that products are re-used where possible. This has been done to reduce the number of products created, making it more organised, and so that the products don’t have to have any random (possibly moderated) string added to their names. You can change this by making the requested product name to be something random (such as a GUID).

If you don’t want to download the example place, you can go ahead and edit this uncopylocked place!

Required request headers:

  • (String) serverKey: Authorization key to verify requests
  • (Integer) universeId: The game.GameId property
  • (String) name: The name that will be given to the developer product (must be unique)
  • (Integer) price: The price that the the developer product will be on sale for

You will need to put a Roblox account cookie in the .env file (or in the index.js file, though I don’t recommend this for security reasons). This project uses the noblox.js package, so you will need to use an alternative acount to prevent yourself from being logged out. I recommend using a randomly generated key as the server key to prevent unauthorized access to your backend server; this goes in the .env file.

Due to the Roblox filtration system, some products may end up with filtered names. If two products both end up with the same name after filtering (even though the original names might have been unique), this will throw an exception and the product will not be created.

Demo

If you’re feeling generous, or just want to check it out in action before you set it up for yourself, then head over here.

Glitch

Feel free to remix my Glitch app to make the setup process easier. However, I cannot guarentee this project will be kept up to date.

License

MIT

89 Likes

Looking into the code of this, I see no protection with the header key, was this a mistake on your end or something i just didnt see?

image

(Im seeing no server checks on this at all, I could use a random key and be able to create Developer products.)

EDIT: All i see in the code is you defining key but not actually using it??

12 Likes

Whoops, that was a massive oversight. I’ll sort that out when I get on my computer.

Thanks for notifying me of this!

EDIT: This has now been fixed. I would recommend that anyone who has already used this updates their code on their web servers (not the games) to prevent possible unauthorized access.

image

6 Likes

May I ask what program you use with this console?

1 Like

The code offsite (the glitch) Is coded in Javascript.

I can see that but he has a console which program is he using to run that.

Do you mean this??

image

1 Like

To access the “Logs” just go to Tools > Logs.

2 Likes

This is worth having if you like to have developer products. Which in that case I do so thank you!!

1 Like

So I’m having a small issue and I’m sure it’s just my stupidity. When I try to create a product, I’m prompted with two errors:

Error 1: Failed to create product 1 Robux Donation 1 Robux: You are not logged in
Error 2: env Line 2: ACCOUNTCOOKIEHERE: command not found

I’ve created a brand new alternate account on the site and used the account cookie for that. Am I missing something?

1 Like

Looks like you havn’t done your config right, Make sure there is NO spaces between them so COOKIE=RBLXSECUIRYTOKEETC (If in .ENV)

if its in a settings.json for Example.

"cookie": "RBLXCOOKIE"
1 Like

Adding on to what HttpBilly said: this error can also occur if the account in question does not have permission to create and edit developer products for the place, as without this permission it cannot function. The only way to achieve this at the moment is through a group game with the bot account given edit place access. With the current Team Create system, it’s not possible unless you enable the Beta Team Create permission system.
Either do this, or if it’s a group game then the bot will need to have edit place access in that group.

This seems like the issue as this has happened to someone prior to this, but the error message does not make it clear. Hopefully this solves the issue!

2 Likes

Alrighty. Thanks to the both of ya! :^)

ps: got it working what what you suggested

Is this still in service? I keep trying and keep getting errors so I just thought maybe it was to out dated.

I just tried my custom donations place and it seemed to work perfectly fine, so this still functions as intended. The only issue is the lack of descriptive error messages.

I have, however, submitted a pull request anyway to update to the latest API endpoint and actually return the error messages that it returns. This wasn’t possible with the old endpoint as it didn’t return any info in the event of a failed request.

Once this PR is accepted, and a release containing it is out, I’ll update my code to use the latest version of Noblox.js so errors aren’t so ambiguous. For now, you could go through the errors in this table and make sure your setup doesn’t cause any of them:
image

2 Likes

Will this work fine if I increase number of users in my game? Your testing place has max players 1 which makes me doubtful. Please confirm. Moreover, when I checked no one else was playing.

1 Like

Yes, there is no reason why it would not support multiple users. The demo place could have any server size and still work, I just decided to limit it to a single player.

Keep in mind the demo place is not the best, I didn’t spend too much time on it and there will be some unhandled error cases as a result. For the best UX, implement the system yourself.

1 Like

Keep in mind that I, @IvanGregrovnich, @gaminmasterrrr and many others have worked in conjunction with ROBLOX’s Back End web team, we have conducted things such as releasing useful and hidden endpoints, dumping apis etc, if anyone needs something that is Web Api related, we will most likely know it.

1 Like

Update: v1.1.0

No major changes, the majority of this update was to restructure the codebase to increase maintainability.

Overview of the update:

  • Endpoint structure remains the same
  • Server key is now required to be set
  • Separated Express.js routes into separate directory
  • Separated utility functions into modules in a separate directory
  • Moved package.json to top level (node entry point changed)
  • Updated README and LICENSE for correctness
  • Minor changes to examples
  • Error handling improvements
  • Switched to latest version of noblox.js (4.9.0)

The restructure should (hopefully) make cloning and deploying the project easier than it was previously. Diagnosing and resolving errors should be easier now with the improved error handling - however, some noblox.js related errors are still a bit ambiguous and/or misleading.

The game doesn’t work???

Also expecting to release a Roblox model anytime soon?