Send your first request
Retrieve account information with a signed account lookup.
Explore API operations
Find the endpoints and fields for your use case.
Open API v3 authenticates requests with HMAC-SHA256 signatures, not OAuth bearer tokens. All public v3 operations documented here use HTTP POST with JSON bodies, including lookups.
Before you begin
Complete account registration and activation if you are onboarding your business. Before sending API traffic, confirm the following with your Pagsmile integration representative:
Account activation and API access are separate prerequisites for this guide. If you have not received your base URL or credential scope, contact your integration representative before proceeding.
Configure your environment
The documented base URL for live traffic is:Choose the right credential
Your credential determines which operations you can call and how you select an account.Account-targeting rules
Account-targeting rules
The account-target headers are
X-ISPB and X-Account-Number.- Always send them together with non-empty values when explicit targeting is required or allowed.
- The selected account must be active, belong to the authenticated user, and have a valid account hierarchy.
- When the headers are present, include both exact trimmed values in the canonical headers before calculating the signature.
- Do not add account-target headers to platform operations or user-owned managed-account operations.
Sign your request
A signature proves that the request was created using your API secret and has not changed since it was signed. Calculate it from the same method, path, query, headers, and raw body that you send.1
Prepare the body and headers
Serialize the JSON body once and retain its exact raw bytes. Generate a fresh nonce for each call and a Unix timestamp in milliseconds.
Requests outside the five-minute timestamp window are rejected. Nonces are retained for ten minutes to prevent replay.
2
Build the canonical string
Calculate the lowercase hexadecimal SHA-256 hash of the raw body, even if you omit the optional An empty query still occupies its blank line. For a documented path such as
X-Content-Hash header.Join the following seven components with a single line feed (\n). Do not add a trailing line feed:/v3/bank_account, use the path without the base URL.Canonical headers: use lowercase names, trim values, and sort names lexically. Always include content-type, x-client-id, x-nonce, and x-timestamp. Include x-content-hash, x-account-number, and x-ispb only when those headers are sent. Do not include X-Signature itself.Canonical query: sort parameter names lexically, preserve the original value order for repeated names, and encode names and values using Go url.QueryEscape semantics.3
Calculate the signature
Calculate HMAC-SHA256 over the canonical string using your API secret. Encode the result as 64 lowercase hexadecimal characters and send it as
X-Signature.Send the exact raw body used to calculate the hash. Changing whitespace, property order, or other body bytes after signing changes the signature input.Example header set for USER account access
Example header set for USER account access
For an account-level operation with a USER credential, add both target headers before calculating the signature. These are illustrative values; generate a current timestamp, fresh nonce, body hash, and signature for your request.For this header set, the canonical names are ordered as
content-type, x-account-number, x-client-id, x-content-hash, x-ispb, x-nonce, and x-timestamp. Omit x-content-hash from the canonical headers only if you omit that request header.Send your first request
Use Get Bank Account to retrieve account information without initiating a payment. It accepts an empty JSON object and requires an ACCOUNT credential or a USER credential with both account-target headers.BASE_URL and CLIENT_ID from your issued configuration, then calculate TIMESTAMP_MS, NONCE, CONTENT_HASH, and SIGNATURE using the signing steps above. The body to hash and send is exactly {}.
Handle the response
Normal API processing returns a JSON envelope. The example below illustrates its structure;data varies by endpoint.
- Check the HTTP response and whether it contains a JSON envelope.
- For an envelope, read the outer
code. On failure,dataisnull. - Choose your error-handling action by code, not by the localized
messagetext. - Handle non-envelope responses separately. Malformed input can return HTTP 400 with plain text; unhandled failures can return plain text, normally with HTTP 500.
error or result fields nested inside data do not override the outer result. Use Error Catalog for the full response contract.
Troubleshoot your first request
Troubleshoot your first request
For every retry, generate a fresh timestamp, nonce, body hash, and signature. Follow the endpoint’s retry and duplicate-handling rules before repeating an operation.
Connect webhooks
Webhooks notify your application about transaction, KYB, and MED events. Pagsmile sends signed HTTP POST requests to your callback URL.1
Choose your events and subscription scope
Use Webhooks to identify the event family and permitted owner scope. For the supported PIX and KYB event values, see Webhook Management. MED uses a separate subscription family; it is not represented by the numeric event values accepted by the management API.
2
Verify each delivery
Retain the raw request body and verify the content hash, signature, timestamp, and nonce before processing the event. Follow Signature Verification.
3
Accept and process events reliably
Store the event with its documented idempotency key, then return HTTP 200 after durable acceptance. Process asynchronously and handle duplicate or out-of-order deliveries. Use a callback URL that returns HTTP 200 directly, without redirects. See Delivery and Retries.
Before handling live operations
- Confirm the assigned environment, credential scope, and target account for each operation.
- Check both successful and failed responses; do not infer success from HTTP status alone.
- Use decimal strings and decimal arithmetic for monetary values. See Object & Enums References.
- Verify webhook signatures and duplicate handling before relying on event notifications.
- Keep API secrets and one-time credential values out of logs.
Choose an API operation
Explore endpoints for accounts, transfers, charges, and refunds.
Handle errors consistently
Map business result codes to the right client behavior.