PHPackages                             php-cupid/cupid - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. php-cupid/cupid

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

php-cupid/cupid
===============

PHP SDK for cupid mapping

01PHP

Since Apr 19Pushed 4y ago1 watchersCompare

[ Source](https://github.com/cupid-mapping/cupid-php)[ Packagist](https://packagist.org/packages/php-cupid/cupid)[ RSS](/packages/php-cupid-cupid/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)

php-cupid/cupid
===============

[](#php-cupidcupid)

Table of Contents
-----------------

[](#table-of-contents)

- [Description](#description)
- [Installation](#installation)
- [Usage](#usage)
- [Method](#method)
- [uploadInventory](#plain-text-or-html)
- [listInventories](#json)
- [inventoryDetails](#simple-post)
- [mapHotelList](#post-with-json)
- [Contact](#contact)

Description
-----------

[](#description)

Performing mapping through the Cupid API is very straightforward. You'll first upload your properties inventory to be used as reference and then send a list of properties to be mapped to the API and get the results directly in the response.

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

[](#installation)

Requires PHP version &gt;=5.3.
The recommended way to install Guzzle is through [Composer](https://getcomposer.org/).

```
composer require php-cupid/cupid
```

Method
------

[](#method)

NOTE: The documentation below is up-to-date with `3.x` releases, if you are using an older version, please check how to [upgrade](#upgrading).

### uploadInventory

[](#uploadinventory)

This function can be used to upload an inventory with a provided CSV file.

You will have to provide the inventory's name and for each column in your file, you'll need match its index with the standard field names provided below.

Let's assume you have a CSV file that looks like the following table:

HotelIDHotel\_NameHotel\_AddressHotel\_LatHotel\_LonCountryCity...1408Smile Hotel123 main st5.4195143.392694AUAdelaid...123Cupid resort456 north av55.6925437.3167887MAZagoura...In this case the form data would be:

- **file**: The csv file to be uploaded
- **name**: Cupid inventory
- **header\_id**: 0
- **header\_name**: 1
- **header\_address**: 2
- **header\_city**: 6
- **header\_country\_code**: 5
- **header\_latitude**: 3
- **header\_longitude**: 4

```
require  "vendor/autoload.php";
$cupid = new App\Cupid(*YOUR  API  KEY*);
$uploadInventory = $cupid->uploadInventory("my npm catalog", "./file.csv", 0, 1, 2, 3, 4, 5, 6)
var_dump($uploadInventory);
```

### listInventories

[](#listinventories)

This function can be used to list the inventories uploaded to your workspace.
You can check their status and other basic info.

```
require  "vendor/autoload.php";
$cupid = new App\Cupid(*YOUR  API  KEY*);
$listInventories = $cupid->listInventories()
var_dump($uploadInventory);
```

### inventoryDetails

[](#inventorydetails)

This function can be used to check the requested inventory's details.

You can use it to get the inventory status `mapping_process_status_id` as outlined below. The status has to be 2 (Done) to start mapping.

**Possible values for the inventory's status `mapping_process_status_id`:**

valueNameDescriptionAction-1**Invalid**The inventory doesn't contain any valid hotelsCorrect your catalog and try again.0**Pending**The inventory is being uploadedWait, no action required.1**Processing**The inventory is being processedWait, no action required.2**Done**The process is complete**You can start mapping.**3**Failed**There was an error while processingRetry and if the error persists, feel free to contact us.When you have an inventory with `active=true` and `mapping_process_status_id=2` you can use the following endpoint to perfom mapping:

```
require  "vendor/autoload.php";
$cupid = new App\Cupid(*YOUR  API  KEY*);
$inventoryDetails = $cupid->inventoryDetails($inventory_id)
var_dump($inventoryDetails);
```

### mapHotelList

[](#maphotellist)

This function allows you to send a list of properties and maps it against your active inventory. You will get the resulting mappings in the response.

**Limit**You can send up to 1000 properties per request.

```
$cupid = new App\Cupid(*YOUR  API  KEY*);
$array = [
	[
		"address" => "123 main street",
		"country_code"=> "US",
		"hotel_code"=> "1256",
		"latitude"=> 36.18743350322336,
		"longitude"=> -115.15064193665704,
		"name"=> "hotel name"
	]
];

$mapHotels = $cupid->mapHotels($array);
print_r($mapHotels);
```

Contact
-------

[](#contact)

- [Cupid](https://cupid.travel)
-

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8311d9a3651e2934297e62e74ef4fed9bfbc5d8d669851cff35f9e8dae80e184?d=identicon)[ladnany](/maintainers/ladnany)

---

Top Contributors

[![ladnany](https://avatars.githubusercontent.com/u/62647849?v=4)](https://github.com/ladnany "ladnany (12 commits)")

### Embed Badge

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

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

###  Alternatives

[qazd/text-diff

A simple text differences visualization library

38121.2k1](/packages/qazd-text-diff)

PHPackages © 2026

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