> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gr4vy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Guest checkout

> Create transactions without a creating a buyer first

It is possible to provide buyer details, including the shipping and billing details, without the need
to [create a buyer resource](/reference/buyers/new-buyer). You can send the buyer details directly when the transaction is requested, either
to the API, Embed, or Secure Fields.

<CodeGroup>
  ```json API theme={"system"}
  {
      "amount": 1299,
      "currency": "AUD",
      "payment_method": {
          // This works with any payment method, 
          // as well as checkout sessions
          ...
      },
      "buyer": {
          "external_identifier": "my-unique-identifier",
          "billing_details": {
              "first_name": "John",
              "last_name": "Smith",
              "address": {
                  "postal_code": "789123"
              }
          },
          "shipping_details": {
              "first_name": "John",
              "last_name": "Smith",
              "address": {
                  "postal_code": "789123"
              }
          }
      }
  }
  ```

  ```js Embed (Node) theme={"system"}
  setup({
      ...
      buyer: {
          externalIdentifier: 'my-unique-identifier',
          billingDetails: {
              firstName: 'John',
              lastName: 'Smith',
              address: {
                  postalCode: '789123',
              },
          taxId: {
              value: '123456',
              kind: 'gb.vat',
          },
          },
          shippingDetails: {
              firstName: 'John',
              lastName: 'Smith',
              address: {
                  postalCode: '789123',
              },
          },
      }
  })

  ```

  ```jsx Embed (React) theme={"system"}
  <Gr4vyEmbed
    ...
    buyer={{
          externalIdentifier: 'my-unique-identifier',
          billingDetails: {
              firstName: 'John',
              lastName: 'Smith',
              address: {
                  postalCode: '789123',
              },
          taxId: {
              value: '123456',
              kind: 'gb.vat',
          },
          },
          shippingDetails: {
              firstName: 'John',
              lastName: 'Smith',
              address: {
                  postalCode: '789123',
              },
          },
      }}
  />
  ```

  ```swift iOS  theme={"system"}
  Gr4vy.init(
    ...
    buyer: Gr4vyBuyer(
      externalIdentifier: "my-unique-identifier",
      billingDetails: Gr4vyBillingDetails(
        firstName: "John",
        lastName: "Smith",
        address: Gr4vyAddress(
          postalCode: "789123"
        ),
        taxId: Gr4vyTaxId(
          value: "123456",
          kind: "gb.vat"
        )
      ),
      shippingDetails: Gr4vyShippingDetails(
        firstName: "John",
        lastName: "Smith",
        address: Gr4vyAddress(
          postalCode: "789123"
        ),
      )
    )
  )
  ```

  ```java Android  theme={"system"}
  gr4vySDK.launch(
    ...
    buyer = Gr4vyBuyer(
      externalIdentifier = "my-unique-identifier",
      billingDetails = Gr4vyBillingDetails(
        firstName = "John",
        lastName = "Smith",
        address = Gr4vyAddress(
          postalCode = "789123"
        ),
        taxId = Gr4vyTaxId(
          value = "123456",
          kind = "gb.vat"
        )
      ),
      shippingDetails = Gr4vyShippingDetails(
        firstName = "John",
        lastName = "Smith",
        address = Gr4vyAddress(
          postalCode = "789123"
        ),
      )
    )
  )
  ```

  ```js React Native  theme={"system"}
  EmbedReactNative.showPaymentSheet({
    ...
    buyer: {
      externalIdentifier: 'my-unique-identifier',
      billingDetails: {
        firstName: 'John',
        lastName: 'Smith',
        address: {
          postalCode: '789123',
        },
        taxId: {
          value: '123456',
          kind: 'gb.vat',
        },
      },
      shippingDetails: {
        firstName: 'John',
        lastName: 'Smith',
        address: {
          postalCode: '789123',
        },
      },
    },
  })
  ```
</CodeGroup>

## Limitations

There are a few limitations to using in-line buyer details like this, rather than using a stored buyer record.

* A guest buyer cannot use a payment method which is assigned to another buyer resource.
* A guest buyer cannot redeem gift cards which are assigned to another buyer resource.
* A buyer resource can not be created when using in-line buyer data. Please use the [new buyers endpoint](/reference/buyers/new-buyer) instead.

<Note>
  The buyer ID and buyer external identifier properties can be passed to the API and SDKs to apply guest buyer details while also using stored
  payment methods. Please see the documentation on [linking](./linking) for more details.
</Note>
