Create Payments
This guide shows you how to create  doTransaction requests for both pre-authorization and single-step payments. You will learn to configure the JSON-RPC parameters and specify transaction-specific details.
Pre-requisites
Before you begin, ensure you have:
- Access to the client application.
- Completed your Nayax Core setup.
- Basic understanding of JSON-RPC 2.0 structure.
JSON-RPC 2.0See Get Started for more details on how the requests are structured and sent.
Create a Pre-Authorization Request
See the example Pre-Authorization request below.
{
    "jsonrpc": "2.0",
    "method": "doTransaction",
    "id": "1696161997899",
    "params": [
        "engine",
        {
            "vuid": "80b458684",
            "tranCode": 3,
            "amount": 100
        }
    ]
}To create this request, follow the steps below:
- First, configure the JSON-RPC parameters:
- jsonrpc: Set this to 2.0.
- method: Set this to- doTransaction.
- id: Input the ID of your request here.
 
- Add the paramsobject inputting the payment service used, which in this example isengine.
- Now, add the parameters for the method:
- vuid: This is the unique transaction identifier the vendor (client) assigns.
- amount: The transaction amount in cents.
- tranCode: This parameter defines the transaction type. It must be set to 3 for a pre-authorization transaction.
 
Once the request is ready, it can be sent to the server endpoint.
Create a Pre-Selection Request
See the example Pre-Selection request below.
{
    "jsonrpc": "2.0",
    "method": "doTransaction",
    "id": "123454352",
    "params": [
        "engine",
        {
            "vuid": "44d96006",
            "amount": 100,
            "tranCode": 1
        }
    ]
}To create this request, follow the steps below:
- First, configure the JSON-RPC parameters:
- jsonrpc: Set this to 2.0.
- method: Set it to- doTransaction.
- id: Input the ID of your request here.
 
- Add the paramsobject inputting the payment service used, which in this example isengine.
- Now, add the parameters for the method:
- vuid: This is the unique transaction identifier the vendor (client) assigns.
- amount: The transaction amount in cents.
- tranCode: This parameter defines the transaction type. It must be set to 1 for a single-step transaction.
 
Once the request is ready, it can be sent to the server endpoint.
See Also
Updated about 1 month ago