0% found this document useful (0 votes)
88 views4 pages

Coinpayments Apis: Process Overview

The document provides an overview of CoinPayments APIs for integrating cryptocurrency payments. It outlines 7 main ways to accept payments including fixed-price transactions, variable deposits to an address, withdrawals, plugins, invoice links, donation buttons, and testing with Litecoin Testnet. Upon receiving a payment, CoinPayments sends an Instant Payment Notification (IPN) to notify merchants with different types of IPNs for each integration method. Sample code and documentation are available on the CoinPayments site to help with API integration and IPN handling.

Uploaded by

mas ganteng
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
88 views4 pages

Coinpayments Apis: Process Overview

The document provides an overview of CoinPayments APIs for integrating cryptocurrency payments. It outlines 7 main ways to accept payments including fixed-price transactions, variable deposits to an address, withdrawals, plugins, invoice links, donation buttons, and testing with Litecoin Testnet. Upon receiving a payment, CoinPayments sends an Instant Payment Notification (IPN) to notify merchants with different types of IPNs for each integration method. Sample code and documentation are available on the CoinPayments site to help with API integration and IPN handling.

Uploaded by

mas ganteng
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

CoinPayments APIs

The best place to start is our Step-By-Step Integration Guide, which helps you through setting up your
CoinPayments account, integration, setting up additional features and testing your integration.

Step-By-Step Integration Guide


https://blog.coinpayments.net/tutorials/integration/coinpayments-ecommerce-integration-guide

PROCESS OVERVIEW

1) A transaction is initiated by vendor. There are two main types of transactions:


a. Specific Amount: These transactions are typically created during the checkout process
when shopping online, through invoice links, etc. There is a set amount of time (varies
by coin) for the customer to make payment, during which the rate is locked. See
‘create_transaction’ below
b. Any Amount: These transactions are typical for customers loading/funding accounts
such as for online gaming sites, trading sites, exchanges, etc. The deposit address is
continually monitored and the rate is determined at the time the payment is received.
See ‘get_callback_address’ below
2) CoinPayments defines the receiving address to be used for payment by customer
3) The receiving address is continually monitored for any incoming payments
4) When an incoming payment is detected on the receiving address, CoinPayments sends an
Instant Payment Notification (IPN) to vendor
5) IPNs contain various information about the payment including the customer details, amount,
status, etc. Different IPN types (containing different information) are returned depending on
how the transaction was created (ie. shopping cart checkout, donation button, invoice link,
etc…)
INSTANT PAYMENT NOTIFICATIONS (IPNs)

The IPN system will notify your server when you receive a payment and when the payment status
changes. IPNs provide an easy and useful way to integrate our payment gateway into your software to
automate order completion, digital downloads, accounting, or any process you want to initiate after
receiving payment.

PAYMENT STATUS

IPNs will be returned with a 'status' field, here are the currently defined values:

-2= PayPal Refund or Reversal


-1 = Cancelled / Timed Out
0 = Waiting for buyer funds
1 = We have confirmed coin reception from the buyer
2 = Queued for nightly payout (if you have the Payout Mode for this coin set to Nightly)
3 = PayPal Pending (eChecks or other types of holds)
100 = Payment Complete. We have sent your coins to your payment address or 3rd party
payment system reports the payment complete

Full IPN Documentation


https://www.coinpayments.net/merchant-tools-ipn

PAYMENTS

For custom integrations we have a variety of API calls available to suit many different situations.
Typically used for making your own custom checkout page keeping customers on your site, instead of
using the CoinPayments hosted checkout page.

Full API List


https://www.coinpayments.net/apidoc-intro

There are various methods of accepting payments via the CoinPayments API and each method typically
returns a different IPN type with different information contained within the IPN.

1) ‘create_transaction’ – Fixed-price Payments (Specific Amount): You specify a price in fiat or


cryptocurrency and what type of coin to receive. The buyer must send the amount of coin
returned by the API in order for the transaction to go through; if you want to receive for
example $100 USD worth of Bitcoin for a client's order this is the choice for you. Fixed-price
payments also have a multitude of payout options from storing in your CoinPayments Wallet,
forwarding to another crypto wallet, converting to another coin, or settling in fiat currency.

Full Documentation for ‘create_transaction’


https://www.coinpayments.net/apidoc-create-transaction
IPN returned is type = ”API”
2) ‘get_callback_address’ – Variable Payments (Any Amount): Gives you an address, any coins
received by it are deposited into your CoinPayments Wallet and if you have an IPN URL set will
notify your server of the payment. The buyer can send any amount of coins as many times as
they want; if you want to assign a client an address they can use to "top up" any time this is the
choice for you.

Full Documentation for ‘get_callback_address’


https://www.coinpayments.net/apidoc-get-callback-address
IPN returned is type=”deposit”

3) 'create_transfer' – Creates a withdrawal to send coins to a specified address or $PayByName tag


by broadcasting the transaction over the coin networks. Optionally, this will send an IPN when
complete. If you are creating a withdrawal to another CoinPayments user and you have their
$PayByName tag or merchant ID you can instead use 'create_transfer' for faster sends that don't
go over the coin networks when possible.

Full Documentation for ‘create_transfer’


https://www.coinpayments.net/apidoc-create-withdrawal
IPN returned is type = ”withdrawal”

4) ‘get_deposit_address’ – Addresses returned by this API are for personal use deposits and reuse
the same personal address(es) in your wallet. Deposits to these addresses don't send IPNs. For
commercial-use addresses and/or ones that send IPNs see 'get_callback_address'.

Full Documentation for ‘get_deposit_address’


NO IPN RETURNED
https://www.coinpayments.net/apidoc-get-deposit-address

5) Prebuilt Plugins - Integrate CoinPayments into your online store by using one or our prebuilt
plugins or integrations for the major ecommerce platforms, such as Shopify, WooCommerce,
Magento and many more.
Full Plugin List
https://www.coinpayments.net/merchant-tools-plugins
IPN returned is type = ”API”

6) Invoice Links – Complete the details on the form to get a link that you can send to customers for
payment. When the customer clicks the link, the exchange rate is pegged at that time and the
customer has a set amount of time to complete the payment.

Invoice Links
https://www.coinpayments.net/merchant-tools-request
IPN returned is type = ”button”

7) Donation Buttons – Complete the details on the form to get some code you can use as a
donation button to receive payments when users click the button. When the user clicks the link,
the exchange rate is pegged at that time and the user has a set amount of time to complete the
payment.
Donation Buttons
https://www.coinpayments.net/merchant-tools-donation-maker
IPN returned is type = ”donation”

INTEGRATION TESTING

Testing is done in a live environment using a free cryptocurrency called Litecoin Testnet (LTCT). You can
enable receiving payments in LTCT in the Coin Settings within your CoinPayments account and you can
request some free LTCT to test your integration on the Wallets page of your CoinPayments account.

Learn More About Testing With Litecoin Testnet


https://www.coinpayments.net/help-testnet

SAMPLE CODE

List of various types of sample code


https://www.coinpayments.net/apidoc-code

Some code samples on how to use get_callback_address and IPN:


https://github.com/CoinPaymentsNet/coinpayments-php

INSTANT PAYMENT NOTIFICATIONS

A complete example of an IPN Handler can be found in:


https://www.coinpayments.net/downloads/cpipn.phps

Example building Ripple transactions in response to IPNs with Quick Gateway Kit:
https://github.com/whotooktwarden/rippled-sign-submit

Handling IPNs for deposits with Quick Gateway Kit:


https://github.com/whotooktwarden/QuickGatewayKit

You might also like