Skip to main content

Transaction

Each movement of money is modeled through a Transaction object, which can be of different types (e.g. credit card, debit card, boleto, wire transfer, etc.). Each Transaction type has a Finite State Machine (FSM) that defines its current status. The Transaction Event object represents transitions in the Transaction's FSM.

A Payment Provider can create a Transaction and update its status through Transaction Events as it changes over time. Since an order can be related to multiple payment methods, a different Transaction must be created for each of them using the same order ID.

Note: This endpoint is for the exclusive use of payment apps.

Properties

All Transaction types have the same attributes, but may generate different kinds of events and contain some info fields specific to their type.

FieldTypeDescription
idString[Read-only] Unique identifier of the Transaction object.
payment_provider_idStringID of the Payment Provider that processed this Transaction.
payment_methodObjectObject containing the payment method used in this Transaction. See Payment Method.
infoObjectObject containing specific info related to this Transaction. See Transaction Info.
statusObject[Read-only] The state of the FSM in which the Transaction is. See Transaction Status.
eventsArray(Object)[Read-only] List of fulfillment events related to this Transaction. See Transaction Events.
captured_amountObject[Read-only] Object containing the captured amount of this Transaction. See Money.
refunded_amountObject[Read-only] Object containing the refunded amount of this Transaction. See Money.
authorized_amountObject[Read-only] Object containing the authorized amount of this Transaction. See Money.
voided_amountObject[Read-only] Object containing the voided amount of this Transaction. See Money.
discount_amountObject[Read-only] Object containing the discount applied to the Transaction on the Payment Provider external site. See Redirect Transactions Discounts.
failure_codeString[Read-only] If the transaction failed, this field is used to indicate the code related to the failure cause. See Transaction Failure Codes.
created_atDate[Read-only] ISO 8601 date for the date the Transaction was created in our platform. Defaults to current time. E.g. "2020-03-11T12:42:15.000Z".

Note: Read-only properties will only appear in our responses, which means that should not be part of the requests.

Payment Method

FieldTypeDescription
typeStringOne of the available Payment Method Types.
idString[Optional for cash, pix and wallet] ID of the payment method used for this Transaction. See Supported Payment Methods by Payment Method Type.

Transaction Info

This object is used to indicate specific information of a Transaction. It can be omitted in the Transaction body if all its fields are unfilled.

FieldTypeDescription
cardObject[Optional] Object containing data related to the consumer's credit or debit card. See Card Info.
installmentsObject[Required for credit_card] Object containing the installments data related to this Transaction. See Installments Info.
external_idString[Required] ID used by the Payment Provider.
external_urlString[Optional] HTTPS URL with details of this Transaction for the merchant.
external_resource_urlString[Required for transparent transactions with boleto, ticket, wire_transfer, bank_debit and pix] HTTPS URL of the boleto or ticket to show to the consumer to resume the payment. In the case of bank debit and wire transfer, link to the bank selected by the consumer to make the transaction. In the case of PIX, source to the QR code image to show to the consumer to make the payment, it could be a URL or a base64 code.
external_resource_codeString[Required for transparent transactions with boleto, ticket, wire_transfer, bank_debit and pix] Barcode for boleto, or code for ticket. For all other cases, used as a reference code for the consumer.
external_resource_expires_atDate[Required for transparent transactions with boleto, ticket and pix] ISO 8601 date for the expiration date of a boleto or ticket.
refund_urlString[Optional] HTTPS URL to request the refund of the transaction. It is required if the supports_partial_refund field is true. See Refund URL.
supports_partial_refundBoolean[Optional] Indicates whether the transaction supports partial refund. Defaults to false.
ipString[Optional] IP of the device that initiated this Transaction.
consumer_chargesArray(Object)[Optional] List of consumer charges. See Transaction Charges.
consumer_discountsArray(Object)[Optional] List of consumer discounts. See Transaction Discounts.
merchant_chargesArray(Object)[Optional] List of merchant charges. See Transaction Charges.

Note: All URLs must be secure URLs (https).

Card Info

