---
title: "Accept payment with Inttegro Checkout"
description: "Present secure hosted Checkout from a finalized Order or an existing Purchase Intent."
canonical: "https://studio.inttegro.com/guides/accept-payment-with-inttegro-checkout"
format: inttegro-machine-docs/v1
language: "Go"
sdk_version: "v11.0.1"
reader_profile: optional
reader_manifest: "https://studio.inttegro.com/machine/go/readers/index.json"
reader_identification: "Optional: declare your client only if known and your current-session capabilities; use reader_manifest for supplemental recommendations."
preamble_estimated_tokens: 440
model_token_report: "https://studio.inttegro.com/machine/token-report.json"
preamble_questions: 5
preamble_source: "curated"
recommended_mcp_tools: ["get_integration_guide","check_integration_readiness","get_order"]
estimated_tokens: 2953
token_estimate_method: "utf8_bytes_divided_by_4"
---

## Machine preamble

**Summary:** Create a finalized order, give the customer its hosted invoice URL, and reconcile payment from the order rather than the browser return.

### Five questions

#### Q1. What is the first server-side action?

Create and finalize the order with customer details and line items. Preserve the order ID; [Orders](https://studio.inttegro.com/machine/go/api/orders.md#create-an-order) owns the exact request and response contract.

#### Q2. What should the customer receive?

Send the hosted invoice URL from the finalized order. Inttegro Checkout handles the customer-facing payment and verification flow; do not move secret API credentials into the browser.

#### Q3. How should an uncertain create response be retried?

Reuse the identical payload and stable Idempotency-Key header rather than creating a second order. Read [Idempotent requests](https://studio.inttegro.com/machine/go/api/idempotency.md) before changing the request or key.

#### Q4. Does a redirect or accepted request prove payment?

No. Preserve the order ID and [look up the order](https://studio.inttegro.com/machine/go/api/orders.md#lookup-an-order) until its authoritative order and payment states show the outcome; a customer return is presentation, not settlement proof.

#### Q5. Where can MCP assist without taking over Checkout?

An authenticated connection can use [`create_order`](https://studio.inttegro.com/machine/go/inttegro-mcp/tools.md#create_order) and [`send_order_invoice`](https://studio.inttegro.com/machine/go/inttegro-mcp/tools.md#send_order_invoice) only with their documented confirmations, then [`get_order`](https://studio.inttegro.com/machine/go/inttegro-mcp/tools.md#get_order) for reconciliation. Checkout remains customer-facing.

## Document content

# Accept payment with Inttegro Checkout

Present Inttegro-hosted Checkout from the payment reference your application
already owns. Inttegro handles amount selection when applicable, payment,
confirmation, and receipt generation.

## Choose the existing Purchase Intent path before generating Order code

If the application already has a Purchase Intent, pass its public `sale_...` ID
directly to the web SDK as `purchaseIntentId`. Do not call `/orders/create` or
pass an `orderId` first. Hosted Checkout renders the Buy experience, including
the product, customer details, quantity, variants, and amount controls that
apply to the offer. It creates the finalized Order only after the buyer
continues. Use the Order path below only when the application owns the
commercial details and must create a new Order on its server.

## Choose the Checkout reference

| What your application has | What to pass to Checkout | What not to do |
| --- | --- | --- |
| An existing fixed-price or customer-selected Purchase Intent | Pass its `sale_...` ID to `createCheckout({ purchaseIntentId })`. | Do not create an Order first. For customer-selected pricing, do not collect the amount yourself. |
| An application-approved purchase with known customer and line items | Create and finalize the Order on your server, then pass its `or_...` ID to `createCheckout({ orderId })`. | Do not expose the API key or let the browser change commercial details. |

For an existing Purchase Intent, the complete browser handoff is deliberately
small:

```typescript
import { loadInttegro } from '@inttegro/js'

const inttegro = await loadInttegro()
if (!inttegro) throw new Error('Checkout requires a browser.')

const checkout = inttegro.createCheckout({ purchaseIntentId })
await checkout.present()
```

See the [JavaScript Checkout guide](https://studio.inttegro.com/machine/go/web/javascript.md) for embedded presentation,
framework adapters, lifecycle events, and server-side reconciliation. The
remaining steps on this page cover the new-Order path.

> Mcp Guide Callout is interactive content. Use the canonical page to view it.

> **Note:**
>
> **Recommended approach.** See [Inttegro Checkout](https://studio.inttegro.com/machine/go/products/checkout.md)
> for why this works better than custom checkout.

## Step 1: create an order

Call `/orders/create`  with customer details and line items, and set [`Finalize`](https://pkg.go.dev/github.com/inttegro/inttegro-sdk-go/v11@v11.0.1/order#CreateParams.Finalize)  to `true`. Finalization seals the order and generates its hosted invoice URLs. Store the order ID for status tracking. Send a unique, stable `Idempotency-Key`  header for each order-creation attempt. If a request times out or its result is unclear, retry the same request with the same key so it does not create a second order. Use a new key when the request payload changes. [`RequestMeta.IdempotencyKey`](https://pkg.go.dev/github.com/inttegro/inttegro-sdk-go/v11@v11.0.1/request#Meta.IdempotencyKey)  remains accepted for compatibility, but new integrations should use the header. **Create order — POST /orders/create**

```go
package main

import (
  "context"
  "log"
  "os"

  inttegro "github.com/inttegro/inttegro-sdk-go/v11"
  "github.com/inttegro/inttegro-sdk-go/v11/customer"
  "github.com/inttegro/inttegro-sdk-go/v11/money"
  "github.com/inttegro/inttegro-sdk-go/v11/order"
  "github.com/inttegro/inttegro-sdk-go/v11/price"
  "github.com/inttegro/inttegro-sdk-go/v11/product"
  "github.com/inttegro/inttegro-sdk-go/v11/request"
)

func main() {
  ctx := context.Background()
  client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))

  params := order.CreateParams{
    RequestMeta: &request.Meta{
      IdempotencyKey: "order_inv_001",
    },
    CustomerData: &customer.Data{
      Name: "Gloria Kesewaa",
      Email: "gloria@example.com",
      PhoneNumber: "+233544998605",
    },
    Finalize: inttegro.Bool(true),
    LineItems: []order.LineItemParams{
      {
        Type: order.LineItemTypeProduct,
        Product: &order.ProductLineItemParams{
          Type: product.TypePhysical,
          Name: "Utility Sneakers",
          Quantity: 1,
          Price: price.InlineParams{
            AmountParams: money.AmountParams{
              Currency: money.GHS,
              Value: 20000,
            },
          },
        },
      },
    },
  }
  result, err := client.Orders.Create(ctx, params)
  if err != nil {
    log.Fatal(err)
  }
  _ = result
}
```

### Response

> **Note:**
>
> Partial response. See complete [Order object](https://studio.inttegro.com/machine/go/api/orders.md#the-order-object).

```json
{
  "order": {
    "id": "or_XyZ9kL2mQrTfVqYz1wNb",
    "number": "INV-2025-001",
    "status": "requires_payment",
    "invoice": {
      "format": {
        "web": {
          "url": "https://pages.inttegro.com/invoices/or_XyZ9kL2mQrTfVqYz1wNb"
        },
        "pdf": {
          "url": "https://pages.inttegro.com/invoices/or_XyZ9kL2mQrTfVqYz1wNb/pdf"
        }
      }
    }
  }
}
```

## Step 2: direct customer to payment

Choose how to get the customer to the payment page:

### Redirect immediately

Read the web invoice URL from the created order and return it to your client.
Check that the invoice is present before redirecting; draft orders do not have
one. Your client can then open the returned URL using its normal navigation
mechanism.

### Share invoice link

If immediate redirect doesn't fit your flow, share the URL asynchronously. Send it through email, SMS, WhatsApp, or your notification system—the URL works in any browser context. Useful for offline orders, delayed billing, or when the customer isn't in your app.

## Step 3: track payment status

Use `/orders/lookup`  to check payment status. Poll periodically or check when the customer returns to your app. When [`Order.Status`](https://pkg.go.dev/github.com/inttegro/inttegro-sdk-go/v11@v11.0.1/order#Order)  becomes [`order.StatusPaid`](https://pkg.go.dev/github.com/inttegro/inttegro-sdk-go/v11@v11.0.1/order#StatusPaid), funds are in your Inttegro balance. **Check status — POST /orders/lookup**

```go
package main

import (
  "context"
  "log"
  "os"

  inttegro "github.com/inttegro/inttegro-sdk-go/v11"
)

func main() {
  ctx := context.Background()
  client := inttegro.NewClient(os.Getenv("INTTEGRO_API_KEY"))

  result, err := client.Orders.Lookup(ctx, "or_XyZ9kL2mQrTfVqYz1wNb")
  if err != nil {
    log.Fatal(err)
  }
  _ = result
}
```

## Customization

### Configure redirect and cancel URLs

```go
order.CreateParams{
  CheckoutSettings: &checkout.Settings{
    RedirectURL: "https://yoursite.com/order/complete",
    CancelURL: "https://yoursite.com/order/cancelled",
  },
}
```

Strongly recommended for a delightful customer experience. When payment completes, customers land on your [`CheckoutSettings.RedirectURL`](https://pkg.go.dev/github.com/inttegro/inttegro-sdk-go/v11@v11.0.1/checkout#Settings.RedirectURL)  where you can show order confirmation and next steps. When customers abandon checkout without paying, they land on your [`CheckoutSettings.CancelURL`](https://pkg.go.dev/github.com/inttegro/inttegro-sdk-go/v11@v11.0.1/checkout#Settings.CancelURL)  where you can show incomplete order details or offer alternative payment methods.

### Add line item details

```go
order.CreateParams{
  LineItems: []order.LineItemParams{
    {
      Product: &order.ProductLineItemParams{
        Name: "Utility Sneakers",
        About: "Size: 42 | Color: Black",
      },
    },
  },
}
```

Appears below product name on invoice.

### Update branding

Change logo, business name, and colors in the [Inttegro dashboard](https://dashboard.inttegro.com) under **Settings → Branding**. Applies to all new invoices instantly.

See [Checkout customization](https://studio.inttegro.com/machine/go/products/checkout.md#customization) for more options.

## Common patterns

**Subscriptions:** Create new order each cycle, send new invoice URL.

Deposits:  Create separate orders for deposit and balance. Link them with a shared value in [`CustomData`](https://pkg.go.dev/github.com/inttegro/inttegro-sdk-go/v11@v11.0.1/order#CreateParams.CustomData). **Multi-currency:** Create one order per currency.

Order limits:  Each order can contain up to 64 line items. Order totals are capped at 100,000 for [`money.GHS`](https://pkg.go.dev/github.com/inttegro/inttegro-sdk-go/v11@v11.0.1/money#GHS)  and 50,000 for all other supported currencies, measured in the currency's smallest unit. Contact [support](mailto:support@inttegro.com)  if you need these limits increased. See [Common patterns](https://studio.inttegro.com/machine/go/products/checkout.md#common-patterns) for implementation details.

## Next steps

- **[Inttegro Checkout](https://studio.inttegro.com/machine/go/products/checkout.md)** — Why Inttegro Checkout works better than custom checkout
- **[Orders](https://studio.inttegro.com/machine/go/api/orders.md)** — Complete order API reference
- **[Accept a payment](https://studio.inttegro.com/machine/go/guides/accept-a-payment.md)** — Build custom checkout (advanced)
