Orders

From Advice Local Wiki
Jump to: navigation, search

Create an Order

You must [Trigger a Report] before creating orders. Ordering for a client consists of selecting what types of products (and sub products) are available and creating projects for the client. Once the order is in the database, then the payment can be initiated. Orders can only be paid by providing an existing credit card ID. The list of cards in the system can be retrieved using the cards which is documented here. Partners

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":3201926,"products":[3021,3047,3063,3230], "card_id": "CREDIT_CARD_ID_HERE"}

"client" is the unique client identifier (client_id) of the client.

"products" are product IDs to ordered. You can get a list of product IDs from the [Get all Products] endpoint.

Example Response

{
    "status": 200,
    "success": true,
    "error": null,
    "data": {
        "order": {
            "client": 3201926,
            "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

Retrieve all information about a particular order. You need to supply the unique order identifier.

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": 3201926,
        "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"
    }
}

Get all Orders

Returns a list of your client orders.

API Endpoint

http://p.lssdev.com/legacyorders

Example Request

GET /legacyorders 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": 94980,
            "id": 133625,
            "price": 1,
            "discount": null,
            "schedule": "",
            "partnerUsername": "dev@lssdev.com",
            "products": [
                "2049"
            ],
            "createdAt": "2014-07-24T00:00:00.000Z",
            "startedAt": "2014-07-24T14:39:51.000Z",
            "publishedAt": "2014-08-01T17:18:17.000Z",
            "isPaid": true,
            "isVerified": true,
            "isDrip": "false",
            "chargeId": "1"
        },
        {
            "partner": 7,
            "client": 94982,
            "id": 133626,
            "price": 1,
            "discount": null,
            "schedule": "",
            "partnerUsername": "dev@lssdev.com",
            "products": [
                "2049"
            ],
            "createdAt": "2014-07-24T00:00:00.000Z",
            "startedAt": "2014-07-24T14:46:00.000Z",
            "publishedAt": "2014-08-01T17:18:17.000Z",
            "isPaid": true,
            "isVerified": true,
            "isDrip": "false",
            "chargeId": "1"
        },
        {
            "partner": 7,
            "client": 94983,
            "id": 133627,
            "price": 1,
            "discount": null,
            "schedule": "",
            "partnerUsername": "dev@lssdev.com",
            "products": [
                "2049"
            ],
            "createdAt": "2014-07-24T00:00:00.000Z",
            "startedAt": "2014-07-24T14:48:22.000Z",
            "publishedAt": "2014-08-01T17:18:17.000Z",
            "isPaid": true,
            "isVerified": true,
            "isDrip": "false",
            "chargeId": "1"
        },
        {...},
        {...}
    ],
    "total": 9
}

Delete an Order

OMG, please be careful with this endpoint. If you have a valid order_id, you can delete an order from the system with the following endpoint.

API Endpoint

http://p.lssdev.com/legacyorders/{order_id}

Example Request

DELETE /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": {
        "order": {
            "id": 872877,
            "price": 0,
            "discount": 0,
            "schedule": null,
            "client": 3201926,
            "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": 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
            }
        ]
    }
}


Get Fulfillment Data

Fulfillment data is all the data related to products in an order getting fulfilled. It includes information about the status of individual products, the live urls as a result of successful work, along with many other important dates, comments, and error messages.

API Endpoint

http://p.lssdev.com/legacyfulfillmentdata

Example Request

POST /legacyorders?client=XXXXX HTTP/1.1
Host: p.lssdev.com
x-api-token: YOUR_API_KEY
Content-Type: application/json

"client" is the unique identifier for the the location in our system (client_id from the Clients endpoints or GET /legacyclient/XXXX)

Any of the data returned can be filtered by

Example Response

{
    "status": 200,
    "success": true,
    "error": null,
    "data": [
        {
            "partner": 760,
            "client": 74496,
            "order": 125550,
            "product": 2044,
            "id": 255205,
            "directory": "Merchant Circle",
            "status": "temporary_problem",
            "comment": "Directory Unavailable at the Moment",
            "username": "project-125550@searchme.us",
            "password": "1LJBBoAY",
            "email": "project-125550@searchme.us",
            "statusInitial": "not_present",
            "url": "about:version",
            "screenshotUrl": null,
            "commentCustom": null,
            "dateScreenshot": null,
            "recoveryPhone": null,
            "recoveryEmail": null,
            "fulfillmentUser": "import",
            "dateStarted": "2014-06-12T00:00:00.000Z",
            "dateEnded": "2014-06-12T00:00:00.000Z",
            "dateReplaced": null,
            "dateCreated": "2014-06-12T00:00:00.000Z",
            "dateUrl": "2020-03-02T16:56:18.000Z",
            "dateUpdated": "2014-06-12T00:00:00.000Z",
            "dateVerified": null,
            "type": "manual",
            "isDisabled": false
        }
    ],
    "total": 10736
}

Here is a description of some of the most useful fields

  • directory - the local directory or source that we are publishing to
  • comment - a comment left by our team or response directly from an API
  • username/password - any login information associated with the listing that may have been used or created
  • email - email address possibly associated with account creation, NOT necessarily the business's email
  • url - the live url of the listing
  • dateCreated - the date the listing and data was initialized
  • dateUrl - the date we first see a url (supported API version 4.15, Feb 2020 onward)
  • dateUpdated - date it was last updated/modified/touched
  • type - either manual or api