Payment providers
The providers the website's customers can pay its orders online through, and the website's own account at each: :connect with its credentials — checked with the provider, kept sealed and never answered back — :verify and :disconnect. A connected provider's ways to pay are offered where checkout.payment_methods names them.
List payment providers
Lists every payment provider of the platform, in its order, each with the website's account at it — state: "NOT_CONNECTED" where there is none. Neither filters nor sorts.
path Parameters
website_idId of the parent website.
query Parameters
page_sizeRows per page. Over the maximum is clamped, not rejected.
page_tokenOpaque token from a previous next_page_token. A token minted under a different order_by/filter is rejected.
skipRows to skip before the page (AIP-158). skip + page_size is capped at 10000; beyond that is OUT_OF_RANGE.
order_byComma-separated field [asc|desc], at most 3 keys. Default: create_time desc. Sortable: none — this collection serves its documented order only.
filterAIP-160 subset (§8). Filterable: none. A field outside the list is INVALID_ARGUMENT.
List payment providers › Responses
One page of payment_providers.
This page of payment_providers, in the requested order.
next_page_tokenOpaque. Absent or empty means this was the last page.
total_sizeRows in the whole filtered collection, not in this page.
Get payment provider
Reads one payment provider and the website's account at it; a provider without an account answers state: "NOT_CONNECTED", an id the platform has no provider of NOT_FOUND.
path Parameters
website_idId of the parent website.
providerThe provider's id, which is the resource's id too: websites/{website}/payment_providers/{provider}. An order's online payment names it as its provider.
Headers
If-None-MatchA matching etag answers 304 with no body (§16).
Get payment provider › Responses
The resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
providerThe provider's id, which is the resource's id too: websites/{website}/payment_providers/{provider}. An order's online payment names it as its provider.
display_nameThe provider's name, as the owner reads it.
module_idThe website module that switches the provider on and off: websites/{website}/modules/{module_id}. While it is off the provider's ways to pay are offered nowhere, and :connect and :verify answer FAILED_PRECONDITION MODULE_DISABLED; an account stays connected.
stateWhere the website's account at the provider stands: NOT_CONNECTED — none; CONNECTED — the provider took its credentials at the last check; INVALID — it refused them since, or the platform can no longer read them: connect the account again. Only a CONNECTED account takes payments.
environmentWhether the account moves the provider's test money (TEST) or real money (LIVE): as its credentials say, or — for a provider whose environment_selectable is true — as the owner chose at :connect; the platform calls that environment of the provider. Absent while NOT_CONNECTED.
environment_selectableWhether :connect asks which environment the credentials are of — environment, TEST or LIVE, required then and refused otherwise. True for a provider whose credentials look the same in both, such as an app's client ID and secret; false for one whose credentials say it themselves, such as a key whose prefix names its mode. The provider's, whatever the account.
credential_fieldsWhat :connect asks for, in order: [{key, secret, required}] — key a member of the body's credentials, secret whether its value is never answered back (only its last four characters, in credential_hints), required whether it must be sent. A form is built of it.
credential_hintsThe last four characters of each secret credential of the account, by its key — enough to tell which one is connected, never the credential. Absent while NOT_CONNECTED, and for a value shorter than 12 characters.
accountWhat the provider says of the account the credentials belong to, at the last check: {id, display_name?, country_code?, default_currency_code?} — its id at the provider, its name, its country (ISO 3166-1 alpha-2) and its default currency (ISO 4217). Absent while NOT_CONNECTED.
webhookHow the provider tells the platform of the account's payments: {uri?, state}. REGISTERED — it sends them to uri, the platform's address of this website and provider; MISSING — it sends none, and a payment is confirmed when the customer comes back from the provider's page and by the platform's own check of open payments. :verify registers it again when it is gone. Absent while NOT_CONNECTED.
payment_methodsThe ways to pay the provider brings to the checkout: [{code, available, unavailable_reason?}] — code a code checkout.payment_methods takes; available whether the checkout offers it once it is in that list: the module on, the account CONNECTED and the provider naming no reason it cannot — a cart in a currency the provider takes no payment in is not offered it at :checkout; unavailable_reason why not: MODULE_DISABLED — the provider's module is off; NOT_CONNECTED — no account is connected; ACCOUNT_INVALID — the provider refused the account's credentials since; ACCOUNT_COUNTRY — the account's country cannot take it (Pix: an account in Brazil alone); NOT_ENABLED_AT_PROVIDER — the account has not switched it on at the provider, as :verify last read it. Tolerate a value not listed here.
capabilitiesWhat the provider does beyond taking a payment at once: {manual_capture, partial_capture, saved_methods} — manual_capture whether it can hold a payment for the shop to take later (:capture_payment of an order) or let go of (:void_payment), partial_capture whether it takes less than it holds, saved_methods whether it keeps a signed-in customer's ways to pay for their next orders, once the provider's own setting of saving them is on — false under an account the provider keeps none for, as :verify last read it, whose setting of saving is refused on (PAYMENT_PROVIDER_CAPABILITY). The rest are the provider's, whatever the account.
connect_timeWhen the account was last connected (:connect). Absent while NOT_CONNECTED.
verify_timeWhen the provider was last asked about the credentials — by :connect or :verify. Absent while NOT_CONNECTED.
Connect (payment provider)
Connects the website's own account at the provider: {"credentials": {"secret_key": "…"}} — every key of its credential_fields, each a string, surrounding whitespace dropped — and, for a provider whose environment_selectable is true, "environment": "TEST" or "LIVE": which of its environments the credentials are of, required there and refused elsewhere (INVALID_ARGUMENT on environment). The platform asks the provider whether the credentials are good, registers a webhook there for the account's payments (webhook.state REGISTERED, or MISSING where the platform has no public address for it, or where the provider declines one — a limit of its webhooks reached), keeps the credentials sealed and answers only the last four characters of each secret one (credential_hints); the account is CONNECTED, and the provider's ways to pay are offered where checkout.payment_methods names them — at :checkout, in a currency the provider takes. Connecting again — other credentials, another account at the provider — replaces the account and removes its webhook. Refused, nothing is written and no webhook is left: credentials the provider does not take, or that are not what it asks for — a key it does not know, a required one missing, one empty or with a space inside — INVALID_ARGUMENT on credentials.<key>; the provider not reached UNAVAILABLE; the platform not able to keep credentials FAILED_PRECONDITION SECRETS_NOT_CONFIGURED, or to reach the provider PAYMENT_PROVIDER_NOT_CONFIGURED; the provider's module off MODULE_DISABLED on websites/{w}/modules/{module_id}. Answers the provider with the account.
path Parameters
website_idId of the parent website.
providerConnect (payment provider) › Request Body optional
Connect (payment provider) › Responses
The affected resource, or the method’s own response object (§10).
Disconnect (payment provider)
Disconnects the website's account at the provider: its webhook is removed at the provider and its credentials are deleted, and its ways to pay are offered nowhere. Takes no body; a provider with no account answers as it is. The provider's module may be off. Answers the provider, NOT_CONNECTED.
path Parameters
website_idId of the parent website.
providerDisconnect (payment provider) › Request Body optional
Disconnect (payment provider) › Responses
The affected resource, or the method’s own response object (§10).
Verify (payment provider)
Checks the website's account with the provider again. Takes no body. Credentials it still takes keep the account CONNECTED — what the provider says of the account read again, verify_time now — and a webhook gone at the provider, or registered at another address of the platform's, is registered again; credentials it refuses now, or that the platform can no longer read, make it INVALID, offered nowhere until it is connected again — an answer, not an error. The provider not reached answers UNAVAILABLE and changes nothing; no account FAILED_PRECONDITION PAYMENT_PROVIDER_NOT_CONNECTED; the provider's module off MODULE_DISABLED. Answers the provider with the account.
path Parameters
website_idId of the parent website.
providerVerify (payment provider) › Request Body optional
Verify (payment provider) › Responses
The affected resource, or the method’s own response object (§10).