PHPackages                             kappafix/php-salesforce - 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. kappafix/php-salesforce

ActiveLibrary[API Development](/categories/api)

kappafix/php-salesforce
=======================

PHP Salesforce REST API wrapper

1.0.2(3y ago)021MITPHPPHP &gt;=7.0

Since Jun 10Pushed 3y agoCompare

[ Source](https://github.com/kappafix/php-salesforce)[ Packagist](https://packagist.org/packages/kappafix/php-salesforce)[ RSS](/packages/kappafix-php-salesforce/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

PHP Salesforce REST API wrapper
===============================

[](#php-salesforce-rest-api-wrapper)

Forked from: `nachitox/php-salesforce-rest-api` `bjsmasth/php-salesforce-rest-api` `Cleeng/php-salesforce-rest-api` `jerkob/php-salesforce-rest-api-forked`

Install
-------

[](#install)

Via **[composer](https://getcomposer.org/)**

```
composer require kappafix/php-salesforce
```

Getting Started
===============

[](#getting-started)

Setting up a Connected App

1. Log into your Salesforce org
2. Click on Setup in the upper right-hand menu
3. Under Build click `Create > Apps `
4. Scroll to the bottom and click `New` under Connected Apps.
5. Enter the following details for the remote application:
    - Connected App Name
    - API Name
    - Contact Email
    - Enable OAuth Settings under the API dropdown
    - Callback URL
    - Select access scope (If you need a refresh token, specify it here)
6. Click Save

After saving, you will now be given a *consumer key* and *consumer secret*. Update your config file with values for `consumerKey` and `consumerSecret`

Setup
=====

[](#setup)

Authentication

```

	/*save the config options in a config file*/

    $options = [
        'grant_type' => 'password',
        'client_id' => 'CONSUMERKEY', /* insert consumer key here */
        'client_secret' => 'CONSUMERSECRET', /* insert consumer secret here */
        'username' => 'SALESFORCE_USERNAME', /* insert Salesforce username here */
        'password' => 'SALESFORCE_PASSWORD' . 'SECURITY_TOKEN', /* insert Salesforce user password and security token here */
		'endPoint' => 'https://login.salesforce.com/', /* if you want to login to a Sandbox change the url to https://test.salesforce.com/ */
		'apiVersion' => 'v48.0'
    ];

	$salesforce = new \Kappafix\Salesforce\SfCaller($options);

    /* if you need access token or instance url */
    $accessToken = $salesforce->getAccessToken();
    $instanceUrl = $salesforce->getInstanceUrl();
```

Query

```
    $query = 'SELECT Id,Name FROM ACCOUNT LIMIT 100';

    /* returns array with the queried data */
    $data = $salesforce->query($query);
```

Create

```
    $data = [
       'Name' => 'Some name',
    ];

    /* returns the id of the created object */
    $salesforce->Account->insert( $data);
```

Update

```
    $new_data = [
       'Name' => 'another name',
    ];

    /* returns statuscode */
    $salesforce->Account->update($id, $new_data);
```

Upsert

```
    $new_data = [
       'Name' => 'another name',
    ];

    /* returns statuscode */
    $salesforce->Account->upsert( 'API Name/ Field Name', 'value', $new_data);
```

Delete

```
    $salesforce->Account->delete($id);
```

Get

```
    $salesforce->Account->get($id);
```

Describe

```
    $salesforce->'Account'->describe();
```

Custom endpoint

```
    $salesforce->Account->customEndpoint('apex/myCustomEndpoint', $data, 200);
```

#### Changelog:

[](#changelog)

##### 16.03.2021

[](#16032021)

- made easier to use, especially if you use it in multiple area of your code
- added a SalesforceWrapper on SalesforceFunctions
- added a SfCaller for the syntax $salesforce-&gt;Object-&gt;method($arguments)

##### 09.06.2021

[](#09062021)

- Bug Fixing

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66% of commits — single point of failure

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

Every ~391 days

Total

2

Last Release

1458d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/46008917?v=4)[kappafix](/maintainers/kappafix)[@kappafix](https://github.com/kappafix)

---

Top Contributors

[![kappafix](https://avatars.githubusercontent.com/u/46008917?v=4)](https://github.com/kappafix "kappafix (33 commits)")[![bjsmasth](https://avatars.githubusercontent.com/u/5401401?v=4)](https://github.com/bjsmasth "bjsmasth (16 commits)")[![laszlof](https://avatars.githubusercontent.com/u/1486486?v=4)](https://github.com/laszlof "laszlof (1 commits)")

---

Tags

php salesforcephp salesforce restphp salesforce rest api

### Embed Badge

![Health badge](/badges/kappafix-php-salesforce/health.svg)

```
[![Health](https://phpackages.com/badges/kappafix-php-salesforce/health.svg)](https://phpackages.com/packages/kappafix-php-salesforce)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M47](/packages/tencentcloud-tencentcloud-sdk-php)[bjsmasth/php-salesforce-rest-api

55115.7k](/packages/bjsmasth-php-salesforce-rest-api)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)[aimeos/prisma

A powerful PHP package for integrating media related Large Language Models (LLMs) into your applications

1943.1k5](/packages/aimeos-prisma)[volcengine/volcengine-php-sdk

118.7k](/packages/volcengine-volcengine-php-sdk)

PHPackages © 2026

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