Tpaga Wallet Payment Codes API 1.0.0

Security

UserAuth (HTTP Basic Authentication)

DEFAULT

GET /{payment_request_token}/info

Description

Returns information of a payment request.

Parameters

Name Located in Required Type Format Properties Description
payment_request_token path Yes string      

Request

Responses

200

Information of a payment request.

Type: PaymentRequest

Example:

{
    "cancelled_at": "somestring",
    "cost": "somestring",
    "expires_at": "somestring",
    "idempotency_token": "somestring",
    "merchant_user_id": "somestring",
    "miniapp_user_token": "somestring",
    "order_id": "somestring",
    "purchase_description": "somestring",
    "purchase_details_url": "somestring",
    "purchase_items": {},
    "status": "created",
    "terminal_id": "somestring",
    "token": "somestring",
    "tpaga_payment_url": "somestring",
    "user_ip_address": "somestring",
    "voucher_url": "somestring"
}
401

Unauthorized

403

The product/service related to the miniapp was disabled. Please contact Tpaga support.

Type: DataErrorModel

Example:

{
    "error_code": 1,
    "error_message": "somestring",
    "field_name": "somestring",
    "rejected_value": "somestring"
}
422

Parameter is not valid.

Type: DataErrorModel

Example:

{
    "error_code": 1,
    "error_message": "somestring",
    "field_name": "somestring",
    "rejected_value": "somestring"
}

Security

Security Schema Scopes
UserAuth  

GET /users/{tpaga_user_token}/info

Description

Returns information from a user.

Parameters

Name Located in Required Type Format Properties Description
tpaga_user_token path Yes string      

Request

Responses

200

Basic information from a user.

Type: UserInformationResponse

Example:

{
    "email": "somestring",
    "first_name": "somestring",
    "identification_number": "somestring",
    "identification_type": "somestring",
    "last_name": "somestring",
    "phone_number": "somestring"
}
401

Unauthorized

403

The product/service related to the miniapp is disabled or forbidden. Please contact Tpaga support.

Type: DataErrorModel

Example:

{
    "error_code": 1,
    "error_message": "somestring",
    "field_name": "somestring",
    "rejected_value": "somestring"
}
422

Parameter is not valid.

Type: InputError

Example:

{
    "error_code": 1,
    "error_message": "somestring",
    "field_name": "somestring",
    "rejected_value": "somestring"
}

Security

Security Schema Scopes
UserAuth  

POST /cancel

Description

Cancels a payment_request if it is in status CREATED.

Request

Body
Name Required Type Format Properties Description
payment_request_token No string      
{
    "payment_request_token": "somestring"
}

Responses

200

Payment request was cancelled.

Type: PaymentRequest

Example:

{
    "cancelled_at": "somestring",
    "cost": "somestring",
    "expires_at": "somestring",
    "idempotency_token": "somestring",
    "merchant_user_id": "somestring",
    "miniapp_user_token": "somestring",
    "order_id": "somestring",
    "purchase_description": "somestring",
    "purchase_details_url": "somestring",
    "purchase_items": {},
    "status": "created",
    "terminal_id": "somestring",
    "token": "somestring",
    "tpaga_payment_url": "somestring",
    "user_ip_address": "somestring",
    "voucher_url": "somestring"
}
401

Unauthorized

403

The product/service related to the miniapp was disabled. Please contact Tpaga support.

Type: DataErrorModel

Example:

{
    "error_code": 1,
    "error_message": "somestring",
    "field_name": "somestring",
    "rejected_value": "somestring"
}
409

Payment request status does not allow to cancel it.

Type: DataErrorModel

Example:

{
    "error_code": 1,
    "error_message": "somestring",
    "field_name": "somestring",
    "rejected_value": "somestring"
}
422

Payload is not valid.

Type: DataErrorModel

Example:

{
    "error_code": 1,
    "error_message": "somestring",
    "field_name": "somestring",
    "rejected_value": "somestring"
}

Security

Security Schema Scopes
UserAuth  

POST /confirm_delivery

Description

Notifies that a payment request was delivered successfully.

Request

Body
Name Required Type Format Properties Description
payment_request_token No string      
{
    "payment_request_token": "somestring"
}

Responses

200

Payment request was marked as delivered.

Type: PaymentRequest

Example:

{
    "cancelled_at": "somestring",
    "cost": "somestring",
    "expires_at": "somestring",
    "idempotency_token": "somestring",
    "merchant_user_id": "somestring",
    "miniapp_user_token": "somestring",
    "order_id": "somestring",
    "purchase_description": "somestring",
    "purchase_details_url": "somestring",
    "purchase_items": {},
    "status": "created",
    "terminal_id": "somestring",
    "token": "somestring",
    "tpaga_payment_url": "somestring",
    "user_ip_address": "somestring",
    "voucher_url": "somestring"
}
401

