Generate Address

The create endpoint generates a unique Bitcoin address to which the customer may send payments

You do this by making a POST request to the Create endpoint from your server with some required annd optional parameters.

Request

  • HTTP Method: POST
  • URL: https://api.bitbata.com/v1/generate_address

The following table lists all additional POST parameters for the request:

Parameter Required? Description
recipients Yes Address(es) for forwarding recieved bitcoin
callback URL for callback No
custom Some custom parameters No

This is what a sample cURL request will look like:

curl https://api.bitbata.com/v1/generate_address
-H "Content-Type: application/json"
-d '{ "callback":"https://example.com/callback",
      "custom":"",
      "recipients":[{
        "mraYcWoNKubjAQzMZAXtRunRyBi1aZJURu": 55,
        "mfw91atZBiMcLGExAbWitsR5GHZ3g7iPwf": 45
    }],
    }'
-X POST

Please note: the recipient parameter will normally accept a JSON type data with your wallet address as key and the percentage share as value. So, in the example request above there are 2 wallet addresses where all bitcoins forwarded to and they are set to be split at 55% and 45% respectively (excluding fees)

Success Response

  • HTTP Status Code: 200
  • Content Type: application/json

The following table lists all potential properties of the JSON object returned in the response body:

Parameter Description? Present
address The generated Bitcoin address Always
recipient The supplied addres(es) where bitcoin payments will be forwarded to Always
callback Specified callback address Always
custom Specified custom parameters params Always
{
  "address": "mtkMv18N7KthrSGKS728PAPS5e9hPGe45G",
  "receipients": {
    "mraYcWoNKubjAQzMZAXtRunRyBi1aZJURu": 55,
    "mfw91atZBiMcLGExAbWitsR5GHZ3g7iPwf": 45
  },
  "callback": null,
  "custom": null
}

The above response simply states that whatever amount that is sent to mtkMv18N7KthrSGKS728PAPS5e9hPGe45G will be forwarded to mraYcWoNKubjAQzMZAXtRunRyBi1aZJURu and mfw91atZBiMcLGExAbWitsR5GHZ3g7iPwf at 55% and 45% share respectively.

Failed Response

  • HTTP Status Code: 422
  • Content Type: application/json

The following table lists all potential properties of the JSON object returned in the response body:

Parameter Required? Description
message Yes General message about the error
errors Yes A JSON object providing the error in details
{
  "message": "The given data was invalid.",
  "errors": {
    "email": ["The email field is required."],
    "recipients": ["The recipients field is required."]
  }
}

Frequently Asked Questions

Sunt autem quidam e nostris, qui officia deserunt mollitia animi, id totum evertitur.

Et quidem exercitus quid ex ea quid percipit aut dolores et voluptatem sequi. Quae fuerit causa, nollem me ab illo inventore veritatis et impetus quo voluptas. In quo pertineant non emolumento aliquo, sed uti oratione perpetua malo quam nihil.

Sunt autem quidam e nostris, qui officia deserunt mollitia animi, id totum evertitur.

Et quidem exercitus quid ex ea quid percipit aut dolores et voluptatem sequi. Quae fuerit causa, nollem me ab illo inventore veritatis et impetus quo voluptas. In quo pertineant non emolumento aliquo, sed uti oratione perpetua malo quam nihil.

Sunt autem quidam e nostris, qui officia deserunt mollitia animi, id totum evertitur.

Et quidem exercitus quid ex ea quid percipit aut dolores et voluptatem sequi. Quae fuerit causa, nollem me ab illo inventore veritatis et impetus quo voluptas. In quo pertineant non emolumento aliquo, sed uti oratione perpetua malo quam nihil.

Sunt autem quidam e nostris, qui officia deserunt mollitia animi, id totum evertitur.

Et quidem exercitus quid ex ea quid percipit aut dolores et voluptatem sequi. Quae fuerit causa, nollem me ab illo inventore veritatis et impetus quo voluptas. In quo pertineant non emolumento aliquo, sed uti oratione perpetua malo quam nihil.

Need more help?

Probabo, inquit, modo dixi, constituto, ut calere ignem, nivem esse vult, summumque malum. Quae fuerit causa, nollem me ab eo delectu rerum, quem ad modum, quaeso.