FieldTypeDescription
brandStringThe brand of the card. See Supported Card Brands.
issuerString[Optional] The issuer of the card.
expiration_monthNumberThe expiration month of the card.
expiration_yearNumberThe expiration year of the card.
first_digitsStringThe first 6 (six) digits of the card.
last_digitsStringThe last 4 (four) digits of the card.
masked_numberString[Optional] Masked card number displaying only the last 4 (four) digits. E.g. "XXXXXXXXXXXX1234".
nameStringName of the card holder.

Installments Info

FieldTypeDescription
quantityNumberThe number of installments. E.g. 3.
interestStringThe interest applied to each installment. E.g. "0.015".

Refund URL

If the Transaction supports refund, the Payment App must specify a URL in the info.refund_url field when creating the Transaction. Nuvemshop will call this URL when the merchant requests the total or partial refund of the order linked to the Transaction from the store's order management tool. In order to avoid invalid refund requests from our platform, we strongly recommend setting the refund URL to the Transaction only if it meets all the conditions to accept the refund operation (the payment method type supports refund; etc.).

Partial refunds will be available only for orders that have a single Transaction with paid or partially_refunded status and as long as the Transaction was created with the field info.supports_partial_refund set to true.

When Nuvemshop sends a POST request to the refund URL, your App should expect to receive the following JSON payload:

FieldTypeDescription
store_idStringThe store ID.
payment_provider_idStringThe Payment Provider ID.
transaction_idStringThe Transaction ID.
amountObjectThe transaction amount to be refunded. See Money.

The Payment App must reply Nuvemshop the HTTP status code 202 Accepted when it accepts the refund request for the transaction, which indicates that it will eventually refund the money. This is because refunding a transaction might be an async process and its complexity is different for each Payment Provider. It is very important to point out that once the refund process is completed by the Payment App, it must be notified to Nuvemshop through a Transaction Event of type refund in order to update the status of the Transaction.

In case of rejecting the refund request, the App must return a 422 Unprocessable Entity status code indicating the reason for the rejection through the error_code field, which can take one of the following values:

Rejection CodeDescription
insufficient_account_balance The available balance in the merchant's account is not sufficient to perform the operation.
refund_already_in_processThe transaction already has a refund in process.
refund_rejected Generic error for refund rejections.
transaction_date_too_old The transaction creation date is outside of the allowed refund period.

Request

Requesting a Payment App for its paid/partially_refunded transaction to be refunded.

curl -X POST \
'https://mypayments.com/transactions/refund' \
-H 'Content-Type: application/json' \
-d '{
"store_id":"12345",
"payment_provider_id":"6b7727b1-f912-4dcf-b0ae-0d006122598f",
"transaction_id":"6e760b6e-e4f3-42ba-8a2d-afddf44e6cf1",
"amount":{
"value":"200.45",
"currency":"BRL"
}
}'

Note: The URL mypayments.com/transactions/refund is used as an example, replace it with your own domain and path.

Note: The refund URL must not have path variables.

Success Response

HTTP/1.1 202 Accepted

Rejection Response

HTTP/1.1 422 Unprocessable Entity

{
"error_code":"insufficient_account_balance"
}

Transaction Charge

FieldTypeDescription
typeStringOne of the available Charge Type.
amountObjectObject containing the amount of this charge. See Money.
descriptionStringA description of this charge in the store language.

Charge Type

  • payment_processing_fee: Payment Processor fee for this transaction.
  • cost_per_transaction: Nuvemshop's transaction fee. Used only when the Payment Provider is implementing payment Split.
  • financing_cost: Financing cost applied to the merchant or consumer when installments are being used.
  • tax: Any tax charged to the merchant.
  • other: For other charges.

Transaction Discount

FieldTypeDescription
typeStringThe type of this discount. This value must be other.
amountObjectObject containing the amount of this discount. See Money.
descriptionStringA description of this discount in the store language.

Transaction Events

FieldTypeDescription
idString[Read-only] Unique identifier of the Transaction Event object.
transaction_idString[Read-only] ID of the Transaction related to this Transaction Event.
amountObjectObject containing the amount of this Transaction Event. See Money.

