Skip to content

Instantly share code, notes, and snippets.

@sakukode
Last active December 15, 2022 01:47
Show Gist options
  • Save sakukode/809c98cd5248838763c66d7b45df21cd to your computer and use it in GitHub Desktop.
Save sakukode/809c98cd5248838763c66d7b45df21cd to your computer and use it in GitHub Desktop.

List Mockup API utk ripple dashboard revamp

note:

  • pastikan menambahkan param ?mockup=1 pada setiap API endpoint untuk mendapatkan data mockup
  • mockup API hanya ada di API sandbox (https://alpha-api.avana.link)

Total Revenue and Order (Graph)

GET {{url}}/api/v3/shops/{{shop_id}}/graph/revenue?start_date=2021-01-01&end_date=2021-12-31&mockup=1

Response:

{
    "total": {
        "revenue": "32128.06",
        "order": 213
    },
    "analytic": {
        "revenue": {
            "amount": 300,
            "percentage": 8.5
        },
        "order": {
            "amount": -100,
            "percentage": -10
        }
    },
    "data": [
        {
            "date": "2022-11-30",
            "revenue": "52.0200",
            "order": 2
        },
        {
            "date": "2022-12-01",
            "revenue": "784.8600",
            "order": 15
        },
        {
            "date": "2022-12-02",
            "revenue": "2081.2700",
            "order": 22
        },
        {
            "date": "2022-12-03",
            "revenue": "2012.0700",
            "order": 20
        },
        {
            "date": "2022-12-04",
            "revenue": "3533.5800",
            "order": 30
        }
    ]
}

Top Shared Products

GET {{url}}/api/v3/shops/{{shop_id}}/best-shared-product?mockup=1&start_date=2022-12-01&end_date=2022-12-31

Response

{
    "current_page": 1,
    "data": [
        [
            {
                "id": 477510,
                "name": "Product #001",
                "image": "https://s3.ap-southeast-1.amazonaws.com/avana.cf/44360/images/thumbnail/f1f35dd21cd79de464c5c5086fbd1b87892df6f2",
                "shared": 41,
                "analytic": {
                    "amount": 0,
                    "percentage": 0
                }
            },
            {
                "id": 477511,
                "name": "Product #002",
                "image": "https://s3.ap-southeast-1.amazonaws.com/avana.cf/44360/images/thumbnail/f1f35dd21cd79de464c5c5086fbd1b87892df6f2",
                "shared": 50,
                "analytic": {
                    "amount": 10,
                    "percentage": 20
                }
            },
            {
                "id": 477512,
                "name": "Product #003",
                "image": "https://s3.ap-southeast-1.amazonaws.com/avana.cf/44360/images/thumbnail/f1f35dd21cd79de464c5c5086fbd1b87892df6f2",
                "shared": 30,
                "analytic": {
                    "amount": -20,
                    "percentage": -40
                }
            },
            {
                "id": 477511,
                "name": "Product #004",
                "image": "https://s3.ap-southeast-1.amazonaws.com/avana.cf/44360/images/thumbnail/f1f35dd21cd79de464c5c5086fbd1b87892df6f2",
                "shared": 50,
                "analytic": {
                    "amount": 10,
                    "percentage": 20
                }
            },
            {
                "id": 477513,
                "name": "Product #005",
                "image": "https://s3.ap-southeast-1.amazonaws.com/avana.cf/44360/images/thumbnail/f1f35dd21cd79de464c5c5086fbd1b87892df6f2",
                "shared": 30,
                "analytic": {
                    "amount": -20,
                    "percentage": -40
                }
            }
        ]
    ],
    "first_page_url": "https://alpha-api.avana.link/api/v3/shops/44360/best-shared-product?page=1&mockup=1",
    "from": 1,
    "last_page": 3,
    "last_page_url": "https://alpha-api.avana.link/api/v3/shops/44360/best-shared-product?page=3&mockup=1",
    "next_page_url": "https://alpha-api.avana.link/api/v3/shops/44360/best-shared-product?page=2&mockup=1",
    "path": "https://alpha-api.avana.link/api/v3/shops/44360/best-shared-product",
    "per_page": 5,
    "prev_page_url": null,
    "to": 5,
    "total": 11
}

Top Selling Products

GET {{url}}/api/v3/shops/{{shop_id}}/best-product?start_date=2021-01-01&end_date=2021-12-31&mockup=1

Response

{
    "current_page": 1,
    "data": [
        [
            {
                "id": 477510,
                "name": "Product #001",
                "image": "https://s3.ap-southeast-1.amazonaws.com/avana.cf/44360/images/thumbnail/f1f35dd21cd79de464c5c5086fbd1b87892df6f2",
                "items_sold": 41,
                "analytic": {
                    "amount": 0,
                    "percentage": 0
                }
            },
            {
                "id": 477511,
                "name": "Product #002",
                "image": "https://s3.ap-southeast-1.amazonaws.com/avana.cf/44360/images/thumbnail/f1f35dd21cd79de464c5c5086fbd1b87892df6f2",
                "items_sold": 50,
                "analytic": {
                    "amount": 10,
                    "percentage": 20
                }
            },
            {
                "id": 477512,
                "name": "Product #003",
                "image": "https://s3.ap-southeast-1.amazonaws.com/avana.cf/44360/images/thumbnail/f1f35dd21cd79de464c5c5086fbd1b87892df6f2",
                "items_sold": 30,
                "analytic": {
                    "amount": -20,
                    "percentage": -40
                }
            },
            {
                "id": 477511,
                "name": "Product #004",
                "image": "https://s3.ap-southeast-1.amazonaws.com/avana.cf/44360/images/thumbnail/f1f35dd21cd79de464c5c5086fbd1b87892df6f2",
                "items_sold": 50,
                "analytic": {
                    "amount": 10,
                    "percentage": 20
                }
            },
            {
                "id": 477513,
                "name": "Product #005",
                "image": "https://s3.ap-southeast-1.amazonaws.com/avana.cf/44360/images/thumbnail/f1f35dd21cd79de464c5c5086fbd1b87892df6f2",
                "items_sold": 30,
                "analytic": {
                    "amount": -20,
                    "percentage": -40
                }
            }
        ]
    ],
    "first_page_url": "https://alpha-api.avana.link/api/v3/shops/44360/best-product?page=1&mockup=1",
    "from": 1,
    "last_page": 3,
    "last_page_url": "https://alpha-api.avana.link/api/v3/shops/44360/best-product?page=3&mockup=1",
    "next_page_url": "https://alpha-api.avana.link/api/v3/shops/44360/best-product?page=2&mockup=1",
    "path": "https://alpha-api.avana.link/api/v3/shops/44360/best-product",
    "per_page": 5,
    "prev_page_url": null,
    "to": 5,
    "total": 11
}

Top Performing Affiliate

GET {{url}}/api/v3/shops/{{shop_id}}/best-agent-affiliate?start_date=2021-01-01&end_date=2021-12-31&mockup=1

Response:

{
    "current_page": 1,
    "data": [
        [
            {
                "id": 477510,
                "name": "Reseller #001",
                "image": "https://s3.ap-southeast-1.amazonaws.com/avana.cf/44360/images/thumbnail/d2429725757d41d081d200c72b1a088394471c5b",
                "earn": 41,
                "initial": "ABC001",
                "analytic": {
                    "amount": 0,
                    "percentage": 0
                }
            },
            {
                "id": 477511,
                "name": "Reseller #002",
                "image": "https://s3.ap-southeast-1.amazonaws.com/avana.cf/44360/images/thumbnail/d2429725757d41d081d200c72b1a088394471c5b",
                "earn": 50,
                "initial": "ABC002",
                "analytic": {
                    "amount": 10,
                    "percentage": 20
                }
            },
            {
                "id": 477512,
                "name": "Reseller #003",
                "image": "https://s3.ap-southeast-1.amazonaws.com/avana.cf/44360/images/thumbnail/d2429725757d41d081d200c72b1a088394471c5b",
                "earn": 30,
                "initial": "ABC003",
                "analytic": {
                    "amount": -20,
                    "percentage": -40
                }
            },
            {
                "id": 477511,
                "name": "Reseller #004",
                "image": "https://s3.ap-southeast-1.amazonaws.com/avana.cf/44360/images/thumbnail/d2429725757d41d081d200c72b1a088394471c5b",
                "earn": 50,
                "initial": "ABC004",
                "analytic": {
                    "amount": 10,
                    "percentage": 20
                }
            },
            {
                "id": 477513,
                "name": "Reseller #005",
                "image": "https://s3.ap-southeast-1.amazonaws.com/avana.cf/44360/images/thumbnail/d2429725757d41d081d200c72b1a088394471c5b",
                "earn": 30,
                "initial": "ABC005",
                "analytic": {
                    "amount": -20,
                    "percentage": -40
                }
            }
        ]
    ],
    "first_page_url": "https://alpha-api.avana.link/api/v3/shops/44360/best-agent-affiliate?page=1&mockup=1",
    "from": 1,
    "last_page": 3,
    "last_page_url": "https://alpha-api.avana.link/api/v3/shops/44360/best-agent-affiliate?page=3&mockup=1",
    "next_page_url": "https://alpha-api.avana.link/api/v3/shops/44360/best-agent-affiliate?page=2&mockup=1",
    "path": "https://alpha-api.avana.link/api/v3/shops/44360/best-agent-affiliate",
    "per_page": 5,
    "prev_page_url": null,
    "to": 5,
    "total": 11
}

Top Performing Dropship

GET {{url}}/api/v3/shops/{{shop_id}}/best-agent-dropship?start_date=2021-01-01&end_date=2021-12-31&mockup=1

Response:

{
    "current_page": 1,
    "data": [
        [
            {
                "id": 477510,
                "name": "Reseller #001",
                "image": "https://s3.ap-southeast-1.amazonaws.com/avana.cf/44360/images/thumbnail/d2429725757d41d081d200c72b1a088394471c5b",
                "earn": 41,
                "initial": "ABC001",
                "analytic": {
                    "amount": 0,
                    "percentage": 0
                }
            },
            {
                "id": 477511,
                "name": "Reseller #002",
                "image": "https://s3.ap-southeast-1.amazonaws.com/avana.cf/44360/images/thumbnail/d2429725757d41d081d200c72b1a088394471c5b",
                "earn": 50,
                "initial": "ABC002",
                "analytic": {
                    "amount": 10,
                    "percentage": 20
                }
            },
            {
                "id": 477512,
                "name": "Reseller #003",
                "image": "https://s3.ap-southeast-1.amazonaws.com/avana.cf/44360/images/thumbnail/d2429725757d41d081d200c72b1a088394471c5b",
                "earn": 30,
                "initial": "ABC003",
                "analytic": {
                    "amount": -20,
                    "percentage": -40
                }
            },
            {
                "id": 477511,
                "name": "Reseller #004",
                "image": "https://s3.ap-southeast-1.amazonaws.com/avana.cf/44360/images/thumbnail/d2429725757d41d081d200c72b1a088394471c5b",
                "earn": 50,
                "initial": "ABC004",
                "analytic": {
                    "amount": 10,
                    "percentage": 20
                }
            },
            {
                "id": 477513,
                "name": "Reseller #005",
                "image": "https://s3.ap-southeast-1.amazonaws.com/avana.cf/44360/images/thumbnail/d2429725757d41d081d200c72b1a088394471c5b",
                "earn": 30,
                "initial": "ABC005",
                "analytic": {
                    "amount": -20,
                    "percentage": -40
                }
            }
        ]
    ],
    "first_page_url": "https://alpha-api.avana.link/api/v3/shops/44360/best-agent-dropship?page=1&mockup=1",
    "from": 1,
    "last_page": 3,
    "last_page_url": "https://alpha-api.avana.link/api/v3/shops/44360/best-agent-dropship?page=3&mockup=1",
    "next_page_url": "https://alpha-api.avana.link/api/v3/shops/44360/best-agent-dropship?page=2&mockup=1",
    "path": "https://alpha-api.avana.link/api/v3/shops/44360/best-agent-dropship",
    "per_page": 5,
    "prev_page_url": null,
    "to": 5,
    "total": 11
}

New Joined Reseller

GET {{url}}/api/v3/shops/{{shop_id}}/new-agent-register?start_date=2021-01-01&end_date=2021-12-31&mockup=1

Response:

{
    "current_page": 1,
    "data": [
        [
            {
                "id": 477510,
                "name": "Reseller #001",
                "image": "https://s3.ap-southeast-1.amazonaws.com/avana.cf/44360/images/thumbnail/d2429725757d41d081d200c72b1a088394471c5b",
                "level": {
                    "id": 45000,
                    "name": "Super"
                },
                "share_earn": 41,
                "sale_earn": 20,
                "items_sold": 34,
                "status": "active",
                "initial": "ABC001",
                "last_login": "2022-12-15 00:12:50"
            },
            {
                "id": 477511,
                "name": "Reseller #002",
                "image": "https://s3.ap-southeast-1.amazonaws.com/avana.cf/44360/images/thumbnail/d2429725757d41d081d200c72b1a088394471c5b",
                "level": {
                    "id": 45001,
                    "name": "Super Duper"
                },
                "share_earn": 50,
                "sale_earn": 30,
                "items_sold": 58,
                "status": "new active",
                "initial": "ABC002",
                "last_login": "2022-12-15 00:12:50"
            },
            {
                "id": 477511,
                "name": "Reseller #003",
                "image": "https://s3.ap-southeast-1.amazonaws.com/avana.cf/44360/images/thumbnail/d2429725757d41d081d200c72b1a088394471c5b",
                "level": {
                    "id": 45002,
                    "name": "Super Duper Webber"
                },
                "share_earn": 0,
                "sale_earn": 10,
                "items_sold": 2,
                "status": "inactive",
                "initial": "ABC004",
                "last_login": "2022-12-15 00:12:50"
            }
        ]
    ],
    "first_page_url": "https://alpha-api.avana.link/api/v3/shops/44360/new-agent-register?page=1&mockup=1",
    "from": 1,
    "last_page": 3,
    "last_page_url": "https://alpha-api.avana.link/api/v3/shops/44360/new-agent-register?page=3&mockup=1",
    "next_page_url": "https://alpha-api.avana.link/api/v3/shops/44360/new-agent-register?page=2&mockup=1",
    "path": "https://alpha-api.avana.link/api/v3/shops/44360/new-agent-register",
    "per_page": 5,
    "prev_page_url": null,
    "to": 5,
    "total": 11
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment