Ecommerce
Coupon

Create

You can add unlimited coupons by coupon create route, coupon route allow only POST Method

https://ecom.coderorbit.com/public/api/admin/{{app_token}}/coupon
 
headers:{ 
    "Accept": "application/json"    
    "Authorization" : `Bearer ${token}`
}
 
body:{
    "sequence": "",
    "name": "test2020",
    "max_amount": "",
    "use_limit": 1, // by default 1 time
    "banner": "", // file or base64
    "icon" : "", // file or base64
    "thumbnails" : "", // file or base64
    "commission": 0,
    "commission_type": "", //fixed | parcentage ,
    "start_offer": "", // Date & time,
    "end_offer": "", // Date & time,
    "status": 1, // 0 | 1,
    "description": "",
    "extend_props": {
      "test": "theis extend props",
      "test2": "theis extend props 02",
      ".....": "....."
    }
    
}

### Results

{
    "0": "Success",
    "store_data": {
        "unique_id": "Q5WpoWDoZ1zKxkF",
        "parent_id": null,
        "name": "test2020",
        "slug": "test2020",
        "banner": "",
        "icon": "",
        "thumbnails": "",
        "commission": "10",
        "commission_type": "fixed",
        "start_offer": "",
        "end_offer": "",
        "status": "1",
        "description": "this is description",
        "extend_props": {
        "test": "theis extend props",
        "test2": "theis extend props 02"
        },
        "created_by": 1,
        "updated_by": 1,
        "updated_at": "2023-03-17T04:31:53.000000Z",
        "created_at": "2023-03-17T04:31:53.000000Z",
    }
}
 

List

Get all list list by GET Method with filter function customized option for you. below list of route with parameter

http://ecom.coderorbit.com/public/api/admin/{{app_token}}/coupon
 
headers:{ 
    "Accept": "application/json"    
    "Authorization" : `Bearer ${token}`
}

### Results

"data" : [
    {
        "id": 1,
        "unique_id": "sLJvIENyg100Pxk",
        "parent_id": null,
        "name": "test2020",
        "slug": "test2020",
        "banner": "",
        "icon": "",
        "thumbnails": "",
        "commission": 10,
        "commission_type": "fixed",
        "start_offer": "",
        "end_offer": "",
        "status": 1,
        "description": "this is description",
        "extend_props": {
            "'test'": "theis extend props 02"
        },
        "created_by": 1,
        "updated_by": 1,
        "created_at": "2023-03-17T04:25:43.000000Z",
        "updated_at": "2023-03-17T04:25:43.000000Z",
        "props": []
    },
    .........
 
  ],

If you want to get by pagination to the list by GET Method Here we have this featuer for you in ths route with parameter like: limit_per_page

http://ecom.coderorbit.com/public/api/admin/{{app_token}}/coupon?limit_per_page=1
 
headers:{ 
    "Accept": "application/json"    
    "Authorization" : `Bearer ${token}`
}

### OUTPUT

"data" : [
    {
        "id": 1,
        "unique_id": "sLJvIENyg100Pxk",
        "parent_id": null,
        "name": "test2020",
        "slug": "test2020",
        "banner": "",
        "icon": "",
        "thumbnails": "",
        "commission": 10,
        "commission_type": "fixed",
        "start_offer": "",
        "end_offer": "",
        "status": 1,
        "description": "this is description",
        "extend_props": {
            "'test'": "theis extend props 02"
        },
        "created_by": 1,
        "updated_by": 1,
        "created_at": "2023-03-17T04:25:43.000000Z",
        "updated_at": "2023-03-17T04:25:43.000000Z",
        "props": []
    },
    .........
 
  ],
  ,
  "first_page_url": "https://ecom.coderorbit.com/public/api/admin/{{app_token}}/coupon?page=1",
  "from": 1,
  "last_page": 1,
  "last_page_url": "https://ecom.coderorbit.com/public/api/admin/{{app_token}}/coupon?page=1",
  "links": [
    {
      "url": null,
      "label": "« Previous",
      "active": false
    },
    {
      "url": "https://ecom.coderorbit.com/public/api/admin/{{app_token}}/coupon?page=1",
      "label": "1",
      "active": true
    },
    {
      "url": null,
      "label": "Next »",
      "active": false
    }
  ],
  "next_page_url": null,
  "path": "https://ecom.coderorbit.com/public/api/admin/{{app_token}}/coupon",
  "per_page": 15,
  "prev_page_url": null,
  "to": 100,
  "total": 100
}

Query Parameters

limit_per_page = 1 // Default 15
name = admin
page = 1 // number of page for pagination
data = all
orderBy=desc // desc|asc 

Advance Query Parameters

// and condition
name = "" 
status = ""
start_offer // only Date
end_offer // Only Date
 
range_start_from_offer // Only Date
range_start_to_offer // Only Date
 
range_end_from_offer // Only Date
range_end_to_offer // Only Date
 
// or condition
or_name = "" 
or_status = ""
or_start_offer // only Date
or_end_offer // Only Date
 
or_range_start_from_offer // Only Date
or_range_start_to_offer // Only Date
 
