Payment Link


Required Header

Key Value
Accept application/json
Content-Type application/json
Authorization Bearer {API-KEY}

Create Payment Link

Here you may add extra information about the section.

Endpoint

Method URI
POST /payment-links

Data Body

KEY TYPE RULE
email string required
currency string required
amount string required
title string required
phone_no string optional
description string optional
redirect_url string optional
reference string optional
reference_2 string optional
send_email boolean optional

Update Payment Link

Here you may add extra information about the section.

Endpoint

Method URI
PUT /payment-links/{payment_link_id}

Data Body

KEY TYPE RULE
email string required
currency string required
amount string required
title string required
phone_no string optional
description string optional
redirect_url string optional
reference string optional
reference_2 string optional
send_email boolean optional

Get Payment Link

Here you may add extra information about the section.

Endpoint

Method URI
GET /payment-links/{payment_link_id}

Index Payment Link

Here you may add extra information about the section.

Endpoint

Method URI
GET /payment-links

Delete Payment Link

Here you may add extra information about the section.

Endpoint

Method URI
DELETE /payment-links/{payment_link_id}

Example

Here you may add extra information about the section.

{
    "email": "email@example.com",
    "phone_no": "60123456789",
    "currency": "MYR",
    "amount": "100.00",
    "title": "Test Payment Link",
    "description": "Testing payment link",
    "redirect_url": "https://www.paymenttest.com/payment/redirect",
    "reference": "reference 1",
    "reference_2": "reference 2"
}

{success} Success Response

Code 200

Response

{
    "success": true,
    "data": {
        "_id": "61aefffdc0e0335ed54194d5",
        "email": "email@example.com",
        "phone_no": "60123456789",
        "currency": "MYR",
        "amount": 100.0,
        "title": "Test Payment Link",
        "description": "Testing payment link",
        "redirect_url": "https://www.paymenttest.com/payment/redirect",
        "reference": "reference 1",
        "reference_2": "reference 2",
        "updated_at": "2021-12-07T06:32:29.757000Z",
        "created_at": "2021-12-07T06:32:29.757000Z",
        "status": "Active",
        "payment_url": "http://localhost:8080/payment/link/pay?id=61aefffdc0e0335ed54194d5",
        "business_id": 1,
        "paid": false
    },
    "errors": null,
    "meta": {
        "timestamp": "2021-12-12 06:00:00 UTC",
        "timezone": "UTC"
    }
}

{danger} Error Response

Code 422

Response



{
    "message" : "The given data was invalid.",
    "errors"  : {
        "currency"  : ["The currency field is required."],
        "email"     : ["The email field is required."],
        "amount"    : ["The amount field is required."],
        "title"     : ["The title field is required."]
    }
}