Tpaga Wallet Payment Codes API 1.4.0¶
DEFAULT¶
POST /authorize
¶
Description¶
Tests the existence of a payment code, and blocks it so no other clients can use it.Responses¶
401¶
No or bad Authorization Credentials
409¶
There is a payment code with the received code, but it has already been authorized/canceled/settled.
Type: ErrorModel
POST /cancel
¶
Description¶
Cancels the usage/consumption of a payment code, and releases the funds associated to it. This will work for created, authorized, and settled payment codes, authorized within the last 24 hours.Request¶
Body¶
Type: CancelRequest
Responses¶
200¶
Payment code succesfully cancelled.
401¶
Missing or bad Authorization Credentials
404¶
There is no payment code with the code received, or the code expired before being authorized/settled.
Type: ErrorModel
409¶
There is a payment code with the received code, but it’s been more than 24 hours since its authorization, so cancelling it is forbidden.
Type: ErrorModel
POST /capture
¶
Description¶
Authorize and settle an OTP code in a single request.Responses¶
401¶
No or bad Authorization Credentials
409¶
REPEATED REQUEST - Payment code data and authorization code for transaction made earlier
Type: PaymentCodeAuthorization
POST /revert
¶
Description¶
Reverts the usage/consumption of a payment code, and releases the funds associated to it. This will work for authorized and settled payment codes, authorized within the last 24 hours.Request¶
Body¶
Type: RevertRequest
Responses¶
200¶
Payment code succesfully reverted.
401¶
Missing or bad Authorization Credentials
404¶
There is no payment code with the code received, or the code expired before being authorized/settled.
Type: ErrorModel
POST /settle
¶
Description¶
Reports the usage/comsumption of a payment code and the details of the transaction.Responses¶
200¶
Payment code succesfully settled.
401¶
No or bad Authorization Credentials
409¶
There is a payment code with the received code, but it has already been authorized/canceled/settled.
Type: ErrorModel
Data Structures¶
CancelRequest Model Structure¶
Name | Required | Type | Format | Properties | Description |
---|---|---|---|---|---|
authorization_code | Yes | string | the authorization code given by Tpaga in the /authorize endpoint. |
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 |
ErrorModel Model Structure¶
Name | Required | Type | Format | Properties | Description |
---|---|---|---|---|---|
additional_data | No | additional_data | |||
error_code | No | integer | code specific to this type of error | ||
error_message | No | string | human-friendly description for the error |
Additional_data schema:
PaymentCode Model Structure¶
Name | Required | Type | Format | Properties | Description |
---|---|---|---|---|---|
code | No | string | The Payment code is generated by the Tpaga Wallet application. | ||
purchase_amount | No | integer | amount that was actually consumed/used from the payment code. | ||
purchase_order_id | No | string | Unique identifier for this transaction from the merchant/seller side | ||
purchase_type | No | string | {‘enum’: [‘PUMP’, ‘SHELF’, ‘CASHOUT’, ‘RETAIL’]} |
PaymentCodeAuthorization Model Structure¶
Name | Required | Type | Format | Properties | Description |
---|---|---|---|---|---|
authorization_code | No | string | unique identifier for the purchase associated to this payment code. This is generated by Tpaga. | ||
authorization_date | No | string | date-time | Time when the autorization took place in the Tpaga platform. | |
buyer_id | No | string | unique identifier for the buyer (owner of the Tpaga wallet) who created/owns the payment code. | ||
payment_code | No | PaymentCode |
PaymentCodeAuthorizationRequest Model Structure¶
Name | Required | Type | Format | Properties | Description |
---|---|---|---|---|---|
additional_data | No | additional_data | |||
payment_code | Yes | string | The Payment code is generated by the Tpaga Wallet application. |
Additional_data schema:
PaymentCodeCaptureRequest Model Structure¶
Name | Required | Type | Format | Properties | Description |
---|---|---|---|---|---|
additional_data | No | additional_data | |||
currency | Yes | string | {‘enum’: [‘COP’], ‘default’: ‘COP’} | ||
payment_code | Yes | string | The Payment code is generated by the Tpaga Wallet application. | ||
purchase_amount | Yes | integer | amount that was actually consumed/used from the payment code. | ||
purchase_items | Yes | array of PurchasedItem | |||
purchase_order_id | Yes | string | Unique identifier for this transaction from the merchant/seller side | ||
purchase_type | Yes | string | {‘enum’: [‘PUMP’, ‘SHELF’, ‘CASHOUT’, ‘RETAIL’]} |
Additional_data schema:
PaymentCodeSettlementRequest Model Structure¶
Name | Required | Type | Format | Properties | Description |
---|---|---|---|---|---|
additional_data | No | additional_data | |||
authorization_code | Yes | string | |||
purchase_amount | Yes | integer | amount that was actually consumed/used from the payment code. | ||
purchase_items | Yes | array of PurchasedItem | |||
purchase_order_id | Yes | string | Unique identifier for this transaction from the merchant/seller side | ||
purchase_reported_date | No | string | date-time | Time when the purchase actually took place. | |
purchase_type | Yes | string | {‘enum’: [‘PUMP’, ‘SHELF’, ‘CASHOUT’, ‘RETAIL’]} |
Additional_data schema:
PurchasedItem Model Structure¶
Name | Required | Type | Format | Properties | Description |
---|---|---|---|---|---|
description | Yes | string | Description of the purchased product | ||
name | Yes | string | Name of the product | ||
price | Yes | number | Total value of the purchased item | ||
quantity | Yes | number | Amount or quantity of the product | ||
unit | Yes | string | Type of the units used in quantity, for example GALLON for gasoline. | ||
unit_price | Yes | number | Unitary price of the product |
RevertRequest Model Structure¶
Name | Required | Type | Format | Properties | Description |
---|---|---|---|---|---|
order_id | Yes | string | Unique identifier for this transaction from the merchant/seller side (purchase_order_id on /capture endpoint). |