Checkout Page (General)

How to use Pagsmile Checkoutpage to submit a payin.

Payin by using Pagsmile checkout page

POST https://gateway-test.pagsmile.com/trade/create

This endpoint allows you to submit a payin by using Pagsmile checkout page

Headers

Request Body

{
    "code": "10000",
    "msg": "Success",
    "trade_no": "2022010110293900083",
    "out_trade_no": "202201010354003",
    "web_url": "http://checkout-testv2.pagsmile.com?prepay_id=123456",
    "prepay_id":"123456"
}

Check here for supported methods.

  • If not passing the parameter "method" or pass "method": "", all enabled methods will be shown to the user on the checkout page.

  • If passing "method": "PIX", only PIX will be shown to the user on the checkout page.

Example

curl --location --request POST 'https://gateway-test.pagsmile.com/trade/create' \
--header 'Authorization: Basic MTYyNTgyOTIxNDUzMTY2Mzg6UGFnc21pbGVfc2tfZDUwMWQ1ZGNkNTI5OGQ5N2MwNmUzYjI4YjA2OWZjZmY3NDU5ZjY2NzNiMjFjMTFlYTY3NDM5MDgzOTZkOTYxNQ==' \
--header 'Content-Type: application/json' \
--data-raw '{
      "charset": "UTF-8",
    * "app_id": "162************38",
    * "out_trade_no": "202201010354002",
    * "order_currency": "BRL",
    * "order_amount": "12.01",
    * "subject": "item name",
    * "content": "item description",
    * "trade_type": "WEB",
      "timeout_express": "1d",
    * "timestamp": "2022-01-01 03:54:01",
    * "notify_url": "http://merchant/callback/success",
    * "buyer_id": "buyer_0101_0001",
    * "version": "2.0",
      "customer": {
          "identify": {
              "type": "CPF",
              "number": "50284414727"
          },
      "name": "Test User Name",
      "email": "test@pagsmile.com"
      },
      "regions": ["BRA"],
      "address": {
          "zip_code": "38082365"
      }
}'

Returnurl is not required in the request parameters. However if needed, you can overwrite it by appending the return_url after the web_url when redirect.

http://checkout.pagsmile.com?prepay_id={$prepay_id}

↓↓↓

http://checkout.pagsmile.com?prepay_id={$prepay_id}&return_url=encodeURIComponent({$return_url})

Note: 162************38 is pagsmile's test app id for sandbox, and MTYyNTgyOTIxNDUzMTY2Mzg6UGFnc21pbGVfc2tfZDUwMWQ1ZGNkNTI5OGQ5N2MwNmUzYjI4YjA2OWZjZmY3NDU5ZjY2NzNiMjFjMTFlYTY3NDM5MDgzOTZkOTYxNQ== is authorization token associated with the test app id.

Please use your own app_id and generate your own authorization token when testing.

Last updated