Note: For this value, only the cart total price reported by Nuvemshop should be considered (See Cart Data). Extra payment method costs such as credit card interest should be excluded from the Transaction amount and can optionally be included into the Card Info object. If multiple payments for the same order are allowed by the payment provider, then the sum of the amount of the generated transactions should be equal to the cart total price, disregarding costs associated with the payment provider. Not doing this could cause some fraud scenarios.
typeStringOne of the available Transaction Event Types.
statusObjectOne of the available Transaction Event Status.
infoObjectObject containing specific info related to this Transaction Event. See Transaction Event Info.
failure_codeString[Required for Transaction Event Status failure] If the Transaction Event failed, this field is used to indicate the code related to the failure cause. See Transaction Failure Codes.
happened_atDateISO 8601 date for the date the Transaction Event was processed. Defaults to current time. E.g. "2020-03-11T12:42:15.000Z".
expires_atDate[Optional] ISO 8601 date for date the Transaction Event expires. It will be used to indicate to the merchant the deadline to accept or cancel a transaction under review.
created_atDate[Read-only] ISO 8601 date for the date the Transaction Event was created in our platform. Defaults to current time. E.g. "2020-03-11T12:42:15.000Z".

Note: The amount property is required for authorization and sale Transaction Event Types, and must always be included in the first_event field during the Transaction creation. If no amount value is specified for subsequent events void, refund or capture, the total amount indicated in the first event is assumed.

Money

FieldTypeDescription
valueStringAmount of money as a string. E.g. "49.99"
currencyStringISO 4217 code for the currency, such as ARS, BRL, USD, etc.

Note: Decimal numbers are represented as string format for better decimal precision handling. It must contain two decimal places and use a point as decimal separator.

Transaction Status

Each type of Transaction has a Finite State Machine (FSM) that defines its status:

  • authorized: The transaction is authorized.
  • expired: The transaction is expired.
  • failed: The transaction failed.
  • in_fraud_analysis: The transaction is under fraud analysis by the payment provider.
  • needs_merchant_review: The transaction needs merchant action to continue.
  • paid: The transaction is confirmed.
  • partially_refunded: The transaction is partially refunded.
  • pending: The transaction is pending.
  • refunded: The transaction is refunded.
  • voided: The transaction is voided.

Transaction Event Types

  • authorization: The credit card transaction has been authorized.
  • capture: The credit card transaction has been captured.
  • expiration: The transaction has expired.
  • in_fraud_analysis: The credit card transaction is being reviewed by the payment provider (no merchant action is required).
  • refund: The sale has been fully refunded.
  • needs_merchant_review: The credit card transaction has to be approved or rejected by the merchant.
  • sale: Represents an authorization along with capture for credit card transactions, or a sale event for all other payment method types.
  • void: The credit card transaction has been voided.

Transaction Event Status

  • error: There was an error processing the transaction event.
  • failure: The transaction event failed. See this list for possible failure causes.
  • pending: The transaction event is pending.
  • success: The transaction event succeed.

Transaction Event Info

FieldTypeDescription
messageString[Optional] Description to explain a Transaction Event update.
fraud_scoreString[Optional] Decimal score between 0 to 1. The closer the score is to 1, the more likely the Transaction is fraudulent. E.g "0.15".
risk_levelString[Optional] Risk level that an Order is fraudulent. One of low, medium or high.
accept_urlString[Optional] HTTPS URL we will call to accept the Transaction from our platform. It should return a 2xx HTTP code or we will return an error to the merchant.
cancel_urlString[Optional] HTTPS URL we will call to cancel the Transaction from our platform. It should return a 2xx HTTP code or we will return an error to the merchant.

Transaction Event Workflow

Transaction Events are used to alter the status of a Transaction and to provide related information to take action on it.

There are specific status values and transitions for each Transaction Event Type, which are shown in the following diagram.

The blue boxes contains the list of status values that each Transaction Event Type supports.

event_types

Available Transaction Event Types by Payment Method Type

