Manage Google Pay (API)

Learn about managing Google Pay and payment method domains via the Payabli API

Applies to:Developers

You can manage Google Pay payment method domains and settings via the Payabli APIs.

Domain management

Add a domain

Send a POST request to /api/PaymentMethodDomain to add more domains to an organization.

POST
/api/PaymentMethodDomain
1curl -X POST https://api-sandbox.payabli.com/api/PaymentMethodDomain \
2 -H "requestToken: <apiKey>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "applePay": {
6 "isEnabled": true
7 },
8 "googlePay": {
9 "isEnabled": true
10 },
11 "domainName": "checkout.example.com",
12 "entityId": 109,
13 "entityType": "paypoint"
14}'

Cascade domain

Send a POST request to /api/PaymentMethodDomain/{domainId}/cascade to cascade the domain to all of the organization’s children (both suborganizations and paypoints).

POST
/api/PaymentMethodDomain/:domainId/cascade
1curl -X POST https://api-sandbox.payabli.com/api/PaymentMethodDomain/pmd_b8237fa45c964d8a9ef27160cd42b8c5/cascade \
2 -H "requestToken: <apiKey>"

Stop accepting Google Pay

To stop accepting Google Pay from a domain, send a PATCH request to /api/PaymentMethodDomain/{domainId} and send googlePay.isEnabled as false.

PATCH
/api/PaymentMethodDomain/:domainId
1curl -X PATCH https://api-sandbox.payabli.com/api/PaymentMethodDomain/pmd_b8237fa45c964d8a9ef27160cd42b8c5 \
2 -H "requestToken: <apiKey>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "applePay": {
6 "isEnabled": false
7 },
8 "googlePay": {
9 "isEnabled": false
10 }
11}'

You can’t deactivate an inherited domain. You must deactivate domains at the domain owner organization’s level.

Start accepting Google Pay

To start accepting Google Pay on a domain, send a POST request to /api/PaymentMethodDomain/{domainId}/verify to verify the domain. If verification succeeds, Google Pay is activated automatically for the domain.

You can’t verify an inherited domain. You must verify domains at the domain owner organization’s level.

View domain details

To view a domain’s details, send a GET request to /api/PaymentMethodDomain/{domainId} retrieve a domain’s details. The response includes cascades.jobStatus, which gives the status of the domain cascade process.

Delete domain

You can remove a domain from an organization by sending a DELETE request to the /PaymentMethodDomain/{domainId} endpoint.

DELETE
/api/PaymentMethodDomain/:domainId
1curl -X DELETE https://api-sandbox.payabli.com/api/PaymentMethodDomain/pmd_b8237fa45c964d8a9ef27160cd42b8c5 \
2 -H "requestToken: <apiKey>"

You can’t delete an inherited domain. You must delete a domain at the owning organization’s level.

Get list of domains

To get a list of domains associated with an entity, send a POST request to the /PaymentMethodDomain/list endpoint.

GET
/api/PaymentMethodDomain/list
1curl -G https://api-sandbox.payabli.com/api/PaymentMethodDomain/list \
2 -H "requestToken: <apiKey>" \
3 -d entityId=1147 \
4 -d entityType=paypoint
  • Send entityType as organization and the organization ID in entityId to get the details for the organization.
  • Send entityType as paypoint and the paypoint’s ID in entityId to get the details for the paypoint.

Google Pay service management

You can activate and deactivate the Google Pay service for an organization and cascade the settings to all of the organization’s children (including suborganizations and paypoints).

Activate Google Pay

To activate Google Pay via the API, see Activate Google Pay (API).

Deactivate Google Pay

To deactivate the Google Pay service, make a POST request to the /Wallet/googlepay/configure-organization.

In the body, send isEnabled as false and cascade as true to deactivate Google Pay on the organization and cascade the deactivation to all of the organization’s children.

Example deactivation request
$ curl --request POST \
> --url https://api-sandbox.payabli.com/api/Wallet/googlepay/configure-organization \
> --header 'Content-Type: application/json' \
> --header 'requestToken: <api-key>' \
> --data '{
> "orgId": 123,
> "isEnabled": false,
> "cascade": true
>}'

After you’ve sent the deactivation request, Payabli deactivates the service and cascades the settings, if applicable. This can take a few minutes, depending on how your entities are structured.

To check whether Google Pay is deactivated, send a GET request to /api/Organization/settings/{orgId}. Check the response for forWallets, when Google Pay isn’t active, you can see the following in the response:

1 "forWallets": [
2 {
3 "key": "IsGooglePayEnabled",
4 "value": "false",
5 "readOnly": true
6 }
7 ]