Retrieving the Payment Provider ID

How to retrieve a listing's payment provider ID.

Get the payment provider information for the listing being booked from the listing itself. There are two options:

Option 1

Retrieve the payment provider ID from the listings endpoint:

curl --location 'https://open-api.guesty.com/v1/listings/{listingId}?fields=paymentProviderId'

Response Example

{
    "_id": "6375259327a35b441f8ab6fa",
    "type": "SINGLE",
    "tags": [],
    "accountId": "6fbef2d2d36c48b94f2c57bc",
    "paymentProviderId": "6ddaba69699ffe2d9b46cfd4",
    "paymentProvider": {
        "_id": "6cdfd852157ccd77cce8d588",
        "paymentProcessorKey": "GUESTY_PAYMENTS",
        "status": "ACTIVE",
        "lastPendingPaymentDate": null,
        "pendingPaymentsCount": 0,
        "paymentMethodsCount": 12,
        "serviceProviderAccountId": 1234,
        "serviceProviderSubAccountId": 1,
        "providerType": "amaryllis",
        "accountName": "Tropical Hideaway",
        "defaultCurrency": "USD",
        "isDefault": true,
        "syncedAt": "2023-03-23T04:04:37.551Z",
        "statsLastUpdated": "2023-06-05T08:02:36.603Z",
        "paymentProcessorName": "GuestyPay",
        "paymentProviderId": "689e9c9232bad3f435482fb3",
        "fallbackToDefault": false
    }
}

Option 2

Retrieve the payment provider ID from /payment-providers endpoint.

curl --location --globoff 'https://open-api.guesty.com/v1/payment-providers/provider-by-listing?listingId={listingId}'

Response Example

{
    "_id": "6375259327a35b441f8ab6fa",
    "paymentProcessorKey": "GUESTY_PAYMENTS",
    "status": "ACTIVE",
    "lastPendingPaymentDate": null,
    "pendingPaymentsCount": 0,
    "paymentMethodsCount": 12,
    "accountId": "6fbef2d2d36c48b94f2c57bc",
    "serviceProviderAccountId": 1234,
    "serviceProviderSubAccountId": 1,
    "serviceProviderProcessor": "nmi",
    "providerType": "amaryllis",
    "accountName": "Tropical Hideaway",
    "defaultCurrency": "USD",
    "isDefault": true,
    "country": "US",
    "apiKey": "713da96a24e41bb93f36e92cbcad1a3c",
    "connectedAt": "2023-03-23T04:04:37.551Z",
    "syncedAt": "2023-03-23T04:04:37.551Z",
    "statsLastUpdated": "2023-06-05T07:02:35.156Z",
    "paymentProcessorName": "GuestyPay",
    "paymentProviderId": "689e9c9232bad3f435482fb3",
    "fallbackToDefault": false
}

Both options return a paymentProviderId field with the required ID for the tokenization request.