The following table shows the Transaction Event Types supported for each payment method type.

Payment Method TypeTransaction Event Type
credit_cardsale, authorization, capture, in_fraud_analysis, needs_merchant_review, void, refund
boleto, pix, ticketsale, expiration, refund
bank_debit, cash, debit_card, wallet, wire_transfersale, refund

Transaction Status Workflow

A Transaction may change its status upon receiving a Transaction Event. The following diagram shows the possible Transaction Status transitions based on the events the Transaction receives.

The arrows represent the occurrence of a Transaction Event with status success unless another status is mentioned in its description.

status_workflow

Redirect Transactions Discounts

Payment Providers may use discounts on their external checkouts to reduce the amount charged to a customer on a payment Transaction. Under this scenario, any promotion applied on the Payment Provider external site, such as a bank promotion or a discount coupon, can affect the Transaction amount for an order, reducing its value.

In these cases, the Transaction object created for the order must include the discount_amount field with the value of the discount applied on the Payment Provider external site. On the other hand, the total amount of the Transaction must also be updated with the corresponding value after the discount has been applied (see case Nº 6 of the Common Examples).

Note: Discounts on external Transactions must be applied to the order total amount reported by Nuvemshop.

Endpoints

POST /orders/{order_id}/transactions

Create a Transaction for a given order.

Request
FieldTypeDescription
payment_provider_idString[Required] ID of the Payment Provider that processed this Transaction.
payment_methodObject[Required] Object containing the payment method used in this Transaction. See Payment Method.
first_eventObject[Required] First transaction event that generated this Transaction. See Transaction Events.
infoObject[Required] Object containing specific info related to this Transaction. See Transaction Info.
Response

HTTP/1.1 201 Created

The created Transaction Object is returned.

POST /orders/{order_id}/transactions/{transaction_id}/events

Create a Transaction Event for a given Transaction.

Request
FieldTypeDescription
typeString[Required] One of the available Transaction Event Types.
statusObject[Required] One of the available Transaction Event Status.
happened_atDate[Required] ISO 8601 date for the date the Transaction Event was processed. Defaults to current time. E.g. "2020-03-11T12:42:15.456Z".
amountObject[Optional] Object containing the amount of this Transaction Event. See Money.
infoObject[Optional] Object containing specific info related to this Transaction Event. See Transaction Event Info.
failure_codeString[Optional] If the Transaction Event failed, this field is used to indicate the code related to the failure cause. See Transaction Failure Codes.
Response

HTTP/1.1 201 Created

The created Transaction Event Object is returned.

GET /orders/{order_id}/transactions

Get all Transactions for a given order.

Request
{}
Response

HTTP/1.1 200 OK

Array of Transaction Objects

GET /orders/{order_id}/transactions/{transaction_id}

Get a specific Transaction for a given order.

Request
{}
Response

HTTP/1.1 200 OK

Transaction Object

HTTP Errors List

  • 400 Bad Request - the request could not be understood or was missing required parameters.
  • 401 Unauthorized - authentication failed or user doesn't have permissions for requested operation.
  • 403 Forbidden - access denied.
  • 404 Not Found - resource was not found.
  • 405 Method Not Allowed - requested method is not supported for resource.

Common Examples

Example Nº 1: Create a credit card transaction that is authorized and captured within a single event

POST /orders/12345/transactions

Request
{
"payment_provider_id": "eeac118e-5534-40ba-b539-443449bc67a3",
"payment_method": {
"type": "credit_card",
"id": "visa"
},
"info": {
"card": {
"brand": "visa",
"expiration_month": 12,
"expiration_year": 2020,
"first_digits": "445566",
"last_digits": "1234",
"masked_number": "XXXXXXXXXXXX1234",
"name": "Ash Ketchum"
},
"installments": {
"quantity": 3,
"interest": "0.15"
},
"external_id": "1234",
"external_url": "https://mypayments.com/account/transactions/1234",
"refund_url": "https://mypayments.com/transactions/refund",
"supports_partial_refund": true,
"ip": "192.168.0.25"
},
"first_event": {
"amount": {
"value": "132.95",
"currency": "ARS"
},
"type": "sale",
"status": "success",
"happened_at": "2020-01-25T12:30:15.000Z"
}
}
Response

