2
Creating a Checkout Session

Once authenticated, you can create a checkout session for your customer. This generates a unique payment URL that you can redirect your customer to.

Checkout Session Endpoint

EndpointMethodDescriptionAuthentication
/api/checkoutPOSTCreate a new checkout sessionBearer token required

Checkout Session Request

The checkout session request requires details about the payment, customer, and callback URLs:

RequestPOST /api/checkout
// Get access token first (see Authentication section)
const accessToken = await getValidAccessToken();

// Create checkout session request
const response = await axios.post(
  'https://apisaligpay.microsource.com.ph/api/checkout',
  {
    amount: 2500,              // $25.00
    currency: "USD",
    description: "Premium Plan - Monthly",
    externalId: "order_ref_12345",
    customerInfo: {
      email: "customer@example.com",
      name: "John Doe"
    },
    successUrl: "https://your-store.com/success",
    cancelUrl: "https://your-store.com/cancel",
    metadata: {
      productId: "premium_monthly"
    }
  },
  {
    headers: {
      "Content-Type": "application/json",
      "Authorization": `Bearer ${accessToken}`
    },
  }
);

// Sample successful response
{
  "success": true,
  "data": {
    "sessionId": "cs_12345abcdef",
    "checkoutUrl": "https://checkout.saligpay.com/cs_12345abcdef",
    "expiresAt": "2023-05-24T15:30:45Z",
    "status": "PENDING"
  }
}

Request Parameters Explained

Required Fields

ParameterTypeRequiredDescription
amountnumberYesAmount in cents (e.g., 2500 for $25.00)
currencystringYesThree-letter ISO currency code (e.g., USD)
externalIdstringYesYour unique identifier for this transaction
successUrlstringYesURL to redirect after successful payment
cancelUrlstringYesURL to redirect if customer cancels payment

Optional Fields

ParameterTypeRequiredDescription
descriptionstringNoBrief description of the payment
customerInfoobjectNoCustomer details like email and name
expiresInnumberNoSession expiration in minutes (default: 30)
metadataobjectNoAdditional data to store with the transaction