Genome Documentation

SEPA Payout API

SEPA Payout API

Overview

Genome provides customers with functionality that allows them to make payouts.

Web ServiceURL
Live Genome Payout API Servicehttps://api.genome.eu/api/mp/payout

Payout request format

  • JSON-request
    To use JSON type a request header should contain “Content-Type: application/json”, request content should be transmitted as a json-object

Parameters of the payout request via SEPA:

Parameter nameRequiredFormat and ruleDescription
api_versionYesint
Possible value: 1
API version
merchant_accountYesstring (6-32)Merchant account
merchant_passwordYesstring (6-32)Account password
methodYesstring
Possible value: init
Method for the payout request
transaction_unique_idYesstring (1-45)Transaction unique identifier in Merchant system.
amountYesfloat (0 - 9999999.9999)Payout transaction amount
currencyYesstring (3)
ISO 4217 (alfa-3)
Payout transaction currency
callback_urlYesNot Empty String https requiredOnce the order has been processed merchant will receive a final response (callback) regarding the transaction status to this URL
typeYesstring
Possible value: sepa
Type of the payout method
receiver_ibanyesstring max - 64Receiver IBAN number
receiver_typeconditionalenum ('PERSONAL', 'LEGAL')Mandatory if parameter receiver_code is provided, otherwise parameter is optional
LEGAL if receiver is legal entity
PERSONAL if receiver is physical person
receiver_codeoptionalstring (1 - 20)Receiver personal code or receiver company code
receiver_nameyesstring (1 - 70)Receiver name. Can be as physical person name as legal entity name
receiver_bicyesstring (max - 32)Receiver SEPA BIC number
transfer_descriptionyesstring (1 - 140)Payment purpose
transfer_priorityoptionalenum ('HIGH', 'NORMAL')Will be 'NORMAL' by default if the parameter is not provided
transfer_perform_dateoptionalstring (YYYY-MM-DD)Payout execution date. Date when the booking on the bank-side should be executed
receiver_addressoptionalstring (2 - 64)Receiver address
receiver_cityoptionalstring (2 - 32)Receiver city
receiver_countryoptionalstring (3)Receivers country in ISO 3166-1 alpha-3 format
receiver_zipoptionalstring (2 - 10)Receiver zip
receiver_emailoptionalstring (6 - 255)Receiver email address
receiver_ipoptionalstring (IPv4, IPv6)Receiver IP address. Not all acquirers support IPv6 format
receiver_idoptionalstring (1 - 60)Customer Id on merchant's side
receiver_phoneoptionalstring (7 - 15)Receiver phone number
Sample code of the Payout via SEPA request in application/json format with mandatory parameters only:
{
"api_version": 1,
"method": "init",
"merchant_account": "Account_MP_TRX",
"merchant_password": "password123",
"transaction_unique_id": "payout_sepa",
"amount": 100,
"currency": "EUR",
"callback_url": "https://merchant.com/callback",
"receiver_iban":"1000000001200012",
"type":"sepa",
"receiver_bic":"BCXX12345",
"receiver_name":"John Doe",
"transfer_description":"Payment for request no. 123456"
}
Sample code of the Payout via SEPA request in application/json format for receiver_type "PERSONAL":
{
"api_version": 1,
"method": "init",
"merchant_account": "Account_MP_TRX",
"merchant_password": "password123",
"transaction_unique_id": "payout_sepa",
"amount": 100,
"currency": "EUR",
"callback_url": "https://merchant.com/callback",
"receiver_iban":"1000000001200012",
"type":"sepa",
"receiver_type":"PERSONAL",
"receiver_code":"AB12345",
"receiver_bic":"BCXX12345",
"receiver_name":"John Doe",
"transfer_description":"Payment for request no. 123456"
}
Sample code of the Payout via SEPA request in application/json format for receiver_type "LEGAL":
{
"api_version": 1,
"method": "init",
"merchant_account": "Account_MP_TRX",
"merchant_password": "password123",
"transaction_unique_id": "payout_sepa",
"amount": 100,
"currency": "EUR",
"callback_url": "https://merchant.com/callback",
"receiver_iban":"1000000001200012",
"type":"sepa",
"receiver_type":"LEGAL",
"receiver_code":"AB12345",
"receiver_bic":"BCXX12345",
"receiver_name":"Company Ltd.",
"transfer_description":"Payment for request no. 123456"
}
Response parameters:
Parameter nameFormat and ruleDescription
session_idstring (36)Unique session Id of the request
timestampinteger
unix timestamp
Payout API response time
statusstring
Possible values: pending, decline, error
Status of the request to Payout API
codeinteger (1-4)Response code of the request
messagestring (6-255)Response message of the request
Sample code of the Payout via SEPA response in application/json format:
{
"sessionid": "5118fcfc-2d9c-492c-9f7c-21470c",
"timestamp": 1531741112,
"status": "pending",
"code": 0,
"message": "Request processed successfully"
}

