Introduction Last updated: 2021-09-21

This document will introduce you to all the basic information you need to better understand our technologies

Etegram Dev

Etegram for developers offers a range of services that make it possible for you to send and receive money across the world in minutes. On this page, we'll go over some of the payment services we offer to give you a quick overview of what is obtainable with Etegram Dev.

Getting Started

Before you can gain access to our developers APIs you must create an account with us, Signup, then upgrade your account to either KYC 2 or KYC 3.

KYC 3 Requirements:
  • UPGRADE YOUR ACCOUNT
  • Certificate of Incoperation
  • Memart document
KYC 2 Requirements:
  1. Ugrade your Etegram wallet
  2. Add your first, middle and last name
  3. Verify your phone number
  4. Add your Address

Webhook

Webhooks are an important part of your payment integration. They allow Etegram notify you about events that happen on your account, such as a successful payment or a failed transaction.


A webhook URL is an endpoint on your server where you can receive notifications about such events. When an event occurs, we'll make a POST request to that endpoint, with a JSON body containing the details about the event, including the type of event and the data associated with it.

Use Webhook.site for testing

Note

Before giving out Webhook values, do not fail to verify the response with our verify endpoint

CURL:
Post name Reason
hash This is a GET request value that contain the hash value you set in your Etegram wallet.
Raw body This contains all the information about the transaction
Successful Payment Webhook JSON

  {
    "id": "558585858589",
    "amount" "1000",
    "merchantId" "575858585",
    "depositorsEmail" "pay@cus.com",
    "depositorsPhone" "23490000000",
    "currency" "NGN",
    "refid" "1628261213",
    "openType" "ETEGRAMPAY",
    "chargeType" "chargeClient",
    "redirectUrl" "http://demo.com/pay",
    "meta" "1",
    "status" "succcess",
    "paymentType" "ETEGRAMPAY",
    "date" "2021-08-06",
    "time" "15:54:16",
    "ipaddress" "105.112.37.110",
    "token" "93b090113ababa3b1333ce4124b6d884b4af32eb9fd2fadce575306d4ec20e09f227524f2e0be68086bd70c0a06b938fcbee193ca10f8eeefeb9bf6889257d58dac6743cde69643e360febeb78be08162cd6f241b43f0b5f7f65ad92a6b3b1d4d2a3eaa0",
    "charge" "10"
  }



Merchant Keys

There are two major keys that enables users make requests to our APIs.

Types of Keys:
  • SECRET KEY (Do not share this key with anyone)
  • PUBLIC KEY, USER OR MERCHANT ID

Note

DO NOT SHARE YOUR SECRET KEY WITH ANYONE, YOUR SECRET KEY IS USED TO DETERMINE SENSITIVE, IMPORTANT AND SECRET ACTIONS

Accept Payments

To accept a payment, create a transaction using our API, our client Javascript library, Popup JS, or our SDKs. Every transaction includes a link that can be used to complete payment.


Popup

Etegram Popup provides a simple and convenient payment flow for web. It can be integrated in five easy steps, making it the easiest way to start accepting payments. See demo of the payment methods on the checkout here

Collect customer information:

To initialize the transaction, you'll need to provide your clients' information such as email, first name, last name, amount, transaction reference, etc. Note: Email and amount are considered imperative. You can also pass any other additional information in the meta parameter. Here is the full list of parameters you can pass:

JSON VALUES AND THEIR DEFINITION:
Value Definition
amount This is the amount you want the client to pay
merchantId This is your User Id.
depositorsEmail This is the depositors Email.
depositorsPhone This is the depositors Phone Number.
currency This is the transacting currency.
refid Unique case sensitive transaction reference. Note: Only -,., =and alphanumeric characters are allowed. Etegram generates a unique reference for you when this parameter is missing or you've failed to provide this parameter.
openType Always set this value to ETEGRAMPAY
chargeType This is the value that determines who settles incurred charges. users can chose to one of two available options. chargeClient is used to specify if charges should be placed on the client and chargeMe specifies if charges are settled by the user.
redirectUrl Set this value to your redirect url. This value is a URL where your client will be redirected to, if the transaction is Successful or failed
meta This is where you can pass any additional information about the transaction. Note if you pass a code our API will convert the code to an HTML entity, You can later decode the value with any HTML entity decode function.
The customer information can be retrieved from your database if you already have it stored, or from a form like in the example below:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Etegrampay | Demo</title>
</head>
<body>
  <h1>Pay me NGN 1,000</h1>