201 Created

{
"id": "aee7e83e-9537-4baf-a4ea-20e6b38521c7",
"payment_provider_id": "eeac118e-5534-40ba-b539-443449bc67a3",
"captured_amount": {
"value": "132.95",
"currency": "ARS"
},
"refunded_amount": {
"value": "0.00",
"currency": "ARS"
},
"authorized_amount": null,
"voided_amount": null,
"payment_method": {
"type": "credit_card",
"id": "visa"
},
"status": "paid",
"info": {
"card": {
"brand": "visa",
"expiration_month": 12,
"expiration_year": 2020,
"first_digits": "445566",
"last_digits": "1234",
"masked_number": "XXXXXXXXXXXX1234",
"name": "Ash Ketchum"
},
"installments": {
"quantity": 3,
"interest": "0.1500"
},
"external_id": "1234",
"external_url": "https://mypayments.com/account/transactions/1234",
"refund_url": "https://mypayments.com/transactions/refund",
"supports_partial_refund": true,
"ip": "192.168.0.25"
},
"failure_code": null,
"created_at": "2020-07-25 17:26:23",
"events": [
{
"transaction_id": "aee7e83e-9537-4baf-a4ea-20e6b38521c7",
"amount": {
"value": "132.95",
"currency": "ARS"
},
"type": "sale",
"status": "success",
"failure_code": null,
"created_at": "2020-07-25T20:26:23.323Z",
"happened_at": "2020-01-25T12:30:15Z",
"expires_at": null
}
]
}
Example Nº 2: Create a boleto transaction that starts pending and then is paid by the buyer

POST /orders/56789/transactions

Request
{
"payment_provider_id": "eeac118e-5534-40ba-b539-443449bc67a3",
"payment_method": {
"type": "boleto",
"id": "bradesco"
},
"info": {
"external_id": "1234",
"external_url": "https://mypayments.com/account/transactions/1234",
"external_resource_url": "https://mypayments.com/boleto/1234",
"external_resource_code": "00190500954014481606906809350314337370000000100",
"external_resource_expires_at": "2020-02-05T12:30:15.000Z",
"ip": "192.168.0.25"
},
"first_event": {
"amount": {
"value": "132.95",
"currency": "ARS"
},
"type": "sale",
"status": "pending",
"happened_at": "2020-01-25T12:30:15.000Z"
}
}
Response

201 Created

{
"id": "6b765950-e8e2-49f1-9c6a-0bb7c15a4f41",
"payment_provider_id": "eeac118e-5534-40ba-b539-443449bc67a3",
"captured_amount": {
"value": "0.00",
"currency": "ARS"
},
"refunded_amount": {
"value": "0.00",
"currency": "ARS"
},
"authorized_amount": null,
"voided_amount": null,
"payment_method": {
"type": "boleto",
"id": "bradesco"
},
"status": "pending",
"info": {
"external_resource_url": "https://mypayments.com/boleto/1234",
"external_resource_code": "00190500954014481606906809350314337370000000100",
"external_resource_expires_at": "2020-02-05T12:30:15Z",
"external_id": "1234",
"external_url": "https://mypayments.com/account/transactions/1234",
"ip": "192.168.0.25"
},
"failure_code": null,
"created_at": "2020-07-25 17:27:42",
"events": [
{
"transaction_id": "6b765950-e8e2-49f1-9c6a-0bb7c15a4f41",
"amount": {
"value": "132.95",
"currency": "ARS"
},
"type": "sale",
"status": "pending",
"failure_code": null,
"created_at": "2020-07-25T20:27:42.784Z",
"happened_at": "2020-01-25T12:30:15Z",
"expires_at": null
}
]
}

POST /orders/56789/transactions/6b765950-e8e2-49f1-9c6a-0bb7c15a4f41/events