Unauthorized

403

The product/service related to the miniapp was disabled. Please contact Tpaga support.

Type: DataErrorModel

Example:

{
    "error_code": 1,
    "error_message": "somestring",
    "field_name": "somestring",
    "rejected_value": "somestring"
}
422

Parameter is not valid.

Type: InputError

Example:

{
    "error_code": 1,
    "error_message": "somestring",
    "field_name": "somestring",
    "rejected_value": "somestring"
}

Security

Security Schema Scopes
UserAuth  

POST /create

Description

Creates payment request.

Request

Body
Name Required Type Format Properties Description
cost Yes integer     Payment request cost.
expires_at Yes string date-time   Payment request expiration date in ISO8601 format.
idempotency_token Yes string     Unique payment identifier offered by the miniapp.
merchant_user_id No string     Offered by the miniapp.
miniapp_user_token Yes string     Identifies the miniapp in calls from the mobile client and wallet.
order_id Yes string     Order identifier offered by the miniapp.
purchase_description Yes string     Payment description that will be shown to the user by the mobile app.
purchase_details_url Yes string     URL that the user will be redirected to once the payment is done.
purchase_items No purchase_items     Optional detail of the items that belong to this transaction.
terminal_id Yes string     Offered by the miniapp to identify the product/service or device involved.
user_ip_address Yes string     IP of the user that created the payment request.
voucher_url No string     URL that holds the voucher of a transaction.

Purchase_items schema:

Optional detail of the items that belong to this transaction.

{
    "cost": 1,
    "expires_at": "2015-01-01T15:00:00.000Z",
    "idempotency_token": "somestring",
    "merchant_user_id": "somestring",
    "miniapp_user_token": "somestring",
    "order_id": "somestring",
    "purchase_description": "somestring",
    "purchase_details_url": "somestring",
    "purchase_items": {},
    "terminal_id": "somestring",
    "user_ip_address": "somestring",
    "voucher_url": "somestring"
}

Responses

201

Payment request was created

Type: PaymentRequest

Example:

{
    "cancelled_at": "somestring",
    "cost": "somestring",
    "expires_at": "somestring",
    "idempotency_token": "somestring",
    "merchant_user_id": "somestring",
    "miniapp_user_token": "somestring",
    "order_id": "somestring",
    "purchase_description": "somestring",
    "purchase_details_url": "somestring",
    "purchase_items": {},
    "status": "created",
    "terminal_id": "somestring",
    "token": "somestring",
    "tpaga_payment_url": "somestring",
    "user_ip_address": "somestring",
    "voucher_url": "somestring"
}
401

Unauthorized

403

The product/service related to the miniapp was disabled. Please contact Tpaga support.

Type: DataErrorModel

Example:

{
    "error_code": 1,
    "error_message": "somestring",
    "field_name": "somestring",
    "rejected_value": "somestring"
}
409

Payment request already exists

Type: BusinessError

Example:

{
    "data": {},
    "error_code": 1,
    "error_message": "somestring"
}
422

Payload is not valid.

Type: InputError

Example:

{
    "error_code": 1,
    "error_message": "somestring",
    "field_name": "somestring",
    "rejected_value": "somestring"
}

Security

Security Schema Scopes
UserAuth  

POST /{payment_request_token}/confirm_delivery

Description

Notifies that a payment request was delivered successfully.

Parameters

Name Located in Required Type Format Properties Description
payment_request_token path Yes string      

Request

Responses

200

Payment request was marked as delivered.

Type: PaymentRequest

Example:

{
    "cancelled_at": "somestring",
    "cost": "somestring",
    "expires_at": "somestring",
    "idempotency_token": "somestring",
    "merchant_user_id": "somestring",
    "miniapp_user_token": "somestring",
    "order_id": "somestring",
    "purchase_description": "somestring",
    "purchase_details_url": "somestring",
    "purchase_items": {},
    "status": "created",
    "terminal_id": "somestring",
    "token": "somestring",
    "tpaga_payment_url": "somestring",
    "user_ip_address": "somestring",
    "voucher_url": "somestring"
}
401

Unauthorized

403

The product/service related to the miniapp was disabled. Please contact Tpaga support.

Type: DataErrorModel

Example:

{
    "error_code": 1,
    "error_message": "somestring",
    "field_name": "somestring",
    "rejected_value": "somestring"
}
422

Parameter is not valid.

Type: InputError

Example:

{
    "error_code": 1,
    "error_message": "somestring",
    "field_name": "somestring",
    "rejected_value": "somestring"
}

Security

Security Schema Scopes
UserAuth  

POST /refund

Description

Reverts a payment and notifies to the buyer via Tpaga wallet about the payment has been reverted

Request