<button onclick="startPayment()">Pay NGN 1,000</button>
  <script src="https://etegram.com/apis/inline/script.js"></script>
  <script>
 
  function startPayment(){
      var paymentInfo = {
    amount: 1000, // Amount to pay
    merchantId: "", // your user ID or Public key
    depositorsEmail: "example@gmail.com", //  Depositors Email
    depositorsPhone: "09000776543", // Depositors phone
    currency: "NGN", // currency
    refid: 1628454281, // your unique id
    openType: "ETEGRAMPAY", // set this to ETEGRAMPAY
    chargeType: "chargeClient", 
    redirectUrl: "https://example.com/etegram/", // success or failed page.
    meta: "1"// information about the transaction
};
 payWithEtegram(paymentInfo);
  }
  </script>
</body>
</html>
In this sample, notice how:
  1. The Etegram inline javascript is included using a script tag. This is how you import Etegram into your code.
  2. The amount here can be hardcoded if you want to charge a specific amount.
  3. Verify expected transaction currency.
  4. The Pay button has been tied to an onClick function called payWithEtegram. This is the action that causes the Etegram popup to load.

Redirect URL

After a successful or failed transaction your client will be redirected to your Redirect URL. Etegram will append a get request that will look like this

Redirect URL SAMPLE

					
								
https://example.com/etegram/?response={"id":"397","amount":"10","merchantId":"176","depositorsEmail":"ememzyonline@gmail.com","depositorsPhone":"07000000000000","currency":"NGN","refid":"1646856438","openType":"ETEGRAMPAY","chargeType":"chargeClient","redirectUrl":"https://betalegit.com/checkpay.php","meta":"1043","status":"success","paymentType":"ETEGRAMPAY","date":"2022-03-09","time":"21:08:09","ipaddress":"197.210.84.112","token":"8c9119a88c21607707354155fa71eb95641e99db5c7bde3c8ba3ff4291b99017ce3c886b9ec1f659543e1caf89064241846d607f95c45723dc97777c1ef879f66ba58aba0f0e87fee58ae618738764e1b7f21d32e1cf28a2894b6f841539dbf5e3cbb687","charge":"0.1"}
					

Verify Payment

After a successful charge, you need to verify that the payment was successful with Etegram before giving value to your customer on your website or App. For every transaction, there is a transaction ID

Here are some important things to check for when verifying the payment:

  • Verify the transaction id.
  • Verify the status of the transaction to be success
  • Verify the currency to be the expected currency
  • Most importantly validate the amount paid to be equal to or at least greater than the amount of the value to be given.
  • Save the transaction id and transaction information in your database.
  • Check your database if you had already given out the value.

Send a POST request to this endpoint https://etegram.com/apis/verifyTransaction/index.php to Validate your transaction

CURL for ID OF THE TRANSACTION

					
								
curl https://etegram.com/apis/verifyTransaction/index.php
-H "Authorization: Bearer Your SECRET_KEY"
-H "Content-Type: application/json"
-d '{ "ID": "Id of the transaction"
    }'
    }'
-X POST
					

CURL for THE REF ID OF THE TRANSACTION

					
								
curl https://etegram.com/apis/verifyRefId/index.php
-H "Authorization: Bearer Your SECRET_KEY"
-H "Content-Type: application/json"
-d '{ "refid": "ref id of the transaction"
    }'
    }'
-X POST
					
Verification response

  {
    "id": "558585858589",
    "amount" "1000",
    "merchantId" "575858585",
    "depositorsEmail" "pay@cus.com",
    "depositorsPhone" "23490000000",
    "currency" "NGN",
    "refid" "1628261213",
    "openType" "ETEGRAMPAY",
    "chargeType" "chargeClient",
    "redirectUrl" "http://demo.com/pay",
    "meta" "1",
    "status" "succcess",
    "paymentType" "ETEGRAMPAY",
    "date" "2021-08-06",
    "time" "15:54:16",
    "ipaddress" "105.112.37.110",
    "token" "93b090113ababa3b1333ce4124b6d884b4af32eb9fd2fadce575306d4ec20e09f227524f2e0be68086bd70c0a06b938fcbee193ca10f8eeefeb9bf6889257d58dac6743cde69643e360febeb78be08162cd6f241b43f0b5f7f65ad92a6b3b1d4d2a3eaa0",
    "charge" "10"
  }



Transfer

