Postbacks

Postbacks are automated notifications sent to merchants when specific customer actions occur, like subscribing or purchasing. These notifications include important details for managing members.

Getting Started

To effectively use Segpay postbacks, you need to meet these requirements:

1. Base URL:

Set up your Payment Page link (Base URL) before creating postbacks. The payment page is necessary for processing payments. Refer to the Base URL document for guidance.

2. Postback Script:

Setting up a server-side script is required to process Segpay postback data. Essential elements include Web Server/Hosting, Server-Side Script, and SSL Certificate. Obtain scripts through Pre-Built Solutions, Developer Hiring, or contact Segpay Tech Support for guidance.

3. Understanding Postback Types:

Segpay offers two postback types: Member Management and Transactional.

Member Management Postbacks

The system uses Member Management Postback types to notify you about a member's subscription status. You will receive notifications when a new username/password is created or a member signs up for or cancels a service.

  • Inquiry: Activated during payment when Segpay collects a username and password. This postback verifies if the username exists. If it does, it substitutes the username with the member's email address. Important: Ensure your scripts can accept email addresses as usernames.

  • Enable: Notifies when to grant member access to the purchased service(s).

  • Disable: Indicates when to revoke access due to subscription changes.

  • Cancellation: Notifies for account cancellations or refunds.

  • Reactivation: Triggered when an inactive account is reactivated.

    For "Member Management" postbacks, merchants must collect a username and password to receive the postback.

Transactional Postbacks

  • TransPost: Activated for all transaction types.

4. Using Postback Parameters

A parameter is a variable element of a URL used to transmit specific information. In the case of Segpay postbacks, parameters send details about transactions or user actions. Each parameter consists of a key (the name of the parameter) and a value (the information it carries).

Adding parameters to your postback URL lets you specify the data you receive. Postback parameters are covered in the following sections of this document.

For a full list of available postback parameters, refer to our Postback Parameters document for more information.

Setting Up Postbacks

You set up postbacks in the Segpay Merchant Portal to define the specific data you want to receive after transaction processing or a member subscription change.

You can customize the available postback types and choose which data to receive by including parameters in your URL string.

Adding a New Postback

  1. Log into the Merchant Portal: https://mp.segpay.com/

  2. Navigate to My Websites > Manage Postbacks.

  3. Click the Add New Postback button.

  4. Configure postback settings by filling in the following fields:

    • Description: Enter a description for your postback.

    • URL: The endpoint where Segpay will send the postback. Example: www.yourserver.com/YourScriptName.php

    • Expected Response: The confirmation text Segpay expects for a successful postback. Example: ‘GOOD’ or ‘OK’.

    • Error Response: Notification text indicating a failed postback. Example: ‘BAD’ or 'ERROR'

      When entering text in the response fields, use a simple data string such as TransactionConfirmed. The postback will not work if you use spaces, line breaks, html, etc.

    • Failed Postback Notification Options:

      • Email: Enter an email to receive notifications for failed postbacks. Required if ‘Retry Postback’ is enabled.

      • Retry Postback: Check this box if you want to retry failed postbacks. Member Management postbacks retry every 5 minutes for up to an hour, and Transaction postbacks retry hourly for up to 12 hours.

    • Password Protected Scripts (if applicable):

      • Domain: Re-enter the URL if it's password-protected.

      • Username/Password: Enter the credentials for accessing the URL.

  1. Click Save to keep your postback configuration settings.

Using Postback Configuration Guidelines

