# Retrieve a checkout

`GET https://api.weavpayments.com/v1/checkouts/{reference_id}`

Reads one checkout. Use it to confirm it was paid, for example when your customer lands on your `success_url`.

A checkout that belongs to another merchant, or to the other mode, returns `404`.

## Path parameters

- `reference_id` (string, required)

## Headers

- `Authorization` (string, required): `Bearer` plus your API key. See [Authentication](https://docs.weavpayments.com/authentication).

## Responses

### 200 OK

The checkout.

What `data` holds:

- `checkout` (object)
  - `reference_id` (string)
  - `external_reference_id` (string | null)
  - `type` (string): One of: `ORDER`, `AMOUNT`.
  - `status` (string): One of: `OPEN`, `COMPLETED`, `EXPIRED`, `CANCELLED`.
  - `currency` (string): ISO 4217. PHP today; more as they're enabled for your account. One of: `PHP`.
  - `amount` (number): The total, in pesos.
  - `description` (string | null)
  - `items` (array of objects)
    - `name` (string, required): Up to 255 characters.
    - `quantity` (integer, required): At least 1. At most 9999.
    - `unit_amount` (number, required): Pesos, as a JSON number.
    - `amount` (number): `quantity` × `unit_amount`.
  - `channels` (array of strings | null): One of: `QR_PH`, `GCASH`, `MAYA`, `CARD`, `PAY_AND_GO`, `PALAWANPAY`, `BAYAD`.
  - `qr_ph_apps` (array of strings | null)
  - `customer` (object)
    - `id` (string | null): Your ID for the customer, with `save_payment_method`.
    - `name` (string | null)
    - `email` (string | null)
    - `mobile_no` (string | null)
  - `save_payment_method` (boolean): A card payment also saves the card (the payment's `payment_method_id`).
  - `checkout_url` (string (uri))
  - `success_url` (string | null)
  - `cancel_url` (string | null)
  - `webhook_url` (string | null)
  - `payment` (any): The payment that paid it.
  - `expires_at` (string (date-time))
  - `completed_at` (string (date-time) | null)
  - `expired_at` (string (date-time) | null)
  - `cancelled_at` (string (date-time) | null)
  - `created_at` (string (date-time))
  - `updated_at` (string (date-time))

```json
{
    "code": "2000000",
    "success": true,
    "message": "OK",
    "data": {
        "checkout": {
            "reference_id": "CK4T8M2Q7X9KBA",
            "external_reference_id": "ORD-10541",
            "type": "ORDER",
            "status": "COMPLETED",
            "currency": "PHP",
            "amount": 1250.0,
            "description": null,
            "items": [
                {
                    "name": "Canvas tote bag",
                    "quantity": 1,
                    "unit_amount": 1000.0,
                    "amount": 1000.0
                },
                {
                    "name": "Canvas Strap",
                    "quantity": 2,
                    "unit_amount": 125.0,
                    "amount": 250.0
                }
            ],
            "channels": null,
            "qr_ph_apps": null,
            "customer": {
                "id": null,
                "name": null,
                "email": null,
                "mobile_no": null
            },
            "save_payment_method": false,
            "checkout_url": "https://pay.weavpayments.com/checkout/CK4T8M2Q7X9KBA",
            "success_url": "https://shop.example.com/orders/ORD-10541/thanks",
            "cancel_url": "https://shop.example.com/cart",
            "webhook_url": null,
            "payment": {
                "reference_id": "PY7K3Q9M2X4TBA",
                "checkout_reference_id": "CK4T8M2Q7X9KBA",
                "status": "COMPLETED",
                "…": "…"
            },
            "expires_at": "2026-10-27T10:12:00+08:00",
            "completed_at": "2026-10-26T10:15:40+08:00",
            "expired_at": null,
            "cancelled_at": null,
            "created_at": "2026-10-26T10:12:00+08:00",
            "updated_at": "2026-10-26T10:15:41+08:00"
        }
    }
}
```

### 401 Unauthorized

Missing, malformed or unknown API key (code 4010000).

```json
{
    "code": "4010000",
    "success": false,
    "message": "Missing or invalid API key."
}
```

### 403 Forbidden

The key can't make this request (code 4030000): an address outside the key's IP allowlist, a live key before your live mode is on, or an account that isn't active. A live key sent from a browser is refused (code 4030001): keep live keys on your server.

```json
{
    "code": "4030000",
    "success": false,
    "message": "Requests with this key must come from an address on its allowlist."
}
```

### 404 Not Found

Not found in this mode for your account (code 4040000).

```json
{
    "code": "4040000",
    "success": false,
    "message": "Not found."
}
```

## Examples

cURL:

```shell
curl -X GET https://api.weavpayments.com/v1/checkouts/CK4T8M2Q7X9KBA \
    -H "Authorization: Bearer $WEAV_API_KEY"
```

Node.js:

```js
const url = 'https://api.weavpayments.com/v1/checkouts/CK4T8M2Q7X9KBA';
const response = await fetch(url, {
    method: 'GET',
    headers: {
        Authorization: `Bearer ${process.env.WEAV_API_KEY}`,
    },
});

const result = await response.json();
```

JavaScript:

```js
import axios from 'axios';

const response = await axios.request({
    method: 'get',
    url: 'https://api.weavpayments.com/v1/checkouts/CK4T8M2Q7X9KBA',
    headers: {
        Authorization: `Bearer ${process.env.WEAV_API_KEY}`,
    },
    // Read error answers too: their body has the error code.
    validateStatus: () => true,
});

const result = response.data;
```

PHP:

```php
use Illuminate\Support\Facades\Http;

$response = Http::withToken(config('services.weav.key'))
    ->get('https://api.weavpayments.com/v1/checkouts/CK4T8M2Q7X9KBA');

$result = $response->json();
```

Python:

```python
import os
import requests

response = requests.get(
    "https://api.weavpayments.com/v1/checkouts/CK4T8M2Q7X9KBA",
    headers={
        "Authorization": f"Bearer {os.environ['WEAV_API_KEY']}",
    },
    timeout=30,
)

result = response.json()
```

Go:

```go
package main

import (
    "fmt"
    "io"
    "net/http"
    "os"
)

func main() {
    req, err := http.NewRequest("GET", "https://api.weavpayments.com/v1/checkouts/CK4T8M2Q7X9KBA", nil)
    if err != nil {
        panic(err)
    }
    req.Header.Set("Authorization", "Bearer "+os.Getenv("WEAV_API_KEY"))

    res, err := http.DefaultClient.Do(req)
    if err != nil {
        panic(err)
    }
    defer res.Body.Close()

    result, err := io.ReadAll(res.Body)
    if err != nil {
        panic(err)
    }
    fmt.Println(res.Status, string(result))
}
```

Rust:

```rust
// Cargo.toml: reqwest = { version = "0.12", features = ["blocking", "json"] }, serde_json = "1"
fn main() -> Result<(), Box<dyn std::error::Error>> {
    let key = std::env::var("WEAV_API_KEY")?;

    let response = reqwest::blocking::Client::new()
        .get("https://api.weavpayments.com/v1/checkouts/CK4T8M2Q7X9KBA")
        .bearer_auth(key)
        .send()?;

    let status = response.status();
    let result: serde_json::Value = response.json()?;
    println!("{status} {result:#}");
    Ok(())
}
```

Java:

```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class WeavExample {
    public static void main(String[] args) throws Exception {
        String url = "https://api.weavpayments.com/v1/checkouts/CK4T8M2Q7X9KBA";
        HttpRequest request =
                HttpRequest.newBuilder()
                        .uri(URI.create(url))
                        .header("Authorization", "Bearer " + System.getenv("WEAV_API_KEY"))
                        .GET()
                        .build();

        HttpResponse<String> response =
                HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.statusCode() + " " + response.body());
    }
}
```
