> For the complete documentation index, see [llms.txt](https://docs.barte.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.barte.com/api-reference/wallet-google-pay-e-apple-pay/iniciar-checkout.md).

# Iniciar Checkout

Após seguir as etapas anteriores, você conseguirá iniciar o SDK do checkout. Chame a função `buildCheckout` apresentada abaixo - será gerado o OneTimeToken, esse uuid deve ser usado para iniciar o pagamento.

```html
<!DOCTYPE html>
<html lang="pt-BR">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>SDK Integration</title>
    <script src="<https://sdk-web.y.uno/v1/static/js/main.min.js>"></script>
  </head>
  <body>
    <script>
      
	    async function buildCheckout() {
	    
		    const yuno = Yuno.initialize(public_key);
	    
        yuno.startCheckout({
          checkoutSession: checkoutSessionId,
          elementSelector: "#root",
          countryCode: "BR",
          language: "pt",
          showLoading: true,
          keepLoader: true,
          issuersFormEnable: true,
          renderMode: {
            type: "element",
            elementSelector: "#rootElement",
          },
          card: {
            type: "extends",
            cardSaveEnable: true,
          },
       
          onLoading: (args) => {
            console.log(args);
          },
       
          async yunoCreatePayment(oneTimeToken) {
	          console.log("oneTimeToken: " + oneTimeToken)
	          
            **await createPayment();**          
            
            yuno.continuePayment({ showPaymentStatus: true });
          },
          yunoPaymentMethodSelected(data) {
            console.log("onPaymentMethodSelected", data);
          },
          yunoPaymentResult(data) {
            console.log("yunoPaymentResult", data);
            yuno.hideLoader();
          },
          yunoError: (error) => {
            console.log("There was an error", error);
            yuno.hideLoader();
          },
        });

        yuno.mountCheckoutLite({
          paymentMethodType: "{{type}}",
        });
      }
    </script>
  </body>
</html>

```

**Parâmetros**:

* **public\_key:** envie a sua chave pública cadastrada na Yuno;
* **checkoutSessionId**: você deverá enviar o `checkoutSession` que foi retornado na etapa “ [Criar Sessão de Pagamento](/api-reference/wallet-google-pay-e-apple-pay/criar-sessao-de-pagamento.md)”;
* **paymentMethodType:** você passará o `type` retornado na "[Listar Métodos de Pagamento](/api-reference/wallet-google-pay-e-apple-pay/listar-metodos-de-pagamento.md)".
  * ⚠️Possíveis `types`: **GOOGLE\_PAY**, **APPLE\_PAY**

🚨**Nota:** A função **`createPayment()`** deve ser substituída pelo endpoint a seguir:

## **Criar Pedido**

```jsx
curl --location --request POST '<https://api.barte.com/v2/orders>' \\
--header 'X-Token-Api: {{seu_token_api}}' \\
--header 'Content-Type: application/json' \\
--data-raw '{
    "startDate": "2025-09-10",
    "value": 1250,
    "installments": 3,
    "title": "Titulo - Lili UfdeDn",
    "payment": {
        "method": "{{type}}",
        "wallet": {
            "oneTimeToken": "{{oneTimeToken}}",
            "checkoutSessionUuid": "{{checkoutSessionId}}",
            "integrationOrderId" : "{{merchantOrderId}}"
        },
        "fraudData": {
            "internationalDocument": {
                "documentNumber": "53824569337",
                "documentType": "CPF",
                "documentNation": "BR"
            },
            "name": "Lili",
            "email": "strigus@mock.com",
            "phone": "5511999994444",
            "billingAddress": {
                "country": "BR",
                "state": "MG",
                "city": "Uberlandia",
                "district": "Patrimonio",
                "street": "Rua de test",
                "zipCode": "38411999"
            }
        }
    },
    "metadata": [
        {
            "key": "RegressivoVersion1",
            "value": "rdjwbK"
        }
    ],
    "uuidBuyer": "{{uuidBuyer}}"
}'
 
```

Quando a requisição for processada com sucesso você terá o seguinte retorno:

```jsx
{
    "uuid": "435d2dbb-1253-45c7-acb8-ad70fcb8b6cc",
    "status": "SENT",
    "title": "Título da Ordem",
    "value": 349,
    "installments": 1,
    "startDate": "2024-11-11",
    "payment": "GOOGLE_PAY",
    "customer": {
        "document": "04386909079",
        "type": "CPF",
        "documentCountry": "BR",
        "name": "João da Barte",
        "email": "joao@email.com",
        "phone": "34999992222",
        "alternativeEmail": "alternativo@mock.com",
        "integrationCustomerId": "98cafcac-6d3b-4863-959b-f4ceabf96cdf"
    },
    "idempotencyKey": "83ae7caf-6291-4884-977a-e4c405b3db46"
}
```

**Documentações complementares:**

<https://docs.y.uno/docs/lite-checkout-ios> - IOS

<https://docs.y.uno/docs/lite-checkout-android> - Android


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.barte.com/api-reference/wallet-google-pay-e-apple-pay/iniciar-checkout.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
