Offline shop

Introduction

Revo provides a deferred payment service for customers of online stores and stationery (offline) stores.

The document defines the offline payment method in merchant stores. Registration of a new transaction is carried out in the store using the Revo API.

 

Process

 

  1. When paying in the store, the buyer chooses deferred payment for purchases from Mokka.
  2. The Buyer’s personal data is transferred to the Revo system.
  3. The Revo system verifies the financial credibility of the Buyer.
  4. Positive verification allows the customer to choose the repayment period depending on the adopted business assumptions.
  5. The buyer chooses the repayment option: within 30 days or divides them into installments, depending on the business assumptions made.
  6. A barcode is generated on the screen, which the seller can scan or enter by hand

 

Integration

Test server address (base URL): https://stage-backend.revoplus.pl

Revo API is based on the REST architecture. Communication is carried out using the HTTPS protocol (POST / GET / PUT methods), the data is exchanged in the JSON format.

Authentication

Revo API requires authentication for all HTTPS methods used in the process. In API 1.1, it is required to pass a parameter in the Authorization header. The type of authorisation is “API Key” and the key name is “Authorization”. The value is the authentication token generated in response to the first request: Create agent session

API queries used in the new customer process

  1. Create agent session

 

Address URL: https://stage-backend.revoplus.pl/api/loans/v1/sessions

 

In order to create a new agent session, you must provide Revo with the basic agent data. After correct verification, an authentication token will be provided in the response.

 

Request input parameters (HTTPS POST):

Parameter name

Type

Required

Description

user

Object

yes

Agent credentials

  • login

string

yes

Agent’s email provided by Revo

  • password

string

yes

Agent’s password provided by Revo

 

Sample request:

 

curl –location –request POST ‘https://stage-backend.revoplus.pl/api/loans/v1/sessions
–header ‘Content-Type: application/json’
–header ‘Cookie: _revoplus_core_session=eyJzZXNzaW9uX2lkIjoiY2RmZDk3NDAzZDQ0ZjMwMDUzMTg1NjEyYzNmMjlkNzgiLCJwcm9maWxpbmdfcmVmZXJlbmNlX2V4cGlyZXNfYXQiOiIyMDIxLTA3LTA3VDIzOjQzOjMzLjkzMSswMjowMCIsInByb2ZpbGluZ19yZWZlcmVuY2UiOiI0YmMyNjRhNDBkNGY2NzI1NjRkZWZlYjFkY2Y3ZTkwOCJ9–1d62ee1d6fb2f913e2585fc5f97a4edb98e90959’
–data-raw ‘{
“user”: {
“login”: “kontakt@test.pl”,
“password”: “1111”
    }
}’

 

Request output parameters (HTTPS POST):

 

In response, Revo returns the authentication token used for further communication with the Revo environment.

 

Sample server response:

HTTPS 200 OK
{
“user”: {
“authentication_token”: “a44958ef2d2f3fcb8f67”
    }
}

The token will be used in EVERY subsequent query as an authentication token in the Authorization header.

 

  1. Obtaining information about the agent

 

Address URL: https://stage-backend.revoplus.pl/api/loans/v1/agent

 

In order to get information about a specific agent, you must provide an authentication token generated in the previous request.

Request input parameters (HTTPS GET):

Parameter name

Type

Required

Description

n/a

n/a

n/a

n/a

 

Sample request:

 

curl –location –request GET ‘https://stage-backend.revoplus.pl/api/loans/v1/agent’
–header ‘Authorization: f5243da19ca2464ff269’
–header ‘Cookie: _revoplus_core_session=eyJzZXNzaW9uX2lkIjoiY2RmZDk3NDAzZDQ0ZjMwMDUzMTg1NjEyYzNmMjlkNzgiLCJwcm9maWxpbmdfcmVmZXJlbmNlX2V4cGlyZXNfYXQiOiIyMDIxLTA3LTA3VDIzOjQzOjMzLjkzMSswMjowMCIsInByb2ZpbGluZ19yZWZlcmVuY2UiOiI0YmMyNjRhNDBkNGY2NzI1NjRkZWZlYjFkY2Y3ZTkwOCJ9–1d62ee1d6fb2f913e2585fc5f97a4edb98e90959’

 

Request output parameters (HTTPS GET):

 

In response to the / api / loans / v1 / agent method call, Revo returns information about the agent in the form of JSON

Sample server response:

 

HTTPS 200 OK
{
“agent”: {
“first_name”: “Test”,
“last_name”: “Testsur”,
“avatar”: “https://stage-backend.revoplus.pl/avatars/original/missing.png”,
“stores”: [
            {
“store”: {
“id”: 111,
“name”: “Test”,
“name_by_trader”: “”,
“address”: “, , Warszawa, Warszawa”,
“tariff_min”: 0.0,
“tariff_max”: 9999.99
                }
            }
        ]
    }
}

 

In the query, specify the authentication token that we got from the previous query.

 

The ID of the selected store will be used in the parameters of subsequent querie.

  1. Create loan request

 

Address URL: https://stage-backend.revoplus.pl/api/loans/v1/loan_requests

 

To create a new loan, please provide the following basic information: store_id, mobile_phone, amount. After correct verification, the answer will be the loan token (id).

 

Request input parameters (HTTPS POST):

Parameter name

Type

Required

Description

loan_request

Object

yes

Request data

  • store_id

string

yes

Store identificator

  • mobile_phone

string

yes

Client’s phone number

  • hold_until

string

yes

The term of validity

  • amount

float

yes

Loan amount

 

Sample request: 

 

curl –location –request POST ‘https://stage-backend.revoplus.pl/api/loans/v1/loan_requests
–header ‘Content-Type: application/json’
–header ‘Authorization: a44958ef2d2f3fcb8f67’
–data-raw ‘{
“loan_request”: {
“store_id”: “422”,
“mobile_phone”: “48333306323”,
“amount”: 640
    }
}’

 

Request output parameters (HTTPS POST):

 

In response to the / api / loans / v1 / loan_requests method call, Revo returns the loan token used to service the given loan in the form of subsequent queries.

 

Sample server response:

 

HTTPS 200 OK
{
“loan_request”: {
“token”: “a330c5d2701e316600efe4acef38e257f7229150”
    }
}

 

The token will be used in each subsequent query as a loan token in the query parameters.

  1. Get client information

 

Address URL: https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/:token/client

 

In order to obtain information about a given customer, enter the loan token in the query parameters, which will be used to check whether the customer with the given phone number exists in the Mokka register. If the server responds with an empty client object, it means that the client with the given phone number was not created. Thanks to this, we have information that will allow us to decide whether to follow the path of a new customer or an existing one.

 

Request input parameters (HTTPS GET):

Parameter name

Type

Required

Description

n/a

n/a

n/a

n/a

 

Sample request:

 

curl –location –request GET ‘https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/f7e6be5428645c374e35f7cc499347b8a3d01119/client’
–header ‘Authorization: cc382b48a6b0924b1a0b’

 

Request output parameters (HTTPS POST):

 

In response, Revo returns the “client” object, which may or may not be empty depending on the case.

 

Sample server response:

HTTPS 200 OK
{
“client”: {}
}

  1. Get document by kind

 

Address URL: https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/:token/documents/:kind

 

In order to obtain information about the document for which the customer must consent, provide a loan token in the query parameters that will be used to collect the consent. The kind parameter should have one of these values: “credit_bureaus”, “regulations”, “personal_data”, “personal_data_marketing_email”.

 

Request input parameters (HTTPS GET):

Parameter name

Type

Required

Description

n/a

n/a

n/a

n/a

 

Sample request:

 

curl –location –request GET ‘https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/a330c5d2701e316600efe4acef38e257f7229150/documents/credit_bureaus’
–header ‘Authorization: cc382b48a6b0924b1a0b’
–header ‘Cookie: _revoplus_core_session=eyJzZXNzaW9uX2lkIjoiY2RmZDk3NDAzZDQ0ZjMwMDUzMTg1NjEyYzNmMjlkNzgiLCJwcm9maWxpbmdfcmVmZXJlbmNlX2V4cGlyZXNfYXQiOiIyMDIxLTA3LTA3VDIzOjQzOjMzLjkzMSswMjowMCIsInByb2ZpbGluZ19yZWZlcmVuY2UiOiI0YmMyNjRhNDBkNGY2NzI1NjRkZWZlYjFkY2Y3ZTkwOCJ9–1d62ee1d6fb2f913e2585fc5f97a4edb98e90959’

 

Request output parameters (HTTPS POST):

 

In response, HTML with the information for the document is shown.

 

Sample server response:

HTTPS 200 OK
document info in HTML format

  1. Send confirmation code

 

Address URL: https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/:token/client/confirmation

 

In order to verify the customer, the Revo system requires confirmation with an SMS code. With the help of this function, an SMS is sent to the user. As query parameters, enter the loan token to which the customer’s phone number has been assigned.

Request input parameters (HTTPS POST):

Parameter name

Type

Required

Description

n/a

n/a

n/a

n/a

 

Sample request:

 

curl –location –request POST ‘https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/a330c5d2701e316600efe4acef38e257f7229150/client/confirmation’
–header ‘Authorization: a44958ef2d2f3fcb8f67’

 

Request output parameters (HTTPS POST):

 

In response, Revo sends server status  200 OK.

 

Sample server response:

HTTPS 200 OK

 

  1. Create client

 

Address URL: https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/:token/client

 

In order to create a customer, you must provide Revo with the basic customer data along with the SMS code that was sent to him in the previous inquiry.

 

Request input parameters (HTTPS POST):

Parameter name

Type

Required

Description

client

Object

yes

New customer’s data

  • first_name

string

yes

Client’s name

  • last_name

string

yes

Client’s surname

  • birth_date

string

yes

Date of birth in the given format dd-mm-rrrr

  • email

string

yes

Client’s email

  • confirmation_code

string

yes

Verification code sent via SMS

  • id_documents

Object

yes

Customer’s identity documents data

  • polish_id

Object

yes

Data relating ID card

  • number

string

yes

ID card number

  • polish_pesel

Object

yes

Data relating PESEL

  • number

string

yes

PESEL number

  • gdpr_acceptance

Object

yes

Regulations that the user agreed to at the beginning of the process

  • credit_bureaus

string

yes

Permission for BIK

  • regulations

string

yes

Permission to regulations

  • personal_data

string

yes

Permission to process user data

  • provider_data

Object

no

n/a

 

Sample request: 

 

curl –location –request POST ‘https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/a330c5d2701e316600efe4acef38e257f7229150/client
–header ‘Content-Type: application/json’
–header ‘Authorization: a44958ef2d2f3fcb8f67’
–header ‘Cookie: _revoplus_core_session=eyJzZXNzaW9uX2lkIjoiY2RmZDk3NDAzZDQ0ZjMwMDUzMTg1NjEyYzNmMjlkNzgiLCJwcm9maWxpbmdfcmVmZXJlbmNlX2V4cGlyZXNfYXQiOiIyMDIxLTA3LTA3VDIzOjQzOjMzLjkzMSswMjowMCIsInByb2ZpbGluZ19yZWZlcmVuY2UiOiI0YmMyNjRhNDBkNGY2NzI1NjRkZWZlYjFkY2Y3ZTkwOCJ9–1d62ee1d6fb2f913e2585fc5f97a4edb98e90959’
–data-raw ‘{
“client”: {
“first_name”: “Filip”,
“last_name”: “TestRevo”,
“birth_date”: “09-07-1920”,
“confirmation_code”: “1111”,

“email”: “test@revo.pl”,
“id_documents”: {
“polish_id”: {
“number”: “OWK104876”
            },
“polish_pesel”: {
“number”: “20070942507”
            }
        },
“gdpr_acceptance”: {
“credit_bureaus”: “1”,
“regulations”: “1”,
“personal_data”: “1”
},
“provider_data”: {}
    }
}’

 

Request output parameters (HTTPS POST):

 

A response from the server 200 OK status and the data of the created client.

 

Sample server response:

HTTPS 200 OK
{
“client”: {
“email”: “test@revo.pl”,
“apartment”: “27”,
“area”: “Warszawa”,
“birth_date”: “09-07-1920”,
“building”: null,
“credit_limit”: “50000.0”,
“first_name”: “Filip”,
“house”: “2”,
“id_documents”: {
“polish_id”: {
“number”: “OWK104876”
            },
“polish_pesel”: {
“number”: “20070942507”
            }
        },
“is_repeated”: false,
“kyc_passed”: true,
“last_name”: “TestRevo”,
“middle_name”: “”,
“missing_documents”: [],
“postal_code”: “03-137”,
“rcl_accepted”: false,
“settlement”: “Warszawa”,
“street”: “Grzybowska”,
“decision”: “approved”,
“credit_decision”: “approved”,
“decision_code”: 210,
“decision_message”: “Gratulacje! Twój limit na zakupy z Mokka wynosi 50000.0”
    }
}

  1. Get tariff information

 

Adress URL: https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/:token?amount={amount}

 

In order to obtain information on possible tariffs and to calculate installments, the loan token and the loan value should be transferred to the Revo system as query parameters.

Request input parameters (HTTPS GET):

 

Parameter name

Type

Required

Description

n/a

n/a

n/a

n/a

 

Sample request: 

 

curl –location –request GET ‘https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/095d5500a90bc1f2dfa28c363f1f9ea0cd229c6e?amount=333’
–header ‘Authorization: 7144b49154c555f40b42’

Request output parameters (HTTPS GET):

 

The response from the server is the status 200 OK and information about possible repayment periods. After the client selects the tariff, keep the value “term_id”, which will be used in the future query.

 

Sample server response:

HTTPS 200 OK
{
“loan_request”: [
        {
“max_amount”: 0.0,
“min_amount”: 50.0,
“monthly_payment”: 126.0,
“product_code”: “”,
“schedule”: [
                {
“date”: “01-07-2021”,
“amount”: 126.0
                },
                {
“date”: “31-07-2021”,
“amount”: 126.0
                },
                {
“date”: “30-08-2021”,
“amount”: 126.0
                }
            ],
“sum_with_discount”: 333.0,
“tariff_product_kind”: “installments_pl”,
“term”: 3,
“term_id”: 173,
“total_of_payments”: 378.0,
“total_overpayment”: 45.0,
“bnpl”: {
“term”: 30,
“date_of_first_payment”: “01-07-2021”
            }
        },
        {
“max_amount”: 0.0,
“min_amount”: 65.0,
“monthly_payment”: 121.0,
“product_code”: “”,
“schedule”: [
                {
“date”: “01-07-2021”,
“amount”: 121.0
                },
                {
“date”: “01-08-2021”,
“amount”: 121.0
                },
                {
“date”: “01-09-2021”,
“amount”: 121.0
                }
            ],
“sum_with_discount”: 333.0,
“tariff_product_kind”: “installments_pl”,
“term”: 3,
“term_id”: 176,
“total_of_payments”: 363.0,
“total_overpayment”: 30.0
        },
        {
“max_amount”: 0.0,
“min_amount”: 50.0,
“monthly_payment”: 27.75,
“product_code”: “”,
“schedule”: [
                {
“date”: “01-07-2021”,
“amount”: 27.75
                },
                {
“date”: “01-08-2021”,
“amount”: 27.75
                },
                {
“date”: “01-09-2021”,
“amount”: 27.75
                },
                {
“date”: “01-10-2021”,
“amount”: 27.75
                },
                {
“date”: “01-11-2021”,
“amount”: 27.75
                },
                {
“date”: “01-12-2021”,
“amount”: 27.75
                },
                {
“date”: “01-01-2022”,
“amount”: 27.75
                },
                {
“date”: “01-02-2022”,
“amount”: 27.75
                },
                {
“date”: “01-03-2022”,
“amount”: 27.75
                },
                {
“date”: “01-04-2022”,
“amount”: 27.75
                },
                {
“date”: “01-05-2022”,
“amount”: 27.75
                },
                {
“date”: “01-06-2022”,
“amount”: 27.75
                }
            ],
“sum_with_discount”: 333.0,
“tariff_product_kind”: “installments_pl”,
“term”: 12,
“term_id”: 191,
“total_of_payments”: 333.0,
“total_overpayment”: 0.0
        }
    ]
}

 

  1. Update loan request amount (optional)

 

Address URL: https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/:token

 

In order to change the loan amount, the new value must be transferred to the Revo system. The loan token must be provided in the query parameters.

Request input parameters (HTTPS PUT):

 

Parameter name

Type

Required

Description

loan_request

Object

yes

Basic loan details

  • mobile_phone

string

yes

The phone number assigned to the loan being updated

  • amount

string

yes

New loan amount

  • agree_insurance

string

yes

n/a

 

Sample request: 

 

curl –location –request PUT ‘https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/40329db7dd87c0f8e9abab6d3316a31b10330d51
–header ‘Content-Type: application/json’
–header ‘Authorization: 42d599f96bb8e58e0de7’
–data-raw ‘{
“loan_request”: {
“mobile_phone”: “48333306313”,
“amount”: “1399.00”,
“agree_insurance”: 1
    }
}’

 

Request output parameters (HTTPS PUT):

 

The response from the server is 200 OK.

Sample server response:

 

HTTPS 200 OK

  1. Create approved loan

 

Address URL: https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/:token/loan

 

In order to change the status of a loan to approved, the loan token parameter and the “term_id” value from the response of Get tariff information should be sent to the Revo system

Request input parameters (HTTPS POST):

 

Parameter name

Type

Required

Description

term_id

string

yes

Tariff’s identificator

 

Sample request: 

curl –location–requestPOST ‘https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/efb2f487b6b08c2d7ccdc8bcc1079623e4d373c3/loan’
–header‘Content-Type: application/json’
–header‘Authorization: 6084026fd2c7d84e8e92’
–data-raw‘{
  “term_id”: 173
}’

 

Request output parameters (HTTPS POST):

 

The response from the server 200 OK status.

 

Sample server response:

HTTPS 200 OK

  1. Send confirmation code

 

Address URL: https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/:token/client/confirmation

 

In order to confirm the loan, the Revo system requires confirmation with an SMS code. With the help of this function, an SMS is sent to the user. As query parameters, enter the loan token to which the customer’s phone number has been assigned.

Request input parameters (HTTPS POST):

 

Parameter name

Type

Required

Description

n/a

n/a

n/a

n/a

 

Sample request:

 

curl –location –request POST ‘https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/a330c5d2701e316600efe4acef38e257f7229150/client/confirmation’
–header ‘Authorization: a44958ef2d2f3fcb8f67’

 

Request output parameters (HTTPS POST):

 

In response, Revo sends server status  200 OK.

 

Sample server response:

HTTPS 200 OK

  1. Finalize loan

 

Address URL: https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/:token/loan/finalization

 

In order to finalize a loan in the Revo system, the loan token must be provided in the query parameters.

Request input parameters (HTTPS POST):

 

Parameter name

Type

Required

Description

loan

Object

tak

Additional loan details needed to finalize the loan

  • agree_processing

string

tak

n/a

  • confirmation_code

