Skip to main content
PATCH
/
payment-request
/
{id}
/
approve
Approve Payment Request
curl --request PATCH \
  --url https://server26-dot-royalti-project.uc.r.appspot.com/payment-request/{id}/approve \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "title": "<string>",
  "transactionDate": "2023-11-07T05:31:56Z",
  "currency": "<string>",
  "amount": 123,
  "amountUSD": 123,
  "conversionRate": 123,
  "memo": "<string>",
  "method": "vertofx",
  "walletId": "<string>",
  "purposeCode": "<string>",
  "files": [
    null
  ]
}'
{
  "message": "Payment request approved successfully",
  "paymentRequest": {
    "id": "0654cd19-cea3-4fad-b92e-4033c4252c79",
    "status": "approved"
  }
}
This endpoint requires authentication. Include your Bearer token in the Authorization header.

Code Examples

const response = await fetch('https://server26-dot-royalti-project.uc.r.appspot.com/payment-request/example-id/approve', {
  method: 'PATCH',
  headers: {
    'Authorization': `Bearer ${token}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "title": "sample-title",
    "transactionDate": "2024-01-21T12:00:00Z",
    "currency": "sample-currency",
    "amount": 1,
    "amountUSD": 1,
    "conversionRate": 1,
    "memo": "sample-memo",
    "method": "sample-method",
    "walletId": "sample-walletId",
    "purposeCode": "sample-purposeCode",
    "files": [
      {}
    ]
  })
});

const data = await response.json();
console.log(data);

Authorizations

Authorization
string
header
required

JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"

Path Parameters

id
string
required

Payment Request ID

Body

application/json
title
string

Title for the payment (defaults to "Payment for [original request title]")

transactionDate
string<date-time>

Transaction date (defaults to current date)

currency
string

Currency code (defaults to request currency)

amount
number

Payment amount (defaults to request amount)

amountUSD
number

Payment amount in USD (defaults to request amountUSD)

conversionRate
number

Conversion rate if different from default

memo
string

Additional notes about the payment

method
enum<string>

Payment method (only 'vertofx' requires additional fields)

Available options:
vertofx
walletId
string

Required if method is 'vertofx' - Wallet ID for VertoFX

purposeCode
string

Required if method is 'vertofx' - Purpose code for VertoFX

files
file[]

Optional receipt or supporting documents

Response

Success

message
string
paymentRequest
object