Create Order

The ‘Create Order’ API is crucial for initializing transactions within the RampNow ecosystem. Once the Access Token is generated, this API enables merchants to create orders by securely authenticating via the Access Token, thereby facilitating seamless transactions for users.

Authorization:

This endpoint requires the Access Token obtained from the ‘Create Access Token’ API in the Authorization header.

Authorization: Bearer YOUR_ACCESS_TOKEN

Create an order

POST /api/v1/external/orders

The ‘Create Order’ API is crucial for initializing transactions within the RampNow ecosystem. Once the Access Token is generated, this API enables merchants to create orders by securely authenticating via the Access Token, thereby facilitating seamless transactions for users.

Request Body

Sample response

{
    "status": "success",
    "data": {
        "id": "cfde78dc-7485-4e84-a26a-5af0a627288c",
        "merchantTransactionId": "dshcucfhweedhbdvsyssasde7fc6sd9a14",
        "type": "buy",
        "status": "created",
        "amount": 0.5,
        "currency": "EUR",
        "baseCurrency": "EUR",
        "baseCurrencyAmount": 0.5,
        "exchangeRate": 1,
        "cryptocurrency": "USDT",
        "cryptocurrencyAmount": 0.5276181732803604,
        "cryptoExchangeRate": 1.0552363465607209,
        "redirectUrl": "https://dev.pay.rampnow.io?orderId=cfde7dsadsad84-a26a-5af0a627288c&token=eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJjNTIwZTQwZmM2OGQ3OTY0OTE3MzZjYzg2M2EzNTQ0ZmY3OGY1OTE1ZjhiOTEzMWUzY2Q5ZGUwZWNkYzIyNTkyIiwiZXhwIjoxNjk1OTEwMjUxfQ.-tzyGwsxqxhM1gGMkE7nA8qwNbS-CU31y5by9Vcg0N4jrZbnwsDViOLcqPUc4yYl4CY--ylLe63KQGsT_Z9u6Q"
    }
}

Usage:

Merchants should open the received redirectUrl for customers to complete the payment.

Note:

The obtained Redirect URL is significant as it is the URL where the customer will complete the payment, and it ensures a seamless user experience by redirecting users directly to the payment page.

Sample request

{
    "orderDetail": {
        "merchantTransactionId": "{{$guid}}",
        "firstName": "Test",
        "lastName": "Customer",
        "email": "test@customer.com",
        "countryCode": "DE",
        "mobileNumber": "1234566778",
        "addressLine1": "Test Address 1",
        "addressLine2": "Test Address 2",
        "city": "Test City",
        "state": "Test State",
        "country": "Test Country",
        "amount": 1,
        "currency": "EUR",
        "paymentMethod": "Card",
        "callbackUrl": "http://testmerchant.com/ipn",
        "returnUrl": "https://google.com"
    }
}

Sample reponse

{
    "status": "success",
    "data": {
        "id": "4df31123-6956-4aa0-983f-d44ae749359c",
        "merchantTransactionId": "712c3e1e-7545-4423-af3b-29093b278bcd",
        "type": "buy",
        "status": "created",
        "amount": 1,
        "currency": "EUR",
        "baseCurrency": "EUR",
        "baseCurrencyAmount": 1,
        "exchangeRate": 1,
        "cryptocurrency": "USDT",
        "cryptocurrencyAmount": 1.054696563798595,
        "cryptoExchangeRate": 1.054696563798595,
        "redirectUrl": "https://dev.pay.rampnow.io?orderId=4df31123-6956-4aa0-983f-d44ae749359c&token=eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJjNTIwZTQwZmM2OGQ3OTY0OTE3MzZjYzg2M2EzNTQ0ZmY3OGY1OTE1ZjhiOTEzMWUzY2Q5ZGUwZWNkYzIyNTkyIiwiZXhwIjoxNjk2ODY4NjM4fQ.9Pyf2YsTTOjF--WRGntsqyqFqBKsSPm0QAfIcJCX6l6mDWDb-H4tGlc2eBUqSQS4A68XpOTw6uEmoAoznX_0vQ&paymentMethod=ideal&returnUrl=https://google.com"
    }
}

Conclusion:

By utilizing the ‘Create Order’ API, merchants can efficiently initialize and manage transactions, offering users a smooth and secure pathway to completing payments within the RampNow ecosystem.

Last updated