v1

latestOpenAPI 3.1.02026-07-263436159.3 KB

Create Transaction

Use this method to create a new transaction / deposit and get paid by your customers!

post/transactions

Headers

Ocp-Apim-Subscription-Keystring required

The subscription key has a length of 32 characters and will be provided within the API keys. Will be available for new integrations from July 24th onwards.

Request body

paymentMethodTagNamestring required

<strong style="color:red;">Only required if paymentMethodId is null</strong></br>The tag of the payment method used to process the transaction.

amountstring required

<strong style="color:red;">Required for all countries</strong></br>The amount of the transaction. The last two digits will be parsed as decimals (e.g. for 32.00$ write 3200)

currencystring required

<strong style="color:red;">Required for all countries</strong></br>The currency code of the currency used for the transaction. </br><strong>Value per country: </strong><a href="https://payretailers.readme.io/reference/transaction-parameters#local-currency-codes">Currency Codes</a>

descriptionstring

A short description of the order.

trackingIdstring

Optional external tracking reference for the transaction (Max 50 characters)

notificationUrlstring

The URL used to send notifications when a transaction is created and changes status.

returnUrlstring

The URL used to redirect the user after the transaction flow is completed.

languagestring

The language that will be displayed on the payment method's checkout page. Click <a href="https://payretailers.readme.io/reference/transaction-parameters#language">here</a> to see the possible values.

testModeboolean

Used to make the difference between real transactions and test transactions. Check the Test Mode page for more details.

merchantSpreadPercentnumber float

The FX rate you would like to add to the transaction amount expressed as a number with two decimals.

Response

200

uidstring
typestring
statusstring
{"stackTrail":"paths:/transactions:post:responses:200:content:application/json:schema:properties:message","oasType":"schema","type":"unknown"}
trackingIdstring
amountinteger
currencystring
descriptionstring
createdAtstring
updatedAtstring
pspTransactionIdstring
{"stackTrail":"paths:/transactions:post:responses:200:content:application/json:schema:properties:isValidPaymentMethod","oasType":"schema","type":"unknown"}
{"stackTrail":"paths:/transactions:post:responses:200:content:application/json:schema:properties:conversionInfo","oasType":"schema","type":"unknown"}

Example response

{
  "uid": "105433d8-74584-40b1-8f0e-3d543bbc0648",
  "type": "payment",
  "status": "PENDING",
  "trackingId": "10010000A100028",
  "amount": 1768,
  "currency": "USD",
  "description": "Payment Test",
  "createdAt": "2023-03-13T12:16:17.6633918Z",
  "updatedAt": "2023-03-13T12:16:17.6633918Z",
  "pspTransactionId": "840480",
  "fxBreakdown": {
    "exchangeRate": 0.1883,
    "components": {
      "merchantSpreadPercent": 1,
      "pspSpreadPercent": 1,
      "localTaxPercent": 1.1,
      "operationFeePercent": 1.5
    },
    "contexts": {
      "base": {
        "currency": "USD",
        "topUpAmount": 941.5,
        "merchantSpreadAmount": 9.42,
        "pspSpreadAmount": 9.42,
        "localTaxAmount": 10.36,
        "operationFee": 74.25,
        "netDepositAmount": 898.83
      },
      "local": {
        "currency": "CRC",
        "topUpAmount": 5000,
        "merchantSpreadAmount": 50,
        "pspSpreadAmount": 50,
        "localTaxAmount": 55,
        "operationFee": 74.25,
        "netDepositAmount": 4770.75
      }
    }
  },
  "customer": {
    "firstName": "John",
    "lastName": "Doe",
    "country": "BR",
    "city": "Sao Paulo",
    "address": "R. Sao Joaquim, 596",
    "phone": "5511999999999",
    "ip": "81.47.160.151",
    "personalId": "00113562600",
    "email": "test@payretailers.com"
  },
  "form": {
    "action": "https://api.gateway.payretailers.com/v2/public/transactions/gateway/105433d8-74584-40b1-8f0e-3d543bbc0648",
    "method": "GET"
  },
  "paymentMethod": {
    "id": "20421d39-5236-5421-9d0a-a9453279c98f",
    "name": "TEST",
    "type": "Online"
  },
  "billing": {
    "currency": "BRL",
    "amount": 10000
  }
}