Getting Started with Bitload4u

This page will help you get started with Bitload4u. You'll be up and running in a jiffy!


Introduction to Bitload4u

Welcome to the Bitload4u API! You can use our API for payin from bitcoin, payout to bitcoin/bank/card etc. as well as getting information of previous transactions.

We have language bindings in cURL for now. cURL examples are provided and can be used in other languages as well. Code examples are viewable in the dark area to the right. Programming language of the examples can be switched via links on top of example box.


Getting Started

To start accepting payments using Bitload4u, you need:

  1. API keys that can be generated through BitLoad4U's dashboard.
  2. Payin form integrated in your website / app
  3. Payout to bitcoin API

Invoice States


A Bitload4u invoice can be in one of a number of states.

There are two sets of invoice states that may be consulted; base states and exception states. Base states provide a simple and straight-forward understanding of the overall status of an invoice. Exception states provide additional details about the status of the invoice if a payment exception has occurred.

Exception states are used for detecting payment exceptions and subsequent execution of automated rules to perform certain customer support operations. For example, using exception states it is possible to detect an under paid invoice, apply decision logic, and either refund the payment or accept the under payment (thereby updating the invoice to match the amount paid) - all without customer support desk intervention.

Base States

paid

As soon as payment is received it is evaluated against the invoice requested amount. If the amount paid is equal to or greater than the amount expected then the invoice is marked as being paid. To detect whether the invoice has been overpaid consult the invoice exception status (exStatus).

confirmed

The transaction speed preference of an invoice determines when an invoice is confirmed. For the high speed setting, it will be confirmed as soon as full payment is received on the bitcoin network (note, the invoice will go from a status of new to confirmed, bypassing the paid status). For the medium speed setting, the invoice is confirmed after the payment transaction(s) have been confirmed by 1 block on the bitcoin network. For the low speed setting, 6 blocks on the bitcoin network are required. Invoices are considered complete after 6 blocks on the bitcoin network, therefore an invoice will go from a paid status directly to a complete status if the transaction speed is set to low.

Errors

The Bitload4u API attempts to return the appropriate HTTP status code for every API request to indicate success or failure.


HTTP Status Code Summary
HTTP Status Code Description
200 - OK Worked as expected.
400 - Bad Request Invalid API request due to omitted required field or invalid field value etc. 1
401 - Unauthorized Authentication Error. Access ID or Secret Key is invalid.
404 - Not Found The requested resource does not exist.
5xx - Server Errors gateway_error or api_error.

Payin flow

A payin has following flow


QR CREATION

QR is created when a user (the customer) fills in and submits the payin information and it is sent to the Bitload4u API. The payin API will send QR in a HTML page in response. Validity is 15 minutes for that particular invoice. No processing has been done on the payin at this stage.

QR scanning and payment

Next step for payin is scanning the QR Code, which was generated previously. User can scan the code from their BTC wallet and pay.

Callback

Bitload4U API server will send the payment details to the merchant's callback url as soon as status is changed.

Payout flow

A payout has following flow


to Bitcoins

User (the customer) fills in Bitcoin address and amount to the Bitload4U API. Bitcoin will be added to user's wallet.

Callback

Bitload4U API server will send the payment details to the marchent's callback url as soon as status is changed.

API Reference


GET /currencies

Currencies are fiat currencies supported by Bitload4u

Sample Request
https://test.bitload4u.com/currencies

curl --request GET \
  --url https://test.bitload4u.com/currencies
                                

GET /countries

Retrieves the list of countries with shortcode, region etc.

Sample Request
https://test.bitload4u.com/countries

  curl --request GET \
    --url https://test.bitload4u.com/countries
                                  

POST /payin

Provides the btc address for the payment. Currency and amount are optional.

HEADERS

                          
  secret_id     : xxxxxxxxxxxxx
  Content-Type  : application/json
  Accept        : application/json 

                        

BODY

  {
    merchant_id :   [string, required],
    transactionId : [string, required],
    currency:       [string, optional],
    amount:         [string, optional]
  }
                      