Request
{
"type": "sale",
"status": "success",
"happened_at": "2020-01-27T12:30:15.000Z"
}
Response

201 Created

{
"transaction_id": "6b765950-e8e2-49f1-9c6a-0bb7c15a4f41",
"amount": {
"value": "132.95",
"currency": "ARS"
},
"type": "sale",
"status": "success",
"failure_code": null,
"created_at": "2020-07-25T20:28:26.590Z",
"happened_at": "2020-01-27T12:30:15Z",
"expires_at": null
}
Example Nº 3: Get a credit card transaction that has been authorized, captured and then refunded

GET /orders/56789/transactions/21781944-a977-4b0d-93dc-908ddb87d778

Request
{}
Response

201 OK

{
"id": "21781944-a977-4b0d-93dc-908ddb87d778",
"payment_provider_id": "eeac118e-5534-40ba-b539-443449bc67a3",
"captured_amount": {
"value": "132.95",
"currency": "ARS"
},
"refunded_amount": {
"value": "132.95",
"currency": "ARS"
},
"authorized_amount": {
"value": "132.95",
"currency": "ARS"
},
"voided_amount": null,
"payment_method": {
"type": "credit_card",
"id": "visa"
},
"status": "refunded",
"info": {
"card": {
"brand": "visa",
"expiration_month": 12,
"expiration_year": 2020,
"first_digits": "445566",
"last_digits": "1234",
"masked_number": "XXXXXXXXXXXX1234",
"name": "Ash Ketchum"
},
"installments": {
"quantity": 3,
"interest": "0.1500"
},
"external_id": "1234",
"external_url": "https://mypayments.com/account/transactions/1234",
"refund_url": "https://mypayments.com/transactions/refund",
"supports_partial_refund": true,
"ip": "192.168.0.25"
},
"failure_code": null,
"created_at": "2020-07-25 17:30:15",
"events": [
{
"transaction_id": "21781944-a977-4b0d-93dc-908ddb87d778",
"amount": {
"value": "132.95",
"currency": "ARS"
},
"type": "authorization",
"status": "success",
"failure_code": null,
"created_at": "2020-07-25T20:30:15.138Z",
"happened_at": "2020-01-25T12:30:15Z",
"expires_at": null
},
{
"transaction_id": "21781944-a977-4b0d-93dc-908ddb87d778",
"amount": {
"value": "132.95",
"currency": "ARS"
},
"type": "capture",
"status": "success",
"failure_code": null,
"created_at": "2020-07-25T20:30:25.481Z",
"happened_at": "2020-01-27T12:30:15Z",
"expires_at": null
},
{
"transaction_id": "21781944-a977-4b0d-93dc-908ddb87d778",
"amount": {
"value": "132.95",
"currency": "ARS"
},
"type": "refund",
"status": "success",
"failure_code": null,
"created_at": "2020-07-25T20:30:33.517Z",
"happened_at": "2020-01-27T12:30:15Z",
"expires_at": null
}
]
}
Example Nº 4: Create a confirmed wallet transaction

POST /orders/24680/transactions

Request
{
"payment_provider_id": "eeac118e-5534-40ba-b539-443449bc67a3",
"payment_method": {
"type": "wallet"
},
"info": {
"external_id": "1234",
"external_url": "https://mypayments.com/account/transactions/1234"
},
"first_event": {
"amount": {
"value": "100.00",
"currency": "BRL"
},
"type": "sale",
"status": "success",
"happened_at": "2020-01-25T12:30:15.000Z"
}
}
Response

201 Created

{
"id": "364df14b-2433-4c7d-a4f6-60a512451592",
"payment_provider_id": "eeac118e-5534-40ba-b539-443449bc67a3",
"captured_amount": {
"value": "100.00",
"currency": "BRL"
},
"refunded_amount": {
"value": "0.00",
"currency": "BRL"
},
"authorized_amount": null,
"voided_amount": null,
"payment_method": {
"type": "wallet",
"id": "wallet"
},
"status": "paid",
"info": {
"external_id": "1234",
"external_url": "https://mypayments.com/account/transactions/1234"
},
"failure_code": null,
"created_at": "2020-09-04 14:27:30",
"events": [
{
"transaction_id": "364df14b-2433-4c7d-a4f6-60a512451592",
"amount": {
"value": "100.00",
"currency": "BRL"
},
"type": "sale",
"status": "success",
"failure_code": null,
"created_at": "2020-09-04T17:27:30.584Z",
"happened_at": "2020-01-25T12:30:15Z",
"expires_at": null
}
]
}
Example Nº 5: Create a failed debit card transaction

