API Reference

Comprehensive documentation for the ZenPay REST API

Getting Started

Essential information to get started with the API

Testing

Resources for testing API integration

API Keys

Manage and use your API keys

Secret key
sk_test_ZenPayDemoKey123456789

API Endpoints

Explore all available endpoints in the ZenPay API

Payment Intents

objects

Payment Intents track the lifecycle of a customer payment through the ZenPay system.

The Payment Intent object

Payment Intent Object
{
  "id": "pi_1OAbCdEfGhIjKlMnOpQrStUv",
  "object": "payment_intent",
  "amount": 2000,
  "amount_received": 2000,
  "currency": "usd",
  "payment_method_types": ["bitcoin", "ethereum"],
  "status": "succeeded",
  "description": "Order #12345",
  "created": 1643648476,
  "metadata": {
    "order_id": "12345"
  },
  "livemode": false
}

Endpoints

POST
/v1/payment_intents
Create a PaymentIntent
GET
/v1/payment_intents/:id
Retrieve a PaymentIntent
POST
/v1/payment_intents/:id
Update a PaymentIntent
GET
/v1/payment_intents
List all PaymentIntents
POST
/v1/payment_intents/:id/capture
Capture a PaymentIntent
POST
/v1/payment_intents/:id/cancel
Cancel a PaymentIntent

Example Request

Create a payment intent
curl https://api.zenpay.io/v1/payment_intents \
  -X POST \
  -H "Authorization: Bearer sk_test_ZenPayDemoKey123456789" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 2000,
    "currency": "usd",
    "payment_method_types": ["bitcoin", "ethereum"],
    "description": "Order #12345",
    "metadata": {
      "order_id": "12345"
    }
  }'

Example Response

Response
{
  "id": "pi_1OAbCdEfGhIjKlMnOpQrStUv",
  "object": "payment_intent",
  "amount": 2000,
  "amount_received": 0,
  "currency": "usd",
  "payment_method_types": ["bitcoin", "ethereum"],
  "status": "requires_payment_method",
  "description": "Order #12345",
  "client_secret": "pi_1OAbCdEfGhIjKlMnOpQrStUv_secret_AbCdEfGhIjKlMnOpQrStUv",
  "created": 1643648476,
  "metadata": {
    "order_id": "12345"
  },
  "livemode": false
}

Need help with integration?

If you're having trouble with your integration, our support team is here to help.