coinbase / coinbase-commerce-node

Coinbase Commerce Node
MIT License
148 stars 54 forks source link

Error: No such API Key. #22

Closed basit1327 closed 5 years ago

basit1327 commented 5 years ago

I was using the old coinbase library coinbase-node and it was working fine but now i want to upgrade to this new library, i use the sample code to create checkout by this sample code (Try to create checkout via Checkout resource create method) sample but it gives error that No such API Key

basit1327 commented 5 years ago

Here is my API Key which have all the access enabled API Key snapshot

basit1327 commented 5 years ago

`'use strict';

const APIKEY = '--------';

var coinbase = require('coinbase-commerce-node'); var Client = coinbase.Client; var Checkout = coinbase.resources.Checkout;

Client.init(APIKEY);

var checkoutData = { 'name': 'The Sovereign Individual', 'description': 'Mastering the Transition to the Information Age', 'pricing_type': 'fixed_price', 'local_price': { 'amount': '100.00', 'currency': 'USD' }, 'requested_info': ['name', 'email'] };

setTimeout(()=>{ Checkout.create(checkoutData, function (error, response) { if ( error ) console.log('err',error); else { console.log('res',response); } }); },3000);

`

joeyfrich commented 4 years ago

I ran into this same problem. You are using a Coinbase customer account api key but you should be using a Coinbase Commerce account api key (https://commerce.coinbase.com/).