string

tak

Confirmation code sent to the customer’s phone number

  • agree_sms_info

boolean

tak

n/a

 

Sample request: 

 

curl –location –request POST ‘https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/a16cf56ead21630e67f39beb16912b4215b50f47/loan/finalization
–header ‘Content-Type: application/json’
–header ‘Authorization: 6084026fd2c7d84e8e92’
–header ‘Cookie: _revoplus_core_session=eyJzZXNzaW9uX2lkIjoiY2RmZDk3NDAzZDQ0ZjMwMDUzMTg1NjEyYzNmMjlkNzgiLCJwcm9maWxpbmdfcmVmZXJlbmNlX2V4cGlyZXNfYXQiOiIyMDIxLTA3LTA3VDIzOjQzOjMzLjkzMSswMjowMCIsInByb2ZpbGluZ19yZWZlcmVuY2UiOiI0YmMyNjRhNDBkNGY2NzI1NjRkZWZlYjFkY2Y3ZTkwOCJ9–1d62ee1d6fb2f913e2585fc5f97a4edb98e90959’
–data-raw ‘{
“loan”: {
“agree_processing”: “1”,
“confirmation_code”: “1111”,
“agree_sms_info”: true
    }
}’

 

Request output parameters (HTTPS POST):

 

The response from the server is 200 OK and a barcode (loan ID).

Sample server response:

HTTPS 200 OK
{
“loan_application”: {
“barcode”: “10PL02000000test3393674248”
    }
}

API requests used in the process for an existing customer

  1. Create agent session

 

Address URL: https://stage-backend.revoplus.pl/api/loans/v1/sessions

 

In order to create a new agent session, you must provide Revo with the basic agent data. After correct verification, an authentication token will be provided in the response.

 

Request input parameters (HTTPS POST):

 

Parameter name

Type

Required

Description

user

Object

yes

Agent credentials

  • login

string

yes

Agent’s email provided by Revo

  • password

string

yes

Agent’s password provided by Revo

Sample request:

 

curl –location –request POST ‘https://stage-backend.revoplus.pl/api/loans/v1/sessions
–header ‘Content-Type: application/json’
–header ‘Cookie: _revoplus_core_session=eyJzZXNzaW9uX2lkIjoiY2RmZDk3NDAzZDQ0ZjMwMDUzMTg1NjEyYzNmMjlkNzgiLCJwcm9maWxpbmdfcmVmZXJlbmNlX2V4cGlyZXNfYXQiOiIyMDIxLTA3LTA3VDIzOjQzOjMzLjkzMSswMjowMCIsInByb2ZpbGluZ19yZWZlcmVuY2UiOiI0YmMyNjRhNDBkNGY2NzI1NjRkZWZlYjFkY2Y3ZTkwOCJ9–1d62ee1d6fb2f913e2585fc5f97a4edb98e90959’
–data-raw ‘{
“user”: {
“login”: “kontakt@test.pl”,
“password”: “1111”
    }
}’

 

Request output parameters (HTTPS POST):

 

In response, Revo returns the authentication token used for further communication with the Revo environment.

 

Sample server response:

HTTPS 200 OK
{
“user”: {
“authentication_token”: “a44958ef2d2f3fcb8f67”
    }
}

The token will be used in EVERY subsequent query as an authentication token in the Authorization header.

 

  1. Obtaining information about the agent

 

Address URL: https://stage-backend.revoplus.pl/api/loans/v1/agent

 

In order to get information about a specific agent, you must provide an authentication token generated in the previous request.

Request input parameters (HTTPS GET):

Parameter name

Type

Required

Description

n/a

n/a

n/a

n/a

 

Sample request:

 

curl –location –request GET ‘https://stage-backend.revoplus.pl/api/loans/v1/agent’
–header ‘Authorization: f5243da19ca2464ff269’
–header ‘Cookie: _revoplus_core_session=eyJzZXNzaW9uX2lkIjoiY2RmZDk3NDAzZDQ0ZjMwMDUzMTg1NjEyYzNmMjlkNzgiLCJwcm9maWxpbmdfcmVmZXJlbmNlX2V4cGlyZXNfYXQiOiIyMDIxLTA3LTA3VDIzOjQzOjMzLjkzMSswMjowMCIsInByb2ZpbGluZ19yZWZlcmVuY2UiOiI0YmMyNjRhNDBkNGY2NzI1NjRkZWZlYjFkY2Y3ZTkwOCJ9–1d62ee1d6fb2f913e2585fc5f97a4edb98e90959’

 

Request output parameters (HTTPS GET):

 

In response to the / api / loans / v1 / agent method call, Revo returns information about the agent in the form of JSON

Sample server response:

 

HTTPS 200 OK
{
“agent”: {
“first_name”: “Test”,
“last_name”: “Testsur”,
“avatar”: “https://stage-backend.revoplus.pl/avatars/original/missing.png”,
“stores”: [
            {
“store”: {
“id”: 111,
“name”: “Test”,
“name_by_trader”: “”,
“address”: “, , Warszawa, Warszawa”,
“tariff_min”: 0.0,
“tariff_max”: 9999.99
                }
            }
        ]
    }
}

 

In the query, specify the authentication token that we got from the previous query.

 

The ID of the selected store will be used in the parameters of subsequent queries.

  1. Create loan request

 

Address URL: https://stage-backend.revoplus.pl/api/loans/v1/loan_requests

 

To create a new loan, please provide the following basic information: store_id, mobile_phone, amount. After correct verification, the answer will be the loan token (id).

 

Request input parameters (HTTPS POST):

Parameter name

Type

Required

Description

loan_request

Object

yes

Request data

  • store_id

string

yes

Store identificator

  • mobile_phone

string

yes

Client’s phone number

  • hold_until

string

yes

The term of validity

  • amount

float

yes

Loan amount

 

Sample request: 

 

curl –location –request POST ‘https://stage-backend.revoplus.pl/api/loans/v1/loan_requests
–header ‘Content-Type: application/json’
–header ‘Authorization: a44958ef2d2f3fcb8f67’
–data-raw ‘{
“loan_request”: {
“store_id”: “422”,
“mobile_phone”: “48333306323”,
“amount”: 640
    }
}’

 

Request output parameters (HTTPS POST):

 

In response to the / api / loans / v1 / loan_requests method call, Revo returns the loan token used to service the given loan in the form of subsequent queries.

 

Sample server response:

 

HTTPS 200 OK
{
“loan_request”: {
“token”: “a330c5d2701e316600efe4acef38e257f7229150”
    }
}

 

The token will be used in each subsequent query as a loan token in the query parameters.

  1. Get client information

 

Address URL: https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/:token/client

 

In order to obtain information about a given customer, enter the loan token in the query parameters, which will be used to check whether the customer with the given phone number exists in the Mokka register. If the server responds with an empty client object, it means that the client with the given phone number was not created. Thanks to this, we have information that will allow us to decide whether to follow the path of a new customer or an existing one.

 

Request input parameters (HTTPS GET):

Parameter name

Type

Required

Description

n/a

n/a

n/a

n/a

 

Sample request:

 

curl –location –request GET ‘https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/f7e6be5428645c374e35f7cc499347b8a3d01119/client’
–header ‘Authorization: cc382b48a6b0924b1a0b’

 

Request output parameters (HTTPS POST):

 

In response, Revo returns the “client” object, which may or may not be empty depending on the case.

 

Sample server response:

HTTPS 200 OK
{
“client”: {}
}

  1. Send confirmation code

 

Address URL: https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/:token/client/confirmation

 

In order to verify the customer, the Revo system requires confirmation with an SMS code. With the help of this function, an SMS is sent to the user. As query parameters, enter the loan token to which the customer’s phone number has been assigned.

Request input parameters (HTTPS POST):

Parameter name

Type

Required

Description

n/a

n/a

n/a

n/a

 

Sample request:

 

curl –location –request POST ‘https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/a330c5d2701e316600efe4acef38e257f7229150/client/confirmation’
–header ‘Authorization: a44958ef2d2f3fcb8f67’

 

Request output parameters (HTTPS POST):

 

In response, Revo sends server status  200 OK.

 

Sample server response:

HTTPS 200 OK

  1. Confirm client

 

Address URL: https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/:token/confirmation

 

When verifying the correctness of the SMS code provided by the customer already existing in the Revo system, the customer should be approved by sending the SMS code in the body of the inquiry and the loan token as a parameter.

 

Request input parameters (HTTPS POST):

Parameter name

Type

Required

Description

code

string

yes

Confirmation code sent to clients phone number

 

Sample request: 

 

curl –location –request POST ‘https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/66e6964009b3037061f1b04411e2dc9c5c3728e3/confirmation’
–header ‘Content-Type: application/json’
–header ‘Authorization: cc382b48a6b0924b1a0b’
–data-raw ‘{
    “code”: “1111”
}’

 

Request output parameters (HTTPS POST):

 

The response of the server is 200 OK and customer data.

 

Sample server response:

 

HTTPS 200 OK
{
“client”: {
“first_name”: “Tomek”,
“middle_name”: “”,
“last_name”: “Zrevotest”,
“credit_limit”: “48002.0”,
“kyc_passed”: true,
“decision”: “approved”,
“decision_code”: 210,
“decision_message”: “Gratulacje! Twój limit na zakupy z Mokka wynosi 440.0”
  }
}

  1. Get tariff information

 

Adress URL: https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/:token?amount={amount}

 

In order to obtain information on possible tariffs and to calculate installments, the loan token and the loan value should be transferred to the Revo system as query parameters.

Request input parameters (HTTPS GET):

 

Parameter name

Type

Required

Description

n/a

n/a

n/a

n/a

 

Sample request: 

 

curl –location –request GET ‘https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/095d5500a90bc1f2dfa28c363f1f9ea0cd229c6e?amount=333’
–header ‘Authorization: 7144b49154c555f40b42’

Request output parameters (HTTPS GET):

 

The response from the server is the status 200 OK and information about possible repayment periods. After the client selects the tariff, keep the value “term_id”, which will be used in the future query.

 

Sample server response:

HTTPS 200 OK
{
“loan_request”: [
        {
“max_amount”: 0.0,
“min_amount”: 50.0,
“monthly_payment”: 126.0,
“product_code”: “”,
“schedule”: [
                {
“date”: “01-07-2021”,
“amount”: 126.0
                },
                {
“date”: “31-07-2021”,
“amount”: 126.0
                },
                {
“date”: “30-08-2021”,
“amount”: 126.0
                }
            ],
“sum_with_discount”: 333.0,
“tariff_product_kind”: “installments_pl”,
“term”: 3,
“term_id”: 173,
“total_of_payments”: 378.0,
“total_overpayment”: 45.0,
“bnpl”: {
“term”: 30,
“date_of_first_payment”: “01-07-2021”
            }
        },
        {
“max_amount”: 0.0,
“min_amount”: 65.0,
“monthly_payment”: 121.0,
“product_code”: “”,
“schedule”: [
                {
“date”: “01-07-2021”,
“amount”: 121.0
                },
                {
“date”: “01-08-2021”,
“amount”: 121.0
                },
                {
“date”: “01-09-2021”,
“amount”: 121.0
                }
            ],
“sum_with_discount”: 333.0,
“tariff_product_kind”: “installments_pl”,
“term”: 3,
“term_id”: 176,
“total_of_payments”: 363.0,
“total_overpayment”: 30.0
        },
        {
“max_amount”: 0.0,
“min_amount”: 50.0,
“monthly_payment”: 27.75,
“product_code”: “”,
“schedule”: [
                {
“date”: “01-07-2021”,
“amount”: 27.75
                },
                {
“date”: “01-08-2021”,
“amount”: 27.75
                },
                {
“date”: “01-09-2021”,
“amount”: 27.75
                },
                {
“date”: “01-10-2021”,
“amount”: 27.75
                },
                {
“date”: “01-11-2021”,
“amount”: 27.75
                },
                {
“date”: “01-12-2021”,
“amount”: 27.75
                },
                {
“date”: “01-01-2022”,
“amount”: 27.75
                },
                {
“date”: “01-02-2022”,
“amount”: 27.75
                },
                {
“date”: “01-03-2022”,
“amount”: 27.75
                },
                {
“date”: “01-04-2022”,
“amount”: 27.75
                },
                {
“date”: “01-05-2022”,
“amount”: 27.75
                },
                {
“date”: “01-06-2022”,
“amount”: 27.75
                }
            ],
“sum_with_discount”: 333.0,
“tariff_product_kind”: “installments_pl”,
“term”: 12,
“term_id”: 191,
“total_of_payments”: 333.0,
“total_overpayment”: 0.0
        }
    ]
}

  1. Update loan request amount (optional)

 

Address URL: https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/:token

 