POST /orders/24680/transactions

Request
{
"payment_provider_id": "eeac118e-5534-40ba-b539-443449bc67a3",
"payment_method": {
"type": "debit_card",
"id": "visa_debit"
},
"info": {
"external_id": "1234",
"external_url": "https://mypayments.com/account/transactions/1234"
},
"first_event": {
"amount": {
"value": "132.95",
"currency": "BRL"
},
"type": "sale",
"status": "failure",
"failure_code": "card_cvv_invalid",
"happened_at": "2021-04-22T12:30:15.000Z"
}
}
Response

201 Created

{
"id":"96d9256b-6935-41bd-b820-48a33595de1d",
"payment_provider_id":"eeac118e-5534-40ba-b539-443449bc67a3",
"captured_amount":null,
"refunded_amount":null,
"authorized_amount":null,
"voided_amount":null,
"payment_method":{
"type":"debit_card",
"id": "visa_debit"
},
"status":"failed",
"info":{
"refund_url":null,
"external_id": "1234",
"external_url": "https://mypayments.com/account/transactions/1234",
"ip":null
},
"failure_code":"card_cvv_invalid",
"created_at":"2021-04-22 14:56:00",
"events":[
{
"transaction_id":"96d9256b-6935-41bd-b820-48a33595de1d",
"type":"sale",
"status":"failure",
"failure_code":"card_cvv_invalid",
"created_at":"2021-04-22T14:56:00.910Z",
"happened_at":"2021-04-22T12:30:15Z",
"expires_at":null,
"amount":{
"value": "132.95",
"currency": "BRL"
}
}
]
}
Example Nº 6: Create an external transaction for a $100 order with a $10 discount

POST /orders/24680/transactions

Request
{
"payment_provider_id": "eeac118e-5534-40ba-b539-443449bc67a3",
"payment_method": {
"type": "credit_card",
"id": "amex"
},
"info": {
"card": {
"brand": "amex",
"expiration_month": 12,
"expiration_year": 2021,
"first_digits": "445566",
"last_digits": "1234",
"masked_number": "XXXXXXXXXXXX1234",
"name": "Ash Ketchum"
},
"installments": {
"quantity": 1,
"interest": "0.00"
},
"external_id": "1234",
"external_url": "https://mypayments.com/account/transactions/1234"
},
"first_event": {
"amount": {
"value": "90.00",
"currency": "ARS"
},
"discount_amount": {
"value": "10.00",
"currency": "ARS"
},
"type": "sale",
"status": "success",
"happened_at": "2021-10-25T12:30:15.000Z"
}
}
Response

201 Created

Appendix

Transaction Failure Codes

The following list contains all the Transaction failures codes currently supported by our platform, organized by data groups.

Consumer
Failure CodeDescription
consumer_blockedThe consumer is blocked by the payment provider.
consumer_city_invalidThe consumer city is invalid.
consumer_country_invalidThe consumer country is invalid.
consumer_district_invalidThe consumer district is invalid.
consumer_email_invalidThe consumer email is invalid.
consumer_firstname_invalidThe consumer firstname is invalid.
consumer_floor_invalidThe consumer address floor is invalid.
consumer_id_invalidThe consumer identification is invalid.
consumer_id_type_invalidThe consumer identification type is invalid.
consumer_lastname_invalidThe consumer lastname is invalid.
consumer_phone_invalidThe consumer phone number is invalid.
consumer_province_invalidThe consumer province is invalid.
consumer_region_invalidThe consumer region is invalid.
consumer_same_as_merchantThe payment provider does not allow payments where the consumer is the same person as the merchant.
consumer_state_invalidThe consumer state is invalid.
consumer_street_invalidThe consumer address street is invalid.
consumer_street_number_invalidThe consumer address number is invalid.
consumer_zip_invalidThe consumer ZIP code is invalid.
Payment Methods