Notice: Response is not a finished status of the transaction. Finished status will be sent in callback request.

Payout callback

Callback request parameters:
Parameter nameFormat and ruleDescription
tokenstring (36)Hashed value of card number, expiry date and cardholder name
referencestring (20)Reference of the transaction in Genome system
transaction_unique_idstring (1-45)Unique transaction Id
statusstring
Possible values: SUCCESS, DECLINE, ERROR
Status of the transaction
codeinteger (1-4)Response code regarding the transaction result
messagestring (6-255)Response message regarding the transaction result
checkSumstring (64)Signature for callback parameters
Example of callback request to merchant in "application/x-www-form-urlencoded" format:
token=5aaaa194-1d68-4ef8-a72f-009184ee03a6
&reference=PTFF00000000396580CF
&transaction_unique_id=payout_0716100000
&status=SUCCESS
&code=0
&message=Transaction processed successfully
&checkSum=4804928393234a6cd05f177569147091d7138da25fc61d9ee5add357017239a6

Genome sends callback data to merchant in application/x-www-form-urlencoded format. Callback is received to a merchant when in response Genome got the code - 200 (it's required), and body text - OK (it's optional). In other cases, callback is not received to merchant and Genome will try periodically to re-send callback data. The number of attempts are limited.

checkSum calculation

checkSum calculation allows to compare value of the checkSum in callback request with own calculation.

PHP algorithm below shows the calculation logic of “checkSum”:

<?php
// Example of the callback request to merchant, application/x-www-form-urlencoded format.
$callbackData = 'token=5aaaa194-1d68-4ef8-a72f-009184ee03a6&reference=PTFF00000000396580CF&transaction_unique_id=payout_0716100000&status=success&code=0&message=Transaction processed successfully&checkSum=4804928393234a6cd05f177569147091d7138da25fc61d9ee5add357017239a6';
// Example of the sorted parameters. Also, private key, provided by Genome is added in the end of the line.
$sortedData = 'code=0|message=Transaction processed successfully|reference=PTFF00000000396580CF|status=success|token=5aaaa194-1d68-4ef8-a72f-009184ee03a6|transaction_unique_id=payout_0716100000|your_private_key';
// Getting the result of checkSum calculation
$countedCheckSum = hash('sha256', $sortedData);
?>

If you need to calculate and compare the value checkSum callback, use the algorithm described below:

Make notice, that all callback values take a part in calculation of the checkSum parameter.

  • excluded from the array checkSum field, then sort the array by key in the alphabetical order, form a line on the principle: key1 = value1 | key2 = value2 | switchN = valueN | your_private_signature from the sorted array

Make notice, that a value of the your_privat_signature is provided by Genome integration team.

If fully translate callback shown in the example into the line we get:

  • code=0|message=Transaction processed successfully|reference=PTFF00000061B7146A8B|status=success|token=43d206b5-af88-4770-9d08-0c7eb17b000|transaction_unique_id=000453542|your_privat_signature
  • The next step is to calculate hash for the obtained line by hash sha256, the result should match the line transfered in checkSum field. $countedCheckSum = hash('sha256','code=0|message=Transaction processed successfully|reference=PTFF00000061B7146A8B|status=success|token=43d206b5-af88-4770-9d08-0c7eb17b000|transaction_unique_id=000453542|your_privat_signature');

  • If the values coincide - the signature is valid.

Transaction statuses

SEPA Payout transaction statuses:
StatusDescription
SUCCESStransaction processed successfully
ERRORtransaction error
DECLINEDtransaction declined
PENDINGtransaction processing
FRAUDEDtransaction fraud

CHECK transaction status

Purpose: Interface should be used to check transaction status.

Gateway supports the CHECK type of transaction requests to provide transaction status information.

Access to CHECK transaction API

The Genome live API can be reached using the following URL:

Web ServiceURL
Live Genome Gateway API Servicehttps://api.genome.eu/api/mp/transaction

CHECK transaction request format

  • JSON-request

To use JSON type a request header should contain “Content-Type: application/json”, request content should be transmitted as a json-object

Request parameters:

Parameter nameRequiredFormat and ruleDescription
api_versionYesint
Possible value: 1
API version
merchant_accountYesstring (6-32)Merchant account
merchant_passwordYesstring (6-32)Account password
transaction_typeYesstring
Possible value: CHECK
Type of the transaction: CHECK
transaction_unique_idYesstring (1-45)Unique transaction id
Sample code of the CHECK request with reference, "application/json" format:
{
"api_version": 1,
"merchant_account": "Account_MP_TRX",
"merchant_password": "password123",
"transaction_type": "CHECK",
"reference": "ATFF00000000395AD690"
}
Sample code of the CHECK request with transaction id, "application/json" format:
{
"api_version": 1,
"merchant_account": "Account_MP_TRX",
"merchant_password": "password123",
"transaction_type": "CHECK",
"transaction_unique_id": "check_request"
}

transaction_unique_id can be passed for CHECK request.

Response parameters:

Parameter nameFormat and ruleDescription
api_versionfloat
Possible value: 1
API version
merchant_accountstring (6-32)Merchant account
sessionidstring (36)Id of the session
transactionsarrayContains of transaction data array
referencestring (20)Reference of the transaction in Genome system
transaction_unique_idstring (1-45)Unique transaction Id
transaction_typestring
Possible value: PAYOUT
Type of the transaction
statusstring
Possible values: success, decline, error
Status of the transaction
codeinteger (1-4)Response code regarding the transaction result
messagestring (6-255)Response message regarding the transaction result
tokenstring (36)Hashed value of card number, expiry date and cardholder name
timestampinteger (unix timestamp)Timestamp of the transaction
authcodestring or null (0-24)Authorization code
transactionsend of the array** -//- **
statusstring
Possible value: success, decline, error
Status of the transaction
codeinteger (1-4)Response code regarding the transaction result
messagestring (6-255)Response message regarding the transaction result
Sample code of the CHECK response in "application/json" format:
{
"api_version": 1,
"merchant_account": "Account_MP_TRX",
"sessionid": "5668fbfb-2d9c-492c-9f7c-11fb8ae9e3fc",
"transactions": [
{
"reference": "ATFF00000000395AD690",
"transaction_unique_id": "check_request",
"transaction_type": "AUTH",
"status": "SUCCESS",
"code": 0,
"message": "SUCCESS",
"token": "5519225d-3460-433f-ad4e-62649d0bb909",
"timestamp": 1529796980,
"authcode": "111313"
}
],
"status": "success",
"code": 0,
"message": "Transaction processed successfully"
}

After the CHECK transaction has been processed merchant can send any transactions depending on the stage of an actual transaction flow process.

Query on Demand API: Transactions

Purpose: Use transactions request qod_type allows to get all of transactions processed on the merchant account.

The Genome live query on demand API can be reached using the following URL:

Web ServiceURL
Live QOD Servicehttps://api.genome.eu/api/mp/transactions

Response parameters:

Parameter nameRequiredFormat and ruleDescription
api_versionYesfloat (1)
Possible value: 1
API version
timestampYesinteger
unix timestamp
Query on Demand API response time
session_idYesstring (36)Unique session Id of the request
merchant_accountYesstring (6-32)Merchant account
transactionsYesarrayContains of transactions data
transaction_typeYesstring
Possible value: PAYOUT
Type of the transaction: CHECK
statusYesstring
Possible value: SUCCESS, DECLINED, ERROR, MALFORMED, FRAUDED, CHARGEDBACK, REFUNDED, VOIDED, PARTIAL-REFUNDED, WRONGREF
Status of the transaction
modeYesstring
Possible value: CC, TOKEN, REF, CASCADE
Transaction mode.
  • CC - by credit card.
  • TOKEN - by token.
  • REF - by reference.
  • CASCADE - by cascade mode.
