Skip to main content

Update Payment Request User API

Overview

Update the status and details of a specific payment request user record.

API Details

Endpoint

PUT https://api.gafapay.com:8443/gafapay/v3/user/payment_request_users

Headers

authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJmYjhmMDkyMTBlMGY0NmI3YjQyNjJkNzdmNWI2YzI3MyIsInJvbGVzIjpbIlJPTEVfQ1VTVE9NRVIiXSwiZXhwIjoxNzU3MTYwNzEzfQ.b3RU1QWT7N7WQQJ5kHAO2yptdnEO6vr-7GwdCAGUpCA
companyid: 59388167894b4d10a04fe5da3b8a2104
requestid: be08f79e-7eac-40e1-acbe-00f6ae7b8f7b
Content-Type: application/json

Request Body

{
"id": "e276fd741b674808b869f7642c47041c",
"payment_status": 3,
"cancel_reason": "close"
}

Request Body Fields

Required Fields
  • id (string, required): The unique identifier of the payment request user record to update
    • Format: UUID string
    • Example: "e276fd741b674808b869f7642c47041c"
Optional Fields (Update Only What You Need)
  • payment_status (integer, optional): New payment status

    • 1 = PAYMENT_STATUS_PENDING
    • 2 = PAYMENT_STATUS_COMPLETED
    • 3 = PAYMENT_STATUS_CANCELLED_BY_INITIATOR
    • 4 = PAYMENT_STATUS_CANCELLED_BY_PAYER
    • See Constants for more details
  • cancel_reason (string, optional): Reason for cancellation if applicable

    • Format: Text string
    • Example: "close", "User requested cancellation", "Payment expired"
    • Can be null if not cancelling
  • payer_transaction_id (string, optional): Transaction ID from the payer

    • Format: Transaction identifier string
    • Example: "TXN123456789"
    • Can be null if payment not completed
  • amount (number, optional): Updated payment amount

    • Format: Decimal number
    • Example: 100.0, 50.5, 1000.00
  • is_active (boolean, optional): Whether the payment request user record is active

    • true = Active
    • false = Inactive

Response

{
"success": 1,
"error": [],
"data": {
"message": "USER_UPDATE_PAYMENT_REQUEST_USERS"
}
}

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 indicating the payment request user was updated

Example Usage

curl --location --request PUT 'https://api.gafapay.com:8443/gafapay/v3/user/payment_request_users' \
--header 'authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJmYjhmMDkyMTBlMGY0NmI3YjQyNjJkNzdmNWI2YzI3MyIsInJvbGVzIjpbIlJPTEVfQ1VTVE9NRVIiXSwiZXhwIjoxNzU3MTYwNzEzfQ.b3RU1QWT7N7WQQJ5kHAO2yptdnEO6vr-7GwdCAGUpCA' \
--header 'companyid: 59388167894b4d10a04fe5da3b8a2104' \
--header 'requestid: be08f79e-7eac-40e1-acbe-00f6ae7b8f7b' \
--header 'Content-Type: application/json' \
--data '{
"id": "e276fd741b674808b869f7642c47041c",
"payment_status": 3,
"cancel_reason": "close"
}'

Example with Payment Completion

curl --location --request PUT 'https://api.gafapay.com:8443/gafapay/v3/user/payment_request_users' \
--header 'authorization: Token YOUR_TOKEN_HERE' \
--header 'companyid: YOUR_COMPANY_ID' \
--header 'requestid: YOUR_REQUEST_ID' \
--header 'Content-Type: application/json' \
--data '{
"id": "YOUR_PAYMENT_REQUEST_USER_ID_HERE",
"payment_status": 2,
"payer_transaction_id": "TXN123456789"
}'

Notes

  • ID is always required in the request body for all PUT APIs
  • Only the fields provided in the request body will be updated
  • Fields not included in the request will remain unchanged
  • Payment status values can be referenced from the Constants page
  • Use this API to update payment status, add transaction IDs, or modify amounts
  • Cancellation reasons are typically required when setting status to cancelled
  • Transaction IDs are typically required when setting status to completed
  • Use the Get Payment Request User API to verify the changes