Direct API Integration
The Direct API is a server-to-server integration in which your platform sends the complete transaction request to Morefin. Morefin validates the request, creates the transaction, and processes it using the payment configuration assigned to the supplied terminal.
Use this integration when your platform owns the cashier or checkout experience and can securely collect the information required by the selected payment method.
See Entities for an explanation of how business accounts, merchants, shops, and terminals relate to an API request.
Integration flow
- Obtain an access token using the OIDC client credentials flow.
- Choose a Pay-In or Pay-Out flow and collect its accepted payment, customer, and browser information.
- Send
POST /api/transactions/authorize. - Inspect the response and handle the returned branch:
result— the request has a transaction result.redirect— redirect the customer to the returned URL.form_submit— submit the returned fields to the returned URL.action— perform the flow-specific client action described by the response.
- If the transaction is not final, use status APIs and webhooks to obtain the final result.
The endpoint name is retained for compatibility. For new transactions, transaction_type selects the operation and payment_method.type selects the client-facing payment flow:
| Direction | transaction_type | payment_method.type examples |
|---|---|---|
| Pay-In | PURCHASE | BankDeposit, WalletDeposit, PixDeposit, CryptoDeposit, VoucherDeposit, CardDeposit |
| Pay-Out | WITHDRAWAL | BankWithdrawal, WalletWithdrawal, CryptoWithdrawal, CardWithdrawal |
The flow name and its accepted payment_method.data fields are the public payment contract. Morefin maps the flow to processing integrations internally; clients do not send integration names or integration-specific payment fields.
Support for a flow, transaction type, currency, and amount range depends on the terminal configuration.
Refunds are transaction-management operations. Send them to the refunds endpoint with transaction_type: REFUND; do not send a payment method for a refund.
Endpoint and authentication
POST /api/transactions/authorize
Authorization: Bearer <access_token>
Content-Type: application/json
See Environments for the API base URLs and Authentication for obtaining an access token.
Minimum request
{
"terminal_id": "your-terminal-id",
"reference": "merchant-order-10001",
"description": "Order 10001",
"currency": "EUR",
"amount": 1050,
"transaction_type": "PURCHASE",
"payment_method": {
"type": "CardDeposit",
"data": {
"encrypted_card_number": "<encrypted-value>",
"encrypted_cvv": "<encrypted-value>",
"encrypted_expiration_month": "<encrypted-value>",
"encrypted_expiration_year": "<encrypted-value>",
"cardholder_name": "Jane Doe"
}
},
"customer": {
"id": "customer-123",
"first_name": "Jane",
"last_name": "Doe",
"dob": "YYYY-MM-DD",
"email": "jane@example.com",
"country": "DE",
"customer_ip": "203.0.113.10"
}
}
amount is an integer in the currency’s minor unit. For example, 1050 represents EUR 10.50.
Send the original customer IP in customer.customer_ip. A value placed in metadata.customer_ip is treated only as merchant metadata and is not a substitute for the customer field.
For browser-initiated card payments, also send the complete browser_info object. It is commonly required for 3-D Secure and risk processing.
Next steps
- Entities — the Morefin account and payment configuration hierarchy.
- Pay-In flows — deposit flow inputs and JSON examples.
- Pay-Out flows — withdrawal flow inputs and JSON examples.
- Purchase — request fields, response branches, and status lookup.
- Card data — encryption and card-specific requirements.
- Transaction statuses — transitional and final outcomes.
- Webhooks — asynchronous transaction updates.