Informacija Atsiprašome, šis skyrius galimas tik anglų kalba.

Transaction request indicates that some specific transaction is requested to be authorised by some Paysera user. This Paysera user can be indicated by user ID, phone number or email address. In case contact info is provided, user can be still not registered in Paysera system - email or SMS message is sent to the user with instructions how one can register, fill account and authorise the request.

To make transaction request, initiated by some user, scope sent_transaction_requests is needed. The same scope allows to search transaction requests, initiated by the user, related to current access token.

To access received transaction requests for some user, scope received_transaction_requests is needed.

Transaction request and it's status is related to the transaction. When transaction is revoked or rejected, transaction request status is changed from pending to failed. When transaction is authorised, status is changed to done, even if transaction is not yet completed.

Create Transaction Request

Informacija This feature is not available by default and is enabled only for some clients

Request

POST https://wallet.paysera.com/rest/v1/transaction/:transactionKey/request

transactionKey - identifier for already created transaction

Request body structure

Parametras
Tipas
Pastabos
Aprašymas
user_id
integer
required if email and phone not provider, unavailable otherwise
User ID in Paysera system
email
string
required if user_id and phone not provider, unavailable otherwise
Email of the user
phone
string
required if email and user_id not provider, unavailable otherwise
Phone number of the user
initiator_id
integer
optional
ID of the user that initiated this request. If access token is used, defaults to the user, related to current access token

Response data structure

Parametras
Tipas
Pastabos
Aprašymas
id
integer
always
ID of this request
created_at
integer
always
Date when request was created in UNIX timestamp
transaction_key
string
always
Transaction, related to this request
user_id
integer
Only if available
User ID in Paysera system
email
string
Only if provided when creating the request
Email of the user
phone
string
Only if provided when creating the request
Phone number of the user
initiator_id
integer
optional
Only if provided when creating the request

Example request

POST /rest/v1/transaction/pDAlAZ3z/request HTTP/1.1
Host: wallet.paysera.com
Content-Type: application/json;charset=utf-8
User-Agent: Paysera WalletApi PHP library
Authorization: MAC id="wkVd93h2uS", ts="1343811600", nonce="nQnNaSNyubfPErjRO55yaaEYo9YZfKHN", mac="xArtm01B2OD9TPs444MVFqLDZ5fAi0Kd5KTPcU9OG1U=", ext="body_hash=H6XyxQRHjhnQ9b9gE6TUTzxMGfO%2BbiCddhVQy4EZi%2F4%3D"
{
    "phone": "37066612345"
}

Example response

HTTP/1.1 200 OK
Content-type: application/json;charset=utf-8
{
    "id": 2987,
    "transaction_key": "pDAlAZ3z",
    "created_at": 1355314332,
    "user_id": 85541,
    "phone": "37066612345"
}

Get Transaction Request Information

This method returns transaction request information.

Request

GET https://wallet.paysera.com/rest/v1/transaction-request/:id

Parameters

id - id of transaction request

Response data structure

Response is transaction request structure.

Example request

GET /rest/v1/transaction-request/2987 HTTP/1.1
Host: wallet.paysera.com
User-Agent: Paysera WalletApi PHP library
Authorization: MAC id="wkVd93h2uS", ts="1343811600", nonce="nQnNaSNyubfPErjRO55yaaEYo9YZfKHN", mac="e2oao9Wuf4igzLGIN+dkftv1FStI7sDuM/ZuNB6pRBM="

Example response

HTTP/1.1 200 OK
Content-type: application/json;charset=utf-8
{
    "id": 2987,
    "transaction_key": "pDAlAZ3z",
    "created_at": 1355314332,
    "user_id": 85541,
    "phone": "37066612345"
}

Search Transaction Requests

This method returns transaction request list by some search criteria.

Request

GET https://wallet.paysera.com/rest/v1/transaction-requests?user_id=:userId&initiator_id=:initiatorId&status=:status&limit=:limit&offset=:offset

Parameters

user_id - User ID for which requests are sent

initiator_id - User ID which initiated the requests

status - Status of transaction requests. One of pending, failed, done

limit - optional; maximum number of objects to be returned in one response. Defaults to 20, maximum available is 200

offset - optional; number of objects to skip. Defaults to 0

At least one of user_id or initiator_id is required.

Response data structure

Parametras
Tipas
Pastabos
Aprašymas
transaction_requests
array of objects
always
Each item in array is transaction request object
_metadata
object
always
Additional information about result

Metadata information structure

Parametras
Tipas
Pastabos
Aprašymas
total
integer
always
Total count of results, ignoring limit and offset parameters
offset
integer
always
Used offset - how many results from the beginning were skipped
limit
integer
always
Used limit - maximum count of available results in single response

Example request

GET /rest/v1/transaction-requests?user_id=85541&status=pending&offset=20 HTTP/1.1
Host: wallet.paysera.com
User-Agent: Paysera WalletApi PHP library
Authorization: MAC id="wkVd93h2uS", ts="1343811600", nonce="nQnNaSNyubfPErjRO55yaaEYo9YZfKHN", mac="0cOAtkiacFR7HE5kwC2Zok068tWVAgmn4BAlQAPT9aw="

Example response

HTTP/1.1 200 OK
Content-type: application/json;charset=utf-8
{
    "transaction_requests": [
        {
            "id": 2987,
            "transaction_key": "pDAlAZ3z",
            "created_at": 1355314332,
            "user_id": 85541,
            "phone": "37066612345"
        }
    ],
    "_metadata": {
        "total": 21,
        "offset": 20,
        "limit": 20
    }
}