🚀Quick Start
Start taking payments with our quick start API guide.
Last updated
Start taking payments with our quick start API guide.
Last updated
Your API requests are authenticated using API keys. Any request that doesn't include an API key will return an error.
You can get your API key in your Dashboard at any time, here:
The best way to interact with our API is to use one of our official libraries:
Good to know: You can also use our APIs in any server-side language. Just see our API Reference.
Creating a payment requires a simple request, containing just API keys as authorisation and the payment parameters.
POST
https://api.piecard.app/payment
Test Mode: You can set sandbox mode to true to easily test you integration. Please see here for test mode usage.
From the POST /payment endpoint, you will receive a payment ID.
To initiate the payment, you must redirect the user to 'https://piecard.app/pay/YOUR_PAYMENT_ID'
GET
https://api.piecard.app/payment/:paymentId
To be able to deliver your product safely, you must listen for a Payment Complete webhook from our servers.
To begin receive webhooks, you must first enter a valid URL to your server in the Pi eCard Gateway Dashboard.
When a payment is completed, our servers with sent an HTTP request to this specified URL, which will consist of the payment data and status, encoded with your secret key.
If success is true, then the payment was fulfilled and you should deliver the product. If the success is false, do not deliver the product.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
amount*
number
The amount of Pi being requested. This includes the transaction fee.
memo*
string
Something to describe the payment to the user.
successURL*
string
The redirect URL for a successful payment.
cancelURL*
string
The redirect URL for a failed payment.
metadata
object
Any set object-key pairs for the developer's use. This will be included in the webhook.
sandbox
boolean
Set to true for testing you payment integration. Default is false.
paymentId*
string
The unique ID of the payment. This is returned when the payment is created.