Skip to content

Premiers Pas

Integrez votre application avec l'API Owem Pay et effectuez votre premiere operation PIX en quelques minutes.

1. Obtenez vos identifiants

Demandez a l'administrateur de votre compte Owem Pay :

  • Client ID -- identifiant de votre API Key
  • Client Secret -- cle secrete pour l'authentification et la signature HMAC

Securite

N'exposez jamais le client_secret dans du code frontend ou des depots publics. Utilisez des variables d'environnement sur votre serveur.

2. Obtenez un token d'acces

Toutes les requetes exigent un token Bearer. Generez un token avec vos identifiants :

bash
curl -X POST https://api.owem.com.br/api/v2/external/auth-token \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": "votre-api-key-id",
    "client_secret": "votre-api-key-secret"
  }'

Reponse :

json
{
  "worked": true,
  "access_token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9...",
  "token_type": "Bearer",
  "expires_in": 3600
}

Le token expire dans 60 minutes. Implementez un renouvellement automatique avant l'expiration.

3. Consultez le solde

Testez l'integration en consultant le solde du compte :

bash
curl -X GET https://api.owem.com.br/api/v2/external/balance \
  -H "Authorization: Bearer $TOKEN"

Reponse :

json
{
  "worked": true,
  "balance": 150000,
  "available": 150000,
  "pending": 0,
  "currency": "BRL"
}

Valeurs en centimes

Toutes les valeurs monetaires sont des entiers en centimes. 150000 = R$ 1.500,00.

4. Generez une demande de paiement PIX (Cash-In)

Creez un QR Code pour recevoir un paiement :

bash
BODY='{"amount":10000,"description":"Commande #1234"}'
HMAC=$(echo -n "$BODY" | openssl dgst -sha512 -hmac "$CLIENT_SECRET" | awk '{print $2}')

curl -X POST https://api.owem.com.br/api/v2/external/pix/cash-in \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -H "hmac: $HMAC" \
  -d "$BODY"

Reponse :

json
{
  "worked": true,
  "transaction_id": "PIXIN20260307a1b2c3d4e5f6",
  "end_to_end_id": "E37839059202603071234000001",
  "qr_code": "00020126580014br.gov.bcb.pix...",
  "qr_code_image": "data:image/png;base64,...",
  "amount": 10000,
  "status": "pending"
}

Affichez le qr_code_image ou le code copier-coller (qr_code) au payeur.

5. Consultez le statut

Suivez le paiement en consultant par transaction_id :

bash
curl -X GET https://api.owem.com.br/api/v2/external/transactions/PIXIN20260307a1b2c3d4e5f6 \
  -H "Authorization: Bearer $TOKEN"

Lorsque le paiement est confirme, le status passe a completed.

6. Recevez des notifications (Webhooks)

Pour recevoir des notifications en temps reel (recommande au lieu du polling) :

bash
BODY='{"url":"https://votresite.com/webhook","events":["pix.received","pix.completed"]}'
HMAC=$(echo -n "$BODY" | openssl dgst -sha512 -hmac "$CLIENT_SECRET" | awk '{print $2}')

curl -X POST https://api.owem.com.br/api/v2/external/webhooks \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -H "hmac: $HMAC" \
  -d "$BODY"

Etapes Suivantes

Owem Pay Instituição de Pagamento — ISPB 37839059