Author

Topic: Help with Coinbase.com API - Please =) (Read 5158 times)

newbie
Activity: 28
Merit: 0
April 09, 2013, 04:32:12 PM
#5
Eric thank you so so much that was what I needed. Now to figure out how to include value="%[PAY_AMOUNT]%" into the price section to replace the button[price_string] so it can create the price that is dynamically created before they click the buy button. I am one step closer so thank you.

No problem! Glad I could help.
newbie
Activity: 26
Merit: 0
April 05, 2013, 09:33:05 PM
#4
Eric thank you so so much that was what I needed. Now to figure out how to include value="%[PAY_AMOUNT]%" into the price section to replace the button[price_string] so it can create the price that is dynamically created before they click the buy button. I am one step closer so thank you.
newbie
Activity: 28
Merit: 0
April 05, 2013, 11:11:22 AM
#3
I'll do the best I can! Wink

Before I jump into the API stuff, though, I just want to point out that uou can generate a checkout button or page with Coinbase's Merchant Tools. Simply click "Merchant Tools" on the left hand side menu. Also see https://coinbase.com/docs/merchant_tools/payment_buttons

The documentation explains "For more advanced integrations, it's sometimes necessary to create many buttons with different prices. In these cases you'll want to use the buttons API." If that's what you need:

Buttons can be embedded in a page using some embed code. There are a couple of other options like button size that you can use, but this is the template for a basic Coinbase Buy button:

Code:

Firstly, we'll need an API key to tell Coinbase who we are when we're asking them to create a button for us. Go to https://coinbase.com/account/integrations and enable and generate an API key.

Secondly, you'll notice that there's this "code", 4d4b84bbad4508b64b61d372ea394dad. This is what tells Coinbase what you're selling and makes your button unique. To create a new code, we need to send an HTTP Post request to https://coinbase.com/api/v1/buttons

You can use HURL to test creating one:

http://www.hurl.it/

Type in https://coinbase.com/api/v1/buttons?api_key=[YOUR_API_KEY_HERE} and select "POST". POST requests typically *create* data, where as GET requests *get* data. You'll want to pass in some params, as the documentation outlines. To do this, click "add param" in Hurl and try adding different params that the documentation explains. button[name], button[price_string], and button[price_currency_iso] are all required.

Here's an example of what it should look like:

https://i.imgur.com/gqvWNcI.png

The response is going to be JSON (JavaScript Object Notation), which is an object that contains a bunch of attributes and corresponding values. The most important one we're concerned with is the "code". This is going to replace "4d4b84bbad4508b64b61d372ea394dad" in the above example. So in my example, the embed code would be:

Code:

A word of caution about using the API: Never let anybody know your API key. If you'd like to create new buttons on the fly, always do it "out of band". That is, have your web server make the request, NOT the user.

Hope that helps! Smiley
newbie
Activity: 26
Merit: 0
April 04, 2013, 10:11:43 PM
#2
Anyone with a few minutes to spare? I know nothing about coding. Wondering how to send info to coinbase api to generate the button I have code for.

here is there documentation https://coinbase.com/api/doc/buttons/create.html
newbie
Activity: 26
Merit: 0
April 04, 2013, 12:54:26 AM
#1
I am trying to figure out how to create a simple function with a payment button from coinbase.com but need help figure out how to use the API to do this. It says it can be done in their documentation but I don't know anything about this stuff. Would love some help if someone is free. Shouldn't take but a few minutes. 
Jump to: