Postman

Postman Access

Optty Direct API: Hosted Payment Page Integration Guide

This document provides a guide for using the "Optty Direct (docs)" Postman collection to integrate with Optty's Hosted Payment Page (HPP). It outlines the required setup and the sequence of API calls for creating, managing, and receiving updates on payment links.

1. Prerequisites: Initial Setup

Before you begin, you must configure your environment and set up a webhook to receive payment status updates.

  • Sandbox UPP Account: If you do not already have a sandbox merchant account please sign up here, https://www.optty.com/merchant-account

  • Set Collection Variables: In your Postman environment, set the following variables:

    • client_id: Your unique Optty client identifier.

    • client_secret: Your Optty client secret. These credentials are used in the first authentication call to obtain a secure token for all subsequent requests.

  • Set Up Your Webhook URL: To receive real-time transaction status updates, you must enable a webhook on your site. Please configure this under Settings on the side bar tab of the UPP. For development and testing purposes, you can use a service like webhook.site to generate a temporary URL to inspect incoming notifications.


2. API Workflow: Order of Calls

The collection is designed to be run in a specific order. Each request builds on the previous one.

Step

Call Name

Description

1

Authentication (Auth - Merchant)

Authenticates your service using your client_id and client_secret. A test script automatically saves the returned access_token to a collection variable for use in subsequent calls.

2

Create Payment Link (Create Session)

A pre-request script generates a unique invoiceNumber, and the call creates a session link that you can present to your customer to complete the payment.

3

Refund or Cancel Link (Refund / Cancel Link)

This call uses the invoiceNumber from the latest created session to cancel a pending payment or refund a completed one. If the payment is not in a PAID state, it will be cancelled; otherwise, it will be refunded.

Last updated