In order to change the loan amount, the new value must be transferred to the Revo system. The loan token must be provided in the query parameters.

Request input parameters (HTTPS PUT):

 

Parameter name

Type

Required

Description

loan_request

Object

yes

Basic loan details

  • mobile_phone

string

yes

The phone number assigned to the loan being updated

  • amount

string

yes

New loan amount

  • agree_insurance

string

yes

n/a

 

Sample request: 

 

curl –location –request PUT ‘https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/40329db7dd87c0f8e9abab6d3316a31b10330d51
–header ‘Content-Type: application/json’
–header ‘Authorization: 42d599f96bb8e58e0de7’
–data-raw ‘{
“loan_request”: {
“mobile_phone”: “48333306313”,
“amount”: “1399.00”,
“agree_insurance”: 1
    }
}’

 

Request output parameters (HTTPS PUT):

 

The response from the server is 200 OK.

Sample server response:

 

HTTPS 200 OK

  1. Create approved loan

 

Address URL: https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/:token/loan

 

In order to change the status of a loan to approved, the loan token parameter and the “term_id” value from the response of Get tariff information should be sent to the Revo system

Request input parameters (HTTPS POST):

 

Parameter name

Type

Required

Description

term_id

string

yes

Tariff’s identificator

 

Sample request: 

curl –location–requestPOST ‘https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/efb2f487b6b08c2d7ccdc8bcc1079623e4d373c3/loan’
–header‘Content-Type: application/json’
–header‘Authorization: 6084026fd2c7d84e8e92’
–data-raw‘{
  “term_id”: 173
}’

 

Request output parameters (HTTPS POST):

 

The response from the server 200 OK status.

 

Sample server response:

HTTPS 200 OK

  1. Send confirmation code

 

Address URL: https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/:token/client/confirmation

 

In order to confirm the loan, the Revo system requires confirmation with an SMS code. With the help of this function, an SMS is sent to the user. As query parameters, enter the loan token to which the customer’s phone number has been assigned.

Request input parameters (HTTPS POST):

 

Parameter name

Type

Required

Description

n/a

n/a

n/a

n/a

 

Sample request:

 

curl –location –request POST ‘https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/a330c5d2701e316600efe4acef38e257f7229150/client/confirmation’
–header ‘Authorization: a44958ef2d2f3fcb8f67’

 

Request output parameters (HTTPS POST):

 

In response, Revo sends server status  200 OK.

 

Sample server response:

HTTPS 200 OK

  1. Finalize loan

 

Address URL: https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/:token/loan/finalization

 

In order to finalize a loan in the Revo system, the loan token must be provided in the query parameters.

Request input parameters (HTTPS POST):

 

Parameter name

Type

Required

Description

loan

Object

tak

Additional loan details needed to finalize the loan

  • agree_processing

string

tak

n/a

  • confirmation_code

string

tak

Confirmation code sent to the customer’s phone number

  • agree_sms_info

boolean

tak

n/a

 

Sample request: 

 

curl –location –request POST ‘https://stage-backend.revoplus.pl/api/loans/v1/loan_requests/a16cf56ead21630e67f39beb16912b4215b50f47/loan/finalization
–header ‘Content-Type: application/json’
–header ‘Authorization: 6084026fd2c7d84e8e92’
–header ‘Cookie: _revoplus_core_session=eyJzZXNzaW9uX2lkIjoiY2RmZDk3NDAzZDQ0ZjMwMDUzMTg1NjEyYzNmMjlkNzgiLCJwcm9maWxpbmdfcmVmZXJlbmNlX2V4cGlyZXNfYXQiOiIyMDIxLTA3LTA3VDIzOjQzOjMzLjkzMSswMjowMCIsInByb2ZpbGluZ19yZWZlcmVuY2UiOiI0YmMyNjRhNDBkNGY2NzI1NjRkZWZlYjFkY2Y3ZTkwOCJ9–1d62ee1d6fb2f913e2585fc5f97a4edb98e90959’
–data-raw ‘{
“loan”: {
“agree_processing”: “1”,
“confirmation_code”: “1111”,
“agree_sms_info”: true
    }
}’

 

Request output parameters (HTTPS POST):

 

The response from the server is 200 OK and a barcode (loan ID).

Sample server response:

HTTPS 200 OK
{
“loan_application”: {
“barcode”: “10PL02000000test3393674248”
    }
}

API requests used in the return process

 

  1. Create agent session

 

Address URL: https://stage-backend.revoplus.pl/api/loans/v1/sessions

 

In order to create a new agent session, you must provide Revo with the basic agent data. After correct verification, an authentication token will be provided in the response.

 

Request input parameters (HTTPS POST):

 

Parameter name

Type

Required

Description

user

Object

yes

Agent credentials

  • login

string

yes

Agent’s email provided by Revo

  • password

string

yes

Agent’s password provided by Revo

Sample request:

 

curl –location –request POST ‘https://stage-backend.revoplus.pl/api/loans/v1/sessions
–header ‘Content-Type: application/json’
–header ‘Cookie: _revoplus_core_session=eyJzZXNzaW9uX2lkIjoiY2RmZDk3NDAzZDQ0ZjMwMDUzMTg1NjEyYzNmMjlkNzgiLCJwcm9maWxpbmdfcmVmZXJlbmNlX2V4cGlyZXNfYXQiOiIyMDIxLTA3LTA3VDIzOjQzOjMzLjkzMSswMjowMCIsInByb2ZpbGluZ19yZWZlcmVuY2UiOiI0YmMyNjRhNDBkNGY2NzI1NjRkZWZlYjFkY2Y3ZTkwOCJ9–1d62ee1d6fb2f913e2585fc5f97a4edb98e90959’
–data-raw ‘{
“user”: {
“login”: “kontakt@test.pl”,
“password”: “1111”
    }
}’

 

Request output parameters (HTTPS POST):

 

In response, Revo returns the authentication token used for further communication with the Revo environment.

 

Sample server response:

HTTPS 200 OK
{
“user”: {
“authentication_token”: “a44958ef2d2f3fcb8f67”
    }
}

The token will be used in EVERY subsequent query as an authentication token in the Authorization header.

  1. Get list of orders

 

Address URL: https://stage-backend.revoplus.pl/api/loans/v1/orders?store_id={store_id}&filters[mobile_phone]={phone}&filters[id_document_no]={document_id}&filters[order_id]={order_id}&filters[guid]={guid}&filters[email]={email}

 

