Pi eCard Transaction Gateway
Gateway DashboardPi eCardPricingContact
  • Pi eCard
  • 🚀Quick Start
  • Reference
    • Payments
      • Using the Gateway
      • Get Payment
      • Create Payment
      • Webhooks
      • App-to-User Payments
      • Sandbox Mode
      • Payment Buttons
      • Subscriptions
    • Plugin for WooCommerce
      • Installation
      • Transactions
    • Examples
      • Example 1
Powered by GitBook
On this page
  • HTTP request
  • Get a payment
  • Usage with NPM Package
  • Example using Axios

Was this helpful?

  1. Reference
  2. Payments

Get Payment

The Get Payment endpoint allows you to get the details and status of any payment, using the ID of the payment.

We recommend your store the payment ID in your database when you create a payment

HTTP request

Get a payment

GET https://api.piecard.app/payment/:paymentId

Path Parameters

Name
Type
Description

paymentId*

string

The unique ID of the payment. This is returned when the payment is created.

{
    success: true,
    payment: {
        _id,
        amount,
        fee,
        memo,
        payee, // your Pi eCard username
        metadata,
        successURL,
        cancelURL,
        sandbox
    }
}

Usage with NPM Package

// Get payment
const paymentId = STRING // 63e064aebc26563e677a9ae1
piecard.getPaymentById(paymentId)
  .then((response) => {
    console.log("Get payment : ", response);
  })
  .catch((err) => {
    console.log("Get payment error : ", err);
  });

Example using Axios

const id = 'YOUR_PAYMENT_ID';
const response = await axios
    .get(`https://api.piecard.app/payment/${id}`, {
        headers: {
            clientid: "YOUR_CLIENT_ID",
            clientsecret: "YOUR_CLIENT_SECRET",
            accesstoken: "YOUR_ACCESS_TOKEN"
        }
    });
PreviousUsing the GatewayNextCreate Payment

Last updated 2 years ago

Was this helpful?