> This page is for Afterpay Online Developer, version Main (default).
> For other versions, use one of these documentation indexes:
> - Main (default): https://developers.afterpay.com/afterpay-online-developer/main/llms.txt
> - v1: https://developers.afterpay.com/afterpay-online-developer/v-1/llms.txt
> - Chinese: https://developers.afterpay.com/afterpay-online-developer/chinese/llms.txt

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

# Get Configuration

GET https://global-api-sandbox.afterpay.com/v2/configuration

This endpoint is used to retrieve the merchant's applicable payment limits.

A request to [Create Checkout](/afterpay-online-developer/api-reference/reference/checkouts/create-checkout-1) may be rejected if the order amount is not between the `minimumAmount` and `maximumAmount` (inclusive).

Afterpay merchant configuration does not change frequently. For this reason, the configuration response will include Cache-Control headers in order to minimise network round trips when using a modern HTTP client. Get configuration should be called on a fixed schedule, preferably once per day.

**Connection Timeouts**
| Timeout | Time (Seconds) |
|---------|----------------|
| Open    | 10             |
| Read    | 20             |

**Example request**

`GET /v2/configuration?include=publicid&include=consumerlending&include=paybyinstallment`

Reference: https://developers.afterpay.com/afterpay-online-developer/api-reference/reference/configuration/get-configuration

## Authentication

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

## Servers

- `https://global-api-sandbox.afterpay.com` (Sandbox, default)
- `https://global-api.afterpay.com` (Production)

## Request

### Query parameters

- `include` (list of string, optional) — Repeat this query parameter to include optional configuration fields in the response. The endpoint always returns `minimumAmount` and `maximumAmount`. Supported values: - `publicid`: include `publicId`, the merchant public identifier (MPID) when one exists. - `consumerlending`: include `consumerLending`, which indicates whether consumer lending is enabled and, when enabled, the eligible minimum and maximum order amounts. - `paybyinstallment`: include `payByInstallment`, the configured pay by installment minimum and maximum eligible order amounts.

### Headers

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

## Response

### 200

Returns a [configuration](/afterpay-online-developer/api-reference/reference/configuration/schemas/merchant-limit) object containing the following attributes. | Attribute | Type | Description | |-----------|----------------| ----------- | | `minimumAmount` | Money | Minimum order amount. Note: This attribute may not be included if the Merchant account has no minimum order amount. | `maximumAmount` | Money | Maximum order amount. | `publicId` | string | Merchant public identifier (MPID). Returned when `include=publicid` is requested and a public mapping exists for the merchant. | `consumerLending` | object | Returned when `include=consumerlending` is requested. Contains `enabled` and, when enabled, `minimumAmount` and `maximumAmount` for consumer lending. | `payByInstallment` | object | Returned when `include=paybyinstallment` is requested and pay by installment is configured for the merchant. Contains `minimumAmount` and `maximumAmount`.

- `minimumAmount` (Money, optional) — Object containing amount and currency. Where a Money object is included in an API request, it will be validated according to the specification above. Invalid Money objects will trigger a **422 Unprocessable Entity response**. The following is a list of common examples: | Example | errorCode | message | | ------------------------------------------------------------------------------- | ---------------------- | ------------------------------------------------------------------------- | | `amount` is omitted or null | invalid\_object | \{Money object}.amount Amount field required | | `amount` has more than 2 decimal places | invalid\_object amount | must be a valid ISO 4217 format value | | `amount` includes a thousands separator comma, for example: "1,000" | invalid\_amount | Amount must be a valid ISO 4217 format value | | `amount` is not a decimal number, for example: "FREE", "\$2" or an empty string | invalid\_object | \{Money object}.amount Amount field must be a valid ISO 4217 format value | | `currency` is omitted or null | invalid\_object | \{Money object}.currency Currency field required | | `currency` is not a valid currency code, not all uppercase or an empty string | invalid\_object | \{Money object}.currency Currency not supported for this merchant | | `currency` is supported by Afterpay, but not valid for the Merchant account | unsupported\_currency | An error occurred |
- `maximumAmount` (Money, optional) — Object containing amount and currency. Where a Money object is included in an API request, it will be validated according to the specification above. Invalid Money objects will trigger a **422 Unprocessable Entity response**. The following is a list of common examples: | Example | errorCode | message | | ------------------------------------------------------------------------------- | ---------------------- | ------------------------------------------------------------------------- | | `amount` is omitted or null | invalid\_object | \{Money object}.amount Amount field required | | `amount` has more than 2 decimal places | invalid\_object amount | must be a valid ISO 4217 format value | | `amount` includes a thousands separator comma, for example: "1,000" | invalid\_amount | Amount must be a valid ISO 4217 format value | | `amount` is not a decimal number, for example: "FREE", "\$2" or an empty string | invalid\_object | \{Money object}.amount Amount field must be a valid ISO 4217 format value | | `currency` is omitted or null | invalid\_object | \{Money object}.currency Currency field required | | `currency` is not a valid currency code, not all uppercase or an empty string | invalid\_object | \{Money object}.currency Currency not supported for this merchant | | `currency` is supported by Afterpay, but not valid for the Merchant account | unsupported\_currency | An error occurred |
- `publicId` (string, optional) — Merchant public identifier (MPID). Returned only when `include=publicid` is requested and a public mapping exists for the merchant.
- `consumerLending` (MerchantLimitConsumerLending, optional) — Returned only when `include=consumerlending` is requested. Indicates whether consumer lending is enabled for the merchant's online channel and, when enabled, the eligible order amount range.
- `payByInstallment` (MerchantLimitPayByInstallment, optional) — Returned only when `include=paybyinstallment` is requested and pay by installment is configured for the merchant. Contains the eligible order amount range for pay by installment.