Etegram allows you to initiate single and bulk transfers to bank accounts and make transfers to vendors all from your Etegram account. You can either use the money you have earned as income i.e. (money collected from your customer's using Etegram) or fund your balance on Etegram to initiate transfers to bank accounts & mobile money wallets in:

  • Nigeria
  • Ghana
  • Kenya
  • Uganda
  • Tanzania
  • Tanzania
  • South Africa
  • Zambia
  • Ivory Coast
  • Cameroon
  • Sierra Leone
  • Burkina Faso
  • Guinea Bissau
  • Mali
  • Senegal
  • Rwanda
  • Tunisia
  • Guinea Conakry

Transfers can be done from the dashboard or using our APIs. To make a transfer, you only need to make a POST request to our /transfers endpoint.

Get all banks

Get list of banks you can transfer to

CURL

					
								
curl https://etegram.com/apis/getBanks/index.php
-H "Authorization: Bearer Your SECRET_KEY"
-H "Content-Type: application/json"
-X POST
					
Successful response

  {
    "status": "status",
    "message" "Banks fetched Successfuly",
    "data" [{"id":1, "code":"044", "name":"Access Bank"}, ...]
  }



Account verification

This page describes the process for verifying bank account numbers
It is Important to verify users' credentials before initiating payments or giving value. Etegram gives you the ability to verify bank account numbers through our account resolution endpoint:

CURL

					
								
curl https://etegram.com/apis/verifyBankAccount/index.php
-H "Authorization: Bearer Your SECRET_KEY"
-H "Content-Type: application/json"
-d '{"account_number": "NUBAN ACCOUNT NUMBER",
	 "bank_code": "BANK CODE"
    }'
    }'
-X POST
					
Successful response

  {
    "status": "status",
    "message" "Account details fetched",
    "data" {"id":1, "account_number":"2367092357", "account_name":"Emem Edem"}
  }



Create a transfer

This will show you how to initiate a transfer

CURL

					
								
curl https://etegram.com/apis/widthdraw/index.php
-H "Authorization: Bearer Your SECRET_KEY"
-H "Content-Type: application/json"
-d '{"account_number": "NUMBAN ACCOUNT NUMBER",
	 "bank_code": "BANK CODE",
	 "amount": "AMOUNT TO TRANSFER",
	 "narration":"reason for transaction",
	 "currency":"NGN",
	 "callback_url":"your callback url",
	 "debit_currency": "NGN",
	 "reference": "your reference"

    }'
    }'
-X POST
					
Successful response

  {
    "status": "status",
    "message" "Transfer Queued Successfuly",
    "data" {"id":1, "account_number":"2367092357", "bank_code":"057"...}
  }



Etegram Transfer

Etegram allows you to initiate single and bulk transfers to Etegram wallets and make transfers to vendors all from your Etegram account. You can either use the money you have earned as income i.e. (money collected from your customer's using Etegram) or fund your balance on Etegram to initiate transfers to Etegram users:

Transfers can be done from the dashboard or using our APIs. To make a transfer, you only need to make a POST request to our /transfers-etegram endpoint.

Account verification

This page describes the process for verifying Etegram account numbers
It is Important to verify users' credentials before initiating payments or giving value. Etegram gives you the ability to verify user names, user_id and phone numbers.

CURL

					
								
curl https://etegram.com/apis/verifyBankAccount/etegram.php
-H "Authorization: Bearer Your SECRET_KEY"
-H "Content-Type: application/json"
-d '{"user_email": "User Email"
    }'
    }'
-X POST
					
Successful response

{"status":"success","message":"Account details fetched","user_id":"98373563","user_email":"example@gmail.com","user_name":"Example co LTD","user_phone":"+23490009876"}
  



Create a transfer

This will show you how to initiate a transfer to a Etegram user

CURL

					
								
curl https://etegram.com/apis/widthdraw/etegram.php
-H "Authorization: Bearer Your SECRET_KEY"
-H "Content-Type: application/json"
-d '{"user_email": "USER EMAIL",
	 "amount": "AMOUNT TO TRANSFER",
	 "narration":"reason for transaction",
	 "currency":"NGN",
	 "debit_currency": "NGN",
	 "reference": "your reference"

    }'
    }'
-X POST
					
Successful response

  {"status":"success","message":"Transfer successful","amount":"2000","currency":"NGN","debit_currency":"NGN","reference":"dgdtet5gdgbs", "narration":"PAYOUT FROM WIXS","user_id":"98373563","user_email":"example@gmail.com","user_name":"Example co LTD","user_phone":"+23490009876"}