Sample Request
https://test.bitload4u.com/payin

  curl --request POST \
    --url https://test.bitload4u.com/payin \
    --header 'accept: application/json' \
    --header 'content-type: application/json' \
    --data '{
    "merchant_id": "xxxxxxxxxxxxx",
    "transactionId": "xxxxxxxxxxxxxxxxxx",
    "currency":"eur",
    "amount":"1"
  }'
                            

Callback

                        {"transaction_id":"xxxxxxxxx","status":"paid","confirmation":"0","satoshi_value":"87410","euro_value":"6.08","usd_value":"7.11","transaction_hash":"bcdddxxxxxxxdfaab8165f0a7a"}
                      
                        {"transaction_id":"xxxxxxxxx","status":"confirmed","confirmation":"5","satoshi_value":"87410","euro_value":"6.08","usd_value":"7.11","transaction_hash":"bcddd8xxxxxxxdfaab8165f0a7a"}
                      

GET /payin/:transactionId

Retrieves satoshi amount paid by the user. Response is same as in the callback of payin.

QUERY PARAMS

                              
  transactionId  : [string, required] (unique transaction id which was requested.)
  
                            
Sample Request
https://test.bitload4u.com/payin/xxxxxxxxxxx

  curl -X GET \
  https://test.bitload4u.com/payin/xxxxxxxxxxx \
  -H 'merchant_id: xxxxxxxxxxxx' \
  -H 'secret_id: KSfUBlz6bxxxxxxxxxxxxxxxxxF5GqCa0oO4d7k='
                                

GET /payout/bank/iban/fields?country=US

Retrieves the required fields for a perticular country. Get country list API: https://test.bitload4u.com/countries For this request, send the shortCode(Two digit country code) as a query parameters

QUERY PARAMS

                              
  country  : [string, required] (Two digit country code)
  
                            
Sample Request
https://test.bitload4u.com/payout/bank/iban/fields?country=US

  curl --request GET \
    --url 'https://test.bitload4u.com/payout/bank/iban/fields?country=US'
                                

POST /payout/bank/iban

Get required bank fields by sending the two digit country code from this API: https://test.bitload4u.com/payout/bank/iban/fields?country=US

HEADERS

                                
  secret_id     : xxxxxxxxxxxxx
  Content-Type  : application/json
      
                              

BODY

  {
    "country": [string, required],
    "merchant_id": [string, required],
    "bank": {
        "BANK_NAME": [string, required],
        "BIC": [string, required],
        "IBAN": [string, required],
        "CUSTOMER_NAME": [string, required],
        "HOLDING_BRANCH": [string, required]
    },
    "transaction": {
        "transactionId": [string, required],
        "transactionMessage": [string, required],
        "amount": "[string, required],
        "currency": [string, required]
    }
  }
                            
Sample Request
https://test.bitload4u.com/payout/bank/iban

  curl --request POST \
  --url https://test.bitload4u.com/payout/bank/iban \
  --header 'content-type: application/json' \
  --header 'secret_id: xxxxxxxxxxxxxx' \
  --data '{
    "country": "MT",
    "merchant_id": "xxxxxxxxxxxxxx",
    "bank": {
        "BANK_NAME": "SATA BANK",
        "BIC":"STBAMTMT",
        "IBAN":"MT14STBA19116000000001041918741",
        "CUSTOMER_NAME":"BITLOAD4U LTD",
        "HOLDING_BRANCH":"VALLETA"
    },
    "transaction": {
        "transactionId": "xxxxxxxxxxxxxx",
        "transactionMessage": "Test",
        "amount": "100",
        "currency": "CAD"
    }
  }'
                                  

GET /payout/bank/iban/:transactionId

Retrieves the IBAN payout by transactionId

HEADERS

                                
    secret_id  : xxxxxxxxxxxxx
    
                              
Sample Request
https://test.bitload4u.com/payout/bank/iban/:transactionId

    curl --request GET \
    --url https://test.bitload4u.com/payout/bank/iban/:transactionId \
    --header 'secret_id: xxxxxxxxxxxxxxxx'
                                  

POST /payout/card

HEADERS

                                
  secret_id     : xxxxxxxxxxxxx
  Content-Type  : application/json
      
                              

BODY

  {
    "merchant_id": [string, required],
    "card": {
        "cardExMonth": [string, required],
        "cardExYear": [string, required],
        "cardNumber": [string, required],
        "securityCode": [string, required]
    },
    "transaction": {
        "transactionId": [string, required],
        "transactionMessage": [string],
        "amount": [string, required],
        "currency": [string, required]
    }
  }
                            
Sample Request
https://test.bitload4u.com/payout/card

  curl --request POST \
    --url https://test.bitload4u.com/payout/card \
    --header 'content-type: application/json' \
    --header 'secret_id: xxxxxxxxxxxxxx' \
    --data '{
      "merchant_id": "xxxxxxxxxxxxxx",
      "card": {
          "cardExMonth": "04",
          "cardExYear": "22",
          "cardNumber": "4111 1111 1111 1111",
          "securityCode": "321"
      },
      "transaction": {
          "transactionId": "xxxxxxxxxxxxxx",
          "transactionMessage": "Test",
          "amount": "100",
          "currency": "EUR"
      }
  }'
                                  

GET /payout/card/:transactionId

Retrieves the PAC payout by transactionId

HEADERS

                                
    secret_id  : xxxxxxxxxxxxx
    
                              
Sample Request
https://test.bitload4u.com/payout/card/:transactionId

  curl --request GET \
    --url https://test.bitload4u.com/payout/card/:transactionId \
    --header 'secret_id: xxxxxxxxxxxxxxxx'
                                  

GET /payout/bank/ach/states

Retrieves the list of states available for ACH

Sample Request
https://test.bitload4u.com/payout/bank/ach/states

  curl --request GET \
    --url https://test.bitload4u.com/payout/bank/ach/states
                                  

POST /payout/bank/ach

HEADERS

                                
  secret_id     : xxxxxxxxxxxxx
  Content-Type  : application/json
      
                              

BODY

  {
    "merchant_id": [string, required],
    "bank": {
    	"ACCOUNT_TYPE": [string, required],
    	"ACCOUNT_NUMBER": [string, required]",
    	"ACCOUNT_NAME": [string, required],
        "BANK_NAME": [string, required],
        "BANK_NUMBER": [string, required],
        "CUSTOMER_STATE": [string, required]
    },
    "transaction": {
        "transactionId": [string, required],
        "transactionMessage": [string],
        "amount": [string, required]
    }
  }
                            
Sample Request
https://test.bitload4u.com/payout/bank/ach

  curl --request POST \
    --url https://test.bitload4u.com/payout/bank/ach \
    --header 'content-type: application/json' \
    --header 'secret_id: xxxxxxxxxxxxxx' \
    --data '{
      "merchant_id": "xxxxxxxxxxxxx",
      "bank": {
        "ACCOUNT_TYPE": "Checking",
        "ACCOUNT_NUMBER":"xxxxxxxxx",
        "ACCOUNT_NAME":"BITLOAD4U LTD",
        "BANK_NAME": "SATA BANK",
        "BANK_NUMBER":"xxxxxxxxx",
        "CUSTOMER_STATE":"AK"
      },
      "transaction": {
          "transactionId": "xxxxxxxxxxxxxx",
          "transactionMessage": "Test",
          "amount": "100"
      }
  }'
                                  

GET /payout/bank/ach/:transactionId

Retrieves the ACH payout by transactionId

HEADERS

                                
    secret_id  : xxxxxxxxxxxxx
    
                              
Sample Request
https://test.bitload4u.com/payout/bank/ach/:transactionId

  curl --request GET \
    --url https://test.bitload4u.com/payout/bank/ach/:transactionId \
    --header 'secret_id: xxxxxxxxxxxxxxxx'