Skip to main content
bob-payments/sdk is the recommended way to integrate in PHP: zero dependencies (uses ext-curl and ext-json), PHP >= 8.1, analyzed with PHPStan level 9.
Server-side only: the sk_live_/sk_test_ API key is secret and must never reach the browser.

Installation

Client

Create a checkout session (PIX)

Use the hosted checkout when you want Bob to present the payment screen. Today the available method is PIX; credit_card arrives when card is launched:
See the field details in Hosted checkout.

Create a PIX charge

Every create sends an Idempotency-Key header automatically (a UUID per call, or your own via ['idempotencyKey' => "pedido-{$orderId}"] in the second argument), which makes the call safe to retry — the SDK retries with backoff on timeout, network failure, 429, and 5xx without risk of a duplicate payment.

Lookups

Hosted checkout

Webhooks

Webhooks::constructEvent verifies the signature (v1 and v2, with hash_equals and anti-replay) and returns the decoded event:
Payload and signature details: Webhooks.

Error handling

Every non-2xx response becomes an ApiException with the API’s RFC 7807 fields:

Sandbox

With sk_test_, the outcome in the sandbox is controlled by the amount’s cents — see Sandbox:

Next steps

Checkout SDK

Frontend layer: mount the checkout on your site with the session created here.

SDK overview

How the server libraries and the frontend SDK fit together.

Source code and releases

github.com/BobPayments/bob-payments-sdk-php — CHANGELOG and versions via semantic-release