# Integration Guide

{% stepper %}
{% step %}

### Enable Pay Later messaging on your website

Add the PayPal JavaScript SDK to your website to enable Pay Later messaging. Copy the following code and paste it in the head tag of your website. Replace CLIENT\_ID with your [sandbox or production client ID](https://developer.paypal.com/dashboard/applications/live).

{% hint style="info" %}
Note: If you’ve already added the PayPal JavaScript SDK to your website, add ‘messages’ to the components components=messages,buttons.
{% endhint %}

{% code fullWidth="true" %}

```html
<script
src="https://www.paypal.com/sdk/js?client-id=CLIENT_ID&components=messages,buttons"
data-namespace="PayPalSDK">
</script>
```

{% endcode %}
{% endstep %}

{% step %}

### Customize and preview Pay Later messaging

Decide where you want dynamic messaging to show up and how you want it to look on your site.
{% endstep %}

{% step %}

### Test and go live

Save your website and publish it to start testing Pay Later messaging. Confirm that messaging displays on all appropriate pages.
{% endstep %}

{% step %}

### Go live

1. Change your sandbox `CLIENT_ID` to production `CLIENT_ID` in the PayPal JavaScript SDK. This includes changing the sandbox client ID in the PayPal JavaScript SDK to call in your HTML.
2. If you created or updated pages on a website, move that code from the test environment to the live environment.
   {% endstep %}
   {% endstepper %}

## Troubleshooting

Message components, console warnings, and errors include configuration attributes and object validations. Configuration properties have distinct validation checks for input formatting and values. For a full list of accepted options, see the Pay Later messaging reference.

If validation fails, the developer console in your web browser displays warning messages that inform you which property is invalid and what you should do to resolve the issue. Depending on the message type, the library attempts to fall back to the default values.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://paypal.gitbook.com/online-payments/invoicing/integration-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
