Skip to main content

Create a Paymentcard

This endpoint allows you to generate a payment link. With this link, you can receive deposits from other TropiPay accounts or external sources in a simple way. You can share your payment links and manage your charges efficiently.

POST <base url>/api/v3/paymentcards

Headers

NameTypeRequiredDescription
AuthorizationstringYesBearer {user-token}
Content-TypestringYesapplication/json

Example Request

{
"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"
},
"reference": "my-reference",
"concept": "Bicycle",
"favorite": "true",
"description": "Two wheels",
"amount": 100,
"currency": "EUR",
"singleUse": "true",
"reasonId": 4,
"accountId": 9,
"expirationDays": 1,
"lang": "es",
"urlSuccess": "https://my-business.com/payment-ok",
"urlFailed": "https://my-business.com/payment-ko",
"urlNotification": "https://my-business.com/payment-callback",
"directPayment": "false",
"paymentMethods": [
"EXT",
"TPP",
"TPP_GIFTCARD"
]
}

Example Response

{
"id": "1178ee20-fd00-11ef-a2a1-395c2db61965",
"saveToken": false,
"accountId": 9,
"reference": "my-reference",
"concept": "Bicycle",
"description": "Two wheels",
"amount": 100,
"currency": "EUR",
"singleUse": true,
"favorite": true,
"reasonId": 4,
"reasonDes": null,
"expirationDays": 0,
"userId": "5b78aed0-70d7-11ef-8e71-afa4d9a6153a",
"lang": "es",
"imageBase": null,
"state": 1,
"urlSuccess": "https://my-business.com/payment-ok",
"urlFailed": "https://my-business.com/payment-ko",
"urlNotification": "https://my-business.com/payment-callback",
"expirationDate": null,
"serviceDate": null,
"hasClient": true,
"credentialId": 10,
"force3ds": false,
"origin": 2,
"paymentcardType": 1,
"strictPostalCodeCheck": false,
"strictAddressCheck": false,
"updatedAt": "2025-03-09T16:03:41.486Z",
"createdAt": "2025-03-09T16:03:40.675Z",
"qrImage": "data:image/png;base64,iVBORw0KGgoA...",
"shortUrl": "https://tppay.me/m81tp753",
"paymentUrl": null,
"bankOrderCode": "439900781291",
"rawUrlPayment": null,
"giftcard": null
}

Fields

FieldTypeDescription
referencestringUsed for tracking orders within your application. This value will be returned in notifications and webhooks.
conceptstringA brief title or concept for the payment.
favoritebooleanMark this payment card as a favorite.
descriptionstringDetailed description of what the payment is for.
amountnumberPayment amount in cents (e.g., 10.55 EUR should be sent as 1055).
currencystringCurrency code (e.g., "EUR").
singleUsebooleanWhether the payment link can be used only once.
reasonIdnumberReason identifier for the payment.
accountIdnumberThe unique identifier of the account for which the payment card will be created. IMPORTANT: Determines where the fund will be settled. If omited the configured default account by the user will be used
reasonDesstringText for the reason if reason is 9 (see below for a comprehensive list of reasons).
expirationDaysnumberFunds will be pending in until this number of days after payment
langstringLanguage code (e.g., "es" for Spanish).
urlSuccessstringURL where users will be redirected after successful payment.
urlFailedstringURL where users will be redirected if payment fails.
urlNotificationstringPOST endpoint that will receive payment notifications. Must be accessible to TropiPay servers. For testing, you can use services like ngrok or webhook.site.
expirationDatestringDate until the paymentcard will be available ISO8601 format including variants allowing timezone
termsAndConditionsbooleanAcceptance of terms and conditions.

Client Information (Required)

tip

The client object, if present, must include ALL the following fields (pass null to let Tropipay request the client data in the payment card):

FieldTypeDescription
namestringClient's first name.
lastNamestringClient's last name.
addressstringClient's address.
phonestringClient's phone number.
emailstringClient's email address.
citystringClient's city.
postCodestringClient's zip code or postal code.
dateOfBirthstringClient's birth date. Format: yyyy-mm-dd.
termsAndConditionsstringAcceptance of terms and conditions.

Optional Fields

FieldTypeDescription
countryIdnumberCountry identifier. Not required if countryIso is provided.
countryIsostringCountry ISO code (e.g., "ES", "US"). Not required if countryId is provided.
paymentMethodsarray[string]Specifies available payment methods. Options include 'EXT' (external cards like Visa, Mastercard) and 'TPP' (TropiPay balance). If omitted, all payment methods will be available.
saveTokenbooleanSave payment token for future use. Defaults to false.
imageBasestringBase64 string format of an image (JPG, PNG, etc.). Example: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKQAAACkHYTCA...

Code Examples

curl --request POST \
--url https://tropipay-dev.herokuapp.com/api/v3/paymentcards \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your-token}' \
--header 'Content-Type: application/json' \
--data '{
"reference": "my-reference",
"concept": "Bicycle",
"favorite": true,
"description": "Two wheels",
"accountId": 9,
"amount": 100000,
"currency": "EUR",
"singleUse": true,
"reasonId": 4,
"expirationDays": 1,
"lang": "es",
"urlSuccess": "https://my-business.com/payment-ok",
"urlFailed": "https://my-business.com/payment-ko",
"urlNotification": "https://my-business.com/payment-callback",
"serviceDate": "2021-08-20",
"client": {
"name": "John",
"lastName": "McClane",
"address": "Ave. Guadí 232, Barcelona, Barcelona",
"phone": "+34645553333",
"email": "client@email.com",
"countryId": 1,
"termsAndConditions": "true",
"city": "Barcelona",
"postCode": "78622",
"dateOfBirth: "1984-08-15"
},
"directPayment": true,
"paymentMethods": [
"EXT",
"TPP"
]
}'

Response Fields

FieldTypeDescription
idstringUnique identifier for the payment card.
referencestringYour provided reference.
conceptstringPayment concept.
descriptionstringPayment description.
amountnumberPayment amount in cents.
accountIdnumberThe unique identifier of the account for which the payment card was created.
currencystringCurrency code.
singleUsebooleanWhether the payment link can be used only once.
favoritebooleanWhether the payment card is marked as favorite.
reasonIdnumberReason identifier.
reasonDesstringReason description (may be null).
expirationDaysnumberDays until expiration.
userIdstringUser ID of the payment card creator.
langstringLanguage code.
statenumberPayment state.
urlSuccessstringSuccess URL.
urlFailedstringFailed URL.
urlNotificationstringNotification URL for webhooks.
expirationDatestringExpiration date (may be null).
serviceDatestringService date (may be null).
hasClientbooleanWhether client information is included.
updatedAtstringLast update timestamp.
createdAtstringCreation timestamp.
qrImagestringBase64-encoded QR code image for the payment.
shortUrlstringShort URL to access the payment.

Implementation Notes

  • For testing webhook notifications locally, consider using services like ngrok or webhook.site
  • The amount field is always an integer in cents (e.g., 10.55 EUR should be represented as 1055)
  • You can specify payment methods to limit how users can pay (external cards, TropiPay balance, or both)
  • The QR image is returned as a base64 string, which can be displayed directly on your website