Transaction Requests
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
Request
POST https://wallet.paysera.com/rest/v1/transaction/:transactionKey/request
- transactionKey
- identifier for already created transaction
Request body structure
user_id
email
and phone
not provider, unavailable otherwise
email
user_id
and phone
not provider, unavailable otherwise
phone
email
and user_id
not provider, unavailable otherwise
initiator_id
Response data structure
id
created_at
transaction_key
user_id
email
phone
initiator_id
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 is200
- offset
- optional; number of objects to skip. Defaults to
0
At least one of user_id
or initiator_id
is required.
Response data structure
transaction_requests
_metadata
Metadata information structure
total
limit
and offset
parameters
offset
limit
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 } }