Body
Name Required Type Format Properties Description
payment_request_token No string      
{
    "payment_request_token": "somestring"
}

Responses

200

Payment request was reverted, the status should be “reverted”.

Type: PaymentRequest

Example:

{
    "cancelled_at": "somestring",
    "cost": "somestring",
    "expires_at": "somestring",
    "idempotency_token": "somestring",
    "merchant_user_id": "somestring",
    "miniapp_user_token": "somestring",
    "order_id": "somestring",
    "purchase_description": "somestring",
    "purchase_details_url": "somestring",
    "purchase_items": {},
    "status": "created",
    "terminal_id": "somestring",
    "token": "somestring",
    "tpaga_payment_url": "somestring",
    "user_ip_address": "somestring",
    "voucher_url": "somestring"
}
401

Unauthorized

403

The product/service related to the miniapp was disabled. Please contact Tpaga support.

Type: DataErrorModel

Example:

{
    "error_code": 1,
    "error_message": "somestring",
    "field_name": "somestring",
    "rejected_value": "somestring"
}
409

Payment request status does not allow to revert it.

Type: DataErrorModel

Example:

{
    "error_code": 1,
    "error_message": "somestring",
    "field_name": "somestring",
    "rejected_value": "somestring"
}
422

Payload is not valid.

Type: DataErrorModel

Example:

{
    "error_code": 1,
    "error_message": "somestring",
    "field_name": "somestring",
    "rejected_value": "somestring"
}

Security

Security Schema Scopes
UserAuth  

Data Structures

BusinessError Model Structure

Name Required Type Format Properties Description
data No data     Business entity related to the error.
error_code No integer      
error_message No string     Human-friendly description of the business error

Data schema:

Business entity related to the error.

DataErrorModel Model Structure

Name Required Type Format Properties Description
error_code No integer      
error_message No string     human-friendly description of the validation error
field_name No string     name of the field whose validation failed
rejected_value No string     string representation of the rejected value

InputError Model Structure

Name Required Type Format Properties Description
error_code No integer      
error_message No string     Human-friendly description of the validation error
field_name No string     Name of the field whose validation failed
rejected_value No string     String representation of the rejected value

PaymentCreationRequest Model Structure

Name Required Type Format Properties Description
cost Yes integer     Payment request cost.
expires_at Yes string date-time   Payment request expiration date in ISO8601 format.
idempotency_token Yes string     Unique payment identifier offered by the miniapp.
merchant_user_id No string     Offered by the miniapp.
miniapp_user_token Yes string     Identifies the miniapp in calls from the mobile client and wallet.
order_id Yes string     Order identifier offered by the miniapp.
purchase_description Yes string     Payment description that will be shown to the user by the mobile app.
purchase_details_url Yes string     URL that the user will be redirected to once the payment is done.
purchase_items No purchase_items     Optional detail of the items that belong to this transaction.
terminal_id Yes string     Offered by the miniapp to identify the product/service or device involved.
user_ip_address Yes string     IP of the user that created the payment request.
voucher_url No string     URL that holds the voucher of a transaction.

Purchase_items schema:

Optional detail of the items that belong to this transaction.

PaymentRequest Model Structure

Name Required Type Format Properties Description
cancelled_at No string     Date when the payment_request was cancelled.
cost No string     Payment request cost.
expires_at No string     Date when the payment_request will expire.
idempotency_token No string     Unique payment identifier offered by the miniapp.
merchant_user_id No string     Offered by the miniapp.
miniapp_user_token No string     Identifies the miniapp in calls from the mobile client and wallet.
order_id No string     Order identifier offered by the miniapp.
purchase_description No string     Payment description that will be shown to the user by the mobile app.
purchase_details_url No string     URL that will be shown to the user in the pyos once the payment is done.
purchase_items No purchase_items     Optional detail of the items that belong to this transaction.
status No string   {“enum”: [“created”, “charge_in_progress”, “paid”, “charge_failed”, “reverted”, “delivered”, “expired”, “cancelled”]}  
terminal_id No string     Offered by the miniapp to identify the product/service or device involved.
token No string     Unique payment request token generated by Tpaga.
tpaga_payment_url No string     Payment link used to open the payment widget in Tpaga app.
user_ip_address No string     IP of the user that created the payment request.
voucher_url No string     URL that holds the voucher url of the miniapp.

Purchase_items schema:

Optional detail of the items that belong to this transaction.

PaymentRequestToken Model Structure

Name Required Type Format Properties Description
payment_request_token No string      

UserInformationResponse Model Structure

Name Required Type Format Properties Description
email No string     Email of the user.
first_name No string     First name of the user.
identification_number No string     Identification number of the user.
identification_type No string     Identification type of the user.
last_name No string     Last name of the user.
phone_number No string     Phone number of the user.