In order to download the list of orders, you must provide at least one parameter in the inquiry. It is “store_id”. The “store_id” parameter is obligatory, it cannot be omitted. The rest of the parameters are optional.

Request input parameters (HTTPS GET):

Parameter name

Type

Required

Description

n/a

n/a

n/a

n/a

 

Sample request: 

 

curl –location -g –requestGET ‘https://stage-backend.revoplus.pl/api/loans/v1/orders?store_id=422&filters[mobile_phone]=333300378’
–header‘Authorization: f43f5e9a591c0b409fe2’
–header‘Cookie: _revoplus_core_session=eyJzZXNzaW9uX2lkIjoiY2RmZDk3NDAzZDQ0ZjMwMDUzMTg1NjEyYzNmMjlkNzgiLCJwcm9maWxpbmdfcmVmZXJlbmNlX2V4cGlyZXNfYXQiOiIyMDIxLTA3LTA3VDIzOjQzOjMzLjkzMSswMjowMCIsInByb2ZpbGluZ19yZWZlcmVuY2UiOiI0YmMyNjRhNDBkNGY2NzI1NjRkZWZlYjFkY2Y3ZTkwOCJ9–1d62ee1d6fb2f913e2585fc5f97a4edb98e90959’

 

Request output parameters (HTTPS GET):

 

In response, the Revo system returns a list “orders” with orders corresponding to the given search parameters. (described above)

Sample server response:

 

HTTPS 200 OK
{
“orders”: [
        {
“id”: 1509232,
“client_name”: “Testowytest Janusz”,
“mobile_phone”: “333300378”,
“barcode”: “1000021383002120604911”,
“created_at”: “2021-06-30T09:48:56+02:00”,
“amount”: 1383.0,
“remaining_amount”: 1383.0,
“guid”: “212060491”
        }
    ]
}

 

Order “id” will be used in further queries.

  1. Send return confirmation code

 

Address URL: https://stage-backend.revoplus.pl/api/loans/v1/orders/:id/send_return_confirmation_code

 

In order to verify the customer for a full or partial refund, the Revo system requires confirmation with an SMS code. With the help of this function, an SMS is sent to the user. As query parameters, enter the id of the order selected in the previous query.

Request input parameters (HTTPS POST):

 

Parameter name

Type

Required

Description

n/a

n/a

n/a

n/a

 

Sample request: 

 

curl –location–requestPOST ‘https://stage-backend.revoplus.pl/api/loans/v1/orders/1509232/send_return_confirmation_code’
–header‘Authorization: f43f5e9a591c0b409fe2’
–header‘Cookie: _revoplus_core_session=eyJzZXNzaW9uX2lkIjoiY2RmZDk3NDAzZDQ0ZjMwMDUzMTg1NjEyYzNmMjlkNzgiLCJwcm9maWxpbmdfcmVmZXJlbmNlX2V4cGlyZXNfYXQiOiIyMDIxLTA3LTA3VDIzOjQzOjMzLjkzMSswMjowMCIsInByb2ZpbGluZ19yZWZlcmVuY2UiOiI0YmMyNjRhNDBkNGY2NzI1NjRkZWZlYjFkY2Y3ZTkwOCJ9–1d62ee1d6fb2f913e2585fc5f97a4edb98e90959’

 

Request output parameters (HTTPS POST):

 

In response to the method call, we get a 200 OK response from the server

 

Sample server response:

 

HTTPS 200 OK

  1. Create return

 

Address URL: https://stage-backend.revoplus.pl/api/loans/v1/returns

 

The create a return query generates a refund for the amount specified by the user.

Request input parameters (HTTPS POST):

 

Parameter name

Type

Required

Description

return[order_id]

string

yes

ID of the order being returned

return[confirmation_code]

string

yes

Return confirmation code sent to client’s phone number

return[amount]

string

yes

Return amount

return[store_id]

string

yes

Identifier of the store where the return is made

Sample request: 

 

curl –location –request POST ‘https://stage-backend.revoplus.pl/api/loans/v1/returns’
–header ‘Content-Type: application/x-www-form-urlencoded’
–header ‘Authorization: f43f5e9a591c0b409fe2’
–header ‘Cookie: _revoplus_core_session=eyJzZXNzaW9uX2lkIjoiY2RmZDk3NDAzZDQ0ZjMwMDUzMTg1NjEyYzNmMjlkNzgiLCJwcm9maWxpbmdfcmVmZXJlbmNlX2V4cGlyZXNfYXQiOiIyMDIxLTA3LTA3VDIzOjQzOjMzLjkzMSswMjowMCIsInByb2ZpbGluZ19yZWZlcmVuY2UiOiI0YmMyNjRhNDBkNGY2NzI1NjRkZWZlYjFkY2Y3ZTkwOCJ9–1d62ee1d6fb2f913e2585fc5f97a4edb98e90959’
–data-urlencode ‘return[order_id]=1509232’
–data-urlencode ‘return[confirmation_code]=1111’
–data-urlencode ‘return[amount]=383’
–data-urlencode ‘return[store_id]=422’

 

Request output parameters (HTTPS POST):

 

In response to the method call, we receive a 200 OK response from the server and general information about the return: id and a barcode in alphanumeric form.

 

Sample server response:

 

HTTPS 200 OK
{
“return”: {
“id”: 592,
“barcode”: “2000020383002120604911”
  }
}

  1. Confirm return

 

Address URL: https://stage-backend.revoplus.pl/api/loans/v1/returns/:id/confirm

 

The inquiry is for the final confirmation of the return by the customer. As a parameter in the query path, we pass the return ID generated in the previous query.

Request input parameters (HTTPS POST):

Parameter name

Type

Required

Description

n/a

n/a

n/a

n/a

 

Sample request: 

 

curl –location–requestPOST ‘https://stage-backend.revoplus.pl/api/loans/v1/returns/592/confirm’
–header‘Authorization: f43f5e9a591c0b409fe2’
–header‘Cookie: _revoplus_core_session=eyJzZXNzaW9uX2lkIjoiY2RmZDk3NDAzZDQ0ZjMwMDUzMTg1NjEyYzNmMjlkNzgiLCJwcm9maWxpbmdfcmVmZXJlbmNlX2V4cGlyZXNfYXQiOiIyMDIxLTA3LTA3VDIzOjQzOjMzLjkzMSswMjowMCIsInByb2ZpbGluZ19yZWZlcmVuY2UiOiI0YmMyNjRhNDBkNGY2NzI1NjRkZWZlYjFkY2Y3ZTkwOCJ9–1d62ee1d6fb2f913e2585fc5f97a4edb98e90959’

 

