Pay By Link API
Last updated
Last updated
Documentation below describes:
api url values
required headers
authentication header
environment | value |
---|---|
NOTE Parametrize api url value.
name | value | description |
---|---|---|
Every request to the Monri's backend requires authentication. Depending on HTTP
method algorithm used to create Authorization
header differs.
To create authorization header you'll need:
merchant_key
(available on merchant’s dashboard)
authenticity_token
(available on merchant’s dashboard)
Authorization header for GET|POST
request is created from:
Digest generation
Digest example
If we have:
url: https://ipgtest.monri.com/v2/terminal-entry/create-or-update
method: POST
fullpath is then: /v2/terminal-entry/create-or-update
merchant_key: qwert1234
timestamp: 1593457122
authenticity_token: 7db11ea5d4a1af32421b564c79b946d1ead3daf0
body:
Then we create digest as:
You can check digest on this link Calculate Digest
Monri's API adheres to following principles:
status
field is always in response and has values:
If response code is 2**
: Request is accepted and processed, response is returned
If response code is 401
: Authorization failed, there's probably an issue with Authorization
header
If response code is 400
: Request processing failure, eg. attempted to create resource with invalid amount
Example of valid response:
Example of invalid-request
response:
Example of error
response:
Every resource on Monri's API has idempotency key used for create-or-update
action. Idempotency key for PayByLink is order_number
. To update resource previously created simply provided same order_number
.
To create PayByLink you'll need to provide:
Valid Authorization
header (see above how to create one)
Required fields (described below)
Request endpoint details
Request body:
Supported payment methods
supported_payment_methods
in an array of valid payment methods
Valid payment method is:
pan token - Secure Vault Tokens.
or a card
Functionality:
If saved card is provided and valid (card(s) not expired, valid token(s) etc) then only cvv input will be shown on the payment form.
All other information (masked pan, expiry date etc) will be pre filled.
Multiple tokens can be sent. In that case, the user will have an option which card to use.
It's possible to send card
payment method which will offer payment with a new card to the buyer
Request body example
CHARGED there's approved transaction authorization for order_number
, with transaction_type authorize
or purchase
NOT CHARGED there's no approved transaction authorization, with transaction_type authorize
or purchase
for order_number
Example of response:
To retrieve previously created PayByLink you'll need to provide:
Valid Authorization
header (see above how to create one)
Create resource beforehand
Provide valid resource order-number
Response is same as create-or-update
response, only difference is status
which is always approved
(if request is valid).
To deactivate/activate previously created PayByLink you'll need to provide:
Valid Authorization
header (see above how to create one)
Create resource beforehand
Provide expires_at
Response is same as create-or-update
response. Active
field shows current status.
name | value | description |
---|---|---|
name | value | description |
---|---|---|
status | status code | description |
---|---|---|
name | value | description |
---|---|---|
field | length | type | required | updateable | description |
---|---|---|---|---|---|
field | length | type | description |
---|---|---|---|
name | value | description |
---|---|---|
name | value | description |
---|---|---|
test
https://ipgtest.monri.com
prod
https://ipg.monri.com
Content-Type
application/json
All api endpoints require application/json
Content-Type header
Accept
application/json
All api endpoints require application/json
Accept header
Authorization
<authorization_header>
All api endpoints require Authorization
header. See below how to generate one
schema
WP3-v2.1
authenticity_token
<authenticity_token>
Available on merchant's dashboard
timestamp
<timestamp>
Unix timestamp, eg PHP's time()
digest
<digest>
See docs for digest generation
merchant_key
<merchant_key>
Value available on merchant's dashboard
timestamp
<timestamp>
Same timestamp value used in authorization header
authenticity_token
<authenticity_token>
Value available on merchant's dashboard
fullpath
<fullpath>
Full path of request, eg, /v2/terminal-entries/create-or-update
body
<body>
Empty string if GET
request, request body if POST
request
created
200
Resource is created
updated
200
Resource is updated
approved
200
Request successful
invalid-request
4**
There's something wrong with request
error
500
Something went wrong while processing the request
base_url
ipgtest.monri.com
or ipg.monri.com
Parametrize this value
path
v2/terminal-entry/create-or-update
This path is used for both create and update action
method
POST
We are creating/updating resource, hence POST
method
amount
1-11
Integer
YES
YES
amount is in minor units, ie. 10.24 USD is sent as 1024
currency
3
String
YES
YES
One of supported currencies (BAM, EUR, USD, CHF etc)
order_number
2-40
String
YES
NO
Unique order identifier
transaction_type
enum
String
YES
YES
possible values are: authorize
or purchase
order_info
3-100
String
YES
YES
Short description of order being processed
number_of_installments
1-2
Integer
NO
YES
range 2-12
supported_payment_methods
predefined
Array<String>
NO
YES
An array of payment methods, pan token or card
(see below for more details)
status
enum
String
NO
YES
buyer's full name
ch_address
3-100
String
NO
YES
buyer's address
ch_city
3-30
String
NO
YES
buyer's city
ch_zip
3-9
String
NO
YES
buyer's zip
ch_country
2-3
String
NO
YES
buyer’s country in alpha2, alpha3 letter code or 3 digit ISO numeric code
ch_phone
3-30
String
NO
YES
buyer's phone
ch_email
3-100
String
NO
YES
buyer's email
language
predefined
String
NO
YES
used for errors localization, possible values are en, es, ba or hr
tokenize_pan_offered
predefined
boolean
NO
YES
offer the client to tokenize his PAN
tokenize_pan
predefined
boolean
NO
YES
tokenize PAN when the client enters it
expires_at
ISO 8601 date-time
String
NO
YES
expiration time, eg: "2021-09-26T07:58:30.996+0200"
success_url_override
predefined
String
NO
YES
Your custom success URL
cancel_url_override
predefined
String
NO
YES
Your custom cancel URL
callback_url_override
predefined
String
NO
YES
Your callback URL
status
enum
String
buyer's full name
id
1-11
Integer
Resource id
amount
1-11
Integer
amount is in minor units, ie. 10.24 USD is sent as 1024
currency
3
String
One of supported currencies (BAM, EUR, USD, CHF etc)
order_number
2-40
String
Unique order identifier
transaction_type
enum
String
possible values are: authorize
or purchase
order_info
3-100
String
Short description of order being processed
number_of_installments
1-2
Integer
range 2-12
ch_address
3-100
String
buyer's address
ch_city
3-30
String
buyer's city
ch_zip
3-9
String
buyer's zip
ch_country
2-3
String
buyer’s country in alpha2, alpha3 letter code or 3 digit ISO numeric code
ch_phone
3-30
String
buyer's phone
ch_email
3-100
String
buyer's email
language
predefined
String
used for errors localization, possible values are en, es, ba or hr
payment_url
predefined
String
Order's link, send this url to the buyer/customer
terminal_entry_status
enum
String
pending
if not charged*, approved
if charged*, expired
if entry is no longer active
created_at
predefined
DateTime
ISO UTC timestamp
updated_at
predefined
DateTime
ISO UTC timestamp
supported_payment_methods
predefined
Array<String>
An array of payment methods. An empty array if none provided.
tokenize_pan_offered
predefined
boolean
offer the client to tokenize his PAN
tokenize_pan
predefined
boolean
tokenize PAN when the client enters it
expires_at
ISO 8601 date-time
String
expiration time, eg: "2021-09-26T07:58:30.996+0200"
base_url
ipgtest.monri.com
or ipg.monri.com
Parametrize this value
path
/v2/terminal-entry/<order-number>/show
order-number
of previously created resource
method
GET
We are retrieving resource, hence GET
base_url
ipgtest.monri.com
or ipg.monri.com
Parametrize this value
path
/v2/terminal-entry/create-or-update
This path is used for both create and update action
method
POST
We are updating resource, hence POST
method