0.1.0 • Published 5 years ago
@laqlaq/sdk v0.1.0
Lalaq SDK
Installation
npm install --save @laqlaq/sdk
Usage
Initialization
When creating a new api caller instance, it should be provided api key
and version
, the baseUrl
is optional and refers by default to Laqlaq production api endpoint.
import { LaqlaqApi } from '@laqlaq/sdk';
let laqlaq = new LaqlaqApi({
key: 'secret_key', // provided by Laqlaq
version: 0 // or any available api version you want to use
});
Calling Endpoints
All resources are available under the LaqlaqApi
instance.
Orders
Create
const newOrder = {
source: {
name: 'أحمد',
location: 'البرامكة',
phoneNumber: '0999999999'
},
destination: {
name: 'ماجد',
location: 'المزة',
phoneNumber: '0988888888'
},
item: {
description: 'فلاشة ديسك مان حمرا 16 غيغا',
price: 10000
}
};
laqlaq.create(newOrder);
0.1.0
5 years ago