# Implementation Steps

## Step 1: Get familiar with the Virtual Cards APIs

The [Reference](https://developers.google.com/pay/virtual-cards-v1/reference/vcn-sequence-diagrams) section
contains details about Virtual Cards APIs.
As the first step for your implementation, we recommend getting familiar with
the sequence diagrams and corresponding APIs for Virtual Cards,
including,
[enrollment](https://developers.google.com/pay/virtual-cards-v1/reference/vcn-sequence-diagrams#enrollment),
[retrieval](https://developers.google.com/pay/virtual-cards-v1/reference/vcn-sequence-diagrams#retrieval),
[unenrollment](https://developers.google.com/pay/virtual-cards-v1/reference/vcn-sequence-diagrams#unenrollment)
and
[transaction management](https://developers.google.com/pay/virtual-cards-v1/reference/vcn-sequence-diagrams#transaction_management)
flows.

Overview and benefits of the product is on the
[Home](https://developers.google.com/pay/virtual-cards-v1) page, whereas frequently asked questions can
be found on the [FAQ](https://developers.google.com/pay/virtual-cards-v1/support/faq) page.

## Step 2: Connectivity and idempotency requirements

It is important to understand and ensure you are able to support the
[transport layer](https://developers.google.com/pay/virtual-cards-v1/guides/connectivity/security/transport-layer)
and [application layer](https://developers.google.com/pay/virtual-cards-v1/guides/connectivity/security/application-layer)
security requirements as well as the
[protocol standards](https://developers.google.com/pay/virtual-cards-v1/guides/connectivity/protocol-standards),
notably those related to
[idempotency](https://developers.google.com/pay/virtual-cards-v1/guides/connectivity/protocol-standards#request_idempotency),
prior to integrating.

## Step 3: Work with Google to set up your configuration

Google needs to configure host(s) and
[application layer](https://developers.google.com/pay/virtual-cards-v1/guides/connectivity/security/application-layer)
encryption (PGP or JWE) to establish communication with the
Virtual Cards APIs you implement.

First, you need to determine the URL for the host(s) on your side responsible
for serving the APIs. If your implementation is split across multiple hosts
(e.g. a 3rd party core or other service provider), indicate which endpoints are
served directly by you and which are handled on your behalf by a service
provider.

Second, if you are hosting any of the APIs, you need to setup either
[PGP](https://developers.google.com/pay/virtual-cards-v1/guides/connectivity/security/application-layer#generating_a_new_pgp_key)
(preferred) or
[JWE](https://developers.google.com/pay/virtual-cards-v1/guides/connectivity/security/application-layer#jwe_encryption_with_jws_signing)
that should be used for application layer encryption with your endpoints.

To create your unique ID and initiate the key exchange process, submit the [Virtual Card Number integration request form](https://support.google.com/faqs/contact/vcn_request).
Once Google has set up your configuration, Google replies with your
[Payment Integrator Account ID (PIAID)](https://developers.google.com/pay/virtual-cards-v1/reference/glossary#payment_integrator_account_id)
and Google's public PGP/JWE key specific to the endpoints you are hosting.

## Step 4: Establish sandbox echo connectivity

Once you have verified you can meet the integration requirements
([step 2](https://developers.google.com/pay/virtual-cards-v1/guides/implementation-steps#step_2_connectivity_and_idempotency_requirements)),
have your PGP/JWE encryption configured, and have a
[Payment Integrator Account ID (PIAID)](https://developers.google.com/pay/virtual-cards-v1/reference/glossary#payment_integrator_account_id)
from Google
([step 3](https://developers.google.com/pay/virtual-cards-v1/guides/implementation-steps#step_3_work_with_google_to_set_up_your_configuration)),
you are ready to implement and
[test the Google hosted `echo`](https://developers.google.com/pay/virtual-cards-v1/guides/connectivity/establish-connectivity#echo_from_partner_to_google)
and your hosted `echo` endpoints. Refer to `echo` definitions in the
Virtual Cards APIs under
[Reference](https://developers.google.com/pay/virtual-cards-v1/reference/vcn-sequence-diagrams).

These scripts use the Google-hosted Sandbox environment echo method to test
baseline connectivity:

- Script using V1 [`echo`](https://developers.google.com/standard-payments/payment-integrator-diagnostic-api/v1/TopLevel/echo): [gsp_sandbox_echo.sh](https://developers.google.com/static/standard-payments/shared/reference/assets/gsp_sandbox_echo.sh)
- Script using V2 [`echo`](https://developers.google.com/standard-payments/payment-integrator-diagnostic-api/v2/TopLevel/echo): [gsp_sandbox_echo_v2.sh](https://developers.google.com/static/standard-payments/shared/reference/assets/gsp_sandbox_echo_v2.sh)

## Step 5: Integrate with the APIs

Once you have the `echo` endpoints working in sandbox, you're ready to
integrate with the rest of the Virtual Cards APIs.

Refer to Virtual Cards APIs under the
[Reference](https://developers.google.com/pay/virtual-cards-v1/reference/vcn-sequence-diagrams) section.

## Step 6: Testing

As development wraps up follow the
[testing process](https://developers.google.com/pay/virtual-cards-v1/guides/testing-and-launch/testing)
to prepare for launch, which includes the
[test cases](https://developers.google.com/pay/virtual-cards-v1/guides/testing-and-launch/testing#test_cases)
expected to be executed to validate your Virtual Cards APIs
implementation.

> [!WARNING]
> **Warning:** Your integration cannot be launched until testing is complete.

## Step 7: Launch!

Follow the
[launch process](https://developers.google.com/pay/virtual-cards-v1/guides/testing-and-launch/launch-process)
to ensure as smooth a release as possible.