## Errors

### 401 Unauthorized Error

Unauthorized

- `errorCode` (string, optional)
- `errorId` (string, optional)
- `message` (string, optional)
- `httpStatusCode` (integer, optional)

## Types

### Money

Object containing amount and currency. Where a Money object is included in an API request, it will be validated according to the specification above. Invalid Money objects will trigger a **422 Unprocessable Entity response**. The following is a list of common examples: | Example | errorCode | message | | ------------------------------------------------------------------------------- | ---------------------- | ------------------------------------------------------------------------- | | `amount` is omitted or null | invalid\_object | \{Money object}.amount Amount field required | | `amount` has more than 2 decimal places | invalid\_object amount | must be a valid ISO 4217 format value | | `amount` includes a thousands separator comma, for example: "1,000" | invalid\_amount | Amount must be a valid ISO 4217 format value | | `amount` is not a decimal number, for example: "FREE", "\$2" or an empty string | invalid\_object | \{Money object}.amount Amount field must be a valid ISO 4217 format value | | `currency` is omitted or null | invalid\_object | \{Money object}.currency Currency field required | | `currency` is not a valid currency code, not all uppercase or an empty string | invalid\_object | \{Money object}.currency Currency not supported for this merchant | | `currency` is supported by Afterpay, but not valid for the Merchant account | unsupported\_currency | An error occurred |

- `amount` (string, required) — The amount as a string representation of a decimal number, rounded to 2 decimal places.
- `currency` (enum, required) — The currency in ISO 4217 format. The value provided must correspond to the currency of the merchant account making the request.
  - Allowed values: `AUD`, `NZD`, `USD`, `CAD`, `GBP`

### MerchantLimitConsumerLending

Returned only when `include=consumerlending` is requested. Indicates whether consumer lending is enabled for the merchant's online channel and, when enabled, the eligible order amount range.

- `enabled` (boolean, optional) — Whether consumer lending is enabled for this merchant.
- `minimumAmount` (Money, optional) — Minimum eligible order amount when consumer lending is enabled.
- `maximumAmount` (Money, optional) — Maximum eligible order amount when consumer lending is enabled.

### MerchantLimitPayByInstallment

Returned only when `include=paybyinstallment` is requested and pay by installment is configured for the merchant. Contains the eligible order amount range for pay by installment.

- `minimumAmount` (Money, optional) — Minimum eligible order amount for pay by installment.
- `maximumAmount` (Money, optional) — Maximum eligible order amount for pay by installment.

## Examples

**Response**

```json
{
  "minimumAmount": {
    "amount": "1.01",
    "currency": "AUD"
  },
  "maximumAmount": {
    "amount": "1000.00",
    "currency": "AUD"
  },
  "publicId": "6956dfdf-c4f6-4881-aa49-230a9454d39b",
  "consumerLending": {
    "enabled": true,
    "minimumAmount": {
      "amount": "10.00",
      "currency": "AUD"
    },
    "maximumAmount": {
      "amount": "20.00",
      "currency": "AUD"
    }
  },
  "payByInstallment": {
    "minimumAmount": {
      "amount": "1.00",
      "currency": "AUD"
    },
    "maximumAmount": {
      "amount": "10.00",
      "currency": "AUD"
    }
  }
}
```

**SDK Code**

```python Retrieved
import requests

url = "https://global-api-sandbox.afterpay.com/v2/configuration"

querystring = {"include":"[\"publicid\",\"consumerlending\",\"paybyinstallment\"]"}

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

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

print(response.json())
```

```javascript Retrieved
const url = 'https://global-api-sandbox.afterpay.com/v2/configuration?include=%5B%22publicid%22%2C%22consumerlending%22%2C%22paybyinstallment%22%5D';
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 Retrieved
package main

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

func main() {

	url := "https://global-api-sandbox.afterpay.com/v2/configuration?include=%5B%22publicid%22%2C%22consumerlending%22%2C%22paybyinstallment%22%5D"

	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 Retrieved
require 'uri'
require 'net/http'

url = URI("https://global-api-sandbox.afterpay.com/v2/configuration?include=%5B%22publicid%22%2C%22consumerlending%22%2C%22paybyinstallment%22%5D")

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 Retrieved
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://global-api-sandbox.afterpay.com/v2/configuration?include=%5B%22publicid%22%2C%22consumerlending%22%2C%22paybyinstallment%22%5D")
  .header("User-Agent", "User-Agent")
  .basicAuth("<username>", "<password>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://global-api-sandbox.afterpay.com/v2/configuration?include=%5B%22publicid%22%2C%22consumerlending%22%2C%22paybyinstallment%22%5D', [
  'headers' => [
    'User-Agent' => 'User-Agent',
  ],
    'auth' => ['<username>', '<password>'],
]);

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

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

var client = new RestClient("https://global-api-sandbox.afterpay.com/v2/configuration?include=%5B%22publicid%22%2C%22consumerlending%22%2C%22paybyinstallment%22%5D");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<password>");
var request = new RestRequest(Method.GET);
request.AddHeader("User-Agent", "User-Agent");

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

```swift Retrieved
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/v2/configuration?include=%5B%22publicid%22%2C%22consumerlending%22%2C%22paybyinstallment%22%5D")! 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()
```