Spanish Portuguese

Introduction Last update 2019-06-01

You can integrate payments through Paygol easily using our Webcheckout Implementation, without the need for technical knowledge. So Likewise, we offer alternatives such as a Whitelabel Webcheckout Implementation and a comprehensive API for developers who want additional functionality.

All the options mentioned above allow the automatic notification of payments to your platform, avoiding the need to manually deliver products / services to your customers.

Base URL: https://www.paygol.com

Webcheckout

Below you will find a sample code for your payment button. Just replace the sample values ​​as required and you are ready to start receiving payments.

POST /pay
Parameters
pg_serviceid
Required
string Paygol merchant ID
pg_price
Required
string Payment amount: ex. 10.12
pg_currency
Required
string Currency type specified in ISO 4217 alphabetic code
pg_country
Optional
string ISO 3166-2 country code
pg_method
Optional
string Payment method code
pg_email
Optional
string Payer's email
pg_first_name
Optional
string Payer name
pg_last_name
Optional
string Payer surname
pg_personalid
Optional
string Payer's document number
pg_phone
Optional
string Payer's phone number
pg_sub_merchant_id
Optional
string Code used to distinguish between different merchants that use our service through their platform
pg_sub_merchant_url
Optional
string Website of the merchant where the payment originates from
pg_return_url
Optional
string Redirect url for completed payments
pg_cancel_url
Optional
string Redirect url for when the payment is failed or canceled by the payer
pg_language
Optional
string ISO 639-1 language
pg_name
Optional
string Description of your product / service, which will be shown in the payment screen (Max: 255)
pg_custom
Optional
string Flexible field, can be used to track user, inventory, etc. (Max. 255)

API

Our API implementation offers a high level of customization, allowing you to implement a white label payment solution directly on your platform in a fast and easy way.

This implementation is based on POST calls to web services, which will deliver a response in JSON format. The response will contain the URL to which you will have to redirect your customers to start the payment process.

Signature

All requests to the payment API must be signed using the merchant's secret key with the HMAC SHA256 algorithm. The signature should be calculated using the request payload, sorted in ascending order, and adding this result in a request header named X-Pg-Sig.

Get token
Headers
X-Pg-Sig
Required
string HMAC-SHA256 request signature
Parameters
pg_serviceid
Required
string Paygol merchant ID
POST /api/v2/auth/token
Response 200 OK - Content-Type: application/json

{
  "token": "dce5b070ba65626dccd4ad700fdf3c1d219105a1"
}
							
Create payment
Headers
X-Pg-Sig
Required
string HMAC-SHA256 request signature
Parameters
pg_serviceid
Required
string Paygol merchant ID
pg_ip
Required
string IP address of the payer.
pg_price
Required
string Payment amount: ex. 10.12
pg_currency
Required
string Currency type specified in ISO 4217 alphabetic code
pg_country
Required
string ISO 3166-2 country code
pg_method
Required
string Payment method code
pg_email
Required
string Payer's email
pg_first_name
Optional
string Payer name
pg_last_name
Optional
string Payer surname
pg_personalid
Optional
string Payer's document number
pg_phone
Optional
string Payer's phone number
pg_sub_merchant_id
Optional
string Code used to distinguish between different merchants that use our service through their platform
pg_sub_merchant_url
Optional
string Website of the merchant where the payment originates from
pg_return_url
Required
string Redirect url for completed payments
pg_cancel_url
Required
string Redirect url for when the payment is failed or canceled by the payer
pg_custom
Optional
string Flexible field, can be used to track user, inventory, etc. (Max. 255)

Note

Some countries have special requirements for certain payment methods.

