PHPackages                             saulmoralespa/wompi-api-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. saulmoralespa/wompi-api-php

ActiveLibrary[API Development](/categories/api)

saulmoralespa/wompi-api-php
===========================

Wompi API PHP SDK

1.0.0(1y ago)121MITPHPPHP &gt;=8.1CI passing

Since Mar 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/saulmoralespa/wompi-api-php)[ Packagist](https://packagist.org/packages/saulmoralespa/wompi-api-php)[ Docs](https://github.com/saulmoralespa/wompi-api-php)[ RSS](/packages/saulmoralespa-wompi-api-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

Wompi API PHP SDK
=================

[](#wompi-api-php-sdk)

[Documentation Wompi](https://docs.wompi.co/docs/colombia/ambientes-y-llaves/)

Installation
------------

[](#installation)

You will need at least PHP 8.1. We match [officially supported](https://www.php.net/supported-versions.php) versions of PHP.

Use [composer](https://getcomposer.org/) package manager to install the lastest version of the package:

```
composer require saulmoralespa/wompi-api-php dev-main
```

```
// ... please, add composer autoloader first
include_once __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';

//import Client
use Saulmoralespa\Wompi\Client;

$keyPrivate = "your_keyprivate";
$keyPublic = "your_keypublic";
$keyIntegrety = "your_keyIntegrety";

//instance class Client

$wompi = new Client($keyPrivate, $keyPublic, $keyIntegrety);

//for sandbox
$wompi->sandbox();
```

### Create card token

[](#create-card-token)

```
$data = [
    "number" => "4242424242424242",
    "exp_month" => "06",
    "exp_year" => "29",
    "cvc" => "123",
    "card_holder" => "Pedro Pérez"
];

try {
$response = $wompi->cardToken($data);
$token = $response[ 'data' ]['id'];
} catch(\Exception $exception) {

}
```

### Create Nequi token

[](#create-nequi-token)

```
$data = [
    "phone_number" => "3178034732"
];

try {
$response = $wompi->nequiToken($data);
$token = $response[ 'data' ]['id'];
} catch(\Exception $exception) {

}
```

### Create Daviplata token

[](#create-daviplata-token)

```
$data = [
    "type_document" => "CC",
    "number_document" => "1122233",
    "product_number" => "3991111111"
];

try {
$response = $this->wompi->daviplataToken($data);
$token = $response[ 'data' ]['id'];
} catch(\Exception $exception) {

}
```

### Create Bancolombia token

[](#create-bancolombia-token)

```
$data = [
    "type_document" => "CC",
    "number_document" => "1122233",
    "product_number" => "3991111111",
    "redirect_url" => "https://www.bancolombia.com",
    "type_auth" => "TOKEN" // or TRANSACTION
];

try {
$response = $this->wompi->bancolombiaToken($data);
$token = $response[ 'data' ]['id'];
} catch(\Exception $exception) {

}
```

### Get Status Subscription Nequi

[](#get-status-subscription-nequi)

```
try {
$token = "";
$response = $this->wompi->getStatusSubscriptionNequi($token);
} catch (\Exception $exception) {

}
```

### Get Status Subscription Daviplata

[](#get-status-subscription-daviplata)

```
try {
$token = "";
$response = $this->wompi->getStatusSubscriptionDaviplata($token);
} catch (\Exception $exception) {

}
```

### Get Status Subscription Bancolombia

[](#get-status-subscription-bancolombia)

```
try {
$token = "";
$response = $this->wompi->getStatusSubscriptionBancolombia($token);
} catch (\Exception $exception) {

}
```

### Create Source Card

[](#create-source-card)

```
try {
$type = "CARD"; //NEQUI, CARD, DAVIPLATA, BANCOLOMBIA_TRANSFER
$token = "";
$acceptanceTokens = $this->wompi->getAcceptanceTokens();
$data = [
    "customer_email" => "testuser@domain.com",
    "type" => $type,
    "token" => $token,
    "payment_description" => "Descripción de la suscripción creada",
    "acceptance_token" => $acceptanceTokens[ 'data' ][ "presigned_acceptance" ][ "acceptance_token" ],
    "accept_personal_auth" => $acceptanceTokens[ 'data' ][ "presigned_personal_data_auth" ][ "acceptance_token" ]
];
$response = $this->wompi->createSource($data);
} catch (\Exception $exception) {

}
```

### Create Transaction with Card

[](#create-transaction-with-card)

```
try {
$sourceId = 12344;
$data = [
    "amount_in_cents" => 4990000,
    "currency" => "COP",
    "customer_email" => "example@gmail.com",
    "payment_method" =>  [
        "installments" => 1
    ],
    "reference" => (string)time(),
    "payment_source_id" => $sourceId,
    "recurrent" => true // optional
];
$response = $this->wompi->transaction($data);
} catch (\Exception $exception) {

}
```

### Create Transaction with Nequi

[](#create-transaction-with-nequi)

```
try {
$sourceId = 13345;
$data = [
    "amount_in_cents" => 6000000,
    "currency" => "COP",
    "customer_email" => "example@gmail.com",
    "reference" => (string)time(),
    "payment_source_id" => $sourceId
];

$response = $this->wompi->transaction($data);
} catch (\Exception $exception) {

}
```

### Create Payment Link

[](#create-payment-link)

```
try {
$data = [
    "name" => "Pago de arriendo edificio Lombardía - AP 505",
    "description" => "Arriendo mensual", // Descripción del pago
    "single_use" => false, // `false` current caso de que el link de pago pueda recibir múltiples transacciones APROBADAS o `true` si debe dejar de aceptar transacciones después del primer pago APROBADO
    "collect_shipping" => false, // Si deseas que el cliente inserte su información de envío current el checkout, o no
    "currency" => "COP",
    "amount_in_cents" => 500000
];
$response = $this->wompi->createPaymentLink($data);
} catch (\Exception $exception) {

}
```

### Get Payment Link

[](#get-payment-link)

```
try {
$id = "ID_PAYMENT_LINK";
$response = $this->wompi->getPaymentLink($id);
} catch (\Exception $exception) {

}
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance47

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

415d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/daa109be7d6d58fcbb08ec4c87d0e014b37547355ec782d54d706bf4147be653?d=identicon)[saulmoralespa](/maintainers/saulmoralespa)

---

Tags

payment-gatewaywompiphpapiWompi

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/saulmoralespa-wompi-api-php/health.svg)

```
[![Health](https://phpackages.com/badges/saulmoralespa-wompi-api-php/health.svg)](https://phpackages.com/packages/saulmoralespa-wompi-api-php)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[hubspot/api-client

Hubspot API client

23414.2M16](/packages/hubspot-api-client)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[resend/resend-php

Resend PHP library.

564.7M21](/packages/resend-resend-php)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

762.6k](/packages/scriptdevelop-whatsapp-manager)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
