API integration by POST:


URL EndPoint:

https://ifthenpay.com/api/gateway/paybylink/[GATEWAY_KEY]


* replace [GATEWAY_KEY] with the GatewayKey sent by Ifthenpay.


Request json format (Body)

{

  "id": "1234",

  "amount": "21.50",

  "description": "Order 1234",

  "lang": "en",

  "expiredate": "",

  "accounts": "MBWAY|XXX-000000;11686|000;MB|BEM-700700;...",

  "btnCloseUrl": "http://url.com",

  "btnCloseLabel": "Text Button",

}


id: (mandatory) Maximum 15 numeric characters that identify your order/invoice. If you gateway for PayByLink use Offline Multibanco Reference method you can only use 4 numeric characters

amount: (mandatory ) Decimal separator "." (ex: "21.50")

description: (optional) Short description of payment. Maximum 200 characters.

lang: (optional) Language presented to the customer at checkout (pt, en, es, fr). Default "pt". 

expiredate: (optional) Expiry date of url in YYYYMMDD format (20211203) 

accounts: (optional) Available methods for payment. (ex: ENTITY|SUBENTITY;MBWAY|MBWAY-KEY;PAYSHOP|PAYSHOP-KEY;CCARD|CCARD-KEY;MB|MB-)


The EndPoint result is the url for gateway payment:

Example: https://gateway.ifthenpay.com/url/onkqPIMib0


API integration by GET:


URL EndPoint:

https://ifthenpay.com/api/gateway/paybylink/get?gatewaykey=[GATEWAY_KEY]&id=[ORDER_ID]&amount=[AMOUNT]&description=[DESCRIPTION]&lang=[LANGUAGE]&expiredate=[EXPIRE_DATE]&accounts=[ACCOUNTS]


gatewaykey: (mandatory ) Gateway Key sent by Ifthenpay.

id: (mandatory) Maximum 15 numeric characters that identify your order/invoice.  If you gateway for PayByLink use Offline Multibanco Reference method you can only use 4 numeric characters 

amount: (mandatory ) Decimal separator "." (ex: "21.50")

description: (optional) Short description of payment. Maximum 200 characters.

lang: (optional) Language presented to the customer at checkout (pt, en, es, fr). Default "pt". 

expiredate: (optional) Expiry date of url in YYYYMMDD format (20211203) 

accounts: (optional) Available methods for payment. (ex: ENTITY|SUBENTITY;MBWAY|MBWAY-KEY;PAYSHOP|PAYSHOP-KEY;CCARD|CCARD-KEY)


The EndPoint result is the url for gateway payment:

Example: https://gateway.ifthenpay.com/url/onkqPIMib0



CALLBACK (Webhook) :


You can define with ifthenpay a callback url endpoint and a antiphishing key. Evertime a payment is done, ifthenpay call that url and you can read the payment information on it:


Callback example :  

http://www.yoursite.com/callback.php?key=[ANTI_PHISHING_KEY]&id=[ID]&amount=[AMOUNT]&payment_datetime=[PAYMENT_DATETIME]&payment_method=[PAYMENT_METHOD]



Callback invoked example:

http://www.yoursite.com/callback.php?key=my_anti_phishing_key&id=1234&amount=21.50&payment_datetime=28-10-2021 10:55:21&payment_method=CCARD


Support:


IFTHENPAY guarantees free technical assistance to all customers and the following channels can be used:


- Through the email suporte@ifthenpay.com

- By telephone: 808 222 777 | +351 227 660 871

- By opening a ticket in helpdesk