POST /api/v2/payment/create
Response 200 OK - Content-Type: application/json
{
  "data": {
    "service_id": "477980",
    "transaction_id": "OO3Q-73HT-ALEB-Y0G2",
    "status": "created",
    "payment_method": "webpay",
    "amount": "3500.00",
    "currency": "CLP",
    "payment_method_url": "https://www.paygol.com/api/pay-direct/OO3Q-73HT-ALEB-Y0G2",
    "custom": "Pago cuenta VIP",
    "customer": {
      "first_name": "Roberto",
      "last_name": "Fernandez",
      "email": "[email protected]",
      "phone": "",
      "personal_id": "",
      "country": "CL"
    },
    "redirect_urls": {
      "success_url": "http://www.mi-sitio.com/pago-ok",
      "cancel_url": "http://www.mi-sitio.com/pago-cancelado"
    }
  }
}
Get payment status
Headers
X-Pg-Sig
Required
string HMAC-SHA256 request signature
Parameters
pg_serviceid
Required
string Paygol merchant ID
pg_token
Required
string Auth token
transaction_id
Required
string Paygol transaction ID
POST /api/v2/payment/status
Response 200 OK - Content-Type: application/json
{
  "payment": {
    "service_id": "477980",
    "transaction_id": "OO3Q-73HT-ALEB-Y0G2",
    "status": "completed",
    "payment_method": "webpay",
    "amount": "3500.00",
    "currency": "CLP",
    "created_at": "2021-01-02 23:11:00",
    "completed": "2021-01-02 23:13:00",
    "custom": "Pago cuenta VIP",
    "customer": {
      "first_name": "Roberto",
      "last_name": "Fernandez",
      "email": "[email protected]",
      "phone": "",
      "personal_id": "",
      "country": "CL"
    }
  }
}

Notifications

IPN (Instant Payment Notification) is a notification that is sent from one server to another through a HTTP POST call in relation to your transactions.

To receive notifications of events in your system, you must have previously configured a notification url to which Paygol has access.

To guarantee the security of the exchanges, the data will be signed using the merchant secret_key .

Note

The notification URL and the secret_key can be found in the Merchant panel, Notifications section.

Confirmation

If your notification script executes very complex logic or makes calls to the network, it is possible that the waiting time will expire before Paygol receives the reception confirmation. Ideally, your code that handles receiving notifications (acknowledging with 2xx status code) is independent of any other logic.

Handling duplicate notifications

Notification endpoints can sometimes receive the same notification more than once. This is why we recommend that you avoid duplicate notification receipts by making your event processing idempotent.

Notifications
{
    "country": "CL",
    "completed_at": "2020-11-26T16:22:32-03:00",
    "currency": "CLP",
    "created_at": "2020-11-26T16:19:27-03:00",
    "custom": "Pago cuenta VIP",
    "method": "webpay",
    "price": "7500.00",
    "service_id": "477980",
    "status": "completed",
    "transaction_id": "ZISS-A7Q8-RE2Z-S73W",
}
	
Retrieve notification information

Payment methods

Internacional
Credit Card creditcard pg_phone is required for this payment method
Bitcoin bitcoin
Argentina
Pago Fácil pagofacil pg_personalid is required for this payment method
Rapipago rapipago pg_personalid is required for this payment method
Brasil
Boleto Bancario boleto pg_personalid is required for this payment method
Banco do Brazil bancodobrasil pg_personalid y pg_phone son Required para este método de pago
Bradesco bradesco pg_personalid y pg_phone is required for this payment method
Itaú itau pg_personalid y pg_phone is required for this payment method
Santander santander pg_personalid y pg_phone is required for this payment method
Mercadopago mercadopago_br pg_personalid is required for this payment method
Chile
Webpay webpay
Servipag servipag
Multicaja multicaja
MACH mach
Khipu khipu
Colombia
Efecty efecty
PSE pse
Via Baloto viabaloto
Bancolombia bancolombia
Apostar apostar
RedServi redservi
Puntored puntored
Susuerte susuerte
Su Red sured
Gana gana
Costa Rica
Banco de Costa Rica bcr
Banco Nacional bncr
Ecuador
Banco Pichincha pichincha
Banco Internacional internacional
Produbanco produbanco
México
Banamex banamex
Bancomer bancomer
Mastercard Débito debmaster
Visa Débito debvisa
OXXO oxxo
Santander santander
Perú
BBVA Continental bbva
BCP bcp
Caja Arequipa arequipa
Caja Cusco cusco
Caja Huancayo huancayo
Caja ICA ica
Caja Piura piura
Caja Tacna tacna
Caja Trujillo trujillo
Interbank interbank
Pago Efectivo pagoefectivo pg_phone is required for this payment method
Scotiabank scotiabank
Western Union wu