Refund

MethodRefund TypeRequire User Info

Pix

Refund through banktransfer

Required

Boleto

Refund through banktransfer

Required

Lottery

Refund through banktransfer

Required

SPEI

Refund through banktransfer

Required

Wallet

Refund through original source

Not Required

CreditCard

Refund through original source

Not Required

Request Base URL

  Test Environment : https://gateway-test.pagsmile.com
  Prod Environment : https://gateway.pagsmile.com

EndPoints

  /trade/refund

Request Header

ParameterRequiredDescription

Content-Type

Recommended

Application/json

Authorization

Yes

Basic Base64(app_id:security_key)

Request Body (JSON format)

ParameterTypeRequiredMax Length(or Default Value)Description

app_id

string

yes

32

App's ID is in dashboard

timestamp

string

yes

19

yyyy-MM-dd HH:mm:ss

trade_no

string

yes

64

Pagsmile trade NO.(can NOT be empty with out_trade_no at same time)

out_trade_no

string

yes

64

ID given by the merchant in their system (can NOT be empty with trade_no at same time)

out_request_no

string

no

16

refund request unique NO.(can NOT be empty when request a partial refund)

refund_currency

string

yes

3

refund_amount

decimal

yes

0.01 ~ 99999999999999.99

refund_reason

string

no

128

user_info.identify.number

string

yes

16

User ID

user_info.identify.type

string

no

16

User's ID type

user_info.name

string

yes

64

User's name

user_info.email

string

yes

64

User's email

user_info.phone

string

no

64

User's phone

bank_info.bank_id

string

no

64

User's bank ID to receive refund

bank_info.bank_name

string

no

64

User's bank name to receive the refund

bank_info.agency

string

no

64

User's bank agency to receive the refund

bank_info.type

string

no

64

User's bank type to receive the refund

bank_info.number

string

no

64

User's bank number to receive refund

Request Sample

curl --location --request POST 'https://gateway.pagsmile.com/trade/refund' \
--header 'Authorization: Basic Base64(appid:security_key)' \
--header 'Content-Type: application/json' \
--data-raw '{
    "app_id": "app_id",
    "content": "content",
    "trade_no": "trade_no",
    "refund_amount": 10,
    "refund_currency": "BRL",
    "out_trade_no": "{{$randomUUID}}",
    "user_info": {
      "identify": {
        "number": "number",
        "type": "type"
      },
      "name": "name",
      "email": "email"
      }
}'

Http Response (JSON format)

ParameterTypeDescription

code

string

Return code

msg

string

Return msg

sub_code

string

Return sub code(only error)

sub_msg

string

Return sub msg(only error)

out_trade_no

string

trade_no

string

refund_currency

string

refund_amount

decimal

refund_status

string

Return Sample (Success)

{
    "code": "10000",
    "msg": "Success",
    "out_trade_no": "{out_trade_no}",
    "trade_no": "{trade_no}",
    "refund_currency": "{refund_currency}",
    "refund_amount": "{refund_amount}",
    "refund_status": "{refund_status}"
}

Return Sample (Fail)

{
    "code": "40002",
    "msg": "Business Failed",
    "sub_code": "invalid-signature",
    "sub_msg": "invalid signature"
}

Last updated