Follow these guidelines to effectively configure and manage your postbacks, and streamline processing within your system.

  • URL field: You do not need to enter https:// in the postback URL field; it's added automatically.

  • Response Fields: When entering text in the response fields, use a simple data string such as TransactionConfirmed. The postback will not work if you use spaces, line breaks, html, etc.

  • Validations: When you set up your system to process and validate incoming postback data, ensure that the validation process is not set up to require case-sensitivity. Postback communication can include upper and lower-case characters.

  • Script Configuration: When configuring your scripts, it's crucial to accommodate both synchronous and asynchronous postback types:

    • Synchronous Postbacks (Inquiry, Enable, Disable): These require your server to respond within a specific timeframe. A timeout will occur without a timely response, impacting the postback's effectiveness.

    • Asynchronous Postbacks (Transaction): These do not require a response from your server. They operate independently, utilizing standard HTTP response codes to convey the outcome of a request. Ensure your server is set up to process transaction postbacks correctly, even though no return response to Segpay is necessary.

Editing a Postback

  1. Log into the Merchant Portal: https://mp.segpay.com/

  2. Navigate to My Websites > Manage Postbacks.

  3. Click the Edit link for the postback you want to edit.

  4. Click Save to keep your new settings.

Postback Explanations & Examples

Use these explanations and examples as a guide when setting up postbacks in the Segpay Merchant Portal. Each example demonstrates how to configure a postback for different scenarios and outlines the required fields and their descriptions.

Inquiry Postback

An Inquiry postback is an automated notification that checks and verifies user information for actions such as sign-ups or payments.

When to Use It

For username verification. The Inquiry postback checks if a chosen username already exists during account creation or service subscriptions. If the username is taken, the postback allows the system to use the member's email address as an alternative identifier. This provides a smooth sign-up process by automatically handling username availability issues.

Your scripts must support email addresses and usernames for this postback to work.

1. URL Field

Type the domain to which Segpay sends the postback. SSL is used by default.

URL Examples

Inquiry Postback Default URL (No Parameters Specified)

Copy
Inquiry Postback Default URL (No Parameters Specified)
www.yourserver.com/YourScriptName.php

Inquiry Postback Custom URL (Simple)

Copy
Inquiry Postback Custom URL (Simple)
www.yourserver.com/YourScriptName.php?action=<action>&username=<extra username>

Inquiry Postback Custom URL (Using All Parameters)

Copy
Inquiry Postback Custom URL (Using All Parameters)
www.yourserver.com/scriptname.php?action=<action>&username=<extra username>&password=<extra password>&purchaseid=<purchaseid>&tranid=<tranid>&name=<billname>&firstname=<billnamefirst>&lastname=<billnamelast>&email=<billemail>&phone=<billphone>&address=<billaddr>&city=<billcity>&state=<billstate>&zipcode=<billzip>&country=<billcntry>&ip=<ipaddress>&eticketid=<eticketid>&price=<price>&currencycode=<currencycode>&initialvalue=<ival>&initialperiod=<iint>&recurringvalue=<rval>&recurringperiod=<rint>&desc=<desc>&customvariable=<extra customvariable>

2. Expected Response & Error Response Fields

For Expected response, enter the text you want to send to Segpay to confirm a successful postback. For Error response, enter the text you want to send to Segpay to indicate when the postback fails.

3. Failed Postback Notification Options

  • Email Field: Enter the email address to which failed postback notifications should be sent. *You must enter a response in the Error reponse field to receive the notification email.

  • Retry Postpack: Check this option if you want to retry failed postbacks. *The Email field is required if you check this.

4. Is Your Script Behind a Password Protected Area?

If the URL you entered in the URL field is password protected, then enter the URL again in the Domain field. Enter the login information for the URL in the Username and Password fields.

Enable Postback

An Enable postback is an automated notification that's activated when a customer's purchase is approved, and that access to the purchased service should be granted.

When to Use It

For granting access after purchase. You can use it to automatically enable access to a product or service once the purchase is approved. It's useful for subscription-based models or any membership-driven platform where it's essential to ensure users gain access as soon as their payment is processed.

1. URL Field

Type the domain to which Segpay sends the postback. SSL is used by default.

URL Examples:

Enable Postback Default URL (No Parameters Specified)

Copy
Enable Postback Default URL (No Parameters Specified)
www.yourserver.com/YourScriptName.php

