![RDoc](https://camo.githubusercontent.com/3500dc5fcd4cf3d6a3fecbeff7fbad4c0ab7f3cc6ba42a6aab644d639ea0f212/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f52446f632d7265666572656e63652d7265642e737667)
RetailCRM API ruby client
require 'retailcrm'
api = Retailcrm.new('https://demo.retailcrm.pro', 'yourApiKeyHere')
response = api.orders_get(345, 'id').response
order = response[:order]
require 'retailcrm'
api = Retailcrm.new('https://demo.retailcrm.pro', 'yourApiKeyHere')
order = {
:externalId => 171,
:number => '171',
:email => '[email protected]',
:createdAt => '2014-10-28 19:31:10',
:discountPercent => 10,
:firstName => 'Jack',
:lastName => 'Daniels',
:customer => {
:externalId => 8768,
:firstName => 'Jack',
:lastName => 'Daniels',
:phones => [{ :number => '+79000000000' }],
},
:delivery => {
:code => 'courier',
:cost => 500,
:address => {:text => '300000, Russia, Moscow, Tverskaya st., 56'}
},
:items => [
{
:productId => 170,
:initialPrice => 500,
:quantity => 2
},
{
:productId => 175,
:initialPrice => 1300,
:quantity => 1
}
]
}
response = api.orders_create(order).response
order_id = response[:id]