Payments API

Create payment links, track payment status, and manage the complete payment verification lifecycle.

What You Can Do

Create Payment Links

Generate secure payment links with custom amounts, descriptions, and redirect URLs.

Track Status

Monitor payment status in real-time from pending to verified or rejected.

Manage Lifecycle

Cancel, expire, or update payment details as needed.

Create Payment Link

Create a new payment link for a customer to complete payment verification.

POST /api/v1/payment-requests
'Response', 'content' => '{ \"invoice_id\": \"ABC123XY\", \"checkout_url\": \"https://veripay.us/pay/ABC123XY\" }' ], [ 'title' => 'cURL', 'content' => 'curl -X POST https://api.veripay.us/v1/payment-requests \\ -H \"Authorization: Bearer sk_test_...\" \\ -H \"Content-Type: application/json\" \\ -d \'{ \"amount_cents\": 15000, \"currency\": \"TTD\", \"description\": \"Wedding Cake Order #12345\", \"customer_name\": \"Jane Smith\", \"customer_email\": \"[email protected]\", \"success_url\": \"https://yoursite.com/payment/success\", \"cancel_url\": \"https://yoursite.com/payment/cancel\" }\'' ], [ 'title' => 'PHP', 'content' => ' $veripay = new VeriPayClient($apiKey); $payment = $veripay->payments->create([ \'amount_cents\' => 15000, \'currency\' => \'TTD\', \'description\' => \'Wedding Cake Order #12345\', \'customer_name\' => \'Jane Smith\', \'customer_email\' => \'[email protected]\', \'success_url\' => \'https://yoursite.com/payment/success\', \'cancel_url\' => \'https://yoursite.com/payment/cancel\' ]); echo $payment->checkout_url;' ] ]" default="Request" />

Request Parameters

Parameter Type Required Description
amount_cents integer Yes Amount in cents (minimum 100)
currency string Yes 3-letter currency code (TTD, USD, XCD)
description string Yes Payment description (max 1000 chars)
customer_name string Yes Customer's full name
customer_email string Yes Customer's email address
success_url string Yes URL to redirect after successful payment
cancel_url string Yes URL to redirect if payment is cancelled
customer_phone string No Customer's phone number
expires_at string No ISO 8601 timestamp (default: 15 minutes)

Get Payment Status

Retrieve the current status and details of a payment.

GET /api/v1/payment-requests/{invoice_id}

Payment Status Values

pending Payment link created, awaiting customer action
submitted Customer submitted payment proof, pending verification
verified Payment verified and approved
rejected Payment proof rejected
expired Payment link expired
cancelled Payment cancelled by merchant or customer

Cancel or Expire Payment

Cancel a pending payment or mark it as expired.

PATCH /api/v1/payment-requests/{invoice_id}
'Expire Request', 'content' => 'PATCH /api/v1/payment-requests/ABC123XY Authorization: Bearer sk_test_... Content-Type: application/json { \"status\": \"expired\" }' ] ]" default="Cancel Request" />

Webhook Integration

Receive real-time notifications when payment status changes:

payment.created Payment link created
payment.submitted Customer submitted payment proof
payment.verified Payment verified and approved
payment.rejected Payment proof rejected

Learn more about webhook implementation in our Webhooks guide.

Best Practices

Next Steps

Now that you understand the Payments API, explore related resources: