Skip to main content
PUT
/
api
/
v1.0
/
payment-link-manage
/
{account_id}
/
{payment_link_id}
Update
curl --request PUT \
  --url https://sandbox-payment-b2b.singapay.id/api/v1.0/payment-link-manage/{account_id}/{payment_link_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-PARTNER-ID: <api-key>' \
  --data '
{
  "max_usage": 1,
  "status": "open",
  "required_customer_detail": true,
  "expired_at": "1705305600000",
  "whitelisted_payment_method": [
    "<string>"
  ],
  "redirect_url": "https://example.com/payment-link",
  "optional_metadata": {
    "invoice_number": "INV20240513001"
  }
}
'
{
  "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.

Payment link identifier (payment_links.id).

Body

application/json
max_usage
integer
required

Maximum number of times this link may be used for payment. Must be greater than or equal to the current usage count.

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

1

status
enum<string>
required

Payment link lifecycle status.

Available options:
open,
closed,
expired
Example:

"open"

required_customer_detail
boolean

Whether customer details are required at checkout. If omitted, defaults to false.

Example:

true

expired_at
string | null

Optional expiration time as a Unix timestamp in milliseconds (13 digits).

Pattern: ^\d{13}$
Example:

"1705305600000"

whitelisted_payment_method
string[] | null

Restricts accepted payment methods for this link. 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://example.com/payment-link"

optional_metadata
object | null

Optional merchant-defined metadata for this payment link.

Example:
{ "invoice_number": "INV20240513001" }

Response

Updated

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.