Skip to main content

Payment Cards

The Payment Cards API allows you to manage and retrieve details about your saved payment cards.


The Payment Card Object

A PaymentCard object represents a stored payment card (Paylink). It contains all the details about the payment request.

Attributes

AttributeTypeDescription
idstringUnique identifier for the payment card.
referencestringYour internal reference for the payment.
conceptstringThe concept or title of the payment.
descriptionstringA short description of the payment.
amountintegerThe amount to be paid, in cents.
currencystringThe currency of the payment (e.g., EUR, USD, USDC).
singleUsebooleanIf true, the link can only be used once.
favoritebooleanMarks the payment card as a favorite.
stateintegerThe state of the payment card (e.g., 1 for active).
shortUrlstringThe short URL for the payment page.
qrImagestringA base64-encoded QR code image for the payment.
urlSuccessstringURL to redirect the user to after a successful payment.
urlFailedstringURL to redirect the user to after a failed payment.
urlNotificationstringWebhook URL to receive payment status notifications.
expirationDatestringThe timestamp when the payment link will expire (ISO 8601).
serviceDatestringThe date the service was rendered (ISO 8601).
createdAtstringThe timestamp when the card was created (ISO 8601).
updatedAtstringThe timestamp when the card was last updated (ISO 8601).
clientobjectOptional. An object containing the client's information, if provided during creation.

List Payment Cards

GET/paymentcards

Retrieves a list of all payment cards (Paylinks) created by the user. The list is paginated and can be filtered by state.

Headers

HeaderDescription
AuthorizationRequired. Your Bearer access token.
AcceptRequired. Must be application/json.

Query Parameters

ParameterTypeDescription
limitintegerOptional. The number of items to return per page. Defaults to 10.
offsetintegerOptional. The number of items to skip for pagination. Defaults to 0.
stateintegerOptional. Filters cards by state. 1 for active, 0 for used or expired.

cURL Example

curl -X GET "https://sandbox.tropipay.me/api/v3/paymentcards?limit=10&offset=0&state=1" \
-H "Authorization: Bearer {your-access-token}" \
-H "Accept: application/json"

Response Example (200 OK)

The response is an array of PaymentCard objects.

[
{
"id": "758bf1b0-5065-11f0-9095-6392f28119a6",
"reference": "order-abc-123",
"concept": "Monthly Subscription",
"description": "Payment for monthly service renewal",
"amount": 2500,
"currency": "EUR",
"state": 1,
"shortUrl": "https://tppay.me/mc9gzasb",
"createdAt": "2025-06-23T19:08:34.252Z",
"updatedAt": "2025-06-23T19:08:34.626Z"
}
]

Retrieve a Payment Card

GET/paymentcards/{id}

Retrieves the details of a specific payment card by its unique ID.

Path Parameters

ParameterTypeDescription
idstringRequired. The unique identifier of the payment card.

Headers

HeaderDescription
AuthorizationRequired. Your Bearer access token.
AcceptRequired. Must be application/json.

cURL Example

curl -X GET https://sandbox.tropipay.me/api/v3/paymentcards/d08d6f20-6cd1-11f0-b254-3d3d43fd5a7d \
-H "Authorization: Bearer {your-access-token}" \
-H "Accept: application/json"

Response Example (200 OK)

Returns a PaymentCard object.

{
"id": "d08d6f20-6cd1-11f0-b254-3d3d43fd5a7d",
"reference": "order-xyz-789",
"concept": "E-book Purchase",
"description": "The Complete Guide to APIs",
"amount": 1999,
"currency": "EUR",
"singleUse": true,
"favorite": false,
"state": 1,
"shortUrl": "https://tppay.me/mdp5mk9t",
"urlSuccess": "https://example.com/success",
"urlFailed": "https://example.com/failed",
"urlNotification": "https://example.com/webhook",
"expirationDate": "2025-07-30T00:00:00.000Z",
"serviceDate": "2025-07-29T00:00:00.000Z",
"createdAt": "2025-07-29T23:14:45.138Z",
"updatedAt": "2025-07-29T23:14:45.816Z"
}

Create a Payment Card

POST/paymentcards

Creates a new payment card (Paylink). A successful creation returns a PaymentCard object.

Headers

HeaderDescription
AuthorizationRequired. Your Bearer access token.
Content-TypeRequired. Must be application/json.
AcceptRequired. Must be application/json.

Body Parameters

