bitcoin ipn

Welcome to the Coinify API.You can use our API to interact with the Coinify systems.All responses from the API are in JSON format, and all POST and PUT requests must use JSON to pass values to the API functions.Aside from the production environment, we also have a sandbox environment for testing, which uses blockchain Testnet. /signup/now /signup/now All API calls currently use the above URL /v As of this moment, there is only one version: 3, and all consumers of the API should use version 3, like the URL on the right.This API was publicly released on May 11th, 2015.We changed a few things up until the public release.The following table summarizes these changes Coinify provides SDKs for accessing our API for various programming languages.At the moment, we provide SDKs for the following languages: To authorize, use the following code.Make sure to replace coinifyapikey and coinifyapisecret with your API key and API secret, respectively.In order to access our API, you need an API key and an API secret.
You can create API keys and secrets by clicking here.All requests to our API must contain the following three values: These values must be provided in a HTTP Authorization header as follows: Authorization: Coinify apikey="", nonce="", signature=" The signature is a HMAC-SHA256 hash of the concatenation of the nonce with your API key, using your API secret as the HMAC key.The hash must be in lowercase hexadecimal format, like the following example: b9926f02caed3c9c08224cd079a162b771c80b0ff49a69d0579cb806d5475ff3.All following code examples assume that you send a Authentication header with your request as shown to the right.Our API always responds with an HTTP 200 status code with the content in JSON format, and the response is either a success type or an error type.You can use the success variable to check which one it is: If success is true, the request succeeded.If success is false, the request failed.All timestamps used in requests and responses are in ISO 8601 format.
The value of the data field contains the result of the API call Whenever a request succeeds, the API returns a JSON object with two values - success and data.The data value contains the result of the request, and the value is either a JSON object (for a single result), or a JSON array (for multiple results).In a successful request, success is always true.The API returns the following object if you don’t provide a valid Authentication header.bitcoin highest rateThe url field is optional and does not appear in all error requests.hukl bitcoinWhenever a request fails, the API returns a JSON object with two values - success and error.bitcoin hubotThe error object always contains two fields - code, which contains a machine-readable error code, and message, which carries a human-readable error message - and optionally a third field - url, which contains a error-specific URL.bitcoin jacksonville fl
In a failed request, success is always false.The API Rate Limit is set to 100 requests pr minute.The following headers are added to the API response, even if the API Rate Limit is exceeded: If the API Rate Limit is exceeded, the API will return an error with code rate_limit_exceeded as shown to the right.Get the current exchange rates for all supported currencies.Returned rates will define the exchange rate for the number of fiat currency units equivalent to one BTC.jurov bitcoinThis end-point is public and no API key/secret is needed.bitcoin kamloopsbuy is the rate for buying bitcoin from Coinify as a Merchant.sell is the rate for selling bitcoin to Coinify as a Merchant.This is also the rate used for payments.This endpoint retrieves the rates for all currencies, sorted alphabetically.The above API call returns JSON structured like this: This endpoint retrieves the rates for a specified currency.
The above API call returns JSON structured like this: This endpoint retrieves the rates for all supported altcoins in base BTC.See the Input currencies section for supported altcoins.The above API call returns JSON structured like this: This endpoint retrieves the rates for a specified altcoin.The above API call returns JSON structured like this: Through this API you can execute operations or get data regarding your merchant account.This endpoint returns the Bitcoin and fiat currency balances that you have on your merchant account.btc contains the balance amount of your BTC account on our platform.fiat contains the balance amount of your default fiat currency account on our platform.fiat_currency is the 3-character currency code of the currency of your default account.The above API call returns JSON structured like this: The invoice is the cornerstone of the Coinify API.We use invoices to create payment requests from customers.Please use a moment to familiarize yourself with the invoice object below before heading to the code samples.
To the right you can see a sample invoice object, and the table below summarizes the individual fields of the object.Note that all invoices will contain the bitcoin object with the bitcoin details for the invoice, regardless of whether or not another input currency is requested to pay with.Note: The invoice object may contain additional fields under certain circumstances.See References to original and sub-invoices for more information.The state field of the invoice object has the following possible values: The payments field of the invoice object is a list of bitcoin payments made to this invoice.Each payment has the following five properties: In addition to paying an invoice with bitcoins, we also support paying with different input currencies.See section on Input currencies for more information.The inputs field of the invoice object is a list of requests to pay the invoice with different input currencies.Such requests can be made upon invoice creation, or after creation.
Each request has the following properties: When we receive a payment to an expired or already paid invoice, or we receive more than enough bitcoins to pay a invoice, we create so-called sub-invoices for the payment amount (or the excess amount for overpayments).These invoices are linked to their original invoices, and you can determine that link through the invoice object: For sub-invoices, an additional key, original_invoice_id is added to the invoice object, which contains the ID of the original payment.For original invoices with sub-invoices, a key sub_invoice_ids is added, which contains a list of IDs of sub-payments linked to the payment.You can choose to receive callbacks on sub-invoices or not in your Merchant IPN settings.The above API call returns JSON structured like this: This endpoint retrieves all your invoices, sorted by newest first.The above API call returns an invoice JSON object structured like this: This endpoint retrieves a specific invoice.
The above API call returns an invoice object like this: This endpoint creates a new invoice.If the creation is successful, you will receive a response object identical to the response from Get a specific invoice.* If neither callback_url nor callback_email is provided, these values default to your IPN callback URL or email.The above API call returns an invoice object like this: After an invoice has been created, you have the option to update some of the fields in that invoice.Supply any of the below parameters to change their current value.The above API call returns an invoice object like this (Notice the inputs sub-object): After an invoice has been created, you can request for the customer to pay with another input currency.This is essentially the same as providing input_currency and input_return_address when creating an invoice.Both of the below parameters must be supplied in order to create a new input currency request: This section describes how to create a refund for an invoice and list all refunds for an invoice.
A refund basically means to send bitcoins back to the customer for a paid invoice.Refunds are subject to the following restrictions: You can do multiple and partial refunds (i.e.for an invoice that was credited 100 EUR, you can refund first 30 EUR, then 40 EUR), as long as the sum of all refunds do not exceed the credited amount of the invoice.Upon creating a refund, the refund amount is withdrawn from your credit account immediately.When refunding to a customer, you must provide either the customer’s email address or the customer’s bitcoin address.If email address is provided, we will send an email to the customer, requesting them to provide us with a bitcoin address to send the refund to.If refunding to an email address, and the customer doesn’t provide a bitcoin address within 7 days, the refund is cancelled, and the withdrawn amount is re-inserted into your credit account.The state field of the invoice object has the following possible values: The above API call returns a (possibly empty) list of refund objects like this: List all refunds to a specific invoice The above API call returns an refund object like this: This endpoint allows you to refund an invoice to a customer.
This API allows our preapproved merchants to buy bitcoins from their fiat account balance.When creating buy orders, you have the choice between whether the order should be instant or not.If you create a non-instant order, our API will return to you a quote so you can decide whether or not you want to accept the order at the rate promised.You will then have to perform another API call instructing us to actually execute the order for you.If you create an instant order, you will automatically accept the given rate and we will execute the order immediately.To the right you can see a sample buy order object.The table below summarizes the individual fields of the object.The state field of the buy order object has the following possible values: The buy order moves between the different states as shown in the following chart: When the state field is failed, the buy order object will contain an additional field failure_reason, which can have the following values: The above API call returns JSON structured like this: This endpoint retrieves all your buy orders, sorted by newest first.
The above API call returns JSON structured like this: This endpoint retrieves a specific buy order.The above API call returns an buy order object like this: This endpoint creates a new buy order.If the creation is successful, you will receive a response object identical to the response from Get a specific buy order.The above API call returns an buy order object like this: When you create a non-instant buy order, you have 1 minute to confirm it.This endpoint confirms a newly created buy order.Note that the state of the buy order has to be waiting for this call to work.If it is in any other state, the call will fail.If the confirmation is successful, you will receive a response object identical to the response from Get a specific buy order, where the state is either queued or complete.Apart from receiving payments in Bitcoin (BTC), we also support a range of other input currencies such as Litecoin (LTC), Ether (ETH), and Dogecoin (DOGE).You can request for the customer to pay with another input currency during invoice creation, or after an invoice has been created.
We constantly monitor the state of our input currencies, enabling or disabling them as we see fit, and provide a means to query for currently supported input currencies: The above API call returns an object like this: Receive a list of supported input currencies The response object contains a list of currency objects.The below table describes the fields of the objects: Whenever something changes – such as the state of an invoice, for example when a customer has paid an invoice – you usually want to know about it as soon as possible.To avoid you having to constantly poll our API for changes to your invoice, we support sending callbacks whenever the state changes, either through a HTTP call to your webservice, or by email.The callback data informs you of what changed, as well as the new complete state of the object.The data contained in a callback is encoded as a JSON object, and it is the same, whether you choose to receive callbacks by HTTP calls or by email.
It looks like the JSON object you see on the right: When performing a HTTP callback, we will always use the POST method.When you receive a HTTP callback, always reply with a HTTP 200 OK status code and an empty body, regardless of the result of validating the callback.Remember to replace with your actual IPN secret in the code above.To ensure that the callback actually originated from Coinify, and that the callback data has not been modified in transit, you must validate the callback data as shown in this section.The callbacks coming from Coinify are signed with the IPN secret, similar to how you authenticate against our API with your API secret.Second, you must extract the signature from the HTTP headers, if using HTTP callbacks, or from the email headers if using email callbacks.Then, you must check that the provided signature matches the HMAC-SHA256 hash of the raw callback data (which is a JSON object encoded as a string), using your IPN secret as the HMAC key.