Skip to main content
POST
/
api
/
v1.0
/
payment-link-manage
/
{account_id}
Create
curl --request POST \
  --url https://sandbox-payment-b2b.singapay.id/api/v1.0/payment-link-manage/{account_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-PARTNER-ID: <api-key>' \
  --data '
{
  "reff_no": "INV20240513001",
  "title": "Invoice Payment",
  "max_usage": 1,
  "total_amount": 150000,
  "items": [
    {
      "name": "Product A",
      "quantity": 1,
      "unit_price": 150000
    }
  ],
  "required_customer_detail": true,
  "expired_at": "1705305600000",
  "whitelisted_payment_method": [
    "<string>"
  ],
  "redirect_url": "https://merchant.example.com/payment/return",
  "optional_metadata": {}
}
'
{
  "status": 200,
  "success": true,
  "data": {
    "id": 103,
    "reff_no": "INV20240513001",
    "title": "Invoice Payment",
    "payment_url": "https://example.com/payment-link",
    "status": "open",
    "status_computed": "open",
    "is_expired": false,
    "required_customer_detail": true,
    "max_usage": 1,
    "current_usage": 0,
    "expired_at": "2024-05-13T00:00:00Z",
    "total_amount": 150000,
    "items": [
      {
        "name": "Product A",
        "quantity": 1,
        "unit_price": 150000,
        "subtotal": 150000
      }
    ],
    "whitelisted_payment_method": [
      "<string>"
    ],
    "redirect_url": "https://example.com/payment-link",
    "optional_metadata": {},
    "payment_date": "2024-05-13T00:00:00Z",
    "created_at": "2024-05-13T00:00:00Z",
    "updated_at": "2024-05-13T00:00:00Z",
    "account": {
      "id": 1,
      "name": "Account 1"
    }
  }
}

Authorizations

Authorization
string
header
required

JWT issued by POST /api/v1.1/access-token/b2b. Send Authorization: Bearer <token>.

X-PARTNER-ID
string
header
required

Merchant API key (Credential.api_key). Required on every request.

Path Parameters

account_id
string
required

Account identifier in ULID format.

Body

application/json
reff_no
string
required

Merchant reference number for this payment link.

Maximum string length: 40
Pattern: ^[^\s\/]+$
Example:

"INV20240513001"

title
string
required

Title displayed for the payment link.

Maximum string length: 255
Example:

"Invoice Payment"

max_usage
integer
required

Maximum number of successful payments allowed for this link.

Required range: 1 <= x <= 1000000
Example:

1

total_amount
number
required

Total payment amount. Must equal the sum of all line items. Minimum and maximum limits depend on merchant configuration and selected payment methods.

Example:

150000

items
object[]
required

List of line items used to compose the total payment amount.

Minimum array length: 1
required_customer_detail
boolean | null

Whether customer details are required during checkout.

Example:

true

expired_at
string | null

Optional expiration time as a Unix timestamp in milliseconds (13 digits), interpreted in Asia/Jakarta timezone.

Pattern: ^\d{13}$
Example:

"1705305600000"

whitelisted_payment_method
string[] | null

Restricts accepted payment methods for this link. Omit or send an empty array to allow all active payment-link methods. Each entry must be a valid payment method code from the payment methods catalog.

redirect_url
string<uri> | null

Optional URL to redirect the payer after payment flow completion.

Maximum string length: 2048
Example:

"https://merchant.example.com/payment/return"

optional_metadata
object | null

Optional merchant-defined metadata stored with the payment link.

Response

Created

status
integer
required

HTTP status code.

Example:

200

success
boolean
required

Indicates whether the request was successful.

Example:

true

data
object

Payment link resource payload.