Request output parameters (HTTPS POST):

 

In response to the method call, we get a 200 OK response from the server.

 

Sample server response:

 

HTTPS 200 OK

After completing this query, the refund (partial or full) should be processed.

Additional inquiries recommended by Revo

 

Signature generation

 

The following queries are authenticated by hashing sha1 (trader_id + trader_access_token). The trader_access_token parameter should be provided by Revo. The resulting signature should be placed in the header parameters under the name X-Revo-Body-Signature.

Base URL: https://stage-backend.revoplus.pl/api/softicon/v1

  1. Check barcode

 

Address URL: https://stage-backend.revoplus.pl/api/softicon/check_barcodes/:store_id?trader_id={trader_id}&barcode={barcode}

 

The method is used to get information from the Revo system about the correctness of the barcode entered or scanned by the merchant. The parameters of the method include a unique store identifier, trader identifier and an alphanumeric barcode. The encrypted signature should be indicated in the header’s parameters (see signature generation). The returned object has a status parameter that takes the values “valid” or “invalid” depending on whether the barcode is valid or not.

 

Request input parameters (HTTPS GET):

 

Parameter name

Type

Required

Description

n/a

n/a

n/a

n/a

 

Sample request: 

 

curl –location–requestGET ‘https://stage-backend.revoplus.pl/api/softicon/v1/check_barcodes/422?trader_id=470&barcode=1000021397003662427298’
–header‘X-Revo-Body-Signature: b7b33c746c6c321ebaac87cb864414e52554ee1f’

 

Request output parameters (HTTPS GET):

 

In response, we receive a response from the server 200 OK and the barcode validation status. The validation status has two possible values: “valid” or “invalid”.

 

Sample server response:

 

HTTPS 200 OK
{
“status”: “valid”
}

 

  1. Check order status

 

Address URL: https://stage-backend.revoplus.pl/api/softicon/order_statuses/:store_id?trader_id={trader_id}&barcode={barcode}

 

The method is used to download information from the Revo system about the settlement status of a given order provided by the user. As a method parameter, you should choose a unique store identifier, trader_id and an alphanumeric barcode. In the header’s parameters, indicate the encrypted signature (see signature generation). The returned object has a status parameter that takes the values ‘active’ or ‘closed’ depending on whether the settlement has been finalized or not.

 

Request input parameters (HTTPS GET):

 

Parameter name

Type

Required

Description

n/a

n/a

n/a

n/a

 

Sample request: 

 

curl –location –request GET ‘https://stage-backend.revoplus.pl/api/softicon/v1/order_statuses/422?trader_id=470&barcode=1000021397003662427298’

–header ‘X-Revo-Body-Signature: b7b33c746c6c321ebaac87cb864414e52554ee1f’

 

Request output parameters (HTTPS GET):

 

In response, we receive a response from the server 200 OK and the status of the order. The order status has two possible values: ‘active’ or ‘closed’.

 

Sample server response:

HTTPS 200 OK
{
“status”: “active”
}

 

  1. Get report for given period

 

Address URL: https://stage-backend.revoplus.pl/api/softicon/reports/:store_id?trader_id={trader_id}&date_from={date_from}&date_to={date_to}

 

The method is used to download a report from the Revo system for a period of time specified by the user. As a method parameter, the unique identifier of the store, start date, end date and trader_id parameter should be indicated. In the header’s parameter, indicate the encrypted signature (see signature generation).

 

Request input parameters (HTTPS GET):

 

Parameter name

Type

Required

Description

n/a

n/a

n/a

n/a

 

Sample request: 

 

curl –location –request GET ‘https://stage-backend.revoplus.pl/api/softicon/v1/reports/422?trader_id=470&date_from=2021-06-01&date_to=2021-06-05’

–header ‘X-Revo-Body-Signature: b7b33c746c6c321ebaac87cb864414e52554ee1f’

 

Request output parameters (HTTPS GET):

 

In response, we receive a response from the server 200 OK and a list of loans and returns for a given period.

 

Sample server response:

HTTPS 200 OK
{
“loan”: [
        {
“store_name”: “Test”,
“store_number_by_merchant”: “0002”,
“salesperson”: “Stelmach Oleg”,
“amount”: “333.0”,
“barcode_order_id”: “1000020333006367037754”,
“date_of_operation”: “2021-06-01 16:01:47”,
“commission_percent”: 1.0,
“commission_amount”: 3.33
        },
        {
“store_name”: “Test”,
“store_number_by_merchant”: “0002”,
“salesperson”: “Test merchant”,
“amount”: “1372.0”,
“barcode_order_id”: “1000021372005595365165”,
“date_of_operation”: “2021-06-04 10:18:01”,
“commission_percent”: 5.0,
“commission_amount”: 68.6
        },
        {
“store_name”: “Test”,
“store_number_by_merchant”: “0002”,
“salesperson”: “Stelmach Oleg”,
“amount”: “333.0”,
“barcode_order_id”: “1000020333000446606766”,
“date_of_operation”: “2021-06-04 12:13:50”,
“commission_percent”: 1.0,
“commission_amount”: 3.33
        },
        {
“store_name”: “Test”,
“store_number_by_merchant”: “0002”,
“salesperson”: “Test merchant”,
“amount”: “1372.0”,
“barcode_order_id”: “1000021372009278342262”,
“date_of_operation”: “2021-06-04 14:26:20”,
“commission_percent”: 5.0,
“commission_amount”: 68.6
        }
    ],
“return”: []
}

Error codes

 

  • 401 – Unauthorized (invalid authentication token)

Response

 

{
“error”: {
“code”: 401,
“type”: “unauthorized”
},
“errors”: [
{
“type”: “unauthorized”,
“message”: “error message”
}
]
}

 

  • 404 – Not Found (wrong endpoint / no endpoint indicated)

Response

 

{
“error”: {
“code”: 404,
“type”: “not_found”
},
“errors”: [
{
“type”: “not_found”,
“message”: “error message”
}
]
}

 

  • 422 – Unprocessable Entity (probably wrong body or parameters in the request)

Response

 

{
“error”: {
“code”: 422,
“type”: “unprocessable_entity”
},
“errors”: [
{
“attribute”: “error attribute”
“type”: “error type”,
“message”: “error message”
}
]
}

 

Aveți mai multe întrebări?

Trimitere solicitare