Retrieves a paginated list of all your payments (transactions).
GET /api/payments
Authorization: Bearer {token}
Accept: application/json
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number |
perPage | integer | 10 | Number of items per page (max: 100) |
curl -X GET "https://api.rise-payments.com/api/payments?page=1&perPage=20" \
-H "Authorization: Bearer sk_live_abc123..." \
-H "Accept: application/json"
Code: 200 OK
{
"data": [
{
"id": "string",
"external_id": "string",
"type": "payment",
"status": "pending",
"amount": "100",
"created_at": "2023-01-01T00:00:00.000Z",
}
]
}
Creates a new payment.
POST /api/payments
Authorization: Bearer {token}
Accept: application/json
Content-Type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
amount | number | Yes | Amount to send in standard units (minimum: 0) |
external_id | string | No | Your internal identifier for the payment |
customer_id | string | No | Your customer ID, used to link the payment to a specific customer |
curl -X POST https://api.rise-payments.com/api/payments \
-H "Authorization: Bearer sk_live_abc123..." \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"amount": 100,
"external_id": "your_payment_id",
"customer_id": "your_customer_id"
}'
Code: 201 Created
{
"message": "Payment created successfully"
}
!NOTE The payment is created and queued for processing. You will receive a
payment.completedwebhook when the transaction is paid.
Code: 422 Unprocessable Entity
{
"message": "The given data was invalid.",
"errors": {
"amount": ["The amount field is required."]
}
}
| Field | Type | Description |
|---|---|---|
id | integer | Unique payment identifier |
external_id | string | Your internal identifier for the payment |
type | string | Transaction type (always payment) |
status | string | Payment status (see below) |
amount | string | Amount of the payment |
metadata | string | Metadata associated with the payment (ex: customer_id) |
created_at | string | Creation timestamp (ISO 8601) |
| Status | Description |
|---|---|
pending | Payment created, awaiting payment confirmation |
completed | Payment paid |
failed | Payment failed |
Use webhooks to monitor payment completion:
<?php
// webhook-handler.php
if ($event['event'] === 'payment.completed') {
$payment = $event['data'];
// Log completion
logPaymentCompleted($payment['id'], $payment['external_id']);
// Notify user
sendEmail($userEmail, "Your payment of {$payment['amount']} has been completed");
}
Payments trigger the following webhook event:
payment.pending - When the payment is createdpayment.completed - When the payment is paidpayment.failed - When the payment failsSee the webhooks documentation for implementation details.