or_range_end_from_offer // Only Date
or_range_end_to_offer // Only Date

Here is example url:

==============================================================================================================
GET = https://ecom.coderorbit.com/public/api/admin/{{app_token}}/coupon
==============================================================================================================
GET = https://ecom.coderorbit.com/public/api/admin/{{app_token}}/coupon?limit_per_page=1
==============================================================================================================
GET = https://ecom.coderorbit.com/public/api/admin/{{app_token}}/coupon?name=apple
==============================================================================================================
GET = https://ecom.coderorbit.com/public/api/admin/{{app_token}}/coupon?page=1
==============================================================================================================
GET = https://ecom.coderorbit.com/public/api/admin/{{app_token}}/coupon?data=all&limit_per_page=1&name=admin&page=1
==============================================================================================================

Single Coupon Show

https://ecom.coderorbit.com/public/api/admin/{{app_token}}/coupon/{{id}}
headers:{ 
    "Accept": "application/json"    
    "Authorization" : `Bearer ${token}`
}

### Result

    {
        "data": {
            "id": 1,
            "unique_id": "39fbojvOz9kQucj",
            "slug": "ms10_39fbojvOz9kQucj",
            "name": "MS10",
            "icon": "...",
            "thumbnails": "...",
            "banner": "...",
            "sequence": null,
            "commission": 10,
            "commission_type": "fixed",
            "status": 1,
            "start_offer": "2023-05-17 12:55:51",
            "end_offer": "2023-06-17 12:55:51",
            "description": "this is description",
            "extend_props": {
            "test": "theis extend props",
            "test2": "theis extend props 02"
            },
            "created_by": 1,
            "updated_by": 1,
            "created_at": "2023-05-17T16:08:46.000000Z",
            "updated_at": "2023-05-17T16:08:55.000000Z",
            "deleted_at": null
        }
    }

Edit Coupon

https://ecom.coderorbit.com/public/api/admin/{{app_token}}/coupon/{{id}}/edit
headers:{ 
    "Accept": "application/json"    
    "Authorization" : `Bearer ${token}`
}

### Result

{
    "data": {
        "id": 1,
        "unique_id": "39fbojvOz9kQucj",
        "slug": "ms10_39fbojvOz9kQucj",
        "name": "MS10",
        "icon": "...",
        "thumbnails": "...",
        "banner": "...",
        "sequence": null,
        "commission": 10,
        "commission_type": "fixed",
        "status": 1,
        "start_offer": "2023-05-17 12:55:51",
        "end_offer": "2023-06-17 12:55:51",
        "description": "this is description",
        "extend_props": {
        "test": "theis extend props",
        "test2": "theis extend props 02"
        },
        "created_by": 1,
        "updated_by": 1,
        "created_at": "2023-05-17T16:08:46.000000Z",
        "updated_at": "2023-05-17T16:08:55.000000Z",
        "deleted_at": null
    }
}

Update coupon

Method allow for category update PUT/PATCH/POST

https://ecom.coderorbit.com/public/api/admin/{{app_token}}/category/{{id}}
 
headers:{ 
    "Accept": "application/json"    
    "Authorization" : `Bearer ${token}`
}
body:{
    
 
    "sequence": "", // optional
    "name": "",
    "use_limit": "",
    "max_amount": "",
    "banner": "", // file
    "icon": "", // file
    "thumbnails": "", // file
    "commission": "",
    "commission_type": "",
    "start_offer": "", // Date & time
    "end_offer": "", // Date & time
    "status": "",
    "description": "",
    "extend_props": {
        "test": "test"
    },
    
}

### OUTPUT

{
  "data": {
    "id": 1,
    "unique_id": "39fbojvOz9kQucj",
    "slug": "ms10_39fbojvOz9kQucj",
    "name": "MS10",
    "icon": "...",
    "thumbnails": "...",
    "banner": "...",
    "sequence": null,
    "commission": 10,
    "commission_type": "fixed",
    "status": 1,
    "start_offer": "2023-05-17 12:55:51",
    "end_offer": "2023-06-17 12:55:51",
    "description": "this is description",
    "extend_props": {
    "test": "theis extend props",
    "test2": "theis extend props 02"
    },
    "created_by": 1,
    "updated_by": 1,
    "created_at": "2023-05-17T16:08:46.000000Z",
    "updated_at": "2023-05-17T16:08:55.000000Z",
    "deleted_at": null
  }
}

DELETE

Method allow for coupon delete DELETE

https://ecom.coderorbit.com/public/api/admin/{{app_token}}/coupon/{{id}}
 
headers:{ 
    "Accept": "application/json"    
    "Authorization" : `Bearer ${token}`
}

### Result

Success

CODER ORBIT
Bangladesh Office:
Call: 01534-645492
11/C, House-01, Lane-10
Road-11, Dhaka 1216
Email: support@coderorbit.com
Others
Domain & Hosting
Course
Debug
Portfolio
FOLLOW US
SUBSCRIBE US
Subscribe
2018 - 2024 Copyright © Coder Orbit. All rights reserved.