Api Reference

Payments

Endpoints to create and manage payments

List Payments

Retrieves a paginated list of all your payments (transactions).

Endpoint

GET /api/payments

Headers

Authorization: Bearer {token}
Accept: application/json

Query Parameters

ParameterTypeDefaultDescription
pageinteger1Page number
perPageinteger10Number of items per page (max: 100)

Example Request

curl -X GET "https://api.rise-payments.com/api/payments?page=1&perPage=20" \
  -H "Authorization: Bearer sk_live_abc123..." \
  -H "Accept: application/json"

Successful Response

Code: 200 OK

{
  "data": [
    {
      "id": "string",
      "external_id": "string",
      "type": "payment",
      "status": "pending",
      "amount": "100",
      "created_at": "2023-01-01T00:00:00.000Z",
    }
  ]
}

Create Payment

Creates a new payment.

Endpoint

POST /api/payments

Headers

Authorization: Bearer {token}
Accept: application/json
Content-Type: application/json

Request Body

FieldTypeRequiredDescription
amountnumberYesAmount to send in standard units (minimum: 0)
external_idstringNoYour internal identifier for the payment
customer_idstringNoYour customer ID, used to link the payment to a specific customer

Example Request

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"
  }'

Successful Response

Code: 201 Created

{
  "message": "Payment created successfully"
}

!NOTE The payment is created and queued for processing. You will receive a payment.completed webhook when the transaction is paid.

Validation Errors

Code: 422 Unprocessable Entity

{
  "message": "The given data was invalid.",
  "errors": {
    "amount": ["The amount field is required."]
  }
}

Payment Fields

FieldTypeDescription
idintegerUnique payment identifier
external_idstringYour internal identifier for the payment
typestringTransaction type (always payment)
statusstringPayment status (see below)
amountstringAmount of the payment
metadatastringMetadata associated with the payment (ex: customer_id)
created_atstringCreation timestamp (ISO 8601)

Payment Statuses

StatusDescription
pendingPayment created, awaiting payment confirmation
completedPayment paid
failedPayment failed

3. Monitor Payment Completion

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");
}

Webhooks

Payments trigger the following webhook event:

  • payment.pending - When the payment is created
  • payment.completed - When the payment is paid
  • payment.failed - When the payment fails

See the webhooks documentation for implementation details.