Skip to main content

API Guide#

Table of Contents#

Tuna Codes#

Summary of assets to download:

Payment Status#

You should track the payment status to make decisions regarding the approval of your overall order.

The payment status can be considered a subset of payment method status. Therefore, check them only when you explicitly need to act on a specific payment method's result. Most times, just tracking the payment status will be enough.

Check out all payment statuses in the file paymentStatus.json. And in the table below, all payment statuses are described:

Status CodeStatusDescription
0StartedThe payment transaction has started, but no transactions have been executed yet.
2CapturedThe payment transaction has been captured, so the funds are secured.
3RefundedThe payment transaction has been refunded.
4DeniedThe payment transaction has been denied by the issuing bank, acquirer, or anti-fraud provider.
5CancelledThe payment transaction has been canceled after being previously authorized.
6AbandonedThe payment transaction has been abandoned. It's been started for too long and never evolved to another status.
7ChargebackThe payment transaction has been reported as a chargeback.
8MoneyReceivedFunds of the payment transaction have been transferred to the partner.
9PartialRefundedThe payment transaction has been partially refunded.
PPendingThe system is waiting for the result of another process, such as anti-fraud analysis, to complete the payment transaction. Whether the transaction has already been authorized or not depends on how your flows are configured.

Payment Methods#

Payment methods identifiers (id) and descriptions are listed in the file paymentMethods.json. They are also listed in the table below:

Payment Method IDPayment MethodDescription
1CreditCardCredit Card
2DebitCardDebit Card
3BoletoBrazilian Bank Slip
4BankTransferBank Wire Transfer
5ThreeDSCredit3DS 1.0 Credit Card
6ThreeDSDebit3DS 1.0 Debit Card
7ThreeDS20Credit3DS 2.0 Credit Card
8ThreeDS20Debit3DS 2.0 Debit Card
9ExternalGeneric External Payment
AGiftCardGift Card Provider
BBalanceProprietary Credit System Balance
CCreditCardPrivateBrandPrivate Label Credit Card
DPIXBrazilian Central Bank's instant payment

Payment Method Status#

It can be more specific than the status of the entire payment, as shown in the file paymentMethodStatus.json.

All payment method statuses are described in the table below:

Status CodeStatusDescription
0StartedThe payment transaction has started, but no transactions have been executed yet.
1AuthorizedThe payment transaction of this method has been authorized but not yet captured. The credit limit has been reserved on the credit card.
2CapturedThe payment transaction has been captured, so the funds are secured.
3RefundedThe payment transaction has been refunded.
4DeniedThe payment transaction has been denied by the issuing bank, acquirer, or anti-fraud provider.
5CancelledThe payment transaction has been canceled after being previously authorized.
6AbandonedThe payment transaction has been abandoned. It's been started for too long and never evolved to another status.
7ChargebackThe payment transaction has been reported as a chargeback.
8MoneyReceivedFunds of the payment transaction have been transferred to the partner.
9PartialRefundedThe payment transaction has been partially refunded.
AErrorThere was an error while processing the transaction of this payment method. This status is followed by a message with more details about the error.
BRedFlagThe system explicitly marked this transaction as a major issue that should be investigated. This is a rare status. You don't need to worry about it while integrating with Tuna.
CPendingCaptureFor some reason, the transaction of this payment method could not be captured. The system will automatically retry to capture it later.
DPendingCancelFor some reason, the transaction of this payment method could not be canceled. The system will automatically retry to cancel it later.
PPendingThe system is waiting for the result of another process, such as anti-fraud analysis, to complete the payment transaction. Whether the transaction has already been authorized or not depends on how your flows are configured.
NNotProcessedThis payment method will not be processed. This status is final.

Message Code List#

All possible return codes of the message objects are given in the file messageCodeList.json and described in the table below:

CodeMessage (it may vary according to custom settings)Behavior
1Successful Payment.The request has been successfully processed.
-101Request object is null.Malformed request. Please check the message and fix it.
-102Invalid Payment.Malformed request. Please check the message and fix it.
-103Invalid Payment Items.Malformed request. Please check the message and fix it.
-104At least one card must be present for the type of paymentMalformed request. Please check the message and fix it.
-105Partner id cannot be nullMalformed request. Please check the message and fix it.
-106Partner Unique id cannot be null.Malformed request. Please check the message and fix it.
-107Custom External Key s invalid.Malformed request. Please check the message and fix it.
-108Partner Unique id already used.The request is repeated. It will not be processed.
-109Invalid Configuration.Configuration issue. Please check your account and look for callouts.
If you can't fix it, contact support and inform this code and data request.
-110CVV not valid.Malformed request. Please check the message and fix it.
-111Partner Token was not provided.Malformed request. Please check the message and fix it.
-112Invalid Partner.Configuration issue. Please check your credentials.
-113Invalid Partner Credentials.Configuration issue. Please check your credentials.
-114Invalid Partner Account.Configuration issue. Please check your credentials.
-115Cancel operation failed.Contact support and inform this code and data request.
-116Capture operation failed.Contact support and inform this code and data request.
-117Configuration error.Configuration issue. Please check your account and look for callouts.
If you can't fix it, contact support and inform this code and data request.
-118Order Identifier can not be null.Malformed request. Please check the message and fix it.
-119Operation failed.Contact support and inform this code and data request.
-120Ivalid amount.Malformed request. Please check the message and fix it.
-121Unexpected error.Contact support and inform this code and data request.
-122Merchant does not exist.Malformed request. Please check the message and fix it.
-123Merchant Percentage and amount, both cannot be null.Malformed request. Please check the message and fix it.
-124Merchant External Id cannot be null.Malformed request. Please check the message and fix it.
-125Merchant Name cannot be null.Malformed request. Please check the message and fix it.
-126Merchant Fantasy Name cannot be null.Malformed request. Please check the message and fix it.
-127Merchant Status cannot be null.Malformed request. Please check the message and fix it.
-128Merchant status is invalid. Should be '1' for Active, '2' for Inactive or '3' for Suspended.Malformed request. Please check the message and fix it.
-129Merchant Name cannot be null.Malformed request. Please check the message and fix it.
-130Agency of bank account cannot be null.Malformed request. Please check the message and fix it.
-131Bank Account number cannot be null.Malformed request. Please check the message and fix it.
-132Bank account type is invalid. Valid values are 'C' for Checking, 'S' for Saving, 'P' for Payment or 'D' for Deposit.Malformed request. Please check the message and fix it.
-133Date filters are invalid.Malformed request. Please check the message and fix it.
-134Merchant Percentage invalid.Malformed request. Please check the message and fix it.
-135Merchant amount invalid.Malformed request. Please check the message and fix it.
-136Merchant shipping amount invalidMalformed request. Please check the message and fix it.

Resources#

  • API Guide: are you looking for a guide for our APIs? Check out the introduction to the API Guide.

  • Payment Integration: do you need to be able to perform secure credit card payments and/or also use other payment methods such as Debit Card, Boleto, PIX, Bitcoin? Checkout how to perform a Payment Integration with our Payment API and Token API.

  • Split Integration: are you looking to set up a marketplace, so your merchants will use split payment solutions in your marketplace? Check out how to perform a Split Integration with our Merchant API.

  • Tuna Codes: do you need to learn about your codes and status? Please, check out the Tuna Codes.

  • Webhooks Notifications: learn more about our notifications in the guide Webhooks Notifications.

  • Sandbox Environment: check out for information about test data and a full description of the Sandbox Environment.

  • Idempotent Requests: do you require idempotent requests? Take a look how to make Idempotent Requests.