> This page is for version v1.
> For other versions, use one of these documentation indexes:
> - v2 (default): https://developers.clearpay.co.uk/v-2/llms.txt
> - v1: https://developers.clearpay.co.uk/v-1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.clearpay.co.uk/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.clearpay.co.uk/_mcp/server.

# Get Order

GET https://global-api-sandbox.afterpay.com/v1/orders/{token}

This endpoint retrieves an incomplete individual order by token.

Order details are only retained in this temporary format for up to 60 minutes. If an order token expires or has a payment captured against it, it can no longer be retrieved from this endpoint.

To retrieve a completed payment along with its associated order details, see [Get Payment By Token](/v-1/api-reference/online-api/payments/get-payment-by-token).

## Successful Response (200)

If an order belonging to the authenticated merchant account is found, returns the order details in response. Fields that were not included in the original [Create Order](/v-1/api-reference/online-api/orders/create-order) request may not be included in any corresponding Get Order request.

| Attribute                       | Type                                             | Description                                                                                                                     |
| :------------------------------ | :----------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------ |
| `expires`                       | string                                           | The UTC timestamp of when the order token will expire, in [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm) format. |
| `token`                         | string                                           | Order token to be used to complete payment.                                                                                     |
| `totalAmount`                   | [Money](/v-1/money-object)                       | Total amount for order to be charged to consumer.                                                                               |
| `consumer`                      | [Consumer](/v-1/consumer-object)                 | The consumer requesting the order.                                                                                              |
| `billing`                       | [Contact](/v-1/contact-object)                   | Billing address.                                                                                                                |
| `shipping`                      | [Contact](/v-1/contact-object)                   | Shipping address.                                                                                                               |
| `courier`                       | [Shipping Courier](/v-1/shipping-courier-object) | Shipping courier details.                                                                                                       |
| `description`                   | string                                           | A description of the order.                                                                                                     |
| `merchant`.`redirectConfirmUrl` | string                                           | The consumer is redirected to this URL on confirmation.                                                                         |
| `merchant`.`redirectCancelUrl`  | string                                           | The consumer to redirected to this URL if the payment process is cancelled.                                                     |
| `paymentType`                   | string                                           | "PAY\_BY\_INSTALLMENT"                                                                                                          |
| `merchantReference`             | string                                           | The merchant's id/reference that this order corresponds to.                                                                     |
| `items`                         | [Item](/v-1/item-object)\[]                      | An array of order items.                                                                                                        |
| `discounts`                     | [Discount](/v-1/discount-object)\[]              | An array of discounts.                                                                                                          |
| `shippingAmount`                | [Money](/v-1/money-object)                       | The shipping amount.                                                                                                            |
| `taxAmount`                     | [Money](/v-1/money-object)                       | The included tax amount after applying all discounts.                                                                           |

## Connection Timeouts

| Timeout | Time (Seconds) |
| :------ | :------------- |
| Open    | 10             |
| Read    | 20             |

## Errors

In addition to the [GET Errors](/v-1/get-errors) applicable to all GET endpoints, the following errors are specific to Get Order:

| HTTP Status Code   | errorCode   | Description                                                        |
| :----------------- | :---------- | :----------------------------------------------------------------- |
| **404**  Not Found | `not_found` | The order token is invalid, expired, completed, or does not exist. |

Reference: https://developers.clearpay.co.uk/v-1/api-reference/get-order

## Authentication

- `Authorization` header (basic auth, required) — Basic authentication of the form `Basic <base64(username:password)>`.

## Request

### Path parameters

- `token` (string, required) — The token of the order to be retrieved.

### Headers

- `Accept` (string, optional, default: application/json)

## Examples

**SDK Code**

```python
import requests

url = "https://global-api-sandbox.afterpay.com/v1/orders/token"

headers = {
    "User-Agent": "User-Agent"
}

response = requests.get(url, headers=headers, auth=("<username>", "<password>"))

print(response.json())
```

```javascript
const url = 'https://global-api-sandbox.afterpay.com/v1/orders/token';
const credentials = btoa("<username>:<password>");

const options = {
  method: 'GET',
  headers: {'User-Agent': 'User-Agent', Authorization: `Basic ${credentials}`}
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

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

func main() {

	url := "https://global-api-sandbox.afterpay.com/v1/orders/token"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("User-Agent", "User-Agent")
	req.SetBasicAuth("<username>", "<password>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://global-api-sandbox.afterpay.com/v1/orders/token")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["User-Agent"] = 'User-Agent'
request.basic_auth("<username>", "<password>")

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://global-api-sandbox.afterpay.com/v1/orders/token")
  .header("User-Agent", "User-Agent")
  .basicAuth("<username>", "<password>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://global-api-sandbox.afterpay.com/v1/orders/token', [
  'headers' => [
    'User-Agent' => 'User-Agent',
  ],
    'auth' => ['<username>', '<password>'],
]);

echo $response->getBody();
```

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://global-api-sandbox.afterpay.com/v1/orders/token");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<password>");
var request = new RestRequest(Method.GET);
request.AddHeader("User-Agent", "User-Agent");

IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let credentials = Data("<username>:<password>".utf8).base64EncodedString()

let headers = [
  "User-Agent": "User-Agent",
  "Authorization": "Basic \(credentials)"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://global-api-sandbox.afterpay.com/v1/orders/token")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```