Welcome to the PayShipGo API documentation. Here, you'll find all the necessary information to integrate our payment and shipping services into your platform. We are committed to providing a simple and streamlined experience for developers. This page provides a full overview of our API, along with code examples to get started.
Before diving in, we invite you to explore our detailed guides and references to facilitate the integration process and ensure all queries are addressed. Let's build something amazing together!
All API requests require authentication using your Merchant ID and API Key. Include these in the request headers:
{
"X-Merchant-ID": "your_merchant_id",
"X-API-Key": "your_api_key",
"Content-Type": "application/json"
}
Base URL: https://api.payshipgo.com/v1
Creates a new payment session for processing a transaction.
{
"amount": 1000.00,
"currency": "PHP",
"gateway": "pesopay", // Options: pesopay, dragonpay, paypal, gcash
"payment_method": "card", // Varies by gateway
"order_id": "ORDER123",
"customer": {
"email": "customer@example.com",
"name": "John Doe",
"phone": "+639123456789"
},
"billing_address": {
"street": "123 Main St",
"city": "Makati",
"state": "Metro Manila",
"postal_code": "1234",
"country": "PH"
},
"success_url": "https://yourstore.com/success",
"cancel_url": "https://yourstore.com/cancel"
}
/payment/session
{
"status": "success",
"session_id": "sess_123456789",
"payment_url": "https://checkout.payshipgo.com/sess_123456789",
"expires_at": "2024-01-14T15:30:00Z"
}
Retrieves the current status of a payment session.
/payment/session/{session_id}/status
{
"status": "completed", // pending, completed, failed, cancelled
"payment_id": "pay_123456789",
"amount": 1000.00,
"currency": "PHP",
"payment_method": "card",
"gateway": "pesopay",
"timestamp": "2024-01-14T15:30:00Z"
}
Initiates a refund for a completed payment.
{
"payment_id": "pay_123456789",
"amount": 1000.00, // Optional, if partial refund
"reason": "Customer request",
"reference_id": "REF123"
}
/payment/refund
{
"status": "success",
"refund_id": "ref_123456789",
"amount": 1000.00,
"currency": "PHP",
"payment_id": "pay_123456789",
"timestamp": "2024-01-14T15:30:00Z"
}
Sets up a recurring payment schedule.
{
"customer_id": "cust_123456789",
"amount": 1000.00,
"currency": "PHP",
"gateway": "pesopay",
"interval": "month", // day, week, month, year
"interval_count": 1,
"start_date": "2024-02-01",
"end_date": "2024-12-31", // Optional
"payment_method": {
"type": "card",
"token": "tok_123456789" // Obtained from initial payment
}
}
/payment/recurring
{
"status": "success",
"subscription_id": "sub_123456789",
"next_payment_date": "2024-02-01",
"schedule": {
"interval": "month",
"interval_count": 1,
"start_date": "2024-02-01",
"end_date": "2024-12-31"
}
}
Creates a new invoice for payment collection.
{
"customer": {
"email": "customer@example.com",
"name": "John Doe",
"phone": "+639123456789"
},
"items": [
{
"description": "Product A",
"quantity": 2,
"unit_price": 500.00
}
],
"due_date": "2024-01-21",
"currency": "PHP",
"notes": "Payment for January order"
}
/payment/invoice
{
"status": "success",
"invoice_id": "inv_123456789",
"amount": 1000.00,
"currency": "PHP",
"payment_url": "https://invoice.payshipgo.com/inv_123456789",
"due_date": "2024-01-21",
"created_at": "2024-01-14T15:30:00Z"
}
Register webhook endpoints for payment notifications.
{
"url": "https://yourstore.com/webhooks/payment",
"events": [
"payment.success",
"payment.failed",
"refund.processed",
"subscription.renewed"
],
"description": "Payment notifications endpoint"
}
/payment/webhooks
{
"status": "success",
"webhook_id": "whk_123456789",
"secret_key": "whsec_123456789", // Use this to verify webhook signatures
"events": [
"payment.success",
"payment.failed",
"refund.processed",
"subscription.renewed"
]
}
PayShipGo sends webhook notifications for various payment events. Here's an example webhook payload:
{
"id": "evt_123456789",
"type": "payment.success",
"created": "2024-01-14T15:30:00Z",
"data": {
"payment_id": "pay_123456789",
"amount": 1000.00,
"currency": "PHP",
"status": "completed",
"customer": {
"email": "customer@example.com",
"name": "John Doe"
}
}
}
All API errors follow this format:
{
"status": "error",
"code": "invalid_request",
"message": "The provided payment method is not supported",
"request_id": "req_123456789"
}
All shipping API requests require the same authentication headers as the payment API:
{
"X-Merchant-ID": "your_merchant_id",
"X-API-Key": "your_api_key",
"Content-Type": "application/json"
}
Base URL: https://api.payshipgo.com/v1
Get shipping rates from available carriers based on package details.
{
"origin": {
"address": "123 Sender St",
"city": "Makati",
"state": "Metro Manila",
"postal_code": "1234",
"country": "PH",
"contact_number": "+639123456789"
},
"destination": {
"address": "456 Receiver St",
"city": "Cebu",
"state": "Cebu",
"postal_code": "6000",
"country": "PH",
"contact_number": "+639987654321"
},
"package": {
"weight": 1.5, // in kg
"dimensions": {
"length": 30, // in cm
"width": 20,
"height": 10
},
"declared_value": 1000.00
},
"service_preferences": {
"carriers": ["lbc", "jnt", "2go", "flash"], // Optional: specific carriers
"delivery_speed": "standard" // standard, express, same_day
}
}
/shipping/rates
{
"status": "success",
"rates": [
{
"carrier": "lbc",
"service_name": "Express",
"amount": 150.00,
"currency": "PHP",
"estimated_days": 2,
"guaranteed_delivery": false
},
{
"carrier": "flash",
"service_name": "Same Day",
"amount": 250.00,
"currency": "PHP",
"estimated_days": 0,
"guaranteed_delivery": true,
"cutoff_time": "15:00:00"
}
]
}
Create a new shipment with your chosen carrier.
{
"rate_id": "rate_123456789", // From rates response
"sender": {
"name": "John Doe",
"address": "123 Sender St",
"city": "Makati",
"state": "Metro Manila",
"postal_code": "1234",
"country": "PH",
"contact_number": "+639123456789",
"email": "sender@example.com"
},
"recipient": {
"name": "Jane Smith",
"address": "456 Receiver St",
"city": "Cebu",
"state": "Cebu",
"postal_code": "6000",
"country": "PH",
"contact_number": "+639987654321",
"email": "recipient@example.com"
},
"package": {
"weight": 1.5,
"dimensions": {
"length": 30,
"width": 20,
"height": 10
},
"declared_value": 1000.00,
"description": "Electronics",
"items": [
{
"description": "Smartphone",
"quantity": 1,
"value": 1000.00
}
]
},
"service_options": {
"insurance": true,
"signature_required": true,
"cash_on_delivery": {
"amount": 1000.00,
"currency": "PHP"
}
},
"reference": "ORDER123"
}
/shipping/shipments
{
"status": "success",
"shipment_id": "ship_123456789",
"tracking_number": "TRACK123456789",
"label_url": "https://api.payshipgo.com/v1/shipping/labels/ship_123456789",
"carrier": "lbc",
"service": "Express",
"estimated_delivery": "2024-01-16",
"pickup_schedule": {
"date": "2024-01-14",
"window": "13:00-17:00"
}
}
Retrieve details of an existing shipment.
/shipping/shipments/{shipment_id}
{
"status": "success",
"shipment_id": "ship_123456789",
"tracking_number": "TRACK123456789",
"carrier": "lbc",
"service": "Express",
"current_status": "in_transit",
"status_detail": "Package in sorting facility",
"estimated_delivery": "2024-01-16",
"tracking_history": [
{
"status": "picked_up",
"location": "Makati City",
"timestamp": "2024-01-14T13:30:00Z",
"description": "Package picked up from sender"
},
{
"status": "in_transit",
"location": "Makati Sorting Facility",
"timestamp": "2024-01-14T15:30:00Z",
"description": "Package in sorting facility"
}
]
}
Schedule a pickup for one or more shipments.
{
"pickup_date": "2024-01-15",
"preferred_time_window": "13:00-17:00",
"location": {
"address": "123 Sender St",
"city": "Makati",
"state": "Metro Manila",
"postal_code": "1234",
"country": "PH",
"contact_name": "John Doe",
"contact_number": "+639123456789"
},
"shipments": ["ship_123456789", "ship_987654321"],
"special_instructions": "Please call before arrival"
}
/shipping/pickups
{
"status": "success",
"pickup_id": "pick_123456789",
"confirmation_number": "PCK123456789",
"scheduled_date": "2024-01-15",
"time_window": "13:00-17:00",
"carrier": "lbc"
}
Validate an address before creating a shipment.
{
"address": "123 Test St",
"city": "Makati",
"state": "Metro Manila",
"postal_code": "1234",
"country": "PH"
}
/shipping/validate-address
{
"status": "success",
"is_valid": true,
"normalized_address": {
"address": "123 Test Street",
"city": "Makati City",
"state": "Metro Manila",
"postal_code": "1234",
"country": "PH"
},
"service_coverage": {
"lbc": true,
"jnt": true,
"2go": true,
"flash": true
}
}
Generate or retrieve a shipping label for a shipment.
/shipping/labels/{shipment_id}
Query Parameters:
- `format`: pdf (default) or zpl
- `size`: 4x6 (default) or A4
{
"status": "success",
"label_url": "https://api.payshipgo.com/v1/shipping/labels/ship_123456789.pdf",
"expires_at": "2024-01-15T15:30:00Z"
}
Cancel a shipment that hasn't been picked up.
/shipping/shipments/{shipment_id}
{
"status": "success",
"shipment_id": "ship_123456789",
"cancellation_id": "can_123456789",
"refund_amount": 150.00,
"currency": "PHP"
}
PayShipGo sends webhook notifications for various shipping events. Configure these in the webhook settings.
{
"id": "evt_123456789",
"type": "shipment.status_update",
"created": "2024-01-14T15:30:00Z",
"data": {
"shipment_id": "ship_123456789",
"tracking_number": "TRACK123456789",
"status": "delivered",
"location": "Cebu City",
"timestamp": "2024-01-14T15:30:00Z",
"details": "Package delivered to recipient"
}
}
All API errors follow this format:
{
"status": "error",
"code": "invalid_address",
"message": "The provided delivery address is invalid or unsupported",
"request_id": "req_123456789"
}
const axios = require('axios');
const PAYSHIPGO_BASE_URL = 'https://api.payshipgo.com/v1';
const config = {
headers: {
'X-Merchant-ID': 'your_merchant_id',
'X-API-Key': 'your_api_key',
'Content-Type': 'application/json'
}
};
// Payment Examples
async function paymentExamples() {
// POST: Create Payment Session
try {
const paymentSession = await axios.post(`${PAYSHIPGO_BASE_URL}/payment/session`, {
amount: 1000.00,
currency: "PHP",
gateway: "pesopay",
payment_method: "card",
order_id: "ORDER123",
customer: {
email: "customer@example.com",
name: "John Doe",
phone: "+639123456789"
}
}, config);
console.log('Payment Session:', paymentSession.data);
} catch (error) {
console.error('Error creating payment:', error.response.data);
}
// GET: Check Payment Status
try {
const paymentStatus = await axios.get(
`${PAYSHIPGO_BASE_URL}/payment/session/sess_123456789/status`,
config
);
console.log('Payment Status:', paymentStatus.data);
} catch (error) {
console.error('Error checking status:', error.response.data);
}
// DELETE: Cancel Payment
try {
const cancelPayment = await axios.delete(
`${PAYSHIPGO_BASE_URL}/payment/session/sess_123456789`,
config
);
console.log('Payment Cancelled:', cancelPayment.data);
} catch (error) {
console.error('Error cancelling payment:', error.response.data);
}
}
// Shipping Examples
async function shippingExamples() {
// POST: Create Shipment
try {
const shipment = await axios.post(`${PAYSHIPGO_BASE_URL}/shipping/shipments`, {
rate_id: "rate_123456789",
sender: {
name: "John Doe",
address: "123 Sender St",
city: "Makati",
state: "Metro Manila",
postal_code": "1234",
country: "PH",
contact_number": "+639123456789"
},
recipient: {
name: "Jane Smith",
address: "456 Receiver St",
city: "Cebu",
state: "Cebu",
postal_code": "6000",
country: "PH",
contact_number": "+639987654321"
},
package: {
weight: 1.5,
dimensions: {
length: 30,
width: 20,
height: 10
}
}
}, config);
console.log('Shipment Created:', shipment.data);
} catch (error) {
console.error('Error creating shipment:', error.response.data);
}
// GET: Track Shipment
try {
const tracking = await axios.get(
`${PAYSHIPGO_BASE_URL}/shipping/shipments/ship_123456789`,
config
);
console.log('Tracking Info:', tracking.data);
} catch (error) {
console.error('Error tracking shipment:', error.response.data);
}
// DELETE: Cancel Shipment
try {
const cancelShipment = await axios.delete(
`${PAYSHIPGO_BASE_URL}/shipping/shipments/ship_123456789`,
config
);
console.log('Shipment Cancelled:', cancelShipment.data);
} catch (error) {
console.error('Error cancelling shipment:', error.response.data);
}
}
Integration typically takes 2-5 business days, depending on your platform and requirements. We provide comprehensive documentation, SDKs, and support to streamline the process.
PayShipGo supports multiple payment methods including credit/debit cards, online banking, e-wallets (GCash, PayMaya, Coins.ph), over-the-counter payments, and cryptocurrency through our integrated payment gateways (PesoPay, Dragonpay, PayPal, and GCash).
Refunds can be processed through our API or dashboard. Full or partial refunds are supported and typically process within 5-7 business days, depending on the payment method and gateway used.
We partner with major Philippine carriers including LBC Express, J&T Express, 2GO Express, and Flash Express, offering nationwide coverage and various shipping options.
PayShipGo provides real-time tracking through our API and webhook notifications. Updates are synchronized with carrier tracking systems and can be integrated into your platform or forwarded to customers via email/SMS.
PayShipGo implements PCI-DSS compliant security measures, encryption for data transmission, tokenization for sensitive information, and fraud detection systems. We also support 3D Secure authentication for card payments.
COD is supported through our integrated carriers. Funds are typically remitted to merchants within 3-5 business days after successful delivery, with real-time notifications for collection status.
All shipments include basic insurance coverage. Claims can be filed through our platform, and we handle coordination with carriers. Additional insurance coverage is available for high-value items.
Yes, PayShipGo allows merchants to set custom shipping rates, add handling fees, and create rule-based pricing based on weight, destination, or other factors.
International shipping is available through 2GO Express, with coverage in over 220 countries. We handle customs documentation and provide international tracking support.
Transaction fees vary by payment method and volume. Standard rates are 2.9% + PHP 15 for card payments, 2.5% for e-wallets, and custom rates for high-volume merchants. Shipping fees are based on carrier rates with volume discounts available.
Failed payments trigger automatic notifications and retry options. Failed deliveries are automatically rescheduled, with options for recipient coordination through our platform.
Yes, we provide plugins for popular platforms like Shopify, WooCommerce, and Magento, plus a comprehensive API for custom integrations.
Webhooks provide real-time notifications for payment and shipping events. You can configure endpoint URLs and select specific events to monitor through our dashboard or API.
We offer technical documentation, API support, and a responsive customer support team via email, live chat, and phone for onboarding and issue resolution.