Skip to main content

Creating Transactions

Endpoint

POST https://api.paysecurez.com/api/v1/transactions

Request Headers

Authorization: Bearer {your_access_token}
Content-Type: application/json

Request Body

{
"transactionAction": "PAYMENT",
"amount": 100.00,
"currency": "USD",
"reference": "ORDER-123",
"statementDescriptor": "My Store Purchase",
"description": "Optional description",
"successUrl": "https://your-domain.com/success",
"pendingUrl": "https://your-domain.com/pending",
"failureUrl": "https://your-domain.com/failure",
"callbackUrl": "https://your-domain.com/webhook",
"ipAddress": "127.0.0.1",
"userDefinedField1": "Custom field 1",
"userDefinedField2": "Custom field 2",
"userDefinedField3": "Custom field 3",

"billing": {
"firstName": "John",
"lastName": "Doe",
"email": "john@example.com",
"phone": "+1234567890",
"customerReference": "CUST123",
"category": "INDIVIDUAL",
"documentNumber": "123456789",
"idType": "PASSPORT",
"pixKey": "pix-key",
"pixKeyType": "CPF",
"streetAddress": "123 Main St",
"city": "New York",
"state": "NY",
"country": "US",
"postcode": "10001"
},

"payment": {
"paymentMethod": "CARD",
"bank": "BANK123",
"holder": "John Doe",
"ifscCode": "IFSC001",
"accountNumber": "1234567890",
"iban": "GB29NWBK60161331926819",
"bic": "NWBKGB2L",
"cardNumber": "4111111111111111",
"expiryMonth": 12,
"expiryYear": 2025,
"cvc": "123"
}
}

Field Descriptions

Main Fields

FieldTypeRequiredDescription
transactionActionstringYesType of transaction (PAYMENT, AUTHORIZATION)
amountdecimalYesTransaction amount
currencystringYesCurrency code (USD, EUR, etc.)
referencestringYesYour unique transaction reference
statementDescriptorstringYesDescription shown on card statement
successUrlstringYesRedirect URL for successful payments
pendingUrlstringNoRedirect URL for pending payments (fallback to successUrl)
failureUrlstringNoRedirect URL for failed/declined payments (fallback to successUrl)
callbackUrlstringYesURL for webhook notifications

Billing Information

FieldTypeRequiredDescription
customerReferencestringYesYour unique customer identifier
firstNamestringNoCustomer's first name
lastNamestringNoCustomer's last name
emailstringNoCustomer's email address
phonestringNoCustomer's phone number

Payment Information

FieldTypeRequiredDescription
paymentMethodstringYesPayment method identifier
cardNumberstringConditionalRequired for card payments
expiryMonthintegerConditionalRequired for card payments
expiryYearintegerConditionalRequired for card payments
cvcstringConditionalRequired for card payments

Response

{
"transactionId": "TX123456789",
"reference": "ORDER-123",
"currency": "USD",
"amount": 100.00,
"status": "PENDING",
"message": "Transaction created successfully",
"checkoutUrl": "https://checkout.zepopay.com/TX123456789"
}

Error Responses

{
"error": "VALIDATION_ERROR",
"message": "Invalid request",
"details": [
{
"field": "amount",
"message": "Amount must be greater than 0"
}
]
}
tip

Use the description field to add internal notes that will be visible in your transaction history.