Enable Postback Custom URL (Simple)

Copy

Enable Postback Custom URL (Simple)

www.yourserver.com/YourScriptName.php?action=<action>&username=<extra username>&password=<extra password>

Enable Postback Custom URL (Using All Available Parameters)

Copy

Enable Postback Custom URL (Using All Available Parameters)

www.yourserver.com/scriptname.php?action=<action>&username=<extra username>&password=<extra password>&purchaseid=<purchaseid>&tranid=<tranid>&name=<billname>&firstname=<billnamefirst>&lastname=<billnamelast>&email=<billemail>&phone=<billphone>&address=<billaddr>&city=<billcity>&state=<billstate>&zipcode=<billzip>&country=<billcntry>&ip=<ipaddress>&eticketid=<eticketid>&price=<price>&currencycode=<currencycode>&initialvalue=<ival>&initialperiod=<iint>&recurringvalue=<rval>&recurringperiod=<rint>&desc=<desc>&customvariable=<extra customvariable>

2. Expected Response & Error Response Fields

For Expected response, enter the text you want to send to Segpay to confirm a successful postback. For Error response, enter the text you want to send to Segpay to indicate when the postback fails.

3. Failed Postback Notification Options

  • Email Field: Enter the email address to which failed postback notifications should be sent. *You must enter a response in the Error reponse field to receive the notification email.
  • Retry Postpack: Check this option if you want to retry failed postbacks. *The Email field is required if you check this.

4. Is Your Script Behind a Password Protected Area?

If the URL you entered in the URL field is password protected, then enter the URL again in the Domain field. Enter the login information for the URL in the Username and Password fields.

Disable Postback

A Disable postback is an automated notification that's activated when when a subscription ends or a service needs to be revoked due to events like chargebacks, refunds, or cancellations.

When to Use It

For removing users access when a subscription expires, when a user cancels their subscription, or where a transaction reversal necessitates removing user access.

Limited Data Set

In a Disable postback, only a specific set of data is used to include only the essential information needed to disable access or subscriptions. This simplifies setup and streamlines the process of disabling access.

Supported Data Description
Action Indicates the type of action triggering the postback. Default value = DISABLE.
Custom Variables Any additional, user defined variables included in the original transaction.
Password Used for additional verification or processing needs.
PurchaseID Unique identifier of the purchase related to the disable action.
Refunded By Identifies who initiated the refund. Available for chargebacks, refunds or voids.
Refund Code Specific code associated with the refund. Available for chargebacks, refunds or voids.
Refund Reason Code Applicable if the disable is related to a chargeback, refund or void.
TranID Transaction ID, useful in cases of refunds or voids. Available for chargebacks, refunds or voids.
URLID The specific identifier for the URL or service being disabled.
Username The identifier of the user whose access is being disabled.

1. URL Field

Type the domain to which Segpay sends the postback. SSL is used by default.

URL Examples:

Disable Postback Default URL (No Parameters Specified)

Copy
Disable Postback Default URL
www.yourserver.com/YourScriptName.php

Disable Postback Custom URL (Simple)

Copy

Disable Postback Custom URL (Simple)

www.yourserver.com/YourScriptName.php?action=<action>&username=<extra username>

Disable Postback Custom URL (Using All Available Parameters)

Copy

Disable Postback Custom URL (Using All Available Parameters)

www.yourserver.com/YourScriptName.php?action=<action>&username=<extra username>&password=<extra password>&purchaseid=<purchaseid>&tranid=<tranid>&ip=<ipaddress>&customvariable=

2. Expected Response & Error Response Fields

For Expected response, enter the text you want to send to Segpay to confirm a successful postback. For Error response, enter the text you want to send to Segpay to indicate when the postback fails.

3. Failed Postback Notification Options

  • Email Field: Enter the email address to which failed postback notifications should be sent. *You must enter a response in the Error reponse field to receive the notification email.
  • Retry Postpack: Check this option if you want to retry failed postbacks. *The Email field is required if you check this.

