Api / External
Enterprise
Integrating an External Application for Enterprise
IMPORTANT: For legibility the ”\” at the end of appropriate line were removed
Creating customer — before they buy for first time
Request
curl -v
-X GET $URL
--header "x-api-key: ${BEARER}"
--header 'Content-Type: application/json'
--data '{
"method":"createCustomer",
"params": {
"id":"ABC",
"name":"ABC Company",
"admin": {
"email":"test3@example.com",
"phone":"111111111",
"displayName": "Isa Aswath"
}
}
}'
Notes
- You send us your internal id (“ABC”) and we return it as “remoteId” in response.
- You can safely ignore “id” in the returned body, this is our internal primary key in the customers table.
- We will not send any emails out, so you can test safely.
Response
STATUS: 200
BODY:
{
"name":"ABC Company",
"partner":0,
"createdAt":1684313717,
"id":1,
"isActive":true,
"admin":{"email":"test3@example.com"},
"remoteId":"ABC"
}
Creating first order (i.e. createInstance)
Request
curl -v
-X GET $URL
--header "x-api-key: ${BEARER}"
--header 'Content-Type: application/json'
--data '{
"method":"createFirstOrder",
"params": {
"customer":"ABC",
"id":"REMOTEORDER1",
"product":"oo-lite",
"licenses":20,
"duration":"monthly"
}
}'
Notes
- “customer” the id you sent us in the “createCustomer” request
- “id” is the order in your tables — in the case of the first order, this is the parent order, you will send that in subsequent requests
- “products” can be any of oo-lite, oo-std, oo-ent, erp-std, erp-admin, erp-lim
- “duration” can be any of monthly or yearly
Creating renewal orders (i.e. renewInstance)
Request
curl -v
-X GET $URL
--header "x-api-key: ${BEARER}"
--header 'Content-Type: application/json'
--data '{
"method":"createRenewalOrder",
"params": {
"parent":"REMOTEORDER1",
"id":"REMOTEORDER2"
}
}'
Notes
- “parent” is the first order — stays the same for all renewals
- “id” is the current order, each new renewal will have a different order
- you cannot renew an order if more than 15 days left on current term (we can change if you want) - this also avoids repeated requests by mistake
- if a previous order expired, we start the term from the current date, otherwise from the end of current term
Cancelling orders (i.e. deleteInstance)
Request
curl -v
-X GET $URL
--header "x-api-key: ${BEARER}"
--header 'Content-Type: application/json'
--data '{
"method":"cancelOrder",
"params":{
"id":"REMOTEORDER1"
}
}'
Notes
- The only parameter is your id of the first order
Suspending orders
Request
curl -v
-X GET $URL
--header "x-api-key: ${BEARER}"
--header 'Content-Type: application/json'
--data '{
"method":"suspendOrder",
"params":{
"id":"REMOTEORDER1"
}
}'
Notes
- The only parameter is your id of the first order
Have questions?
Still have questions? Talk to support.
All content copyright OneOffice / ZeGenie Inc. -- Unauthorized use is prohibited.