🎁Products

To enable the payment link creation process more interesting, merchants can now display their goods as Products without having a website.

You can interact (add, update, remove) with Products using Lazerpay Dashboard or our API which allows you to programmatically interact with your products.

Products can be created and seen on the dashboard more like a store inventory, They can be hidden when no longer available or for sale. There are no limitations as to the number of products you add on the products page as the pagination feature would help product data spread across different pages automatically.

Create Product

Create a new product

POST https://api.lazerpay.engineering/api/v1/products

Request Body

{
    "message": "Product created successfully",
    "data": {
        "name": "not fake product",
        "description": "not fake description",
        "businessId": "3dc8842d-fbdc-41a8-ad61-c023afc3a391",
        "network": "testnet",
        "prices": [
            {
                "id": "f024a92c-ff80-40fe-8cc2-e12e8aa1087d",
                "amount": 80000,
                "currency": {
                    "name": "United States Dollar",
                    "symbol": "USD"
                },
                "pricingType": "standard"
            }
        ],
        "image": {
            "url": "https://my-fake-cover-image.jpeg",
            "createdAt": "2022-09-05T15:14:36.721Z"
        },
        "id": "3a78a41a-305b-4061-aea5-8f0f1994fd00",
        "createdAt": "2022-09-05T15:14:36.721Z",
        "updatedAt": "2022-09-05T15:14:36.721Z",
        "active": true
    },
    "statusCode": 201,
    "status": "success"
}

You can add a Payment link and associate it with your Product using the Payment Links API and passing product_id as payload

Note :

  • Each product can be associated with multiple price tags and every price entry is recorded as its own separate entity in the database.

  • When creating a new standard link, there's option to tie that payment link to a specific price of the product or multiple pricing (array of price tags).

  • Since a pricing is tied to a product, tying a payment link to a pricing will therefore invaluably links the payment link to that product.

price_id --> product_id --> payment_link

"cart": [
        {
            "price_id": "4f6a2f7f-3400-4f47-8973-fa8bb2f5d483",
            "quantity": 10,
            "quantity_adjustable": false
        }
    ]

Find Products

GET https://api.lazerpay.engineering/api/v1/products?network={}{{network}}

Find a product

Path Parameters

{
    "status": "success",
    "statusCode": 200,
    "data": [
        {
            "id": "3a78a41a-305b-4061-aea5-XXXX",
            "name": "Book",
            "createdAt": "2022-09-05T15:14:36.721Z",
            "updatedAt": "2022-09-05T15:14:36.721Z",
            "description": "Atomic Habits",
            "active": true,
            "businessId": "3dc8842d-XX-XXX-ad61-c023afc3a391",
            "network": "testnet",
            "prices": [
                {
                    "id": "XX-ff80-40fe-XX-e12e8aa1087d",
                    "amount": "80000",
                    "currency": {
                        "name": "United States Dollar",
                        "symbol": "USD"
                    }
                }
            ],
            "image": {
                "url": "https://my-fake-cover-image.jpeg",
                "publicId": "default",
                "folder": "products"
            }
        }
    ],
    "count": 1,
    "currentPage": 1,
    "nextPage": null,
    "prevPage": null,
    "lastPage": 1
}

Get Product

Get product by id

GET https://api.lazerpay.engineering/api/v1/products/:id

Path Parameters

{
    "message": "Product fetched successfully",
    "data": {
        "id": "978ba584-839a-4af2-a673-4bc3b814b54a",
        "name": "Guccie Purse",
        "createdAt": "2022-07-25T04:56:07.810Z",
        "updatedAt": "2022-07-25T04:56:07.810Z",
        "description": "Bag of Guccie Stuff With sun",
        "active": true,
        "userId": "51afc3cd-cbb3-43ac-a404-db2897915ecc",
        "businessId": "e4b23ecf-9d10-4b4f-9582-20700cf00d1b",
        "network": "testnet",
        "prices": [
            {
                "id": "ec99bcce-7a57-47c2-adc6-b284db779841",
                "createdAt": "2022-07-25T04:56:07.810Z",
                "amount": "8.00",
                "pricingType": "standard",
                "currency": {
                    "id": "dedb6fb9-bc74-4a72-a8ce-f6fcc6435de0",
                    "name": "United States Dollar",
                    "symbol": "USD",
                    "logo": null,
                    "status": "active",
                    "createdAt": "2022-07-22T09:05:15.164Z",
                    "updatedAt": "2022-07-22T09:05:15.164Z"
                },
                "paymentLinks": []
            }
        ],
        "image": {
            "id": "b74d0cd5-f972-454f-9d4d-a29a9255098c",
            "url": "https://res.cloudinary.com/lazer/image/upload/v1654710452/product_img_yfgeb6.png",
            "publicId": "default",
            "createdAt": "2022-07-25T04:56:07.810Z",
            "folder": "products"
        }
    },
    "statusCode": 200,
    "status": "success"
}

Update Product

PUT https://api.lazerpay.engineering/api/v1/products/:id

Update a product

Request Body

