Skip to main content

Response

After sending a request to the PagaSul payment platform, your system should be ready to accept a response which PagaSul returns synchronously, i.e. within the same HTTP session.

The response may contain the following information:

  • the data you passed in the initial request
  • the payment ID the PagaSul payment platform assigned to your payment
  • the status the payment's currently in. To learn more about payment statuses in the PagaSul payment platform, see the Payment statuses and result codes section
  • the data you should use to redirect the customer so that they could complete the payment

Check out the information below to learn more details about the responses that the PagaSul payment platform returns to your requests.

HeaderValueDescription
SignaturecalculatedSignature string. For the information on how the signature is generated, see Signature generation.
Content-TypejsonHTTP header indicating the media type of the resource sent in the response body.

Parameters that may be passed in the response:

Object/ParameterTypeDescription
client_idintegerAccount ID you obtained from PagaSul when integrating.
client_payment_idstringPayment ID unique within your system.
payment_idintegerPayment ID the PagaSul payment platform assigned to the payment.
payment_typestringPayment direction, e.g., pay-in, pay-out.
currencystringCode of the payment currency in the ISO-4217 alpha-3 format.
amountnumberPayment amount in major currency units, e.g., 12.34 for the 12 dollars 34 cents amount.
payment_methodstringPayment method's code.
statusstringStatus the payment is currently in. See the statuses that may be passed in this parameter in the Payment statuses section.
result_codestringRequest processing result code. See the codes that may be passed in this parameter in the Result codes section.
result_messagestringDescription of the request processing result code.
checkout_dataobject
checkout_data.methodstringHTTP method for retrieving the checkout page, e.g., POST or GET.
checkout_data.urlstringURL to redirect the customer to.

Here is an example of a response that the PagaSul payment platform may return to a pay-in request.

--header 'Content-Type: application/json'
--header 'Signature: NTU1YjUwY2M1MTU3ZjE2ZmY5MjMDI1lZNDQ2NDQ='
--data '{
"client_id": 123,
"client_payment_id": "payment_35",
"payment_type": "pay-in",
"payment_id": 301150550709,
"payment_method": "BR.PIX",
"currency": "BRL",
"amount": 192.21,
"status": "redirect",
"checkout_data": {
"method": "GET",
"url": "https://example.com/redirect"
},
"result_code": "0",
"result_message": "payment processing"
}'

Here is an example of a response that the PagaSul payment platform may return to a pay-out request.

--header 'Content-Type: application/json'
--header 'Signature: NTU1YjUwY2M1MTU3ZjE2ZmY5MjMDI1lZNDQ2NDQ='
--data '{
"client_id": 123,
"client_payment_id": "payment_35",
"payment_type": "pay-out",
"payment_id": 301150550709,
"payment_method": "BR.PIX",
"currency": "BRL",
"amount": 192.21,
"status": "new",
"result_code": "0",
"result_message": "payment processing"
}'