Create an Order [v3]
This API creates an order and returns and order_id
. To create an order, you will need to provide an amount, currency and and invoice_id
. This invoice id will be your internal reference for the order. Order creation is the first step in processing payments. There are additional parameters also required for order creation and their significance is explained below.
Request Body required
- Array [
- ]
- Encrypted payloads are not enabled by default so please reach out to our team if you want this functionality
- You will need to use AES GCM encryption for encrypting and decrypting the payload
- The same encryption/decryption logic is applicable for all the APIs called from your server
- You will be using the access_secret shared with you on your dashboard for the encryption and decryption process
- We will be happy to assist wherever possible, please reach out to help@nimbbl.biz
- Take the access_secret shared and remove the string part till
access_secret_
- Create a SHA256 digest of the remaining key we got from step 1
- AES Encrypt the unencrypted payload with AES Mode:
AES_GCM
- Encrypt the data and create a digest
- Create a bytes text in following format
- First 16 bytes as nonce
- After that the encrypted payload
- Last 16 bytes as authentication tag (This is either automatically generated or has to be manually passed depending on the programming language)
- Convert the bytes text (created in step 3) to hex
- Send the generated hex in the form of string in the encrypted_payload key
This is the amount before tax for your entire cart amount
This is the tax amount for your entire cart amount
This is the total amount inclusive of taxes for your entire cart amount
user object nullable
User information is typically mandatory to create an order, in case you are unable to provide some user information, please reach out to our team and we can make certain fields nullable to meet your requirements
This is the email address of your consumer
This is the first name of your consumer
This is the last name of your consumer
Default value: +91
This is the country code as defined by the Internation Telecom Union
This is the mobile number of your consumer
shipping_address object nullable
Shipping information is typically mandatory to create an order, in case you are unable to provide shipping information, please reach out to our team and we can make certain fields nullable to meet your requirements
This is the first line of the address for your consumer
This is the name of the street of the address for your consumer
This is the name of the landmark of the address for your consumer
This is the name of the area of the address for your consumer
This is the name of the city of the address for your consumer
This is the name of the state of the address for your consumer
This is the pincode or zipcode of the address for your consumer
This is a name or tag given to a specific address
This is your internal unique reference identifier for this order
This is for internal use by Nimbbl
This is for internal use by Nimbbl
This is the ip_address of the server from which order is created.
This is the domain URL from which the payments will be captured.
order_line_items object[] nullable
This contains the cart items so that they can be displayed on the checkout or cart based offers can be calculated. Cart information is typically mandatory to create an order, in case you are unable to provide cart information, please reach out to our team and we can make certain fields nullable to meet your requirements
This is the unique id of the product stored in your system
This is the title of the product that is being sold
This is the detailed description of the product being sold
This is the public URL from which the image of the product can be fetched
This is the pre tax rate of the item
This is the quantity that is being purchased
This is the rate * quantity i.e. the amount before tax
This is the tax amount on the cart item
This is the sum of amount before tax and the tax amount
bank_account object nullable
This is required only if you need your payment processor to check if the payment made is from a specific bank account(Third Party Verification). This is typically a requirement while collecting payments for certain financial services.
This is the bank account number of the consumer
This is the name of the bank account holder
Possible values: Value must match regular expression [A-Z]{4}0[A-Z0-9]{6}
This is the Indian Financial System Code of the bank and its corresponding branch
custom_attributes object nullable
Custom attributes that are associated with the order in a key and value pair
Before getting started
Steps for generating the Encryption/Decryption key
Steps for encryption
- 200
- 4XX
- 5XX
When the order is successfully created, the response will be as below.
Schema
- Array [
- ]
This is the unique order_id generated by Nimbbl for the invoice_id shared by you. This will be used in subsequent API calls
This is the date and time at which the order was created in UTC
Possible values: [new
]
This is the status of the order, at the time of order creation, this will always be new
This is your internal unique reference identifier for this order
user object
This is the user information fetched from Nimbbl depending on the user details shared during the create order API call
This is the email address of your consumer stored at Nimbbl
This is the first name of your consumer stored at Nimbbl
This is the last name of your consumer stored at Nimbbl
Default value: +91
This is the country code as defined by the Internation Telecom Union
This is the mobile number of your consumer shared by you
This is the unique identifier for the consumer on Nimbbl
This is the number of payment attempts made on this order, for a new order this will be 0
This is the currency code in ISO-4217 format
This is the amount before tax for your entire cart amount
This is the tax amount for your entire cart amount
This is the total amount inclusive of taxes for your entire cart amount
currency_conversion object nullable
This object is sent only if the transaction currency was changed. This object will have all the details related to currency conversion.
This is the currency code in ISO-4217 format in which the order was initiated
This is the currency code in ISO-4217 format in which the order will be processed in
This is the exchange rate used to convert amounts from original currency to converted currency
Possible values: [ALTERNATE_CURRENCY_CONFIG
]
This is the reason for currency conversion
This is the amount_before_tax
received when the order was initiated
This is the tax
when the order was initiated, if not received will be set to 0
This is the total_amount
received when the order was initiated
This token should be used to launch checkout. This token has expiry of 20 minutes.
This is the expiry of the token, it is expressed in UTC. If the token has expired, you will need to use refresh token.
This token is used to regenerate the token
to launch the checkout. This token has expiry of 24 hours.
This is the expiry of the token, it is expressed in UTC. If the token has expired, you will need to create a new order.
next object[]
The next array provides a recommendation for the next API call to be made, where multiple options are available, all of these are provided
Possible values: [payment_modes
]
To show on your checkout all the payment modes that are enabled for you and are personalised for your customer, you can call this API
Possible values: [/api/v3/payment-modes
]
This is the end point of the API that needs to be called for the above action, you will need to append the baseurl as provided in this doc
Possible values: [resolve_user
]
To link the user with this order and to restrict the use of the order for a specific user, you can call this API
Possible values: [/api/v3/resolve-user
]
This is the end point of the API that needs to be called for the above action, you will need to append the baseurl as provided in this doc
Possible values: [update_order
]
To update the details in an order, you can call this API
Possible values: [/api/v3/update-order
]
This is the end point of the API that needs to be called for the above action, you will need to append the baseurl as provided in this doc
{
"order_id": "o_9yo5wxlLlbJGK6dp",
"order_date": "2021-04-15 04:34:15.990152",
"status": "new",
"invoice_id": "inv_asjjeibdhakk49hnek3",
"user": {
"email": "wonderwoman@themyscira.gov",
"first_name": "Diana",
"last_name": "Prince",
"country_code": "+91",
"mobile_number": 9876543210,
"user_id": "user_78hsjkdhb2482ndk"
},
"attempts": 0,
"currency": "INR",
"amount_before_tax": 1000,
"tax": 180,
"total_amount": 1180,
"currency_conversion": {
"original_currency": "USD",
"converted_currency": "INR",
"exchange_rate": 83.72,
"conversion_reason": "ALTERNATE_CURRENCY_CONFIG",
"original_amount_before_tax": 11.94,
"original_tax": 2.15,
"original_total_amount": 14.09
},
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo0LCJleHAiOjE2MTc4ODkxMjJ9.mBz-d9hizuhLaIBVHYR8eGL5E9mJ0F2gsRfS5VNqrAw",
"token_expiration": "2021-01-09T09:49:57.715413",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjo2LCJzdWJfbWVyY2hhbnRfaWQiOjMsImV4cCI6MTcwNzg5ODk1OSwidHlwZSI6Im1lcmNoYW50IiwiaWF0IjoxNzA3ODk3NzU5LCJpc3MiOiJ1cm46bmltYmJsIiwidG9rZW5fdHlwZSI6InRyYW5zYWN0aW9uIn0.YLpLWonfBIlB8FFBEXQcLt_JA6ymnN0zXANR1J_Bg2M",
"refresh_token_expiration": "2021-01-09T09:49:57.715413",
"next": [
{},
{},
{}
]
}
{
"order_id": "o_9yo5wxlLlbJGK6dp",
"order_date": "2021-04-15 04:34:15.990152",
"status": "new",
"invoice_id": "inv_asjjeibdhakk49hnek3",
"attempts": 0,
"currency": "INR",
"amount_before_tax": 2100,
"tax": 105,
"total_amount": 2205,
"next": [
{
"action": "payment_modes",
"url": "/api/v3/payment-modes"
},
{
"action": "update_order",
"url": "/api/v3/update-order"
},
{
"action": "resolve_user",
"url": "/api/v3/resolve-user"
}
]
}
{
"order_id": "o_9yo5wxlLlbJGK6dp",
"order_date": "2021-04-15 04:34:15.990152",
"status": "new",
"invoice_id": "inv_asjjeibdhakk49hnek3",
"attempts": 0,
"currency": "INR",
"amount_before_tax": 2100,
"tax": 105,
"total_amount": 2205,
"user": {
"email": "wonderwoman@themyscira.gov",
"first_name": "Diana",
"last_name": "Prince",
"country_code": "+91",
"mobile_number": 9876543210,
"user_id": "user_78hsjkdhb2482ndk"
},
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjo2LCJzdWJfbWVyY2hhbnRfaWQiOjMsImV4cCI6MTcwNzg5ODk1OSwidHlwZSI6Im1lcmNoYW50IiwiaWF0IjoxNzA3ODk3NzU5LCJpc3MiOiJ1cm46bmltYmJsIiwidG9rZW5fdHlwZSI6InRyYW5zYWN0aW9uIn0.YLpLWonfBIlB8FFBEXQcLt_JA6ymnN0zXANR1J_Bg2M",
"token_expiration": "2021-01-09T09:49:57.715413",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjo2LCJzdWJfbWVyY2hhbnRfaWQiOjMsImV4cCI6MTcwNzg5ODk1OSwidHlwZSI6Im1lcmNoYW50IiwiaWF0IjoxNzA3ODk3NzU5LCJpc3MiOiJ1cm46bmltYmJsIiwidG9rZW5fdHlwZSI6InRyYW5zYWN0aW9uIn0.YLpLWonfBIlB8FFBEXQcLt_JA6ymnN0zXANR1J_Bg2M",
"refresh_token_expiration": "2021-01-09T09:49:57.715413",
"next": [
{
"action": "payment_modes",
"url": "/api/v3/payment-modes"
},
{
"action": "update_order",
"url": "/api/v3/update-order"
},
{
"action": "resolve_user",
"url": "/api/v3/resolve-user"
}
]
}
When the order cannot be created, the response will be as below
Schema
error object
This is the error_code generated by Nimbbl
This is a customer friendly message that can be displayed to your consumer
This explains to your team how to recover from the error
{
"error": {
"nimbbl_error_code": "INVALID_REQUEST_PARAMETER",
"nimbbl_consumer_message": "Sorry, your payment cannot be processed due to a technical error. Please try again after some time.",
"nimbbl_merchant_message": "There is an input validation error, please check the payload of your request."
}
}
When there is a problem on the server, the response will be as below
Schema
error object
This is the error_code generated by Nimbbl
This is a customer friendly message that can be displayed to your consumer
This explains to your team how to recover from the error
{
"error": {
"nimbbl_error_code": "INVALID_REQUEST_PARAMETER",
"nimbbl_consumer_message": "Sorry, your payment cannot be processed due to a technical error. Please try again after some time.",
"nimbbl_merchant_message": "There is an input validation error, please check the payload of your request."
}
}