referenceYesstring (20)Reference of the transaction in Genome system.
base_referenceYesnull or string (20)Base reference of the transaction in Genome system if exists.
amountYesfloat (0-9999999.9999)Transaction amount
currencyYesstring (3)
ISO 4217 (alfa-3)
Transaction currency
merchantYesarray or nullContains of merchant data
merchant_accountYesstring (6-32)Merchant account
descriptor_merchantYesnull or string (0-255)Merchant descriptor
descriptor_phoneYesnull or string (0-255)Merchant descriptor phone
merchant_domain_nameYesnull or string (0-255)Merchant website name
merchant_product_nameYesnull or string (0-255)Merchant product name
merchant_affiliate_idYesnull or string (0-255)Merchant affiliate identifier
merchant_user_idYesnull or string (0-32)Unique user Id in Merchant system
end of the merchant array-//--//-End of the merchant array
useryesarray or nullContains of user data
first_nameyesstring (1-32)The first name of the customer
last_nameyesstring (1-32)The last name of the customer
countryyesstring (2-3)
ISO 3166-1 alpha-3
Customer's country
stateyesnull or string (1-32)Customer's state
cityyesnull or string (2-32)Customer's city
addressyesnull or string (2-64)Customer's address
zipyesnull or string (2-10)Customer's zip
user_ipyesstring (IPv4, IPv6)Customer's IP address
user_emailyesstring (6-255)Customer's email
user_phoneyesnull or string (7-15)Customer's phone number
end of the user array-//--//-End of the user array
cardyesarray or nullContains of custmer's card data
card_holderyesstring (2-32)Card holder name
brandyesstring (0-255)Card brand - VISA, MASTERCARD, AMEX, JCB etc
bankyesstring (0-255)Issuer bank
levelyesstring (0-255)Level of the card - ELECTRON, CLASSIC etc
typeyesstring (0-255)Type of the card - CREDIT, DEBIT etc
binyesstring (6)The first 6 digits of the card
lastyesstring (4)The last 4 digits of the card
exp_monthyesstring (2)Card expiration month
exp_yearyesstring (4)Card expiration year
end of the card array-//--//-End of the card array
bankyesarray or nullContains of acquirer data
idyesinteger (0-20)Bank identifier code
authcodeyesstring (0-45)Bank authorization code
timeyesfloat or nullBank transaction time
end of the bank array-//--//-End of the bank array
timeyesfloat or nullTransaction time in Genome system, UTC timezone
tokenyesstring (36)Hashed value of card number, expiry date and cardholder name.
transaction_unique_idyesstring (1-45)Transaction unique identifier in Merchant system.
paresyesstring (0-65535)The hashed value of the result of 3D Secure authorization
codeyesnull or integer (1-4)Transaction response code, check the response codes table below
messageyesnull or string (6-255)Transaction response message, check the response codes table below
end of transactions array-//--//-End of the transactions array
statusyesstring
Possible values: success, error
Status of the request to QoD API
codeyesinteger (1-4)Response code of the request to QoD API
messageyesstring (6-255)Response message of the request to QoD API
Sample code of the Transaction response in "application/json" format:
{
"api_version": 1,
"timestamp": 1545117788.019275,
"session_id": "de7a5f-67f1-5c18a05b-167c0326604-113b",
"merchant_account": "Account_MP_TRX",
"transactions": [
{
"transaction_type": "AUTH",
"status": "SUCCESS",
"mode": "CC",
"reference": "ATFF00000000395376F6",
"base_reference": null,
"amount": 10,
"currency": "GBP",
"merchant": {
"merchant_account": "Account_MP_TRX",
"descriptor_merchant": "",
"descriptor_phone": "",
"merchant_domain_name": "",
"merchant_product_name": "",
"merchant_affiliate_id": "",
"merchant_user_id": ""
},
"user": {
"first_name": "John",
"last_name": "Doe",
"country": "GBR",
"state": "",
"city": "London",
"address": "123 Streetname",
"zip": "11111",
"user_ip": "127.0.0.1",
"user_email": "johndoe@test.com",
"user_phone": "+123456789012"
},
"card": {
"card_holder": "John Doe",
"brand": "VISA",
"bank": "TEST BANK",
"level": "CLASSIC",
"type": "DEBIT",
"bin": "400002",
"last": "1234",
"exp_month": "06",
"exp_year": "2023"
},
"bank": {
"id": 1,
"authcode": "111737",
"time": 1532542316.3496
},
"time": 1520447215.4163,
"token": "54817d79-8b5c-4c6f-a266-7f2264ed02ad",
"transaction_unique_id": "accept.1420447212.1505680771",
"pares": "",
"code": 0,
"message": "SUCCESS"
}
],
"status": "success",
"code": 0,
"message": "Transaction processed successfully"
}

QoD Request format

  • JSON-request
    To use JSON type a request header should contain “Content-Type: application/json”, request content should be transmitted as a json-object

Request parameters:

Parameter nameRequiredFormat and ruleDescription
api_versionYesfloat (1)
Possible value: 1
API version
merchant_accountYesstring (6-32)Merchant account
merchant_passwordYesstring (6-32)Account password
time_fromYesstring (unix timestamp)Processing transaction time FROM
time_toYesstring (unix timestamp)Processing transaction time TO
qod_typeYesstring
Possible value: transactions
Transaction types is used for the request: transactions
orderno1string
Possible values: acs, desc
Ordering ASC (by default)/DESC
pageno2string (1-12)Fetching page number. If response contains transactions quantity more than limit, paged fetching is possible. A page contains the Limited number of records (Limit).
limitno3string (1-1000)Quantity of the fetched transactions. 1000 by default. Can’t be greater than 1000