4. Is Your Script Behind a Password Protected Area?

If the URL you entered in the URL field is password protected, then enter the URL again in the Domain field. Enter the login information for the URL in the Username and Password fields.

 

Cancel Postback

A Cancel postback is an automated notification that's activated when a customer requests a cancellation or a refund

When to Use It

For automating the process of subscription or services cancellations and for processing refunds and ensuring services are discontinued.

Limited Data Set

In a Cancel postback, only a specific set of data is used to include only the essential information needed to process cancellations. This simplifies setup and streamlines handling of cancellation-related actions in your system.

Supported Data Description
Action Indicates the type of action triggering the postback. Default value = CANCEL.
Canceled By Identifies who initiated the cancellation.
Cancellation Code A specific code that categorizes the type of cancellation.
Cancellation Reason Code Provides a code to indicate why the cancellation is occurring.
Custom Variables Any additional variables included in the original transaction and relevant to the cancellation.
Password Used for confirming or processing the cancellation.
PurchaseID Unique identifier of the purchase or subscription being canceled.
TranID Transaction ID.
URLID The specific identifier for the URL or service related to the cancellation.
Username The identifier of the user whose membership or service is being canceled.

1. URL Field

Type the domain to which Segpay sends the postback. SSL is used by default.

URL Examples:

Cancel Postback Default URL (No Parameters Specified)

Copy
Cancel Postback Default URL
www.yourserver.com/YourScriptName.php

Cancel Postback Custom URL (Simple)

Copy
Cancel Postback Custom URL (Simple)
www.yourserver.com/YourScriptName.php?action=<action>&username=<extra username>

Cancel Postback Custom URL (Using All Available Parameters)

Copy
Cancel Postback Custom URL (Using All Available Parameters)
www.yourserver.com/YourScriptName.php?action=<action>&username=<extra username>&password=<extra password>&purchaseid=<purchaseid>

2. Expected Response & Error Response Fields

For Expected response, enter the text you want to send to Segpay to confirm a successful postback. For Error response, enter the text you want to send to Segpay to indicate when the postback fails.

3. Failed Postback Notification Options

  • Email Field: Enter the email address to which failed postback notifications should be sent. *You must enter a response in the Error reponse field to receive the notification email.
  • Retry Postpack: Check this option if you want to retry failed postbacks. *The Email field is required if you check this.

4. Is Your Script Behind a Password Protected Area?

If the URL you entered in the URL field is password protected, then enter the URL again in the Domain field. Enter the login information for the URL in the Username and Password fields.

Reactivation Postback

A Reactivation postback is an automated notification that's activated when an inactive or canceled account is reactivated. It handles the reinstatement of a user's access to services or subscriptions.

When to Use It

For reactivating previously inactive or canceled subscriptions. Use it to automate the process of restoring a user's access to membership.

Limited Data Set

In a Reactivation postback, only a specific set of data is used to include only the essential information needed to process reactivations. This simplifies setup and streamlines handling reactivations in your system.

Supported Data Description
Action Indicates the reactivation action. Default value = REACTIVATION.
Bill Name The customer's first and last name as listed on the billing record.
Currency Code The currency used for the subscription or service.
Custom Variables Any additional variables included in the original transaction and relevant to the reactivation.
EticketID A unique identifier associated with the user's ticket or subscription.
Last Bill Date The date when the customer was last billed before deactivation.
Next Bill Date The upcoming billing date post-reactivation.
Password Used for authentication or processing purposes.
PurchaseID The unique identifier for the specific purchase being reactivated.
Reactivation Timestamp The exact time and date the account was reactivated.
Rval Recurring Amount. The amount for recurring charges, applicable post-reactivation.
URLID Identifier for the specific URL or service being reactivated.
Username User identifier for the reactivated account.

1. URL Field

Type the domain to which Segpay sends the postback. SSL is used by default.

URL Examples:

Reactivation Postback Default URL (No Parameters Specified)

Copy
Reactivation Postback Default URL
www.yourserver.com/YourScriptName.php

Reactivation Postback Custom URL (Simple)

Copy
Reactivation Postback Custom URL (Simple)
www.yourserver.com/YourScriptName.php?action=<action>&username=<extra username>

Reactivation Postback Custom URL (Using All Available Parameters)

Copy
Reactivation Postback Custom URL (Using All Available Parameters)
www.yourserver.com/YourScriptName.php?action=<action>&username=<extra username>&password=<extra password>&purchaseid=<purchaseid>

2. Expected Response & Error Response Fields

For Expected response, enter the text you want to send to Segpay to confirm a successful postback. For Error response, enter the text you want to send to Segpay to indicate when the postback fails.

3. Failed Postback Notification Options

  • Email Field: Enter the email address to which failed postback notifications should be sent. *You must enter a response in the Error reponse field to receive the notification email.
  • Retry Postpack: Check this option if you want to retry failed postbacks. *The Email field is required if you check this.

4. Is Your Script Behind a Password Protected Area?

If the URL you entered in the URL field is password protected, then enter the URL again in the Domain field. Enter the login information for the URL in the Username and Password fields.

Transaction Postback

A Reactivation postback is an automated notification that's activated following any transactional activity such as payments, refunds, chargebacks, or voids. It's designed to provide transaction details to your system in real-time. Up to four postbacks can be set for different transaction scenarios. For each type, Segpay sends all available parameters, including user-defined ones set at the time of the transaction. For a comprehensive list of all postback parameters, [click here] (link to full list).

When to Use It

For keeping track of all transaction activities and maintaining accurate transaction records. Use it to update your transaction records and reconcile financial transactions in your accounting or bookkeeping systems.

1. URL Field

Type the domain to which Segpay sends the postback. SSL is used by default.

[insert screenshot]

URL Examples:

Transaction Postback Default URL (No Parameters Specified)

Copy
Transaction Postback Default URL
www.yourserver.com/YourScriptName.php

Transaction Postback Custom URL (Using All Available Parameters)

Copy
Transaction Postback Custom URL (Using All Available Parameters)
www.yourserver.com/scriptname.php?action=<action>&stage=<stage>&approved=<approved>&trantype=<trantype>&purchaseid=<purchaseid>&tranid=<tranid>&price=<price>&currencycode=<currencycode>&eticketid=<eticketid>&ip=<ipaddress>&initialvalue=<ival>&initialperiod=<iint>&recurringvalue=<rval>&recurringperiod=<rint>&desc=<desc>&username=<extra username>&password=<extra password>&name=<billname>&firstname=<billnamefirst>&lastname=<billnamelast>&email=<billemail>&phone=<billphone>&address=<billaddr>&city=<billcity>&state=<billstate>&zipcode=<billzip>&country=<billcntry>&merchantpartnerid=<extra merchantpartnerid>&transGUID=<transguid>&standin=<standin>&xsellnum=<xsellnum>&billertranstime=<transtime>&REF1=<extra ref1&customvariable=<extra customvariable>&relatedtranid=<relatedtranid>&singleusepromo=<singleusepromo>&paymentaccountid=<paymentaccountid>

2. Expected Response & Error Response Fields

For Expected response, enter the text you want to send to Segpay to confirm a successful postback. For Error response, enter the text you want to send to Segpay to indicate when the postback fails.

[insert screenshot]

3. Failed Postback Notification Options

  • Email Field: Enter the email address to which failed postback notifications should be sent. *You must enter a response in the Error reponse field to receive the notification email.
  • Retry Postpack: Check this option if you want to retry failed postbacks. *The Email field is required if you check this.

4. Is Your Script Behind a Password Protected Area?

If the URL you entered in the URL field is password protected, then enter the URL again in the Domain field. Enter the login information for the URL in the Username and Password fields.