Poll invoice status
curl --request GET \
--url https://api-beta.pepay.io/api/v1/invoices/{invoiceId}/status \
--header 'x-api-key: <api-key>'import requests
url = "https://api-beta.pepay.io/api/v1/invoices/{invoiceId}/status"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api-beta.pepay.io/api/v1/invoices/{invoiceId}/status', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-beta.pepay.io/api/v1/invoices/{invoiceId}/status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-beta.pepay.io/api/v1/invoices/{invoiceId}/status"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-beta.pepay.io/api/v1/invoices/{invoiceId}/status")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-beta.pepay.io/api/v1/invoices/{invoiceId}/status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"object": "invoice_status",
"invoice": {
"object": "invoice",
"id": "550e8400-e29b-41d4-a716-446655440000",
"merchant_id": 123,
"status": "paid",
"invoice_type": "standard",
"currency": "usd",
"amount": 49990,
"amount_decimal": "49.990",
"amount_unit": "usd_millis",
"environment": "devnet"
},
"latest_payment": {
"object": "invoice_payment",
"id": "550e8400-e29b-41d4-a716-446655440111",
"invoice_id": "550e8400-e29b-41d4-a716-446655440000",
"merchant_id": 123,
"status": "confirmed",
"settlement_status": "settled",
"currency": "usd",
"amount": 49990,
"amount_decimal": "49.990",
"amount_unit": "usd_millis"
}
}Get Invoice Status
Fetch the latest invoice status and payment/settlement summaries.
GET
/
api
/
v1
/
invoices
/
{invoiceId}
/
status
Poll invoice status
curl --request GET \
--url https://api-beta.pepay.io/api/v1/invoices/{invoiceId}/status \
--header 'x-api-key: <api-key>'import requests
url = "https://api-beta.pepay.io/api/v1/invoices/{invoiceId}/status"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api-beta.pepay.io/api/v1/invoices/{invoiceId}/status', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-beta.pepay.io/api/v1/invoices/{invoiceId}/status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-beta.pepay.io/api/v1/invoices/{invoiceId}/status"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-beta.pepay.io/api/v1/invoices/{invoiceId}/status")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-beta.pepay.io/api/v1/invoices/{invoiceId}/status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"object": "invoice_status",
"invoice": {
"object": "invoice",
"id": "550e8400-e29b-41d4-a716-446655440000",
"merchant_id": 123,
"status": "paid",
"invoice_type": "standard",
"currency": "usd",
"amount": 49990,
"amount_decimal": "49.990",
"amount_unit": "usd_millis",
"environment": "devnet"
},
"latest_payment": {
"object": "invoice_payment",
"id": "550e8400-e29b-41d4-a716-446655440111",
"invoice_id": "550e8400-e29b-41d4-a716-446655440000",
"merchant_id": 123,
"status": "confirmed",
"settlement_status": "settled",
"currency": "usd",
"amount": 49990,
"amount_decimal": "49.990",
"amount_unit": "usd_millis"
}
}Overview
Use this endpoint to get the latest invoice status and any associated payment/settlement summaries.Authentication
- Merchant server auth:
x-api-keyorAuthorization: Bearer <jwt>
Request
SDK
const status = await pepay.invoices.status('550e8400-e29b-41d4-a716-446655440000');
cURL
INVOICE_ID="550e8400-e29b-41d4-a716-446655440000"
curl "https://api-beta.pepay.io/api/v1/invoices/$INVOICE_ID/status" \
-H "x-api-key: sk_live_..."
Response
{
"object": "invoice_status",
"invoice": {
"object": "invoice",
"id": "550e8400-e29b-41d4-a716-446655440000",
"merchant_id": 123,
"status": "paid",
"invoice_type": "standard",
"currency": "usd",
"amount": 49990,
"amount_decimal": "49.990",
"amount_unit": "usd_millis",
"environment": "devnet"
},
"latest_payment": {
"object": "invoice_payment",
"id": "550e8400-e29b-41d4-a716-446655440111",
"invoice_id": "550e8400-e29b-41d4-a716-446655440000",
"merchant_id": 123,
"status": "confirmed",
"settlement_status": "settled",
"settlement": {
"summary_status": "settled",
"stage": "final",
"merchant_settlement_id": 30,
"settlement_tx_hash": "0xabc123",
"network": "bsc",
"status": "settled"
}
}
}
Errors
400invalid invoice id401missing/invalid merchant auth404invoice not found
Examples
Poll until the invoice is terminal:const status = await pepay.invoices.waitForStatus(invoiceId, { timeoutMs: 5 * 60 * 1000 });
Authorizations
merchantApiKeybearerAuth
API key for server-to-server operations (scope=merchant or commerce)
Path Parameters
Invoice ID
Response
Invoice status retrieved successfully
Was this page helpful?
⌘I

