> This is Payabli documentation. For a complete page index, fetch https://docs.payabli.com/llms.txt — append .md to any page URL for lightweight markdown. For section-level indexes, query parameters, and other AI-optimized access methods, see https://docs.payabli.com/ai-agents.md

# Configure Apple Pay for org

POST https://api-sandbox.payabli.com/api/Wallet/applepay/configure-organization
Content-Type: application/json

Configure and activate Apple Pay for a Payabli organization

Reference: https://docs.payabli.com/developers/api-reference/wallet/applepay/applepay-configure-organization

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.
- `requestToken` header (required) — Long-lived API token sent in the `requestToken` header. See [API token authentication](/developers/api-tokens).

## Servers

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

## Request

### Body (application/json)

This endpoint expects a ConfigureOrganizationRequestApplePay.

- `cascade` (boolean, optional) — When `true`, the wallet service configuration cascades to all paypoints and suborganizations belonging to the parent entity.
- `isEnabled` (boolean, optional) — When `true`, the service is enabled.
- `orgId` (long, optional) — Organization ID for the target organization.

## Response

### 200

Success

- `responseText` (string, required) — Response text for operation: 'Success' or 'Declined'.
- `isSuccess` (boolean, optional) — Boolean indicating whether the operation was successful. A `true` value indicates success. A `false` value indicates failure.
- `pageIdentifier` (string, optional) — Auxiliary validation used internally by payment pages and components.
- `responseCode` (integer, optional) — Code for the response. Learn more in [API Response Codes](/developers/api-reference/api-responses).
- `responseData` (ApplePayOrganizationUpdateData, optional)

## Errors

### 400 Bad Request Error

Bad request / invalid data.

- `isSuccess` (boolean, required) — Always `false` for error responses.
- `responseText` (string, required) — Error text describing what went wrong.
- `responseCode` (integer, optional) — Code for the response. Learn more in [API Response Codes](/developers/api-reference/api-responses).
- `responseData` (PayabliErrorBodyResponseData, optional) — Object with detailed error context.

### 401 Unauthorized Error

Unauthorized request.

- `isSuccess` (boolean, required) — Always `false` for error responses.
- `responseText` (string, required) — Error text describing what went wrong.
- `responseCode` (integer, optional) — Code for the response. Learn more in [API Response Codes](/developers/api-reference/api-responses).
- `responseData` (PayabliErrorBodyResponseData, optional) — Object with detailed error context.

### 500 Internal Server Error

Internal server error.

- `isSuccess` (boolean, required) — Always `false` for error responses.
- `responseText` (string, required) — Error text describing what went wrong.
- `responseCode` (integer, optional) — Code for the response. Learn more in [API Response Codes](/developers/api-reference/api-responses).
- `responseData` (PayabliErrorBodyResponseData, optional) — Object with detailed error context.

### 503 Service Unavailable Error

Database connection error.

- `isSuccess` (boolean, required) — Always `false` for error responses.
- `responseText` (string, required) — Error text describing what went wrong.
- `responseCode` (integer, optional) — Code for the response. Learn more in [API Response Codes](/developers/api-reference/api-responses).
- `responseData` (PayabliErrorBodyResponseData, optional) — Object with detailed error context.

## Types

### ApplePayOrganizationUpdateData

- `createdAt` (datetime, optional) — Timestamp of when record was created, in UTC.
- `id` (string, optional) — Internal ID for the Apple Pay organization update.
- `jobId` (string, optional) — The cascade process ID.
- `jobStatus` (enum, optional) — The cascade process status.
  - Allowed values: `in_progress`, `completed`, `failed`
- `organizationId` (long, optional) — Organization ID for the target organization.
- `type` (string, optional) — The record type, in this context it will always be `ApplePayOrganizationUpdate`.
- `updatedAt` (datetime, optional) — Timestamp of when record was last updated, in UTC.
- `updates` (OrganizationUpdates, optional)

### PayabliErrorBodyResponseData

Object with detailed error context.

- `explanation` (string, optional) — Human-readable explanation of what happened.
- `todoAction` (string, optional) — Suggested resolution.

### OrganizationUpdates

- `cascade` (boolean, optional) — When `true`, the wallet service configuration cascades to all paypoints and suborganizations belonging to the parent entity.
- `isEnabled` (boolean, optional) — When `true`, wallet service is enabled.

## Examples

**Request**

```json
{
  "cascade": true,
  "isEnabled": true,
  "orgId": 900123
}
```

**Response**

```json
{
  "responseText": "Success",
  "isSuccess": true,
  "pageIdentifier": "null",
  "responseCode": 1,
  "responseData": {
    "createdAt": "2022-07-01T15:00:01Z",
    "id": "id",
    "jobId": "445865",
    "jobStatus": "completed",
    "organizationId": 901,
    "type": "type",
    "updatedAt": "2022-07-01T15:00:01Z",
    "updates": {
      "cascade": true,
      "isEnabled": true
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://api-sandbox.payabli.com/api/Wallet/applepay/configure-organization"

payload = {
    "cascade": True,
    "isEnabled": True,
    "orgId": 900123
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api-sandbox.payabli.com/api/Wallet/applepay/configure-organization';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"cascade":true,"isEnabled":true,"orgId":900123}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api-sandbox.payabli.com/api/Wallet/applepay/configure-organization"

	payload := strings.NewReader("{\n  \"cascade\": true,\n  \"isEnabled\": true,\n  \"orgId\": 900123\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	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://api-sandbox.payabli.com/api/Wallet/applepay/configure-organization")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"cascade\": true,\n  \"isEnabled\": true,\n  \"orgId\": 900123\n}"

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.post("https://api-sandbox.payabli.com/api/Wallet/applepay/configure-organization")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"cascade\": true,\n  \"isEnabled\": true,\n  \"orgId\": 900123\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api-sandbox.payabli.com/api/Wallet/applepay/configure-organization', [
  'body' => '{
  "cascade": true,
  "isEnabled": true,
  "orgId": 900123
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api-sandbox.payabli.com/api/Wallet/applepay/configure-organization");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"cascade\": true,\n  \"isEnabled\": true,\n  \"orgId\": 900123\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "cascade": true,
  "isEnabled": true,
  "orgId": 900123
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/Wallet/applepay/configure-organization")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```