Difference between revisions of "Orders"
From Advice Local Wiki
(→Get an Order) |
(→Example Response) |
||
Line 175: | Line 175: | ||
=== Example Response === | === Example Response === | ||
<syntaxhighlight lang="json"> | <syntaxhighlight lang="json"> | ||
− | + | { | |
+ | "status": 200, | ||
+ | "success": true, | ||
+ | "error": null, | ||
+ | "data": { | ||
+ | "order": { | ||
+ | "id": 872877, | ||
+ | "price": 0, | ||
+ | "discount": 0, | ||
+ | "schedule": null, | ||
+ | "client": 3201926, | ||
+ | "partnerUsername": "lssdev@emeraldconnect.com", | ||
+ | "products": [ | ||
+ | "3021", | ||
+ | "3047", | ||
+ | "3063", | ||
+ | "3230" | ||
+ | ], | ||
+ | "createdAt": "2017-12-13T22:10:16.000Z", | ||
+ | "startedAt": "2017-12-13T22:10:16.000Z", | ||
+ | "publishedAt": "2017-12-13T22:10:16.000Z", | ||
+ | "isPaid": true, | ||
+ | "isVerified": false, | ||
+ | "isDrip": "", | ||
+ | "chargeId": null, | ||
+ | "partner": 7 | ||
+ | }, | ||
+ | "products": [ | ||
+ | { | ||
+ | "id": 3598242, | ||
+ | "price": 0, | ||
+ | "customPackage": null, | ||
+ | "priceMaintenance": 0, | ||
+ | "priceRenewal": null, | ||
+ | "delayMaintenance": 1, | ||
+ | "intervalMaintenance": null, | ||
+ | "intervalRenewal": "yearly", | ||
+ | "periodMaintenance": 1, | ||
+ | "isDrip": "false", | ||
+ | "isDisabled": "true", | ||
+ | "isCompleted": "false", | ||
+ | "createdAt": "2017-12-13T22:10:16.000Z", | ||
+ | "startedAt": null, | ||
+ | "completedAt": "0000-00-00 00:00:00", | ||
+ | "disabledAt": "2017-12-13T22:28:42.000Z", | ||
+ | "derezzedAt": null, | ||
+ | "partner": 7, | ||
+ | "client": 3201926, | ||
+ | "order": 872877, | ||
+ | "product": 3021 | ||
+ | }, | ||
+ | { | ||
+ | "id": 3598243, | ||
+ | "price": 0, | ||
+ | "customPackage": null, | ||
+ | "priceMaintenance": 0, | ||
+ | "priceRenewal": null, | ||
+ | "delayMaintenance": 1, | ||
+ | "intervalMaintenance": null, | ||
+ | "intervalRenewal": "yearly", | ||
+ | "periodMaintenance": 1, | ||
+ | "isDrip": "false", | ||
+ | "isDisabled": "true", | ||
+ | "isCompleted": "false", | ||
+ | "createdAt": "2017-12-13T22:10:16.000Z", | ||
+ | "startedAt": null, | ||
+ | "completedAt": "0000-00-00 00:00:00", | ||
+ | "disabledAt": "2017-12-13T22:28:42.000Z", | ||
+ | "derezzedAt": null, | ||
+ | "partner": 7, | ||
+ | "client": 3201926, | ||
+ | "order": 872877, | ||
+ | "product": 3047 | ||
+ | }, | ||
+ | { | ||
+ | "id": 3598244, | ||
+ | "price": 0, | ||
+ | "customPackage": null, | ||
+ | "priceMaintenance": 0, | ||
+ | "priceRenewal": null, | ||
+ | "delayMaintenance": 1, | ||
+ | "intervalMaintenance": null, | ||
+ | "intervalRenewal": "yearly", | ||
+ | "periodMaintenance": 1, | ||
+ | "isDrip": "false", | ||
+ | "isDisabled": "true", | ||
+ | "isCompleted": "false", | ||
+ | "createdAt": "2017-12-13T22:10:16.000Z", | ||
+ | "startedAt": null, | ||
+ | "completedAt": "0000-00-00 00:00:00", | ||
+ | "disabledAt": "2017-12-13T22:28:42.000Z", | ||
+ | "derezzedAt": null, | ||
+ | "partner": 7, | ||
+ | "client": 3201926, | ||
+ | "order": 872877, | ||
+ | "product": 3230 | ||
+ | }, | ||
+ | { | ||
+ | "id": 3598245, | ||
+ | "price": 0, | ||
+ | "customPackage": null, | ||
+ | "priceMaintenance": 0, | ||
+ | "priceRenewal": null, | ||
+ | "delayMaintenance": 1, | ||
+ | "intervalMaintenance": null, | ||
+ | "intervalRenewal": "yearly", | ||
+ | "periodMaintenance": 1, | ||
+ | "isDrip": "false", | ||
+ | "isDisabled": "true", | ||
+ | "isCompleted": "false", | ||
+ | "createdAt": "2017-12-13T22:10:16.000Z", | ||
+ | "startedAt": null, | ||
+ | "completedAt": "0000-00-00 00:00:00", | ||
+ | "disabledAt": "2017-12-13T22:28:42.000Z", | ||
+ | "derezzedAt": null, | ||
+ | "partner": 7, | ||
+ | "client": 3201926, | ||
+ | "order": 872877, | ||
+ | "product": 3063 | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | } | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 14:29, 13 December 2017
Contents
Create an Order
You must [Trigger a Report] before creating an order.
API Endpoint
http://p.lssdev.com/legacyorders
Example Request
POST /legacyorders HTTP/1.1
Host: p.lssdev.com
x-api-token: YOUR_API_KEY
Content-Type: application/json
{"client":12345,"products":[3021,3047,3063,3230]}
"client" is the {client_id} of the client.
"products" are product IDs to ordered. The list of products is here [Get all Products].
Example Response
{
"status": 200,
"success": true,
"error": null,
"data": {
"order": {
"client": 12345,
"price": 0,
"discount": 0,
"id": 872877,
"partnerUsername": "dev@lssdev.com",
"products": [
"3021",
"3047",
"3063",
"3230"
],
"createdAt": "2017-12-13T22:10:16.000Z",
"startedAt": "2017-12-13T22:10:16.000Z",
"publishedAt": "2017-12-13T22:10:16.000Z",
"isPaid": true,
"isVerified": true,
"isDrip": false,
"partner": 7
},
"products": [
{
"price": 0,
"id": 3598242,
"priceMaintenance": 0,
"delayMaintenance": "1",
"intervalMaintenance": null,
"intervalRenewal": "yearly",
"isDrip": "false",
"isDisabled": "false",
"isCompleted": "false",
"createdAt": "2017-12-13T22:10:16.000Z",
"partner": 7,
"client": 3201926,
"order": 872877,
"product": 3021
},
{
"price": 0,
"id": 3598243,
"priceMaintenance": 0,
"delayMaintenance": "1",
"intervalMaintenance": null,
"intervalRenewal": "yearly",
"isDrip": "false",
"isDisabled": "false",
"isCompleted": "false",
"createdAt": "2017-12-13T22:10:16.000Z",
"partner": 7,
"client": 3201926,
"order": 872877,
"product": 3047
},
{
"price": 0,
"id": 3598245,
"priceMaintenance": 0,
"delayMaintenance": "1",
"intervalMaintenance": null,
"intervalRenewal": "yearly",
"isDrip": "false",
"isDisabled": "false",
"isCompleted": "false",
"createdAt": "2017-12-13T22:10:16.000Z",
"partner": 7,
"client": 3201926,
"order": 872877,
"product": 3063
},
{
"price": 0,
"id": 3598244,
"priceMaintenance": 0,
"delayMaintenance": "1",
"intervalMaintenance": null,
"intervalRenewal": "yearly",
"isDrip": "false",
"isDisabled": "false",
"isCompleted": "false",
"createdAt": "2017-12-13T22:10:16.000Z",
"partner": 7,
"client": 3201926,
"order": 872877,
"product": 3230
}
],
"test": false
}
}
Get an Order
API Endpoint
http://p.lssdev.com/legacyorders/{order_id}
Example Request
GET /legacyorders/872877 HTTP/1.1
Host: p.lssdev.com
x-api-token: YOUR_API_KEY
Content-Type: application/json
Example Response
{
"status": 200,
"success": true,
"error": null,
"data": {
"partner": 7,
"client": 12345,
"id": 872877,
"price": 0,
"discount": 0,
"schedule": null,
"partnerUsername": "dev@lssdev.com",
"products": [
"3021",
"3047",
"3063",
"3230"
],
"createdAt": "2017-12-13T22:10:16.000Z",
"startedAt": "2017-12-13T22:10:16.000Z",
"publishedAt": "2017-12-13T22:10:16.000Z",
"isPaid": true,
"isVerified": true,
"isDrip": "",
"chargeId": null,
"transactionId": "545ecda1-52f1-4c54-ac03-57d706e218dc"
}
}
Delete an Order
API Endpoint
http://p.lssdev.com/legacyorders/{order_id}
Example Request
Example Response
{
"status": 200,
"success": true,
"error": null,
"data": {
"order": {
"id": 872877,
"price": 0,
"discount": 0,
"schedule": null,
"client": 3201926,
"partnerUsername": "lssdev@emeraldconnect.com",
"products": [
"3021",
"3047",
"3063",
"3230"
],
"createdAt": "2017-12-13T22:10:16.000Z",
"startedAt": "2017-12-13T22:10:16.000Z",
"publishedAt": "2017-12-13T22:10:16.000Z",
"isPaid": true,
"isVerified": false,
"isDrip": "",
"chargeId": null,
"partner": 7
},
"products": [
{
"id": 3598242,
"price": 0,
"customPackage": null,
"priceMaintenance": 0,
"priceRenewal": null,
"delayMaintenance": 1,
"intervalMaintenance": null,
"intervalRenewal": "yearly",
"periodMaintenance": 1,
"isDrip": "false",
"isDisabled": "true",
"isCompleted": "false",
"createdAt": "2017-12-13T22:10:16.000Z",
"startedAt": null,
"completedAt": "0000-00-00 00:00:00",
"disabledAt": "2017-12-13T22:28:42.000Z",
"derezzedAt": null,
"partner": 7,
"client": 3201926,
"order": 872877,
"product": 3021
},
{
"id": 3598243,
"price": 0,
"customPackage": null,
"priceMaintenance": 0,
"priceRenewal": null,
"delayMaintenance": 1,
"intervalMaintenance": null,
"intervalRenewal": "yearly",
"periodMaintenance": 1,
"isDrip": "false",
"isDisabled": "true",
"isCompleted": "false",
"createdAt": "2017-12-13T22:10:16.000Z",
"startedAt": null,
"completedAt": "0000-00-00 00:00:00",
"disabledAt": "2017-12-13T22:28:42.000Z",
"derezzedAt": null,
"partner": 7,
"client": 3201926,
"order": 872877,
"product": 3047
},
{
"id": 3598244,
"price": 0,
"customPackage": null,
"priceMaintenance": 0,
"priceRenewal": null,
"delayMaintenance": 1,
"intervalMaintenance": null,
"intervalRenewal": "yearly",
"periodMaintenance": 1,
"isDrip": "false",
"isDisabled": "true",
"isCompleted": "false",
"createdAt": "2017-12-13T22:10:16.000Z",
"startedAt": null,
"completedAt": "0000-00-00 00:00:00",
"disabledAt": "2017-12-13T22:28:42.000Z",
"derezzedAt": null,
"partner": 7,
"client": 3201926,
"order": 872877,
"product": 3230
},
{
"id": 3598245,
"price": 0,
"customPackage": null,
"priceMaintenance": 0,
"priceRenewal": null,
"delayMaintenance": 1,
"intervalMaintenance": null,
"intervalRenewal": "yearly",
"periodMaintenance": 1,
"isDrip": "false",
"isDisabled": "true",
"isCompleted": "false",
"createdAt": "2017-12-13T22:10:16.000Z",
"startedAt": null,
"completedAt": "0000-00-00 00:00:00",
"disabledAt": "2017-12-13T22:28:42.000Z",
"derezzedAt": null,
"partner": 7,
"client": 3201926,
"order": 872877,
"product": 3063
}
]
}
}