createOrder
/?class=order&method=create
Usage and SDK Samples
curl -X GET\
-H "Accept: application/json"\
"https://public.ecorpay.net/?class=order&method=create?merchant=&amount=&payway=&bill=&unique=&userID=&nonce=&description=&sign="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.CreateOrderApi;
import java.io.File;
import java.util.*;
public class CreateOrderApiExample {
public static void main(String[] args) {
CreateOrderApi apiInstance = new CreateOrderApi();
Integer merchant = 56; // Integer | Unique merchant ID from credentials
Integer amount = 56; // Integer | Payment amount in format 1 RUB. = 100
Integer payway = 56; // Integer | Payway direction identificator
Integer bill = 56; // Integer | Unique payment identificator on a merchant side. Should be replaced for 0 in sign if was not used.
Integer unique = 56; // Integer | Is payment must not be created with duplicate merchant bill
Integer userID = 56; // Integer | User identificator on a merchant side
String nonce = nonce_example; // String | Unique salt for every request, current timestamp may be used as nonce
String description = description_example; // String | Payment description will be shown on invoice payment page
String sign = sign_example; // String | HMAC-SHA256 hash of string contains (`class` + '/' + `method` + '/' + `amount` + '/' + `bill` + '/' + `payway` + '/' + `nonce`) and signed with your api key
try {
OrderResponse result = apiInstance.createOrder(merchant, amount, payway, bill, unique, userID, nonce, description, sign);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CreateOrderApi#createOrder");
e.printStackTrace();
}
}
}
import io.swagger.client.api.CreateOrderApi;
public class CreateOrderApiExample {
public static void main(String[] args) {
CreateOrderApi apiInstance = new CreateOrderApi();
Integer merchant = 56; // Integer | Unique merchant ID from credentials
Integer amount = 56; // Integer | Payment amount in format 1 RUB. = 100
Integer payway = 56; // Integer | Payway direction identificator
Integer bill = 56; // Integer | Unique payment identificator on a merchant side. Should be replaced for 0 in sign if was not used.
Integer unique = 56; // Integer | Is payment must not be created with duplicate merchant bill
Integer userID = 56; // Integer | User identificator on a merchant side
String nonce = nonce_example; // String | Unique salt for every request, current timestamp may be used as nonce
String description = description_example; // String | Payment description will be shown on invoice payment page
String sign = sign_example; // String | HMAC-SHA256 hash of string contains (`class` + '/' + `method` + '/' + `amount` + '/' + `bill` + '/' + `payway` + '/' + `nonce`) and signed with your api key
try {
OrderResponse result = apiInstance.createOrder(merchant, amount, payway, bill, unique, userID, nonce, description, sign);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CreateOrderApi#createOrder");
e.printStackTrace();
}
}
}
Integer *merchant = 56; // Unique merchant ID from credentials (default to 1)
Integer *amount = 56; // Payment amount in format 1 RUB. = 100 (default to 1000)
Integer *payway = 56; // Payway direction identificator (default to 1)
Integer *bill = 56; // Unique payment identificator on a merchant side. Should be replaced for 0 in sign if was not used. (optional) (default to 1)
Integer *unique = 56; // Is payment must not be created with duplicate merchant bill (optional)
Integer *userID = 56; // User identificator on a merchant side (optional)
String *nonce = nonce_example; // Unique salt for every request, current timestamp may be used as nonce (optional)
String *description = description_example; // Payment description will be shown on invoice payment page (optional)
String *sign = sign_example; // HMAC-SHA256 hash of string contains (`class` + '/' + `method` + '/' + `amount` + '/' + `bill` + '/' + `payway` + '/' + `nonce`) and signed with your api key (optional)
CreateOrderApi *apiInstance = [[CreateOrderApi alloc] init];
[apiInstance createOrderWith:merchant
amount:amount
payway:payway
bill:bill
unique:unique
userID:userID
nonce:nonce
description:description
sign:sign
completionHandler: ^(OrderResponse output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var EcorpayApi10 = require('ecorpay___api_10');
var api = new EcorpayApi10.CreateOrderApi()
var merchant = 56; // {{Integer}} Unique merchant ID from credentials
var amount = 56; // {{Integer}} Payment amount in format 1 RUB. = 100
var payway = 56; // {{Integer}} Payway direction identificator
var opts = {
'bill': 56, // {{Integer}} Unique payment identificator on a merchant side. Should be replaced for 0 in sign if was not used.
'unique': 56, // {{Integer}} Is payment must not be created with duplicate merchant bill
'userID': 56, // {{Integer}} User identificator on a merchant side
'nonce': nonce_example, // {{String}} Unique salt for every request, current timestamp may be used as nonce
'description': description_example, // {{String}} Payment description will be shown on invoice payment page
'sign': sign_example // {{String}} HMAC-SHA256 hash of string contains (`class` + '/' + `method` + '/' + `amount` + '/' + `bill` + '/' + `payway` + '/' + `nonce`) and signed with your api key
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.createOrder(merchant, amount, payway, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class createOrderExample
{
public void main()
{
var apiInstance = new CreateOrderApi();
var merchant = 56; // Integer | Unique merchant ID from credentials (default to 1)
var amount = 56; // Integer | Payment amount in format 1 RUB. = 100 (default to 1000)
var payway = 56; // Integer | Payway direction identificator (default to 1)
var bill = 56; // Integer | Unique payment identificator on a merchant side. Should be replaced for 0 in sign if was not used. (optional) (default to 1)
var unique = 56; // Integer | Is payment must not be created with duplicate merchant bill (optional)
var userID = 56; // Integer | User identificator on a merchant side (optional)
var nonce = nonce_example; // String | Unique salt for every request, current timestamp may be used as nonce (optional)
var description = description_example; // String | Payment description will be shown on invoice payment page (optional)
var sign = sign_example; // String | HMAC-SHA256 hash of string contains (`class` + '/' + `method` + '/' + `amount` + '/' + `bill` + '/' + `payway` + '/' + `nonce`) and signed with your api key (optional)
try
{
OrderResponse result = apiInstance.createOrder(merchant, amount, payway, bill, unique, userID, nonce, description, sign);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling CreateOrderApi.createOrder: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\ApiCreateOrderApi();
$merchant = 56; // Integer | Unique merchant ID from credentials
$amount = 56; // Integer | Payment amount in format 1 RUB. = 100
$payway = 56; // Integer | Payway direction identificator
$bill = 56; // Integer | Unique payment identificator on a merchant side. Should be replaced for 0 in sign if was not used.
$unique = 56; // Integer | Is payment must not be created with duplicate merchant bill
$userID = 56; // Integer | User identificator on a merchant side
$nonce = nonce_example; // String | Unique salt for every request, current timestamp may be used as nonce
$description = description_example; // String | Payment description will be shown on invoice payment page
$sign = sign_example; // String | HMAC-SHA256 hash of string contains (`class` + '/' + `method` + '/' + `amount` + '/' + `bill` + '/' + `payway` + '/' + `nonce`) and signed with your api key
try {
$result = $api_instance->createOrder($merchant, $amount, $payway, $bill, $unique, $userID, $nonce, $description, $sign);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CreateOrderApi->createOrder: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::CreateOrderApi;
my $api_instance = WWW::SwaggerClient::CreateOrderApi->new();
my $merchant = 56; # Integer | Unique merchant ID from credentials
my $amount = 56; # Integer | Payment amount in format 1 RUB. = 100
my $payway = 56; # Integer | Payway direction identificator
my $bill = 56; # Integer | Unique payment identificator on a merchant side. Should be replaced for 0 in sign if was not used.
my $unique = 56; # Integer | Is payment must not be created with duplicate merchant bill
my $userID = 56; # Integer | User identificator on a merchant side
my $nonce = nonce_example; # String | Unique salt for every request, current timestamp may be used as nonce
my $description = description_example; # String | Payment description will be shown on invoice payment page
my $sign = sign_example; # String | HMAC-SHA256 hash of string contains (`class` + '/' + `method` + '/' + `amount` + '/' + `bill` + '/' + `payway` + '/' + `nonce`) and signed with your api key
eval {
my $result = $api_instance->createOrder(merchant => $merchant, amount => $amount, payway => $payway, bill => $bill, unique => $unique, userID => $userID, nonce => $nonce, description => $description, sign => $sign);
print Dumper($result);
};
if ($@) {
warn "Exception when calling CreateOrderApi->createOrder: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.CreateOrderApi()
merchant = 56 # Integer | Unique merchant ID from credentials (default to 1)
amount = 56 # Integer | Payment amount in format 1 RUB. = 100 (default to 1000)
payway = 56 # Integer | Payway direction identificator (default to 1)
bill = 56 # Integer | Unique payment identificator on a merchant side. Should be replaced for 0 in sign if was not used. (optional) (default to 1)
unique = 56 # Integer | Is payment must not be created with duplicate merchant bill (optional)
userID = 56 # Integer | User identificator on a merchant side (optional)
nonce = nonce_example # String | Unique salt for every request, current timestamp may be used as nonce (optional)
description = description_example # String | Payment description will be shown on invoice payment page (optional)
sign = sign_example # String | HMAC-SHA256 hash of string contains (`class` + '/' + `method` + '/' + `amount` + '/' + `bill` + '/' + `payway` + '/' + `nonce`) and signed with your api key (optional)
try:
api_response = api_instance.create_order(merchant, amount, payway, bill=bill, unique=unique, userID=userID, nonce=nonce, description=description, sign=sign)
pprint(api_response)
except ApiException as e:
print("Exception when calling CreateOrderApi->createOrder: %s\n" % e)
Parameters
Query parameters
Name | Description |
---|---|
merchant* |
Integer
(int32)
Unique merchant ID from credentials
Required
|
amount* |
Integer
(int32)
Payment amount in format 1 RUB. = 100
Required
|
payway* |
Integer
(int32)
Payway direction identificator
Required
|
bill |
Integer
(int32)
Unique payment identificator on a merchant side. Should be replaced for 0 in sign if was not used.
|
unique |
Integer
(int32)
Is payment must not be created with duplicate merchant bill
|
userID |
Integer
(int32)
User identificator on a merchant side
|
nonce |
String
Unique salt for every request, current timestamp may be used as nonce
|
description |
String
Payment description will be shown on invoice payment page
|
sign |
String
HMAC-SHA256 hash of string contains (`class` + '/' + `method` + '/' + `amount` + '/' + `bill` + '/' + `payway` + '/' + `nonce`) and signed with your api key
|