Bank Debit

Failure CodeDescription
bank_debit_bank_invalidThe bank debit bank is invalid.
bank_debit_method_unavailableThe bank debit payment method is not available.
bank_debit_payer_id_invalidThe bank debit payer identification is invalid.
bank_debit_payer_id_type_invalidThe bank debit payer identification type is invalid.
bank_debit_payer_name_invalidThe bank debit payer name is invalid.

Boleto

Failure CodeDescription
boleto_method_unavailableThe boleto method is not available.
boleto_payer_id_invalidThe boleto payer identification is invalid.
boleto_payer_id_type_invalidThe boleto payer identification type is invalid.
boleto_payer_name_invalidThe boleto payer name is invalid.

Card

Failure CodeDescription
card_cvv_invalidThe card security code is invalid.
card_expiration_date_invalidThe card expiration date is invalid.
card_holder_birthdate_invalidThe cardholder date of birth is invalid.
card_holder_id_invalidThe cardholder identification is invalid.
card_holder_id_type_invalidThe cardholder identification type is invalid.
card_holder_name_invalidThe cardholder name is invalid.
card_holder_phone_invalidThe cardholder phone number is invalid.
card_info_invalidThe card information is invalid.
card_issuer_invalidThe card issuer is invalid.
card_method_unavailableThe card method is not available.
card_number_invalidThe card number is invalid.
card_rejectedCard rejected.
card_rejected_call_for_authorizeCard rejected because payment must be authorized by the issuer.
card_rejected_deny_listCard rejected for being on a list of non accepted cards.
card_rejected_disabledCard rejected for being disabled.
card_rejected_duplicated_paymentCard rejected because payment seems to be duplicated.
card_rejected_fraud_high_riskCard rejected due to high fraud risk.
card_rejected_insufficient_fundsCard rejected for insufficient funds.
card_rejected_invalid_installmentsCard rejected for not supporting the specified installments.
card_rejected_max_attempsCard rejected for exceeding the number of attempts.
card_token_invalidThe card token is invalid.

Ticket

Failure CodeDescription
ticket_method_unavailableThe ticket method is not available.
ticket_operator_invalidThe ticket operator is invalid.
Shipping
Failure CodeDescription
shipping_city_invalidThe shipping city is invalid.
shipping_country_invalidThe shipping country is invalid.
shipping_district_invalidThe shipping district is invalid.
shipping_email_invalidThe shipping recipient email is invalid.
shipping_firstname_invalidThe shipping recipient firstname is invalid.
shipping_floor_invalidThe shipping address floor is invalid.
shipping_lastname_invalidThe shipping recipient lastname is invalid.
shipping_method_invalidThe shipping method is invalid.
shipping_method_unavailableThe shipping method is not available.
shipping_phone_invalidThe shipping recipient phone number is invalid.
shipping_price_invalidThe shipping price value is invalid.
shipping_province_invalidThe shipping province is invalid.
shipping_region_invalidThe shipping region is invalid.
shipping_state_invalidThe shipping state is invalid.
shipping_street_invalidThe shipping address street is invalid.
shipping_street_number_invalidThe shipping address number is invalid.
shipping_total_curreny_invalidThe shipping amount currency is invalid.
shipping_zip_invalidThe shipping ZIP code is invalid.
Order
Failure CodeDescription
line_items_currency_invalidAn order item amount currency is invalid.
line_items_description_invalidAn order item description is invalid.
line_items_price_invalidAn order item price value is invalid.
line_items_quantity_invalidAn order item quantity is invalid.
order_total_currency_invalidThe order amount currency is invalid.
order_total_price_invalidThe order price value is invalid.
order_total_price_too_smallThe order price value is less than the minimum supported value.