ParameterTypeDescription
conceptstringRequired. A brief title for the payment that the user will see (max 254 characters).
descriptionstringRequired. A short description of the payment.
amountintegerRequired. The amount to be paid, in the smallest currency unit (e.g., cents). Must be at least 100.
currencystringRequired. The three-letter ISO currency code: USD, EUR, or USDC.
singleUsebooleanRequired. If true, the link can only be used once.
favoritebooleanRequired. Marks the payment card as a favorite for easy access.
reasonIdintegerOptional. A numeric ID representing the reason for the payment. 4 is a common value for general payments.
accountIdintegerOptional. The unique identifier of the account for which the payment card will be created. If not provided, the default account will be used.
referencestringOptional. Your unique internal reference for the transaction. Required if singleUse is true.
serviceDatestringOptional. The date the service is rendered, in ISO 8601 format (e.g., YYYY-MM-DD). Required if singleUse is true.
expirationDatestringOptional. The expiration date for the payment link in ISO 8601 format.
expirationDaysintegerOptional. The number of days until the payment link expires.
langstringOptional. The language for the payment page (e.g., es, en). Defaults to the user's account language.
saveTokenbooleanOptional. If true, saves the payment token for future use.
directPaymentbooleanOptional. If true, attempts to process the payment directly without showing the payment page. Defaults to false.
urlSuccessstringOptional. URL to redirect the user to after a successful payment. Must be a valid URL.
urlFailedstringOptional. URL to redirect the user to after a failed payment. Must be a valid URL.
urlNotificationstringOptional. A webhook URL to receive server-to-server notifications about the payment status. Must be a valid URL.
paymentMethodsarrayOptional. An array of strings specifying allowed payment methods (e.g., ["TPP", "EXT"]).
strictPostalCodeCheckbooleanOptional. If true, enforces strict postal code validation. Defaults to false.
strictAddressCheckbooleanOptional. If true, enforces strict address validation. Defaults to false.
paymentcardTypeintegerOptional. The type of payment card to create.
payment3DSstringOptional. 3D Secure configuration: default, force, or bypass. Defaults to default.
clientobjectOptional. An object containing the end client's information. Required if singleUse is true. See client object details below.

Client Object (when provided)

When the client object is provided, singleUse must be true and the following fields are required:

FieldTypeDescription
namestringRequired. Client's first name.
lastNamestringRequired. Client's last name.
emailstringRequired. Client's email address (must be valid).
phonestringRequired. Client's phone number.
addressstringRequired. Client's street address.
countryIdintegerRequired* Either countryId or countryIso must be provided. Numeric country identifier.
countryIsostringRequired* Either countryId or countryIso must be provided. ISO 3166-1 alpha-2 country code.
termsAndConditionsbooleanRequired. Must be true to accept terms and conditions.
citystringOptional. Client's city.
postCodestringOptional. Client's postal/ZIP code.
statestringOptional. Client's state or province.
dateOfBirthstringOptional. Client's date of birth in yyyy-MM-dd format.

cURL Example

curl -X POST https://sandbox.tropipay.me/api/v3/paymentcards \
-H "Authorization: Bearer {your-access-token}" \
-H "Content-Type: application/json" \
-d '{
"concept": "E-book Purchase",
"description": "The Complete Guide to APIs",
"amount": 1999,
"currency": "EUR",
"singleUse": true,
"favorite": false,
"reasonId": 4,
"accountId": 958,
"reference": "order-xyz-789",
"serviceDate": "2025-07-29",
"urlSuccess": "https://example.com/success",
"urlFailed": "https://example.com/failed",
"urlNotification": "https://example.com/webhook",
"client": {
"name": "John",
"lastName": "McClane",
"address": "Ave. Guadí 232, Barcelona, Barcelona",
"phone": "+34645553333",
"email": "client@email.com",
"countryId": 2,
"termsAndConditions": true,
"city": "Barcelona",
"postCode": "78622",
"dateOfBirth": "1984-08-15"
}
}'

Response Example (200 Created)

{
"id": "d08d6f20-6cd1-11f0-b254-3d3d43fd5a7d",
"accountId": 958,
"reference": "order-xyz-789",
"concept": "E-book Purchase",
"description": "The Complete Guide to APIs",
"amount": 1999,
"currency": "EUR",
"singleUse": true,
"favorite": false,
"state": 1,
"shortUrl": "https://tppay.me/mdp5mk9t",
"qrImage": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
"urlSuccess": "https://example.com/success",
"urlFailed": "https://example.com/failed",
"urlNotification": "https://example.com/webhook",
"expirationDate": "2025-07-30T00:00:00.000Z",
"serviceDate": "2025-07-29T00:00:00.000Z",
"createdAt": "2025-07-29T23:14:45.138Z",
"updatedAt": "2025-07-29T23:14:45.816Z"
}