{
    "message": "Product fetched successfully",
    "data": {
        "id": "978ba584-839a-4af2-a673-4bc3b814b54a",
        "name": "Chlorine Bubble Gum",
        "createdAt": "2022-07-25T04:56:07.810Z",
        "updatedAt": "2022-07-25T05:01:28.949Z",
        "description": "Tons Of Gums",
        "active": false,
        "userId": "51afc3cd-cbb3-43ac-a404-db2897915ecc",
        "businessId": "e4b23ecf-9d10-4b4f-9582-20700cf00d1b",
        "network": "testnet",
        "prices": [
            {
                "id": "ec99bcce-7a57-47c2-adc6-b284db779841",
                "createdAt": "2022-07-25T04:56:07.810Z",
                "amount": "8.00",
                "pricingType": "standard",
                "currency": {
                    "id": "dedb6fb9-bc74-4a72-a8ce-f6fcc6435de0",
                    "name": "United States Dollar",
                    "symbol": "USD",
                    "logo": null,
                    "status": "active",
                    "createdAt": "2022-07-22T09:05:15.164Z",
                    "updatedAt": "2022-07-22T09:05:15.164Z"
                },
                "paymentLinks": []
            }
        ],
        "image": {
            "id": "b74d0cd5-f972-454f-9d4d-a29a9255098c",
            "url": "https://res.cloudinary.com/lazer/image/upload/v1654710452/product_img_yfgeb6.png",
            "publicId": "default",
            "createdAt": "2022-07-25T04:56:07.810Z",
            "folder": "products"
        }
    },
    "statusCode": 200,
    "status": "success"
}

Get Prices

Get prices of the products

GET https://api.lazerpay.engineering/api/v1/products/:id

Path Parameters

{
    "status": "success",
    "statusCode": 200,
    "data": [
        {
            "id": "69d58386-0b29-449d-9401-57ab11ff7c5d",
            "createdAt": "2022-06-25T17:06:23.531Z",
            "amount": "20.00",
            "pricingType": "standard",
            "currency": {
                "name": "United Emirates Dirham",
                "symbol": "AED"
            },
            "paymentLinks": [
                {
                    "id": "a31b321a-d9cf-4377-bffa-79ffafc3387a",
                    "createdAt": "2022-06-27T08:20:32.705Z",
                    "title": "red silver shit",
                    "slug": "BZa3Suc4",
                    "isActive": true
                },
                {
                    "id": "331162c3-d9cf-4026-9d22-887b8de5f635",
                    "createdAt": "2022-07-06T17:25:37.875Z",
                    "title": "chlorine candy II",
                    "slug": "J6pkthAE",
                    "isActive": true
                },
                {
                    "id": "a29af358-a811-44cd-aab8-8638090434a9",
                    "createdAt": "2022-07-08T18:50:11.315Z",
                    "title": "chlorine candy II",
                    "slug": "G_L9l4Z8",
                    "isActive": true
                },
                {
                    "id": "98ce3ecb-742b-4ded-8420-fee4223cb0a7",
                    "createdAt": "2022-07-08T18:50:19.247Z",
                    "title": "chlorine candy II",
                    "slug": "MDKKrLAC",
                    "isActive": true
                }
            ]
        }
    ],
    "count": 1,
    "currentPage": 1,
    "nextPage": null,
    "prevPage": null,
    "lastPage": 1
}

GET https://api.lazerpay.engineering/api/v1/products/:price_id

Path Parameters

{
    "data": [
        {
            "id": "XXX-XX-4bf7-af7f-2cceefcc12bb",
            "createdAt": "2022-06-26T17:30:43.729Z",
            "title": "Candy II",
            "slug": "0B7tKYKB",
            "isActive": true
        },
        {
            "id": "11f0ad05-acd9-XX-99a8-XXXX",
            "createdAt": "2022-06-28T08:34:32.041Z",
            "title": "chlorine candy II",
            "slug": "mEeqzLI3",
            "isActive": true
        }
    ],
    "status": "success",
    "statusCode": 200,
    "message": "Price links fetched successfully"
}

Add Price

Add price to an existing product

POST https://api.lazerpay.engineering/api/v1/products/:id/pricing

Request Body

{
    "message": "Price added successfully",
    "statusCode": 201,
    "status": "success",
    "data": {
        "amount": 5000,
        "id": "96688e79-a7b5-4e72-bb67-82bbbfeb6708",
        "createdAt": "2022-07-25T05:23:41.707Z",
        "pricingType": "standard",
        "currency": {
            "name": "United Emirates Dirham",
            "symbol": "AED"
        }
    }
}

Delete Price

Delete price of an existing product

DELETE https://api.lazerpay.engineering/api/v1/products/:iprice_id

Path Parameters

{
    "message": "Price deleted successfully",
    "statusCode": 200,
    "status": "success"
}

Delete Product

Delete an existing Product

GET https://api.lazerpay.engineering/api/v1/products/:id

Path Parameters

{
    "message": "Product deleted successfully",
    "data": "9117c54c-56d6-4ba1-92d3-a92f051c38c1",
    "statusCode": 200,
    "status": "success"
}

Last updated