Bitcoin Forum
March 22, 2019, 09:32:39 AM *
News: Latest Bitcoin Core release: 0.17.1 [Torrent]
   Home   Help Search Login Register More  
Pages: [1]
Author Topic: Could someone explain how to implement  (Read 1096 times)
Hero Member
Offline Offline

Activity: 603
Merit: 500

View Profile
January 15, 2012, 03:58:50 PM

I need a basic step by step really, I have no idea where to put the code  Undecided There will be a small reward for the best answer.

Creating Orders

POST /orders


    "foreign_order_id" : "1234",
    "total_amount" : "23.223",
    "custom_field" : "foobar",
    "auth_token" : auth_token


  "order" : { "bitcoin_address" : "1F2vgWSRcfRzZz1LetFxrk6qfWhpTeW32s"}

view raw gistfile1.txt This Gist brought to you by GitHub.
Handling Payment Notifications

We send payment notifications to the URL you specify. It is important for you to verify the post is from us.

1) Create a string with parameter pairs under "Payment Notification" in alphabetical order, it should look like this: param1=v1params2=v2.... Do not include the signature.

2) Add your access token in front of the string

3) Perform a SHA2 hash function


  "Payment Notification" :
    "foreign_order_id" : "A1234",
    "amount" : "2.20",
    "transaction_fee" : 0.0,
    "bitcoin_address" : "1AFZ6Cv8q96rFaS9T8fR1y2j2CjNDcTIVD",
    "number_of_confirmations" : 1,
    "transaction_timestamp" : 1307671121,
    "category" : "receive"/"send",
    "order_status" : "satisfied"/"open",
    "signature" : "unique signature for this request"

You can send yourself a test payment notification using this link:

view raw gistfile1.txt This Gist brought to you by GitHub.
Creating Additional Access Tokens

We provide you with your primary access token upon signup. Additional access tokens can be created to provide order and payment notifications for individual customers. For example, if you are building a Bitcoin marketplace, an access token can be created for each individual seller. We handle tracking of each order, and forward payments directly to the seller.

POST /tokens


  "auth_token" : "Your primary access token"
  "token" : { "bitcoin_address" : "Bitcoin address associated with this token" }


  "token" : { "hash_id" : "43a7441a186d22266a0456842bca1934" }

view raw gistfile1.txt This Gist brought to you by GitHub.
Implementation Examples

Ruby example for creating an order:

require "rubygems"
require "net/http"

@base_url = ""
@access_token = "yourtoken"

# create an order:
uri = URI.parse("#{@base_url}/orders")
http =, uri.port)

request =
request.set_form_data({"auth_token" => @access_token, "foreign_order_id" => "order123",
                       "total_amount" => 0.01, "custom_field" => "blah blah blah"})

response = http.request(request)
puts "Response: #{response.body}"

Pages: [1]
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!