Customers
This end point handles the customers related to your account
Get all customers
This endpoint gets all account customers
GET
https://api.coinforbarter.com/v1/customers
Sample Response
Get a customer
This endpoint gets a particular customer with id {{customer_id}}
{{customer_id}} is the id gotten from the get all customers end point
GET
https://api.coinforbarter.com/v1/customers/{{customer_id}}
Sample Response
Create customer
This endpoint creates a customer for your account
POST
https://api.coinforbarter.com/v1/customers
Body params
email (text)
Email of the customer that will be created
fullName (text)
Full name of the customer
phoneNumber (text)
Customers phone number
isBlacklisted (text)
(optional) if the customer created should be black listed
Sample Response
Update
This endpoint updates a customer information. {{customer_id}} is the id gotten from the get all customers end point
PATCH
https://api.coinforbarter.com/v1/customers/{{customer_id}}
Body params
phoneNumber (text)
New customer phone number to be updated with
isBlacklisted (text)
A boolean if the customer should be blacklisted.
fullName (text)
Name to update the customer
email (text)
New customer email to be updated
Sample Response
Bank accounts
This end point handles the bank accounts related to your account
get account name
This endpoints is to validate the full name of a bank account
POST
https://api.coinforbarter.com/v1/bank-accounts/account/name
Body params
accountNumber (text)
Account Number of the bank to get the account name
accountBank (text)
Bank code of the bank to get the account name
create
This endpoint creates a bank account
POST
https://api.coinforbarter.com/v1/bank-accounts
Body params
accountNumber (text)
Account Number to be added
accountBank (text)
Bank Name
country (text)
Country of the bank account
currency (text)
Currency code of the account(see get all currency endpoint)
accountName (text)
Account Name
get all
This endpoint gets all bank accounts
GET
https://api.coinforbarter.com/v1/bank-accounts
Query params
from
start date query
to
end date query
isPrimary
a boolean value to determinine if you want to filter by primary bank accounts or not.
page
The page you want to query
country
currency
skip
the number of rows per page
accountBank
Body params
accountNumber (text)
accountBank (text)
country (text)
currency (text)
accountName (text)
get one
A request to get one bank account of id {{bank_account_id}}. {{bank_account_id}} is the id of bank count gotten from get all bank accounts endpoint
GET
https://api.coinforbarter.com/v1/bank-accounts/{{bank_account_id}}
Body params
accountNumber (text)
accountBank (text)
country (text)
currency (text)
accountName (text)
make primary
A request to make a bank account of id {{bank_account_id}} primary i.e. Main bank account. {{bank_account_id}} is the id of bank count gotten from get all bank accounts endpoint
GET
https://api.coinforbarter.com/v1/bank-accounts/primary/{{bank_account_id}}
Body params
accountNumber (text)
accountBank (text)
country (text)
currency (text)
accountName (text)
delete
A request to delete a bank account of id {{bank_account_id}}. {{bank_account_id}} is the id of bank count gotten from get all bank accounts endpoint
DELETE
https://api.coinforbarter.com/v1/bank-accounts/account/archive/{{bank_account_id}}
all banks
This endpoint returns all bank account in a particular country with code {{country_code}}. {{country_code}} is the country code gotten from get all country endpoints.
GET
https://api.coinforbarter.com/v1/bank-accounts/banks/{{country_code}}
Misc
Get Countries
This endpoint return all Countries
GET
https://api.coinforbarter.com/v1/countries
Sample Response
Get Wallet Balances
This endpoint returns all your balances of relating to currencies
GET
https://api.coinforbarter.com/v1/balances
Sample Response
Get Currencies
This endpoint return all currencies supported
GET
https://api.coinforbarter.com/v1/currencies
Payment Plans
This end point handles the payment plans related to your account
Misc
This endpoint returns the types of frequency or intervals of the payment plan supported by CoinForBarter
GET
https://api.coinforbarter.com/v1/payment-plans/misc
Sample Response
Create
This endpoint creates a payment plan
POST
https://api.coinforbarter.com/v1/payment-plans
Body params
frequency (text)
The type of frequency (Choose any one from the Frequency response in the get payment-plans/misc endpoint)
planName (text)
name of the plan to create
numberOfTimesToCharge (text)
Number of time to charge customer on this plan in the inputted frequency
amount (text)
Amount to charge per time
currency (text)
Base currency for the payment i.e. the currency of the amount
currencies[] (text)
An array of currencies to accept for payment
currencies[] (text)
An array of currencies to accept for payment
Sample Response
Find all
Returns all payment plans
GET
https://api.coinforbarter.com/v1/payment-plans
Query params
from
Date to start sort
to
Date to end sort
currency
Filter the get all by currency
page
Numbers of page
Sample Response
Find One
This endpoint returns a payment plan with id {{payment_plan_id}}. {{payment_plan_id}} is the id gotten from get all payment-plans endpoint
GET
https://api.coinforbarter.com/v1/payment-plans/{{payment_plan_id}}
Sample Response
Update
PATCH
https://api.coinforbarter.com/v1/payment-plans/{{payment_plan_id}}
Body params
amount (text)
isActive (text)
Sample Response
Payment Plan Subscribers
This end point handles the payment plan subscribers related to your account
Create
This is a post request to subscribe to one of your payment plan with id {{payment_plan_id}}. {{payment_plan_id}} is the id gotten from get all payment-plans endpoint
POST
https://api.coinforbarter.com/v1/payment-plan-subscribers/{{payment_plan_id}}
Body params
email (text)
email of the sucriber to the payment pan
Sample Response
Find all
This endpoint return list of all subscribers
GET
https://api.coinforbarter.com/v1/payment-plan-subscribers
Query params
from
start date query
to
end date query
page
the page you want to query
customer
the email address of a customer to query
isActive
a boolean value to determinine if you want to filter by active subscribers or not
Sample Response
Find One
This endpoint returns list of all subscribers with id {{payment_plan_subscriber_id}}. {{payment_plan_subscriber_id}} is the id gotten from get all payment-plans-subscribers endpoint
GET
https://api.coinforbarter.com/v1/payment-plan-subscribers/{{payment_plan_subscriber_id}}
Sample Response
Remove
This endpoint deletes subscriber with id {{payment_plan_subscriber_id}} from your subscribers list. {{payment_plan_subscriber_id}} is the id gotten from get all payment-plans-subscribers endpoint
DELETE
https://api.coinforbarter.com/v1/payment-plan-subscribers/{{payment_plan_subscriber_id}}
Sample Response
Wallet Addresses
This end point is for wallet addresses.
Wallet addresses are used for making withdrawals.
When you request a withdrawal, you can select from any of these addresses for that withdrawal.
create
This end point creates a new wallet address on your account
POST
https://api.coinforbarter.com/v1/wallet-addresses
Body params
address (text)
* Address of the wallet
currency (text)
* This is the currency for this wallet address
isPrimary (text)
If the wallet should be the primary wallet
network (text)
This is the network of the address
Sample Response
get all
This endpoint get all wallet addresses attached to your account
GET
https://api.coinforbarter.com/v1/wallet-addresses
Query params
from
start date query
to
end date query
isPrimary
a boolean value to determinine if you want to filter by primary wallet adresses or not.
page
the page you want to query
network
a blockchain network to query
currency
a currency to query
skip
the number of rows per page
address
a wallet address to query
label
a wallet address label to query
Body params
accountNumber (text)
accountBank (text)
country (text)
currency (text)
accountName (text)
Sample Response
Get One
This endpoint get wallet of id {{wallet_address_id}}. {{wallet_address_id}} is the id of the wallet gotten from get all wallet endpoint
GET
https://api.coinforbarter.com/v1/wallet-addresses/{{wallet_id}}
Body params
(text)
(text)
(text)
(text)
(text)
Sample Response
make primary
This endpoint makes the wallet address of id {{wallet_address_id}} Primary {{wallet_address_id}} is the id of the wallet gotten from get all wallet endpoint
GET
https://api.coinforbarter.com/v1/wallet-addresses/primary/{{wallet_address_id}}
Sample Response
Transfers
Create
This end point creates a new transfers on your account
POST
https://api.coinforbarter.com/v1/transfers
Body params
amount (text)
Amount to transfer
currency (text)
Currency to Transfer in
walletAddress (text)
walletNetwork (text)
Sample Response
Get Fee
POST
https://api.coinforbarter.com/v1/transfers/fee
Body params
amount (text)
currency (text)
walletAddress (text)
walletNetwork (text)
Sample Response
Get one
GET
https://api.coinforbarter.com/v1/transfers/{{transfer_id}}
Sample Response
Get ALL
GET
https://api.coinforbarter.com/v1/transfers
Query params
from
to
page
skip
Sample Response
Payouts
Get all
GET
https://api.coinforbarter.com/v1/payouts
Query params
from
Date to sort from
to
Date to sort to
page
currency
status
sort
field to sort with
minAmount
minimum amount to sort from
maxAmount
maxAmount to sort to
bankAccount
Bank account id of which payout was made to
address
Wallet address id of which payout was made to
isAscending
if its ascending or not
skip
Number per role
Get one
GET
https://api.coinforbarter.com/v1/payouts/{{payout_id}}
Payments
This handles payments.
The payment endpoints can be authorized by both public key and private key.
Use /payments/checkout when using public keys.
You can handle a complete payment flow by following the steps below;
- Create a payment
- Set a currency for that payment
- Lock the currency.
- Send payment to the address provided
- Verify the payment via webhook or using the verify payment or transaction endpoint.
Payment Object
- id - the id of the payment.
- status - the present status of the payment - in progress, error, cancelled, success.
- description - The description of the payment.
- txRef - the txRef provided while creating the payment for your reference.
- redirectUrl - a url to redirect to after the payment ends.
- fee - the total CoinForBarter Fee for this payment.
- currency - the selected currency to make payment in.
- currencyNetwork the selected currency network to make payment in.
- amount - the amount to be paid in the selected currency.
- nairaValue - total amountReceived in naira at time it was received.
- dollarValue - total amountReceived in dollar at time it was received.
- baseAmount - the amount to which this payment was created.
- baseCurrency - the currency to which the amount of this payment was created.
- currencies - the list of currencies acceptable for this payment.
- expiresBy - the expiry time of this payment.
- customer - the email address of the customer.
- customerDetails - an object containing the other details of the customer - phoneNumber, fullName.
- addressInformation - an object containing the crypto address to which payment will be made - address, network.
- transactionTimeLog - an array of objects containing the log of events on this payment-time (time of event), type (if the event was a success or error), event (description of event).
- isCurrencyLocked - a boolean value telling if the currency to make this payment in has been locked.
- createdAt - the time this payment was created.
- branding an object containing branding information set from your dashboard - businessName, name, logo.
Create
This endpoint creates a new payment.
Use /payments/checkout to create a payment using your public key for authorization
POST
https://api.coinforbarter.com/v1/payments/checkout
Body params
customer (text)
This is an object has some of the customer information like customerName, customerEmail etc.
txRef (text)
This is a transaction reference you supply to identify different transactions on your account. It is important to ensure that you pass unique references for every transaction
baseCurrency (text)
The base currency you are trying to pay with.
amount (text)
This is the amount in the base currency you are trying to pay with
customerFullName (text)
customerphoneNumber (text)
redirectUrl (text)
(text)
Sample Response
Get One
This endpoint gets the details of a payment
GET
https://api.coinforbarter.com/v1/payments/{{payment_id}}
Sample Response
Cancel
This endpoint cancels a payment
PATCH
https://api.coinforbarter.com/v1/payments/{{payment_id}}/cancel
Sample Response
Lock Currency
PATCH
https://api.coinforbarter.com/v1/payments/{{payment_id}}/currency/lock
Sample Response
Set Currency
This endpoint sets a currency for this payment.
- {{currency}} is the chosen currency to use for this transaction
- {{network}} is the network option of the currency you want to pay in.
Get the list of currencies and networks from the /currencies endpoint
PATCH
https://api.coinforbarter.com/v1/payments/{{payment_id}}/currency/set/{{currency}}/{{network}}
Sample Response
Transactions
Get all
This endpoint return all transactions associated with your account
GET
https://api.coinforbarter.com/v1/transactions
Sample Response
Get one
POST
https://api.coinforbarter.com/v1/transactions/{{transaction_id}}/webhook
Sample Response
Verify
To verify a transaction before giving out value,
- confirm that the baseAmount, baseCurrency are equal to amount and currency you had sent.
- confirm that the amountReceived is equal to the amount on the transaction object
GET
https://api.coinforbarter.com/v1/transactions/{{transaction_id}}/verify
Sample Response
Get Transaction Time Log
GET
https://api.coinforbarter.com/v1/transactions/{{transaction_id}}/events
Sample Response
Get fee
GET
https://api.coinforbarter.com/v1/transactions/{{transaction_id}}/fee
Sample Response
Get one
GET
https://api.coinforbarter.com/v1/transactions/{{transaction_id}}
Sample Response
Wallets
Create and manage wallets.
you will get notified via webhooks when a wallet you have created receives a transaction.
Find all
GET
https://api.coinforbarter.com/v1/wallets
Query params
currency
label
Sample Response
Find One
GET
https://api.coinforbarter.com/v1/wallets/{{wallet_id}}
Sample Response
Create
POST
https://api.coinforbarter.com/v1/wallets
Body params
currency (text)
label (text)
Sample Response
Delete
This will delete the wallet and you will stop getting updates when this wallet receives a transaction
DELETE
https://api.coinforbarter.com/v1/wallets/{{wallet_id}}