Update Payment Link API
Overview
Update an existing payment link. The request body is a map of field names to new values; only provided fields are updated. The payment link id is required in the body.
API Details
- Method: PUT
- URL: https://api.gafapay.com/gafapay/v3/user/payment_link
- Content-Type: application/json
- companyid: b760d21412dd473999e374053fb95031
- requestid: be08f79e-7eac-40e1-acbe-00f6ae7b8f7b
- Authorization: Token required
Endpoint
PUT https://api.gafapay.com/gafapay/v3/user/payment_link
Headers
authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJlNDk0Njg3N2YxODk0NmIyOTlmZGRmMGYyMTMzZGNiYSIsInJvbGVzIjpbIlJPTEVfQURNSU4iXSwiZXhwIjoxNzU3MDA3NDEyfQ.ph7qKBEzuHxgljV3141L9iOrWmHI4TnyoknBSNoVYYU
companyid: b760d21412dd473999e374053fb95031
requestid: be08f79e-7eac-40e1-acbe-00f6ae7b8f7b
Content-Type: application/json
Request Body
The body must be a JSON object (map) that includes the payment link id and any fields to update. Field names typically use snake_case to match the data model.
{
"id": "a1b2c3d4e5f6g7h8i9j0",
"amount": 150.00,
"note": "Updated note",
"status": 2,
"link_name": "Updated Invoice #001",
"expiry_date": 1756756000
}
Request Body Fields
Required Fields
- id (string, required): The unique identifier of the payment link to update
- Format: Payment link ID string
- Example: "a1b2c3d4e5f6g7h8i9j0"
Optional Fields (update only what you need)
- amount (number, optional): New payment amount
- note (string, optional): New note/description
- expiry_date (long, optional): New expiry timestamp (epoch seconds)
- status (integer, optional): New status (1=Created, 2=Expired, 3=Completed, 4=Cancelled)
- link_name (string, optional): New display name for the link
- link_description (string, optional): New link description
- payment_link (string, optional): New payment link URL/identifier
- target_user_id (string, optional): New target user ID
- target_user_type (integer, optional): New target user type
- target_user_info (object, optional): New target user information map
- charges_info (object, optional): New charges/fee information
Response (Success)
{
"success": 1,
"error": [],
"data": {
"message": "USER_PAYMENT_LINK_UPDATED_SUCCESSFULLY."
}
}
Response Fields
- success (integer): Response status indicator (1 = Success, 0 = Failure)
- error (array): Array of error messages (empty on success)
- data (object): Response data object
- message (string): Success message
Response (Update Failed / Validation Error)
{
"success": 0,
"error": [],
"data": {
"check_validation_failed": true,
"validation_message": "USER_PAYMENT_LINK_ERROR_UPDATING_PLEASE_TRY_AGAIN_LATER."
}
}
When the request is invalid (e.g. missing id or company_id), the API may return:
{
"success": 0,
"error": ["BAD_REQUEST"],
"data": null
}
Example Usage
curl --location --request PUT 'https://api.gafapay.com/gafapay/v3/user/payment_link' \
--header 'authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...' \
--header 'companyid: b760d21412dd473999e374053fb95031' \
--header 'requestid: be08f79e-7eac-40e1-acbe-00f6ae7b8f7b' \
--header 'Content-Type: application/json' \
--data '{
"id": "a1b2c3d4e5f6g7h8i9j0",
"amount": 150.00,
"status": 2,
"link_name": "Updated Invoice #001"
}'
Notes
company_idis required (viacompanyidheader). The backend setsupdated_byfrom the token andupdated_dateautomatically.- Only include fields you want to change; the
idfield is used to identify the record and is not updated. - Payment link status values: 1=Created, 2=Expired, 3=Completed, 4=Cancelled. See Constants.
- If no document is updated (e.g. invalid id), the API returns
USER_PAYMENT_LINK_ERROR_UPDATING_PLEASE_TRY_AGAIN_LATER.