# Documentation

Welcome to the comprehensive documentation for 1-CP Corporate Checkout - the leading payment solution designed specifically for corporate transactions and business expense management.

## 🚀 What is 1-CP Corporate Checkout?

1-CP Corporate Checkout transforms how businesses handle payments by providing a seamless, compliant, and feature-rich checkout experience. Our solution is built for companies that need more than just payment processing - we provide complete transaction lifecycle management, advanced reporting, and enterprise-grade security.

### Key Benefits

* **🏢 Corporate-First Design**: Built specifically for business transactions with features like cost center allocation, project tracking, and approval workflows
* **🌍 Global Payment Support**: Accept payments in 30+ currencies with local payment methods worldwide
* **📊 Advanced Reporting**: Real-time analytics, detailed transaction reporting, and customizable dashboards
* **🔒 Enterprise Security**: PCI DSS compliant with advanced fraud protection and encryption
* **⚡ Quick Integration**: Get started in minutes with our lightweight SDK and comprehensive APIs
* **🎨 Customizable Experience**: White-label solution that matches your brand and workflow

## 📚 Documentation Sections

### 🎯 Quick Start

* [**Getting Started**](/overview-and-getting-started/getting-started) - 5-minute integration guide
* [**Checkout Web SDK**](/integration-and-development/checkout-web-sdk) - Frontend integration reference
* [**Test Credentials**](/integration-and-development/testing/test-credentials) - Sandbox testing resources

### 🔧 Configuration & Setup

* [**Payment Configuration**](/configuration-and-setup/payment) - Configure payment methods and providers
  * [Receiving Payments](/configuration-and-setup/payment/receiving) - Accept customer payments
  * [Issuing Payments](/configuration-and-setup/payment/issuing) - Corporate card and virtual payment solutions
* [**Webhooks**](/configuration-and-setup/webhooks) - Real-time event notifications
* [**Users & Permissions**](/configuration-and-setup/users) - Access control and team management

### 📖 Reference Materials

* [**Currency Codes**](/reference-materials/currency-codes) - Supported currencies and minor units
* [**Tax Calculation**](/reference-materials/tax-calculation) - Tax processing and compliance

### 🧪 Testing & Certification

* [**Certification**](/integration-and-development/testing/certification) - Integration testing requirements
* [**Test Credentials**](/integration-and-development/testing/test-credentials) - Sandbox testing resources
* [**Error Messages**](/integration-and-development/testing/error-messages) - Troubleshooting and error handling

## 🌟 Use Cases

### Travel & Expense Management

Perfect for corporate travel booking platforms, expense management systems, and business travel agencies.

### E-commerce & Procurement

Ideal for B2B marketplaces, corporate procurement platforms, and business supply chain solutions.

### Professional Services

Great for consulting firms, legal services, and any business that needs detailed expense tracking and reporting.

## 🔧 Supported Payment Methods

### Card Payments

* **Credit/Debit Cards**: Visa, Mastercard, American Express, Discover, JCB, Diners Club
* **3D Secure**: Enhanced security for card transactions
* **Corporate Cards**: Specialized handling for business cards

### Digital Wallets

* **PayPal**: Integrated PayPal processing via Stripe
* **Bank Transfers**: Direct bank account payments
* **Corporate Accounts**: Virtual card solutions via AirPlus

### Regional Payment Methods

* **Europe**: SEPA, Sofort, iDEAL, Bancontact
* **Asia-Pacific**: China UnionPay, Local bank transfers
* **Americas**: ACH, Local bank networks

## 📊 Enterprise Features

### Advanced Reporting

* Real-time transaction monitoring
* Customizable reporting dashboards
* Export capabilities (CSV, PDF, Excel)
* Cost center and project tracking

### Compliance & Security

* PCI DSS compliant
* GDPR compliant data handling
* SOX compliance reporting
* Advanced fraud detection

### Integration Capabilities

* RESTful APIs with comprehensive documentation
* Webhook notifications for real-time updates
* SDK support for multiple programming languages
* White-label customization options

## 🆘 Support & Resources

### Documentation

* [**API Reference**](https://docs.one-cp.com/api-reference): Complete endpoint documentation with examples
* **Integration Guides**: Step-by-step tutorials for common scenarios
* **Best Practices**: Security, performance, and implementation guidelines

### Community & Support

* **📧 Email Support**: <support@one-cp.com>
* **📞 Phone Support**: Available for enterprise customers
* **📝 Status Page**: [status.1-cp.com](https://status.1-cp.com)

### Getting Help

* **Technical Issues**: Check our [Error Messages](/integration-and-development/testing/error-messages) guide
* **Integration Questions**: Review our [Getting Started](/overview-and-getting-started/getting-started) guide
* **Feature Requests**: Contact our product team
* **Security Concerns**: <security@one-cp.com>

## 📈 Performance & Scalability

### Performance Metrics

* **Average Response Time**: < 200ms
* **Uptime SLA**: 99.9% availability guarantee
* **Transaction Throughput**: 10,000+ transactions per minute
* **Global CDN**: Sub-100ms latency worldwide

### Scalability

* **Auto-scaling**: Handles traffic spikes automatically
* **Rate Limiting**: Fair usage policies with burst capacity
* **Caching**: Intelligent caching for optimal performance

***

## 🚀 Ready to Get Started?

1. [**Create an Account**](https://dash.1-cp.io) - Sign up for free staging environment
2. [**Follow Our Guide**](/overview-and-getting-started/getting-started) - Complete integration in 5 minutes
3. [**Test Your Integration**](/integration-and-development/testing) - Validate your setup
4. **Go Live** - Switch to production environment

Need assistance? Our integration team is here to help at <support@one-cp.com>


# Getting Started

Quick start guide to integrate 1-CP Corporate Checkout

Welcome to 1-CP Corporate Checkout! This guide will help you integrate our corporate payment solution into your application in just a few minutes.

## Overview

1-CP Corporate Checkout is a comprehensive payment solution designed specifically for corporate transactions. It provides:

* **Streamlined Corporate Purchasing**: Simplify business expense management
* **Multiple Payment Methods**: Support for cards, corporate accounts, and virtual payment solutions
* **Compliance & Reporting**: Built-in compliance features and detailed reporting
* **Global Currency Support**: Process payments in multiple currencies worldwide

## Prerequisites

Before you begin, ensure you have:

* [ ] **1-CP Account**: [Sign up](https://dash.1-cp.io) for a staging account
* [ ] **Business Unit Setup**: Configure your business unit in the dashboard
* [ ] **API Credentials**: Obtain your `client-id` and `client-secret`
* [ ] **Development Environment**: Node.js 14+ or any web development setup

## Quick Start (5 minutes)

### Step 1: Get Your Credentials

1. Log in to the [Staging Dashboard](https://dash.1-cp.io)
2. Navigate to **Config** → **Widget**
3. Create a new widget configuration
4. Copy your `client-id` and `client-secret`

### Step 2: Install the SDK

Choose your preferred installation method:

**NPM:**

```bash
npm install @one-cp/web-checkout
```

**CDN:**

```html
<script src="https://one-cp-public.s3.eu-central-1.amazonaws.com/init.min.js"></script>
```

### Step 3: Create Your First Transaction

**Backend (Create Transaction):**

```javascript
// Example using Node.js/Express
// For complete API documentation: https://docs.one-cp.com/api-reference
const response = await fetch("https://api.1-cp.io/v1/transactions/initialize", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${accessToken}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    title: "Hotel Booking",
    currency: "EUR",
    items: [
      {
        name: "Business Hotel Room",
        category: "ACCOMMODATION",
        price: 15000, // €150.00 in minor units
        quantity: {
          amount: 2,
          unit: "FLAT_FEE",
        },
      },
    ],
  }),
});

const { transactionID } = await response.json();
```

**Frontend (Initialize Checkout):**

```javascript
import { init } from "@one-cp/web-checkout";

// Initialize checkout
init({
  transactionID: "your-transaction-id",
  widgetID: "your-widget-id",
  config: {
    env: "sandbox", // Use 'production' for live transactions
    mode: "lightbox",
  },
  onSuccess: (data) => {
    console.log("Payment completed successfully!", data);
    // Handle successful payment
  },
  onError: (error) => {
    console.error("Payment failed:", error);
    // Handle payment errors
  },
});
```

### Step 4: Test Your Integration

Use our test credentials to verify your setup:

**Test Card Numbers:**

* Visa: `4242 4242 4242 4242`
* Mastercard: `5555 5555 5555 4444`
* CVV: `123`
* Expiry: Any future date

## Configuration Options

### Environment Setup

Configure your environment based on your needs:

```javascript
const config = {
  env: "sandbox", // 'sandbox' | 'production'
  mode: "lightbox", // 'lightbox' | 'inline'
  lang: "en", // 'en' | 'de'
  redirectURL: "https://yoursite.com/success",
};
```

### Payment Methods

Configure which payment methods to accept:

1. Navigate to **Dashboard** → **Payment Configuration**
2. Select your payment providers / acquirer
3. Configure payment method restrictions
4. Set up business unit mappings

### Webhook Configuration

Set up webhooks to receive real-time payment notifications:

1. Go to **Dashboard** → **Configurations** → **Connectors**
2. Create a new Webhook connector
3. Configure your endpoint URL
4. Select event triggers (create, update, complete, etc.)

## Common Integration Patterns

### E-commerce Integration

```javascript
// Add to your checkout flow
function initiatePayment(cartItems) {
  const transactionData = {
    title: "Purchase Order #12345",
    currency: "USD",
    items: cartItems.map((item) => ({
      name: item.name,
      category: item.category,
      price: item.price * 100, // Convert to minor units
      quantity: {
        amount: item.quantity,
        unit: "FLAT_FEE",
      },
    })),
  };

  // Create transaction via your backend
  createTransaction(transactionData).then(({ transactionID }) => {
    init({
      transactionID,
      widgetID: "your-widget-id",
      config: { env: "production" },
      onSuccess: handlePaymentSuccess,
      onError: handlePaymentError,
    });
  });
}
```

### Travel Booking Integration

```javascript
// Travel-specific transaction
const travelTransaction = {
  title: "Business Trip - Berlin",
  currency: "EUR",
  items: [
    {
      name: "Hotel Accommodation",
      category: "ACCOMMODATION",
      price: 25000, // €250.00
      accommodationType: "HOTEL",
      roomType: "SINGLE",
      period: {
        start: "2025-12-01T15:00:00Z",
        end: "2025-12-03T11:00:00Z",
      },
      location: {
        street: "Unter den Linden",
        house: "1",
        city: "Berlin",
        country: "Germany",
        postCode: "10117",
      },
    },
    {
      name: "Flight Ticket",
      category: "FLIGHT",
      price: 45000, // €450.00
      flightNumber: "LH441",
      departure: "FRA",
      destination: "TXL",
      serviceClass: "BUSINESS_CLASS",
    },
  ],
};
```

## Next Steps

Now that you have a basic integration running:

1. **Configure Payment Methods**: Set up your preferred payment providers
2. **Customize Appearance**: Brand the checkout experience with your colors and logo
3. **Set Up Reporting**: Configure webhooks and reporting connectors
4. **Test Thoroughly**: Use our comprehensive test scenarios
5. **Go Live**: Switch to production environment

## Need Help?

* **Documentation**: Browse our complete [API reference](https://docs.one-cp.com/api-reference) and guides
* **Test Scenarios**: Review our [certification test cases](/integration-and-development/testing/certification)
* **Support**: Contact our integration team at <support@one-cp.com>
* **Community**: Join our developer community forum

## Troubleshooting

### Common Issues

**Invalid Transaction ID**

* Ensure the transaction was created successfully
* Check that you're using the correct environment (sandbox/production)
* Verify your API credentials are valid

**Payment Method Not Available**

* Check your payment configuration in the dashboard
* Ensure the payment method is enabled for your business unit
* Verify currency compatibility

**Checkout Not Loading**

* Confirm the SDK is loaded correctly
* Check for JavaScript console errors
* Ensure the container element exists (for inline mode)

For more detailed troubleshooting, see our [Error Messages](/integration-and-development/testing/error-messages) reference.


# Web SDK Integration

1-CP Corporate Checkout Web SDK

The 1-CP Web SDK is a lightweight yet powerful JavaScript library that seamlessly integrates the 1-CP Corporate Checkout experience directly into your web applications. It's designed to streamline corporate purchasing, making it as effortless and intuitive as your favorite online shopping experience.

### Why choose the 1-CP Web SDK?

* **Seamless Integration:** Easily embed the 1-CP Corporate Checkout technology into your existing web applications, regardless of your tech stack.
* **Enhanced User Experience:** Provide your employees with a familiar, user-friendly checkout process that boosts adoption and satisfaction, leading to higher compliance.

### Usage

### Installation

You can install the 1-CP Web SDK via npm:

```bash
npm install @one-cp/web-checkout
```

Alternatively, you can include it directly in your HTML file using a script tag:

```html
<script src="https://one-cp-public.s3.eu-central-1.amazonaws.com/init.min.js"></script>
```

### Initialization

To integrate the 1-CP checkout into your web application, follow these steps:

1. Import or include the 1-CP Web SDK in your JavaScript file or HTML file.
2. Call the init function with the required parameters:

```ts
import { init } from "@one-cp/web-checkout";

// Initialize 1-CP checkout
init({
  transactionID: "transaction_id",
  widgetID: "your_widget_id",
  config: {
    env: "sandbox", // or 'production'
    mode: "lightbox", // or 'inline'
    containerID: "checkout-container", // optional, defaults to 'checkout-container'
    expand: false,
    viewOnly: false,
    redirectURL: "https://yoursite.com/success", // optional redirect after success
  },
  onSuccess: (data) => {
    // Callback function on successful transaction
    console.log("Transaction completed successfully", data);
  },
  onError: (message) => {
    // Callback function on transaction error
    console.error("Transaction failed:", message);
  },
  onClose: () => {
    // Callback function on iframe close
    console.log("Checkout iframe closed");
  },
});
```

#### Parameters

<table><thead><tr><th width="140.79998779296875">Parameter</th><th width="403.5999755859375">Description</th><th width="265">Type</th><th>Required</th></tr></thead><tbody><tr><td><code>transactionID</code></td><td>Unique ID for the transaction.</td><td><code>string</code></td><td>Yes</td></tr><tr><td><code>widgetID</code></td><td>ID of the widget associated with the transaction.</td><td><code>string</code></td><td>No</td></tr><tr><td><code>config</code></td><td>Configuration object for customizing the checkout.</td><td><code>OneCPCheckoutConfig</code></td><td>No</td></tr><tr><td><code>onSuccess</code></td><td>Callback function called on successful transaction.</td><td><code>(data: CheckoutInfo) => void</code></td><td>No</td></tr><tr><td><code>onError</code></td><td>Callback function called on transaction error.</td><td><code>(message: string) => void</code></td><td>No</td></tr><tr><td><code>onClose</code></td><td>Callback function called when the user closes the checkout <strong>without completing</strong> the payment (e.g. clicking the X button). This is <strong>not</strong> called after a successful payment.</td><td><code>() => void</code></td><td>No</td></tr></tbody></table>

#### Configuration Object

<table><thead><tr><th width="219.20001220703125">Parameter</th><th width="398.4000244140625">Description</th><th width="243.39990234375">Type</th><th>Default Value</th></tr></thead><tbody><tr><td><code>env</code></td><td>Environment for the checkout.</td><td><code>'sandbox' | 'production'</code></td><td><code>'sandbox'</code></td></tr><tr><td><code>mode</code></td><td>Mode of checkout display.</td><td><code>'lightbox' | 'inline'</code></td><td><code>'lightbox'</code></td></tr><tr><td><code>containerID</code></td><td>ID of the container element for inline mode.</td><td><code>string</code></td><td><code>'checkout-container'</code></td></tr><tr><td><code>expand</code></td><td>Whether to expand the checkout component.</td><td><code>boolean</code></td><td><code>false</code></td></tr><tr><td><code>viewOnly</code></td><td>Hide action buttons (view-only mode).</td><td><code>boolean</code></td><td><code>false</code></td></tr><tr><td><code>useTemplateData</code></td><td>Use template data when in view-only mode.</td><td><code>boolean</code></td><td><code>false</code></td></tr><tr><td><code>lang</code></td><td><a href="https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes">ISO 639 language code</a> for the checkout interface.</td><td><code>'en' | 'de'</code></td><td><code>'en'</code></td></tr><tr><td><code>redirectURL</code></td><td>URL to redirect to after successful transaction completion.</td><td><code>string</code></td><td>-</td></tr><tr><td><code>colors</code></td><td>Custom colors for the checkout interface.</td><td><code>object</code></td><td>See Colors section</td></tr><tr><td><code>logoURL</code></td><td>Custom logo URL for the provider.</td><td><code>string</code></td><td>-</td></tr><tr><td><code>hidePriceOverThumbnail</code></td><td>Hide/show price over thumbnail.</td><td><code>boolean</code></td><td><code>false</code></td></tr><tr><td><code>hideCo2Tag</code></td><td>Hide/show CO2 tag.</td><td><code>boolean</code></td><td><code>false</code></td></tr></tbody></table>

**Important Notes:**

* Passing a widget ID will override the `logoURL` parameter. If no logo is found in the widget configuration, the `logoURL` from the configuration will be used. If neither is available, a default company logo will be displayed.
* Passing a widget ID will override the `hidePriceOverThumbnail` and `hideCo2Tag` parameters.
* Setting a language will override the browser's default language. The language selector in the footer will not be shown. This ensures a consistent language experience for users, regardless of their browser settings.
* If `containerID` is not provided for inline mode, it defaults to `'checkout-container'`. Ensure a DOM element with this ID exists.

#### onSuccess Response Data

When a transaction is completed successfully, the `onSuccess` callback receives a `CheckoutInfo` object with the following structure:

```typescript
interface CheckoutInfo {
  reference: string;
  payment: {
    reference: string;
    provider: string;
  };
  customer: {
    firstName: string;
    lastName: string;
    email?: string;
    phone?: string;
    address?: Address;
  };
  beneficiary?: {
    firstName: string;
    lastName: string;
    email: string;
  };
  billing: {
    name?: string;
    email: string;
    address: Address;
    externalIds: {
      [key: string]: string;
    };
    identifiers: CompanyIdentifiers;
  };
  /**
   * Payment card data will be present if the payment method used is a card and the card details are available.
   * This property will be undefined if the payment was made using a non-card method, or if card data is not returned for security or compliance reasons.
   */
  card?: PaymentCardData;
  reporting?: Record<string, string | number>;
}

interface CompanyIdentifiers {
  VATIN: string;
  BIC?: string;
  DID?: string;
  GLN?: string;
  DUNS?: string;
  TIN?: string;
  LEI?: string;
  IATA?: string;
}

interface Address {
  street: string;
  house: string;
  city: string;
  country: string;
  zipCode: string;
}

interface PaymentCardData {
  fingerprint?: string;
  masked?: string;
  expiryMonth: string;
  expiryYear: string;
  cardHolder: {
    prefix?: string;
    title?: string;
    salutation?: string;
    first?: string;
    last?: string;
  };
  useType: "SINGLE" | "MULTIPLE";
  cardInfo?: {
    type: string;
    brand: string;
    usage: string;
    country: string;
    issuer: string;
  };
}
```

#### Handling the Success State

Understanding the flow after a successful transaction is crucial for creating a seamless user experience. The SDK simplifies this process by handling the post-success redirection for you via the **redirectURL** parameter.

#### The onSuccess Callback

This callback is fired immediately after the payment is successfully processed. It is the ideal place to update your application's state (e.g., clear a shopping cart, update internal order status ) without worrying about UI changes.

#### The redirectURL Parameter

This optional parameter gives you control over the post-checkout experience.

**1. If redirectURL is Provided (Recommended):**

After a successful transaction, the checkout UI will display a confirmation message with a 3-second countdown. Once the countdown finishes, the SDK will automatically redirect the user to the URL you provided. The `onSuccess` callback is fired when the payment completes — `onClose` is **not** called in this flow.

**2. If redirectURL is NOT Provided:**

The behavior depends on the mode.

**Lightbox Mode:** The checkout modal will close automatically after the 3-second countdown. The user will remain on your page.

**Inline Mode:** The success message will remain visible within its container. The user will not be redirected.

#### Color Customization

You can customize the appearance of the checkout interface by providing a `colors` object in the configuration:

<table><thead><tr><th width="248.60003662109375">Color Parameter</th><th width="430.60009765625">Description</th><th>Default Value</th></tr></thead><tbody><tr><td><code>lightbox-color</code></td><td>Lightbox overlay color.</td><td><code>#2e2f4690</code></td></tr><tr><td><code>primary-color</code></td><td>Main color for header text and buttons.</td><td><code>#0866b6</code></td></tr><tr><td><code>light-primary-text</code></td><td>Text color on primary color buttons and components.</td><td><code>#ffffff</code></td></tr><tr><td><code>primary-color-white</code></td><td>Main background color.</td><td><code>#ffffff</code></td></tr><tr><td><code>primary-color-light</code></td><td>Light gray background color.</td><td><code>#f9f9fb</code></td></tr><tr><td><code>dark-primary-text</code></td><td>Main text color.</td><td><code>#000000de</code></td></tr><tr><td><code>medium-color-shade</code></td><td>Color for disabled buttons and other disabled elements.</td><td><code>#b2b8cd</code></td></tr><tr><td><code>accent-color</code></td><td>Hover effects color for buttons and other elements.</td><td><code>#88c7fd</code></td></tr><tr><td><code>tertiary-color-shade-tint</code></td><td>Color for borders and checkboxes.</td><td><code>#d8e4e3</code></td></tr><tr><td><code>danger-color</code></td><td>Background color for alerts and validation form errors.</td><td><code>#eb445a</code></td></tr><tr><td><code>danger-color-text</code></td><td>Text color for error messages and alerts.</td><td><code>#eb445a</code></td></tr><tr><td><code>medium-color-gray</code></td><td>Border color for input fields.</td><td><code>#8d8d8d</code></td></tr></tbody></table>

**Note:** Passing a widget ID will override the color configuration.

### How to Obtain a Transaction ID

To initialize a checkout session, you need to obtain a transaction ID from the 1-CP API:

1. Your backend needs to call the `/initialize` endpoint of the 1-CP API.
2. To obtain `client-id` and `client-secret`, access the 1-CP Dashboard:
   * Navigate to **Config → Widget**
   * Create and configure your widget
   * You will receive the `client-id` and `client-secret` credentials

### Example Implementation

#### HTML Example

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>1-CP Checkout Example</title>
  </head>
  <body>
    <div id="checkout-container"></div>
    <script src="https://one-cp-public.s3.eu-central-1.amazonaws.com/init.min.js"></script>

    <script>
      const transactionID = await request('your-api-to-create-transaction');

      // Initialize 1-CP checkout
      OneCP.init({
        transactionID,
        widgetID: 'your_widget_id',
        config: {
          env: 'sandbox',
          mode: 'inline',
          containerID: 'checkout-container', // optional, defaults to 'checkout-container'
          expand: false,
          viewOnly: false,
          lang: 'de', // Set checkout interface to German
          redirectURL: 'https://yoursite.com/success' // optional redirect after success
        },
        onSuccess: (data) => {
          console.log('Transaction completed successfully', data);
        },
        onError: (message) => {
          console.error('Transaction failed:', message);
        },
        onClose: () => {
          console.log('Checkout iframe closed');
        }
      });
    </script>
  </body>
</html>
```

#### Cleanup and Memory Management

**The SDK handles cleanup automatically** when the checkout process completes normally. This includes:

* **Event Listener Cleanup**: Message event listeners are automatically removed when the checkout closes
* **DOM Cleanup**: Iframe elements and containers (in lightbox mode) are automatically removed
* **Style Restoration**: Original body overflow styles are restored in lightbox mode

**Cleanup Triggers:**

* When the user completes or cancels the checkout
* When a `redirectURL` is provided and the user is redirected after success
* When the iframe sends a 'close' message

**For Single-Page Applications (SPAs):** The automatic cleanup should prevent memory leaks in most scenarios. However, if you need to handle edge cases or force cleanup:

**Edge Case Considerations:**

1. **Unexpected Page Navigation**: If the user navigates away during checkout, cleanup may not trigger
2. **Manual iframe Removal**: If you remove iframe elements manually, ensure proper cleanup
3. **Multiple Rapid Initializations**: Allow previous checkout to complete before initializing a new one

**Best Practices for SPAs:**

* Let the normal checkout flow complete (don't manually interrupt)
* Wait for `onSuccess` or `onClose` before reinitializing — note that after a completed payment only `onSuccess` fires; `onClose` only fires when the user abandons the checkout
* Test your specific use cases to ensure proper cleanup

#### TypeScript Support

The SDK now includes comprehensive TypeScript definitions. All configuration options, callback parameters, and return types are fully typed for better development experience and type safety.


# 1-CP Corporate Checkout API


# 🚀 Overview

The 1-CP Corporate Checkout API provides comprehensive functionality for managing corporate travel and expense transactions. This RESTful API enables service providers to seamlessly integrate with the 1-CP platform for streamlined checkout processing, automated content detection, and complete transaction lifecycle management.

{% hint style="info" %}
**New to 1-CP?** Start with our Quick Start Guide to get up and running in minutes.
{% endhint %}


# ✨ Key Features

* 🔒 **Secure Authentication**: Industry-standard Basic Auth with widget ID and backend secret
* 💳 **Complete Transaction Management**: Full checkout lifecycle from creation to completion
* 🤖 **AI-Powered Detection**: Automatic extraction of booking information from documents
* 🔄 **Real-time Processing**: Instant transaction processing and status updates
* 📊 **Comprehensive Reporting**: Detailed analytics and transaction reporting
* 🛠️ **Developer Tools**: Testing utilities and debugging capabilities
* 🌍 **Multi-Currency Support**: Global transaction processing capabilities


# 🏃‍♂️ Quick Start Guide

{% tabs %}
{% tab title="1. Get Credentials" %}

1. Log into your 1-CP dashboard
2. Navigate to **API Settings**
3. Generate or retrieve your:
   * **Widget ID** (your username)
   * **Backend Secret** (your password)
4. Save these credentials securely
   {% endtab %}

{% tab title="2. Test Connection" %}

```bash
curl -X GET "https://api.1-cp.io/status" \
  -H "Authorization: Basic $(echo -n 'widget_id:backend_secret' | base64)"
```

Expected response:

```json
{
    "status": "ready",
    "provider": "your_provider_id"
}
```

{% endtab %}

{% tab title="3. Create Transaction" %}

```bash
curl -X POST "https://api.1-cp.io/initialize" \
  -H "Authorization: Basic $(echo -n 'widget_id:backend_secret' | base64)" \
  -H "Content-Type: application/json" \
  -d @transaction.json
```

See the transaction examples below for sample payloads.
{% endtab %}
{% endtabs %}


# 🔐 Authentication

All API endpoints require **HTTP Basic Authentication** using your 1-CP credentials.

#### Authentication Process

1. **Combine Credentials**: Format as `widget_id:backend_secret`
2. **Encode**: Convert to base64: `base64(widget_id:backend_secret)`
3. **Set Header**: `Authorization: Basic <base64_string>`

{% hint style="warning" %}
**Security Note**: Always use HTTPS in production and never expose your backend secret in client-side code.
{% endhint %}

#### Example Authentication

```javascript
// JavaScript example
const credentials = btoa('your_widget_id:your_backend_secret')
const headers = {
    Authorization: `Basic ${credentials}`,
    'Content-Type': 'application/json'
}
```

```python
# Python example
import base64
import requests

credentials = base64.b64encode('widget_id:backend_secret'.encode()).decode()
headers = {
    'Authorization': f'Basic {credentials}',
    'Content-Type': 'application/json'
}
```


# 📋 Corporate Checkout Schema

#### CorporateCheckout

This is the main object for creating a Corporate Checkout transaction. It includes all the information needed to process a transaction through the 1-CP platform.

| Property          | Type   | Required | Description                                                                                      |
| ----------------- | ------ | -------- | ------------------------------------------------------------------------------------------------ |
| refIDs            | Map    | No       | External identifiers associated with the CorporateCheckout.                                      |
| title             | string | Yes      | Title of the CorporateCheckout.                                                                  |
| currency          | string | Yes      | Currency code for the CorporateCheckout.                                                         |
| items             | array  | Yes      | List of items included in the CorporateCheckout.                                                 |
| attachments       | array  | No       | List of attachments associated with the CorporateCheckout.                                       |
| note              | string | No       | Additional notes about the CorporateCheckout. (Internal note only - not visible to the customer) |
| email             | object | No       | Email content Subject and recipients which will receive the contract email.                      |
| restrictedMethods | array  | No       | Payment methods that the provider has deactivated                                                |

**Item Object**

This is the basic item properties:

<table><thead><tr><th width="176">Property</th><th width="166">Type</th><th width="90" data-type="checkbox">Required</th><th width="386">Description</th></tr></thead><tbody><tr><td>stockId</td><td>string</td><td>false</td><td>Extenal Stock identifier for the item.</td></tr><tr><td>name</td><td>string</td><td>true</td><td>Name of the item.</td></tr><tr><td>category</td><td>enum</td><td>true</td><td>Item Category.</td></tr><tr><td>description</td><td>string</td><td>false</td><td>Description of the item.</td></tr><tr><td>price</td><td>number</td><td>true</td><td>Price of the item.</td></tr><tr><td>quantity</td><td><a href="https://docs.one-cp.com/checkout-api#item-quantity-object">Quantity</a></td><td>true</td><td>Quantity details of the item.</td></tr><tr><td>totalTax</td><td>number</td><td>false</td><td>Total tax applicable to the item. This value will be calculated based on the <code>taxes</code> in case it is not provided(exp. 10)</td></tr><tr><td>total</td><td>number</td><td>false</td><td>Total cost of the item including taxes. This value will be calculated based on the taxes and the <code>price</code> in case it is not provided(exp. 1350)</td></tr><tr><td>taxes</td><td>array of <a href="https://docs.one-cp.com/checkout-api#item-tax-object">Tax</a></td><td>false</td><td>List of taxes applicable to the item</td></tr><tr><td>co2</td><td>number</td><td>false</td><td>Carbon dioxide pollution.</td></tr><tr><td>cancellationPolicy</td><td>CancellationPolicy</td><td>false</td><td>cancellation policy applicable to the item.</td></tr></tbody></table>

{% hint style="danger" %}
There are nine types of items that need additional properties in addition to the basic properties.
{% endhint %}

{% tabs %}
{% tab title="Accommodation" %}

<table><thead><tr><th width="183">Property</th><th width="94">Type</th><th width="79" data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td>period</td><td>Period</td><td>true</td><td>Time period for which the item is valid.</td></tr><tr><td>location</td><td>Location</td><td>true</td><td>Location address.</td></tr><tr><td>locationName</td><td>string</td><td>false</td><td>Location name (property name)</td></tr><tr><td>accommodationType</td><td>enum</td><td>true</td><td>AccommodationType</td></tr><tr><td>roomType</td><td>enum</td><td>false</td><td>RoomType</td></tr></tbody></table>
{% endtab %}

{% tab title="Rail" %}

<table><thead><tr><th width="141">Property</th><th width="99">Type</th><th width="102" data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td>period</td><td>Period</td><td>true</td><td>Time period for which the item is valid.</td></tr><tr><td>departure</td><td>Location</td><td>true</td><td>Location address.</td></tr><tr><td>destination</td><td>Location</td><td>true</td><td>Location address.</td></tr><tr><td>serviceClass</td><td>enum</td><td>true</td><td><code>FIRST_CLASS</code>, <code>BUSINESS_CLASS</code>, <code>ECONOMY_CLASS</code>, <code>OTHER</code></td></tr></tbody></table>
{% endtab %}

{% tab title="Rental car" %}

<table><thead><tr><th width="190">Property</th><th width="98">Type</th><th width="94" data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td>period</td><td>Period</td><td>true</td><td>Time period for which the item is valid.</td></tr><tr><td>pickUpLocation</td><td>Location</td><td>true</td><td>Pick-up location.</td></tr><tr><td>dropOffLocation</td><td>Location</td><td>true</td><td>Drop off location.</td></tr><tr><td>classificationCode</td><td>string</td><td>false</td><td>Classification code</td></tr></tbody></table>
{% endtab %}

{% tab title="Taxi shuttle" %}

<table><thead><tr><th width="172">Property</th><th width="101">Type</th><th width="89" data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td>period</td><td>Period</td><td>true</td><td>Time period for which the item is valid.</td></tr><tr><td>pickUpLocation</td><td>Location</td><td>true</td><td>Pick-up location.</td></tr><tr><td>dropOffLocation</td><td>Location</td><td>true</td><td>Drop off location.</td></tr></tbody></table>
{% endtab %}

{% tab title="Flight" %}

<table><thead><tr><th width="146">Property</th><th width="82">Type</th><th width="87" data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td>period</td><td>Period</td><td>true</td><td>Time period for which the item is valid.</td></tr><tr><td>flightNumber</td><td>string</td><td>false</td><td>Flight number.</td></tr><tr><td>departure</td><td>string</td><td>true</td><td>Departure - 3-letter IATA airport code. e.g. FRA</td></tr><tr><td>destination</td><td>string</td><td>true</td><td>Destination - 3-letter IATA airport code. e.g. MUC</td></tr><tr><td>airline</td><td>string</td><td>true</td><td>Airline - 3-letter ICAO or 2-letter IATA airline code. e.g. LH</td></tr><tr><td>serviceClass</td><td>enum</td><td>true</td><td><code>FIRST_CLASS</code>, <code>BUSINESS_CLASS</code>, <code>ECONOMY_CLASS</code>, <code>OTHER</code></td></tr><tr><td>fareClass</td><td>string</td><td>false</td><td>Fare class</td></tr></tbody></table>
{% endtab %}

{% tab title="Parking" %}

<table><thead><tr><th width="97">Property</th><th width="86">Type</th><th width="115">Required</th><th>Description</th><th data-hidden>Example</th><th data-hidden>Default value</th></tr></thead><tbody><tr><td>period</td><td>Period</td><td>true</td><td>Time period for which the item is valid.</td><td></td><td></td></tr><tr><td>location</td><td>Location</td><td>true</td><td>Location address.</td><td></td><td></td></tr><tr><td>plateNumber</td><td>string</td><td>false</td><td>Plate number of the car</td><td>433453</td><td></td></tr></tbody></table>
{% endtab %}

{% tab title="Other Travel" %}

<table><thead><tr><th width="97">Property</th><th width="86">Type</th><th width="115">Required</th><th>Description</th><th data-hidden>Example</th><th data-hidden>Default value</th></tr></thead><tbody><tr><td>period</td><td>Period</td><td></td><td>Time period for which the item is valid.</td><td></td><td></td></tr></tbody></table>
{% endtab %}

{% tab title="Travel Agency" %}

<table><thead><tr><th width="97">Property</th><th width="86">Type</th><th width="115">Required</th><th>Description</th><th data-hidden>Example</th><th data-hidden>Default value</th></tr></thead><tbody><tr><td>period</td><td>Period</td><td></td><td>Time period for which the item is valid.</td><td></td><td></td></tr></tbody></table>
{% endtab %}

{% tab title="Public Transportation" %}

<table><thead><tr><th width="97">Property</th><th width="86">Type</th><th width="115">Required</th><th>Description</th><th data-hidden>Example</th><th data-hidden>Default value</th></tr></thead><tbody><tr><td>period</td><td>Period</td><td></td><td>Time period for which the item is valid.</td><td></td><td></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

{% hint style="info" %}
The items will be arranged in the order in which they appear. The first item is considered the main item.
{% endhint %}

#### Types

{% tabs %}
{% tab title="Category Type" %}

```
// Travel Categories
FLIGHT
RENTAL_CAR
TAXI_SHUTTLE
ACCOMMODATION
EVENT
SERVICE
PUBLIC_TRANSPORTATION
MICRO_MOBILITY
PARKING
FUEL
FEE
F_AND_B
OTHER
RAIL
CONFERENCE
TRAVEL_AGENCY
OTHER_TRAVEL

// Sales & Marketing Categories
ADVERTISING
MARKET_RESEARCH
CONFERENCE_NOT_TRAVEL
SUBSCRIPTION

// Research & Development Categories
LAP_SUPPLY
CONSULTING

// Technology & Subscriptions Categories
HARDWARE
SOFTWARE_AND_IT
SOFTWARE_SUBSCRIPTION
TELECOM

// General & Administrative Categories
OFFICE_SUPPLY
OFFICE_EQUIPMENT_AND_FURNITURE
RENT_AND_LEASE
UTILITIES
INSURANCE
LEGAL_FEE
ADMINISTRATIVE_SERVICE
RETAIL
```

{% endtab %}

{% tab title="Tax Type" %}

```
NET_PRICE
VAT
BED_TAX
CITY_HOTEL_FEES
COUNTRY_TAX
CITY_TAX
ENERGY_CHARGE
FEDERAL_TAX
GST
INCLUSION
LODGING_TAX
MAINTENANCE_FEE
OCCUPANCY_TAX
PACKAGE_RATE_FEE
ROOM_TAX
RESORT_FEES
SALES_TAX
STATE_PROVINCE_TAX
SURCHARGE
SERVICE_CHARGE
OTHER_TAX
TOURISM_TAX
```

{% endtab %}

{% tab title="Accommodation Type" %}

```
 RESORT
 HOSTEL
 HOTEL
 INN
 LODGE
 MOTEL
 LOVE_HOTEL
 KP_BUSINESS_HOTEL
 CAPSULE_HOTEL
 APARTMENT
 BED_BREAKFAST
 CAMPING
 CHALET
 BOAT
 FARM_STAY
 TENTED
 VILLA
 GUEST_HOUSE
 APART_HOTEL
 RIAD
 RYOKAN
 HOME_STAY
 HOLIDAY_HOME
 COUNTRY_HOUSE
 HOLIDAY_PARK
```

{% endtab %}

{% tab title="Room Type" %}

```
APARTMENT
QUADRUPLE
SUITE
TRIPLE
TWIN
DOUBLE
SINGLE
STUDIO
FAMILY
TWIN_DOUBLE
DORMITORY_ROOM
BEDINDORMITORY
BUNGALOW
CHALET
HOLIDAY_HOME
VILLA
MOBILE_HOME
TENT
```

{% endtab %}
{% endtabs %}

**Location Object**

<table><thead><tr><th width="119">Property</th><th width="91">Type</th><th width="99" data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td>street</td><td>string</td><td>false</td><td>Street name.</td></tr><tr><td>house</td><td>string</td><td>false</td><td>Number of Apartment.</td></tr><tr><td>zipCode</td><td>string</td><td>false</td><td>ZipCode.</td></tr><tr><td>city</td><td>string</td><td>true</td><td>City name.</td></tr><tr><td>country</td><td>string</td><td>true</td><td>Country name</td></tr><tr><td>lat</td><td>string</td><td>false</td><td>Latitude of the Location.</td></tr><tr><td>lng</td><td>string</td><td>false</td><td>Longitude of the Location.</td></tr></tbody></table>

{% hint style="danger" %}
Either street/house combination or latitude/longitude combination must be present
{% endhint %}

**Period Object**

<table><thead><tr><th width="111">Property</th><th width="98">Type</th><th width="89" data-type="checkbox">Required</th><th width="434">Description</th></tr></thead><tbody><tr><td>start</td><td>date time</td><td>false</td><td>Start Date/time using the ISO 8601 localized to the time zone at origin/ start.</td></tr><tr><td>end</td><td>date time</td><td>false</td><td>End Date/time using the ISO 8601 localized to the time zone at destination/ end.</td></tr></tbody></table>

**Item Quantity Object**

<table><thead><tr><th width="113">Property</th><th width="91">Type</th><th width="95" data-type="checkbox">Required</th><th width="492">Description</th></tr></thead><tbody><tr><td>amount</td><td>number</td><td>true</td><td>Amount of the quantity. Min is 1</td></tr><tr><td>unit</td><td>enum</td><td>false</td><td>Unit of the quantity : <code>FLAT_FEE</code>, <code>PER_HOUR</code>, <code>PER_DAY</code>, <code>PER_NIGHT</code>, <code>PER_WEEK</code>, <code>PER_MONTH</code>, <code>PER_YEAR</code>, <code>PER_PERSON</code> . Default value <code>FLAT_FEE</code></td></tr></tbody></table>

**Item Tax Object**

<table><thead><tr><th width="107">Property</th><th width="95">Type</th><th width="75" data-type="checkbox">Required</th><th width="504">Description</th></tr></thead><tbody><tr><td>type</td><td>enum</td><td>false</td><td>Type of the tax.see Tax type. Default <code>VAT</code></td></tr><tr><td>value</td><td>number</td><td>true</td><td>Value of the tax based on the unit used (if the unit provided is <code>AMOUNT</code>, we expect the value to be based on the currency used in the CorporateCheckout).</td></tr><tr><td>unit</td><td>enum</td><td>false</td><td>Unit of the tax value. <code>AMOUNT</code>, <code>PERCENT</code> . Default <code>PERCENT</code></td></tr><tr><td>basis</td><td>enum</td><td>false</td><td>Basis of the tax calculation: <code>FLAT_FEE</code>, <code>PER_QUANTITY</code>. Default <code>PER_QUANTITY</code></td></tr><tr><td>applyTo</td><td>enum</td><td>false</td><td>Indicates what the tax applies to. Tax type</td></tr></tbody></table>

**Attachment Object**

<table><thead><tr><th width="86">Property</th><th width="81">Type</th><th width="70" data-type="checkbox">Required</th><th width="512">Description</th></tr></thead><tbody><tr><td>url</td><td>string</td><td>false</td><td>URL to the file. (File size is limited to 10MB if uploaded to our system; otherwise, the URL must be publicly available and accessible at all times.)</td></tr><tr><td>type</td><td>string</td><td>false</td><td>Type of the attachment: <code>INVOICE</code>, <code>PROPOSAL</code>, <code>TERMS_CONDITIONS</code>, <code>PICTURES</code>, <code>HEADER_IMAGE</code>, <code>OTHER.</code></td></tr></tbody></table>

{% hint style="info" %}
The first image will be`HEADER_IMAGE`and the rest will be `PICTURES.`
{% endhint %}

**CheckoutEmail Object**

<table><thead><tr><th width="118">Property</th><th width="98">Type</th><th width="71" data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td>recipients</td><td>Recipient emails</td><td>true</td><td>List of recipients associated with the CorporateCheckout.</td></tr><tr><td>subject</td><td>string</td><td>true</td><td>The email subject that will be sent to the Recipient list.</td></tr><tr><td>content</td><td>string</td><td>true</td><td>The email content that will be sent to the Recipient list.</td></tr></tbody></table>

#### Payment Method Restriction

Merchant can declare which methods to disable when initializing a transaction. For example to restrict Visa and Klarna from use during contract checkout:

```
restrictedMethods: ['VIS', 'KLN']
```

| Payment Method Name | Payment Method Code |
| ------------------- | ------------------- |
| MasterCard          | ECA                 |
| Visa                | VIS                 |
| American Express    | AMX                 |
| China Union Pay     | CUP                 |
| Diners Club         | DIN                 |
| Discover            | DIS                 |
| JCB                 | JCB                 |
| EPS                 | EPS                 |
| iDEAL               | DEA                 |
| Klarna              | KLN                 |
| MobilePay           | MBP                 |
| PayPal              | PAP                 |
| BanContact          | BCN                 |
| Przelewy24          | P24                 |

**Set Up Cancellation of Item**

* The cancellationPolicy must be either a fully detailed object or a text.
* If sent item does not have a cancellation policy, the cancellation policy will be determined based on the configuration of the service provider company.
* If there are no applicable config for the service provider company, the policy will remain empty, and the items get created without a Cancellation Policy and Always refund the full amount (default 1-CP Policy will applied).
* Basically we have two reference date to do cancellation:
  1. Start period date (it is used with items that have a period property only)
  2. Payment date (it is used with all items)

you can determine the reference date through CancellationPolicy.reference property.

#### Cancellation Policy

<table><thead><tr><th width="134">Property</th><th width="151">Type</th><th width="93">Required</th><th>Description</th><th data-hidden>Example</th><th data-hidden>Default value</th></tr></thead><tbody><tr><td>description</td><td>string</td><td>no</td><td>Description of applicable penalty</td><td>"cancellation policy "</td><td>--</td></tr><tr><td>reference</td><td>enum</td><td>yes</td><td>Type of reference Enum: [PAYMENT_DATE, START_PERIOD]</td><td>PAYMENT_DATE</td><td>--</td></tr><tr><td>penalties</td><td>array of Penalty</td><td>yes</td><td>List of penalties applicable to the item.</td><td>--</td><td>--</td></tr></tbody></table>

#### Penalties types

* There are two models for determining the penalty:

1. DatePenalty: based on dates explicitly
2. OffsetPenalty: based on offsets relative to the reference

* The CancellationPolicy.penalties should be of one type, either DatePenalty or OffsetPenalty. Not both types together.

The API validates the penalties array when a cancellation policy is provided as an object:

* Do not mix `DATE_PENALTY` and `OFFSET_PENALTY` entries in the same array.
* For `DATE_PENALTY`, each penalty must have a unique `until` value.
* For `OFFSET_PENALTY`, each `amount` and `unit` combination must be unique, and the array may contain at most one offset with an amount of `0`.

If validation fails, the error identifies the item and field using the path `items.<index>.cancellationPolicy.penalties`.

#### DatePenalty

<table><thead><tr><th width="79">Property</th><th width="222">Type</th><th width="87">Required</th><th>Description</th><th data-hidden>Example</th><th data-hidden>Default value</th></tr></thead><tbody><tr><td>type</td><td>enum</td><td>yes</td><td>Type of Penalty Enum: [DATE_PENALTY]</td><td>DATE_PENALTY</td><td>--</td></tr><tr><td>value</td><td>CancellationPenaltyValue</td><td>yes</td><td>Value of Penalty</td><td>--</td><td>--</td></tr><tr><td>until</td><td>Date</td><td>yes</td><td>The date after which the penalty will be applied</td><td>2023-06-12T11:37:51.582Z</td><td>--</td></tr></tbody></table>

#### OffsetPenalty

<table><thead><tr><th width="101">Property</th><th width="224">Type</th><th width="90">Required</th><th>Description</th><th data-hidden>Example</th><th data-hidden>Default value</th></tr></thead><tbody><tr><td>type</td><td>enum</td><td>yes</td><td>Type of Penalty Enum: [OFFSET_PENALTY]</td><td>OFFSET_PENALTY</td><td>--</td></tr><tr><td>value</td><td>CancellationPenaltyValue</td><td>yes</td><td>Value of Penalty</td><td>--</td><td>--</td></tr><tr><td>offset</td><td>CancellationPenaltyOffset</td><td>yes</td><td>The time offset which will be applied</td><td>--</td><td>--</td></tr><tr><td>condition</td><td>string</td><td>no</td><td>Penalty Condition</td><td>"AFTER_PAYMENT"</td><td>--</td></tr></tbody></table>

#### CancellationPenaltyValue

<table><thead><tr><th width="93">Property</th><th width="101">Type</th><th width="93">Required</th><th>Description</th><th data-hidden>Example</th><th data-hidden>Default value</th></tr></thead><tbody><tr><td>amount</td><td>number</td><td>yes</td><td>Penalty amount</td><td>0</td><td>0</td></tr><tr><td>unit</td><td>enum</td><td>yes</td><td>Penalty value unit Enum: [FIXED_AMOUNT, PERCENTAGE]</td><td>FIXED_AMOUNT</td><td>--</td></tr></tbody></table>

#### CancellationPenaltyOffset

<table><thead><tr><th width="98">Property</th><th width="98">Type</th><th width="97">Required</th><th>Description</th><th data-hidden>Example</th><th data-hidden>Default value</th></tr></thead><tbody><tr><td>amount</td><td>number</td><td>yes</td><td>Penalty amount</td><td>2</td><td>0</td></tr><tr><td>unit</td><td>enum</td><td>yes</td><td>Penalty offset unit Enum:[DAYS, HOURS, MONTHS]</td><td>DAYS</td><td>--</td></tr></tbody></table>

**CancellationReq**

Request body for the cancel and refund endpoint.

| Property      | Type      | Required | Description                                                                                                             |
| ------------- | --------- | -------- | ----------------------------------------------------------------------------------------------------------------------- |
| contractId    | string    | Yes      | ID of the contract to cancel.                                                                                           |
| itemsOrder    | number\[] | Yes      | Array of item order numbers to cancel.                                                                                  |
| amount        | number    | No       | Specific refund amount. If not provided, the maximum refundable amount will be calculated based on cancellation policy. |
| invoiceNumber | string    | No       | Invoice number to associate with the cancellation.                                                                      |
| invoiceTitle  | string    | No       | Title of the invoice.                                                                                                   |

**ValidationError**

Describes the error response when request validation fails.

| Property   | Type                | Description                                  |
| ---------- | ------------------- | -------------------------------------------- |
| message    | string\[] \| string | Array of error messages or a single message. |
| error      | string              | General error type (e.g., "Bad Request").    |
| statusCode | number              | HTTP status code.                            |

#### Update Corporate checkout

Some properties of the Transaction can be updated to reflect changes such as title. These updates are restricted to specific fields to ensure the transaction’s consistency.

| Property    | Type   | Description                            | example               |
| ----------- | ------ | -------------------------------------- | --------------------- |
| title       | string | Title of the transaction.              | Booking               |
| note        | string | Note of the transaction.               | note text             |
| externalIds | object | External ids of the transaction        | { "sap\_id": "12345"} |
| attachments | object | Attachment associated with transaction | See attachment above  |


# 🪄 API Reference

💳 Payment processing and transactions

## Check API Connection Status

> Verifies that the connection to the One-CP API is established and returns the provider information. This endpoint is used for health checks and connection validation.

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"tags":[{"name":"checkout","description":"💳 Payment processing and transactions"}],"servers":[{"url":"https://api.1-cp.io","description":"Staging Server (Current Environment)"},{"url":"https://api.1-cp.com","description":"Production Server"}],"paths":{"/status":{"get":{"description":"Verifies that the connection to the One-CP API is established and returns the provider information. This endpoint is used for health checks and connection validation.","operationId":"InitController_status","parameters":[],"responses":{"201":{"description":"Connection established successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","description":"Connection status indicator"},"provider":{"type":"string","description":"Unique identifier of the authenticated provider"}}}}}},"401":{"description":"Invalid authentication credentials provided."},"403":{"description":"Access denied - insufficient permissions."}},"summary":"Check API Connection Status","tags":["checkout"]}}}}
```

## Get transaction Status

> Retrieves the status of a transaction by transaction ID. If the transaction status is PAID, returns additional checkout information including payment details, customer information, and billing data.

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"tags":[{"name":"checkout","description":"💳 Payment processing and transactions"}],"servers":[{"url":"https://api.1-cp.io","description":"Staging Server (Current Environment)"},{"url":"https://api.1-cp.com","description":"Production Server"}],"paths":{"/status/{transactionId}":{"get":{"description":"Retrieves the status of a transaction by transaction ID. If the transaction status is PAID, returns additional checkout information including payment details, customer information, and billing data.","operationId":"InitController_getContractStatus","parameters":[{"name":"transactionId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Transaction status retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}},"400":{"description":"Invalid transaction ID format"},"401":{"description":"Invalid authentication credentials or unauthorized access to contract"},"404":{"description":"Contract not found with the provided transaction ID"}},"summary":"Get transaction Status","tags":["checkout"]}}},"components":{"schemas":{"StatusResponse":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["PENDING","CONFIRMED","CANCELLED","PAID","FAILED"],"description":"Current status of the transaction"},"checkout":{"$ref":"#/components/schemas/CheckoutInfo","description":"Detailed checkout information (only present when status is PAID)"}},"additionalProperties":false},"CheckoutInfo":{"type":"object","required":["reference","payment","customer","billing"],"properties":{"reference":{"type":"string","description":"Contract reference key"},"payment":{"$ref":"#/components/schemas/PaymentInfo"},"customer":{"$ref":"#/components/schemas/CustomerInfo"},"beneficiary":{"$ref":"#/components/schemas/BeneficiaryInfo"},"billing":{"$ref":"#/components/schemas/BillingInfo"},"card":{"type":"object","description":"Payment card information","additionalProperties":true},"reporting":{"type":"object","description":"Additional reporting data","additionalProperties":true}},"additionalProperties":false},"PaymentInfo":{"type":"object","required":["reference","provider"],"properties":{"reference":{"type":"string","description":"Payment reference"},"provider":{"type":"string","description":"Payment provider name (e.g., 'Stripe', 'PayPal')"}},"additionalProperties":false},"CustomerInfo":{"type":"object","required":["firstName","lastName"],"properties":{"firstName":{"type":"string","description":"Customer first name"},"lastName":{"type":"string","description":"Customer last name"},"email":{"type":"string","format":"email","description":"Customer email address"},"phone":{"type":"string","description":"Customer phone number"},"address":{"$ref":"#/components/schemas/Address"}},"additionalProperties":false},"BeneficiaryInfo":{"type":"object","required":["firstName","lastName","email"],"properties":{"firstName":{"type":"string","description":"Beneficiary first name"},"lastName":{"type":"string","description":"Beneficiary last name"},"email":{"type":"string","format":"email","description":"Beneficiary email address"}},"additionalProperties":false},"BillingInfo":{"type":"object","properties":{"name":{"type":"string","description":"Billing name"},"email":{"type":"string","format":"email","description":"Billing email address"},"address":{"$ref":"#/components/schemas/Address"},"externalIds":{"type":"object","description":"External company identifiers","additionalProperties":true}},"additionalProperties":false}}}}
```

## Initialize Corporate Checkout Transaction

> Creates a new transaction for corporate checkout processing. This endpoint accepts a complete checkout request with items, pricing, and metadata to generate a transaction ready for payment processing.

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"tags":[{"name":"checkout","description":"💳 Payment processing and transactions"}],"servers":[{"url":"https://api.1-cp.io","description":"Staging Server (Current Environment)"},{"url":"https://api.1-cp.com","description":"Production Server"}],"paths":{"/initialize":{"post":{"description":"Creates a new transaction for corporate checkout processing. This endpoint accepts a complete checkout request with items, pricing, and metadata to generate a transaction ready for payment processing.","operationId":"InitController_init","parameters":[],"requestBody":{"required":true,"description":"Complete corporate checkout information including items, pricing, and customer details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CorporateCheckout"}}}},"responses":{"201":{"description":"Transaction created successfully with unique identifier","content":{"application/json":{"schema":{"type":"object","properties":{"transactionId":{"type":"string","description":"Unique identifier for the created transaction"}}}}}},"400":{"description":"Invalid request data - validation errors in the request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Authentication failed - invalid credentials"},"403":{"description":"Access denied - insufficient permissions"}},"summary":"Initialize Corporate Checkout Transaction","tags":["checkout"]}}},"components":{"schemas":{"CorporateCheckout":{"type":"object","required":["currency","items","title"],"properties":{"currency":{"type":"string","description":"Currency of the CorporateCheckout"},"items":{"type":"array","description":"List of items included in the CorporateCheckout.","items":{"$ref":"#/components/schemas/Item"},"minItems":1},"refIDs":{"type":"object","properties":{},"additionalProperties":true,"description":"External identifiers associated with the CorporateCheckout."},"title":{"type":"string","description":"Title of the CorporateCheckout"},"attachments":{"type":"array","description":"List of attachments associated with the CorporateCheckout","items":{"$ref":"#/components/schemas/Attachment"}},"note":{"description":"Additional notes about the CorporateCheckout. (Internal note only - not visible to the customer)","type":"string"},"email":{"description":"Email content, Subject and Recipient list which will be sent to the user","$ref":"#/components/schemas/CheckoutEmail"},"restrictedMethods":{"type":"string","description":"Payment methods that the provider has deactivated","enum":["ECA","VIS","AMX","CUP","DIN","DIS","JCB","EPS","DEA","KLN","MBP","PAP","BCN","P24"]}},"additionalProperties":false},"Item":{"type":"object","required":["name","quantity","price","category"],"properties":{"name":{"type":"string","description":"Name of the item"},"category":{"type":"string","description":"Category of the item","enum":["FLIGHT","RENTAL_CAR","TAXI_SHUTTLE","ACCOMMODATION","EVENT","SERVICE","PUBLIC_TRANSPORTATION","MICRO_MOBILITY","PARKING","FUEL","FEE","F_AND_B","OTHER","RAIL","CONFERENCE","TRAVEL_AGENCY","OTHER_TRAVEL","ADVERTISING","MARKET_RESEARCH","CONFERENCE_NOT_TRAVEL","SUBSCRIPTION","LAP_SUPPLY","CONSULTING","HARDWARE","SOFTWARE_AND_IT","SOFTWARE_SUBSCRIPTION","TELECOM","OFFICE_SUPPLY","OFFICE_EQUIPMENT_AND_FURNITURE","RENT_AND_LEASE","UTILITIES","INSURANCE","LEGAL_FEE","ADMINISTRATIVE_SERVICE","RETAIL"]},"quantity":{"type":"object","$ref":"#/components/schemas/ItemQuantity"},"price":{"type":"number","description":"Price of the item depending on the quantity (amount and unit) provided. If FLAT_FEE then price is the total price for the item otherwise price is the price per unit","minimum":0},"description":{"type":"string","description":"Description of the item"},"order":{"type":"number","description":"The order of the item."},"stockId":{"type":"string","description":"External Stock identifier for the item."},"totalTax":{"type":"number","description":"Total tax amount in the currency specified in the CorporateCheckout. This value will be calculated based on the taxes if not provided","minimum":0},"total":{"type":"number","description":"Total amount of the items, price + totalTax. This value will be calculated based on the price and taxes if not provided","minimum":0},"taxes":{"type":"array","description":"List of taxes associated with the item","items":{"$ref":"#/components/schemas/ItemTax"}},"co2":{"type":"number","description":"Carbon dioxide pollution in kg","minimum":0},"cancellationPolicy":{"oneOf":[{"$ref":"#/components/schemas/CancellationPolicy"},{"type":"string","description":"String representation of cancellation policy"}]}},"additionalProperties":false,"oneOf":[{"$ref":"#/components/schemas/Flight"},{"$ref":"#/components/schemas/Accommodation"},{"$ref":"#/components/schemas/Rail"},{"$ref":"#/components/schemas/RentalCar"},{"$ref":"#/components/schemas/TaxiShuttle"},{"$ref":"#/components/schemas/Parking"},{"$ref":"#/components/schemas/DatePeriodItem"}]},"ItemQuantity":{"type":"object","required":["amount"],"properties":{"amount":{"type":"number","description":"Amount of the quantity","minimum":1},"unit":{"type":"string","description":"Unit of the quantity. If FLAT_FEE then price is the total price for the amount without tax, otherwise price is the price per unit","enum":["FLAT_FEE","PER_HOUR","PER_DAY","PER_NIGHT","PER_WEEK","PER_MONTH","PER_YEAR","PER_PERSON"],"default":"FLAT_FEE"}},"additionalProperties":false},"ItemTax":{"type":"object","required":["value","applyTo"],"properties":{"type":{"type":"string","description":"Type of the tax","enum":["NET_PRICE","VAT","BED_TAX","CITY_HOTEL_FEES","COUNTRY_TAX","CITY_TAX","ENERGY_CHARGE","FEDERAL_TAX","GST","INCLUSION","LODGING_TAX","MAINTENANCE_FEE","OCCUPANCY_TAX","PACKAGE_RATE_FEE","ROOM_TAX","RESORT_FEES","SALES_TAX","STATE_PROVINCE_TAX","SURCHARGE","SERVICE_CHARGE","OTHER_TAX","TOURISM_TAX"],"default":"VAT"},"value":{"type":"number","description":"Value of the tax based on the unit used (if the unit provided is AMOUNT, we expect the value to be based on the currency used in the CorporateCheckout)","minimum":0},"unit":{"type":"string","description":"Unit of the tax value (AMOUNT or PERCENT)","enum":["AMOUNT","PERCENT"],"default":"PERCENT"},"basis":{"type":"string","description":"Basis of the tax value (FLAT_FEE or PER_QUANTITY)","enum":["FLAT_FEE","PER_QUANTITY"],"default":"PER_QUANTITY"},"applyTo":{"type":"string","description":"Indicates what base value the tax will be applied to. Some taxes are accumulated on the total price of the item plus other taxes","enum":["NET_PRICE","VAT","BED_TAX","CITY_HOTEL_FEES","COUNTRY_TAX","CITY_TAX","ENERGY_CHARGE","FEDERAL_TAX","GST","INCLUSION","LODGING_TAX","MAINTENANCE_FEE","OCCUPANCY_TAX","PACKAGE_RATE_FEE","ROOM_TAX","RESORT_FEES","SALES_TAX","STATE_PROVINCE_TAX","SURCHARGE","SERVICE_CHARGE","OTHER_TAX","TOURISM_TAX"],"default":"NET_PRICE"}},"additionalProperties":false},"CancellationPolicy":{"type":"object","required":["reference","penalties"],"properties":{"reference":{"type":"string","description":"Reference date for penalty calculation","enum":["PAYMENT_DATE","START_PERIOD"]},"penalties":{"type":"array","description":"List of penalties applicable to the item","items":{"$ref":"#/components/schemas/BasePenalty"},"minItems":1},"description":{"type":"string","description":"Description of the cancellation policy"}},"additionalProperties":false},"BasePenalty":{"type":"object","required":["type","value"],"properties":{"type":{"type":"string","enum":["OFFSET_PENALTY","DATE_PENALTY"]},"value":{"$ref":"#/components/schemas/CancellationPenaltyValue"}},"oneOf":[{"properties":{"type":{"enum":["OFFSET_PENALTY"]},"offset":{"$ref":"#/components/schemas/CancellationPenaltyOffset"}},"required":["offset"]},{"properties":{"type":{"enum":["DATE_PENALTY"]},"until":{"type":"string","format":"date-time","description":"The date after which the penalty will be applied"}},"required":["until"]}],"additionalProperties":false},"CancellationPenaltyValue":{"type":"object","required":["amount","unit"],"properties":{"amount":{"type":"number","description":"Penalty amount","minimum":0},"unit":{"type":"string","description":"Penalty value unit","enum":["FIXED_AMOUNT","PERCENTAGE"]}},"additionalProperties":false},"CancellationPenaltyOffset":{"type":"object","required":["amount","unit"],"properties":{"amount":{"type":"number","description":"Offset amount","minimum":0},"unit":{"type":"string","description":"Offset time unit","enum":["DAYS","HOURS","MONTHS"]}},"additionalProperties":false},"Flight":{"type":"object","required":["category","period","departure","destination","airline","serviceClass"],"properties":{"category":{"type":"string","enum":["FLIGHT"]},"period":{"$ref":"#/components/schemas/Period"},"departure":{"type":"string","description":"Departure airport - 3-letter IATA airport code"},"destination":{"type":"string","description":"Destination airport - 3-letter IATA airport code"},"airline":{"type":"string","description":"Airline - 3-letter ICAO or 2-letter IATA airline code"},"serviceClass":{"type":"string","enum":["FIRST_CLASS","BUSINESS_CLASS","ECONOMY_CLASS","OTHER"]},"flightNumber":{"type":"string","description":"Flight number"},"fareClass":{"type":"string","description":"Fare class code"}},"additionalProperties":false},"Period":{"type":"object","required":["start","end"],"properties":{"start":{"type":"string","format":"date-time","description":"Start date/time using ISO 8601 format"},"end":{"type":"string","format":"date-time","description":"End date/time using ISO 8601 format"}},"additionalProperties":false},"Accommodation":{"type":"object","required":["category","period","location","accommodationType"],"properties":{"category":{"type":"string","enum":["ACCOMMODATION"]},"period":{"$ref":"#/components/schemas/Period"},"locationName":{"type":"string","description":"Location name (property name)"},"location":{"$ref":"#/components/schemas/Location"},"roomType":{"type":"string","enum":["APARTMENT","QUADRUPLE","SUITE","TRIPLE","TWIN","DOUBLE","SINGLE","STUDIO","FAMILY","TWIN_DOUBLE","DORMITORY_ROOM","BED_IN_DORMITORY","BUNGALOW","CHALET","HOLIDAY_HOME","VILLA","MOBILE_HOME","TENT"]},"accommodationType":{"type":"string","enum":["RESORT","HOSTEL","HOTEL","INN","LODGE","MOTEL","LOVE_HOTEL","KP_BUSINESS_HOTEL","CAPSULE_HOTEL","APARTMENT","BED_BREAKFAST","CAMPING","CHALET","BOAT","FARM_STAY","TENTED","VILLA","GUEST_HOUSE","APART_HOTEL","RIAD","RYOKAN","HOME_STAY","HOLIDAY_HOME","COUNTRY_HOUSE","HOLIDAY_PARK"]},"serviceClass":{"type":"string","enum":["FIRST_CLASS","BUSINESS_CLASS","ECONOMY_CLASS","OTHER"]}},"additionalProperties":false},"Location":{"type":"object","required":["city","country"],"properties":{"street":{"type":"string","description":"Street name"},"house":{"type":"string","description":"House number"},"zipCode":{"type":"string","description":"Postal code"},"city":{"type":"string","description":"City name"},"country":{"type":"string","description":"Country name"},"lat":{"type":"string","description":"Latitude of the location"},"lng":{"type":"string","description":"Longitude of the location"}},"additionalProperties":false},"Rail":{"type":"object","required":["category","period","departure","destination","serviceClass"],"properties":{"category":{"type":"string","enum":["RAIL"]},"period":{"$ref":"#/components/schemas/Period"},"departure":{"$ref":"#/components/schemas/Location"},"destination":{"$ref":"#/components/schemas/Location"},"serviceClass":{"type":"string","enum":["FIRST_CLASS","BUSINESS_CLASS","ECONOMY_CLASS","OTHER"]}},"additionalProperties":false},"RentalCar":{"type":"object","required":["category","period","pickUpLocation","dropOffLocation"],"properties":{"category":{"type":"string","enum":["RENTAL_CAR"]},"period":{"$ref":"#/components/schemas/Period"},"pickUpLocation":{"$ref":"#/components/schemas/Location"},"dropOffLocation":{"$ref":"#/components/schemas/Location"},"classificationCode":{"type":"string","description":"Vehicle classification code"}},"additionalProperties":false},"TaxiShuttle":{"type":"object","required":["category","period","pickUpLocation","dropOffLocation"],"properties":{"category":{"type":"string","enum":["TAXI_SHUTTLE"]},"period":{"$ref":"#/components/schemas/Period"},"pickUpLocation":{"$ref":"#/components/schemas/Location"},"dropOffLocation":{"$ref":"#/components/schemas/Location"}},"additionalProperties":false},"Parking":{"type":"object","required":["category","period","location"],"properties":{"category":{"type":"string","enum":["PARKING"]},"period":{"$ref":"#/components/schemas/Period"},"plateNumber":{"type":"string","description":"Plate number of the car"},"location":{"$ref":"#/components/schemas/Location"}}},"DatePeriodItem":{"type":"object","required":["category","period"],"properties":{"category":{"type":"string","enum":["OTHER_TRAVEL","TRAVEL_AGENCY","PUBLIC_TRANSPORTATION"]},"period":{"$ref":"#/components/schemas/Period"}},"additionalProperties":false},"Attachment":{"type":"object","required":["url","type"],"properties":{"url":{"type":"string","description":"URL to the file. (File size is limited to 10MB if uploaded to our system; otherwise, the URL must be publicly available and accessible at all times.)"},"type":{"type":"string","description":"Type of the attachment","enum":["INVOICE","PROPOSAL","CONTRACT","TERMS_AND_CONDITIONS","PICTURES","HEADER_IMAGE","OTHER"]}},"additionalProperties":false},"CheckoutEmail":{"type":"object","required":["subject","content","recipients"],"properties":{"subject":{"type":"string","description":"Subject of the email"},"content":{"type":"string","description":"Body of the email"},"recipients":{"type":"array","description":"List of recipients associated with the CorporateCheckout","items":{"type":"string","format":"email"},"minItems":1}},"additionalProperties":false},"ValidationError":{"type":"object","properties":{"message":{"type":"array","items":{"type":"string"}},"error":{"type":"string"},"statusCode":{"type":"number"}}}}}}
```

## Cancel Transaction and Process Refund (JSON)

> Cancels items in an existing contract and processes refunds based on cancellation policies. \
> \
> \
> &#x20;           \*\*Features:\*\* \
> \
> &#x20;           \- Partial or full cancellation support \
> \
> &#x20;           \- Automatic refund calculation based on cancellation policies \
> \
> &#x20;           \- Real-time refund processing \
> \
> &#x20;           \- JSON format only (no file upload) \
> \
> \
> &#x20;           \*\*Cancellation Process:\*\* \
> \
> &#x20;           1\. Validate contract status and permissions \
> \
> &#x20;           2\. Calculate refundable amount based on cancellation policy \
> \
> &#x20;           3\. Process refund transaction \
> \
> &#x20;           4\. Update contract status \
> \
> &#x20;           5\. Generate cancellation receipt \
> \
> &#x20;      &#x20;

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"tags":[{"name":"checkout","description":"💳 Payment processing and transactions"}],"servers":[{"url":"https://api.1-cp.io","description":"Staging Server (Current Environment)"},{"url":"https://api.1-cp.com","description":"Production Server"}],"paths":{"/cancel/{transactionId}":{"patch":{"description":"Cancels items in an existing contract and processes refunds based on cancellation policies. \n\n\n            **Features:** \n\n            - Partial or full cancellation support \n\n            - Automatic refund calculation based on cancellation policies \n\n            - Real-time refund processing \n\n            - JSON format only (no file upload) \n\n\n            **Cancellation Process:** \n\n            1. Validate contract status and permissions \n\n            2. Calculate refundable amount based on cancellation policy \n\n            3. Process refund transaction \n\n            4. Update contract status \n\n            5. Generate cancellation receipt \n\n        ","operationId":"InitController_cancelAndRefund","parameters":[{"name":"transactionId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Cancellation request without file upload (JSON format only).","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/CancellationReq"}]}}}},"responses":{"200":{"description":"Cancellation processed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["SUCCESS","FAILED"],"description":"Result of the cancellation operation"},"errorMessage":{"type":"string","description":"Error details if status is FAILED, null if SUCCESS"}}}}}},"400":{"description":"Invalid request data or contract status does not allow cancellation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Authentication failed - invalid credentials"},"403":{"description":"Access denied - insufficient permissions"},"404":{"description":"Contract not found with the provided ID"},"500":{"description":"Internal server error or refund processing failure"}},"summary":"Cancel Transaction and Process Refund (JSON)","tags":["checkout"]}}},"components":{"schemas":{"CancellationReq":{"type":"object","required":["itemsOrder"],"properties":{"itemsOrder":{"type":"array","description":"Array of item order numbers to cancel, order numbers start from 1","items":{"type":"number","minimum":1},"minItems":1},"amount":{"type":"number","description":"Specific refund amount. If not provided or 0, the refundable amount will be calculated based on cancellation policy","minimum":0},"invoiceTitle":{"type":"string","description":"Title of the cancellation invoice"},"invoiceNumber":{"type":"string","description":"Invoice number for the cancellation"}},"additionalProperties":false},"ValidationError":{"type":"object","properties":{"message":{"type":"array","items":{"type":"string"}},"error":{"type":"string"},"statusCode":{"type":"number"}}}}}}
```

## Cancel Transaction and Process Refund (with File Upload)

> Cancels items in an existing contract and processes refunds based on cancellation policies. \
> \
> \
> &#x20;           \*\*Features:\*\* \
> \
> &#x20;           \- Partial or full cancellation support \
> \
> &#x20;           \- Automatic refund calculation based on cancellation policies \
> \
> &#x20;           \- Optional invoice file upload for documentation \
> \
> &#x20;           \- Real-time refund processing \
> \
> &#x20;           \- Multipart/form-data format with optional file attachment \
> \
> \
> &#x20;           \*\*Cancellation Process:\*\* \
> \
> &#x20;           1\. Validate contract status and permissions \
> \
> &#x20;           2\. Calculate refundable amount based on cancellation policy \
> \
> &#x20;           3\. Process refund transaction \
> \
> &#x20;           4\. Update contract status \
> \
> &#x20;           5\. Generate cancellation receipt \
> \
> &#x20;      &#x20;

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"tags":[{"name":"checkout","description":"💳 Payment processing and transactions"}],"servers":[{"url":"https://api.1-cp.io","description":"Staging Server (Current Environment)"},{"url":"https://api.1-cp.com","description":"Production Server"}],"paths":{"/cancel/{transactionId}/invoice":{"patch":{"description":"Cancels items in an existing contract and processes refunds based on cancellation policies. \n\n\n            **Features:** \n\n            - Partial or full cancellation support \n\n            - Automatic refund calculation based on cancellation policies \n\n            - Optional invoice file upload for documentation \n\n            - Real-time refund processing \n\n            - Multipart/form-data format with optional file attachment \n\n\n            **Cancellation Process:** \n\n            1. Validate contract status and permissions \n\n            2. Calculate refundable amount based on cancellation policy \n\n            3. Process refund transaction \n\n            4. Update contract status \n\n            5. Generate cancellation receipt \n\n        ","operationId":"InitController_cancelAndRefundWithFile","parameters":[{"name":"transactionId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Cancellation request with optional invoice file upload (multipart/form-data format).","content":{"multipart/form-data":{"schema":{"allOf":[{"$ref":"#/components/schemas/CancellationReq"}]}}}},"responses":{"200":{"description":"Cancellation processed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["SUCCESS","FAILED"],"description":"Result of the cancellation operation"},"errorMessage":{"type":"string","description":"Error details if status is FAILED, null if SUCCESS"}}}}}},"400":{"description":"Invalid request data or contract status does not allow cancellation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Authentication failed - invalid credentials"},"403":{"description":"Access denied - insufficient permissions"},"404":{"description":"Contract not found with the provided ID"},"500":{"description":"Internal server error or refund processing failure"}},"summary":"Cancel Transaction and Process Refund (with File Upload)","tags":["checkout"]}}},"components":{"schemas":{"CancellationReq":{"type":"object","required":["itemsOrder"],"properties":{"itemsOrder":{"type":"array","description":"Array of item order numbers to cancel, order numbers start from 1","items":{"type":"number","minimum":1},"minItems":1},"amount":{"type":"number","description":"Specific refund amount. If not provided or 0, the refundable amount will be calculated based on cancellation policy","minimum":0},"invoiceTitle":{"type":"string","description":"Title of the cancellation invoice"},"invoiceNumber":{"type":"string","description":"Invoice number for the cancellation"}},"additionalProperties":false},"ValidationError":{"type":"object","properties":{"message":{"type":"array","items":{"type":"string"}},"error":{"type":"string"},"statusCode":{"type":"number"}}}}}}
```

## PUT /{transactionId}

> Update Transaction info

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"tags":[{"name":"checkout","description":"💳 Payment processing and transactions"}],"servers":[{"url":"https://api.1-cp.io","description":"Staging Server (Current Environment)"},{"url":"https://api.1-cp.com","description":"Production Server"}],"paths":{"/{transactionId}":{"put":{"operationId":"InitController_update","parameters":[{"name":"transactionId","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Adjustable contract properties","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/UpdateCorporateCheckout"}]}}}},"responses":{"200":{"description":"Transaction updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"401":{"description":"Authentication failed - invalid credentials"},"403":{"description":"Access denied - insufficient permissions"}},"summary":"Update Transaction info","tags":["checkout"]}}},"components":{"schemas":{"UpdateCorporateCheckout":{"type":"object","properties":{"externalIds":{"type":"object","description":"External company identifiers","additionalProperties":true},"title":{"type":"string","description":"Title of contract"},"note":{"type":"string","description":"Note"},"attachments":{"type":"array","description":"List of attachments associated with the CorporateCheckout","items":{"$ref":"#/components/schemas/Attachment"}}}},"Attachment":{"type":"object","required":["url","type"],"properties":{"url":{"type":"string","description":"URL to the file. (File size is limited to 10MB if uploaded to our system; otherwise, the URL must be publicly available and accessible at all times.)"},"type":{"type":"string","description":"Type of the attachment","enum":["INVOICE","PROPOSAL","CONTRACT","TERMS_AND_CONDITIONS","PICTURES","HEADER_IMAGE","OTHER"]}},"additionalProperties":false}}}}
```


# Models

## The CorporateCheckout object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"CorporateCheckout":{"type":"object","required":["currency","items","title"],"properties":{"currency":{"type":"string","description":"Currency of the CorporateCheckout"},"items":{"type":"array","description":"List of items included in the CorporateCheckout.","items":{"$ref":"#/components/schemas/Item"},"minItems":1},"refIDs":{"type":"object","properties":{},"additionalProperties":true,"description":"External identifiers associated with the CorporateCheckout."},"title":{"type":"string","description":"Title of the CorporateCheckout"},"attachments":{"type":"array","description":"List of attachments associated with the CorporateCheckout","items":{"$ref":"#/components/schemas/Attachment"}},"note":{"description":"Additional notes about the CorporateCheckout. (Internal note only - not visible to the customer)","type":"string"},"email":{"description":"Email content, Subject and Recipient list which will be sent to the user","$ref":"#/components/schemas/CheckoutEmail"},"restrictedMethods":{"type":"string","description":"Payment methods that the provider has deactivated","enum":["ECA","VIS","AMX","CUP","DIN","DIS","JCB","EPS","DEA","KLN","MBP","PAP","BCN","P24"]}},"additionalProperties":false},"Item":{"type":"object","required":["name","quantity","price","category"],"properties":{"name":{"type":"string","description":"Name of the item"},"category":{"type":"string","description":"Category of the item","enum":["FLIGHT","RENTAL_CAR","TAXI_SHUTTLE","ACCOMMODATION","EVENT","SERVICE","PUBLIC_TRANSPORTATION","MICRO_MOBILITY","PARKING","FUEL","FEE","F_AND_B","OTHER","RAIL","CONFERENCE","TRAVEL_AGENCY","OTHER_TRAVEL","ADVERTISING","MARKET_RESEARCH","CONFERENCE_NOT_TRAVEL","SUBSCRIPTION","LAP_SUPPLY","CONSULTING","HARDWARE","SOFTWARE_AND_IT","SOFTWARE_SUBSCRIPTION","TELECOM","OFFICE_SUPPLY","OFFICE_EQUIPMENT_AND_FURNITURE","RENT_AND_LEASE","UTILITIES","INSURANCE","LEGAL_FEE","ADMINISTRATIVE_SERVICE","RETAIL"]},"quantity":{"type":"object","$ref":"#/components/schemas/ItemQuantity"},"price":{"type":"number","description":"Price of the item depending on the quantity (amount and unit) provided. If FLAT_FEE then price is the total price for the item otherwise price is the price per unit","minimum":0},"description":{"type":"string","description":"Description of the item"},"order":{"type":"number","description":"The order of the item."},"stockId":{"type":"string","description":"External Stock identifier for the item."},"totalTax":{"type":"number","description":"Total tax amount in the currency specified in the CorporateCheckout. This value will be calculated based on the taxes if not provided","minimum":0},"total":{"type":"number","description":"Total amount of the items, price + totalTax. This value will be calculated based on the price and taxes if not provided","minimum":0},"taxes":{"type":"array","description":"List of taxes associated with the item","items":{"$ref":"#/components/schemas/ItemTax"}},"co2":{"type":"number","description":"Carbon dioxide pollution in kg","minimum":0},"cancellationPolicy":{"oneOf":[{"$ref":"#/components/schemas/CancellationPolicy"},{"type":"string","description":"String representation of cancellation policy"}]}},"additionalProperties":false,"oneOf":[{"$ref":"#/components/schemas/Flight"},{"$ref":"#/components/schemas/Accommodation"},{"$ref":"#/components/schemas/Rail"},{"$ref":"#/components/schemas/RentalCar"},{"$ref":"#/components/schemas/TaxiShuttle"},{"$ref":"#/components/schemas/Parking"},{"$ref":"#/components/schemas/DatePeriodItem"}]},"ItemQuantity":{"type":"object","required":["amount"],"properties":{"amount":{"type":"number","description":"Amount of the quantity","minimum":1},"unit":{"type":"string","description":"Unit of the quantity. If FLAT_FEE then price is the total price for the amount without tax, otherwise price is the price per unit","enum":["FLAT_FEE","PER_HOUR","PER_DAY","PER_NIGHT","PER_WEEK","PER_MONTH","PER_YEAR","PER_PERSON"],"default":"FLAT_FEE"}},"additionalProperties":false},"ItemTax":{"type":"object","required":["value","applyTo"],"properties":{"type":{"type":"string","description":"Type of the tax","enum":["NET_PRICE","VAT","BED_TAX","CITY_HOTEL_FEES","COUNTRY_TAX","CITY_TAX","ENERGY_CHARGE","FEDERAL_TAX","GST","INCLUSION","LODGING_TAX","MAINTENANCE_FEE","OCCUPANCY_TAX","PACKAGE_RATE_FEE","ROOM_TAX","RESORT_FEES","SALES_TAX","STATE_PROVINCE_TAX","SURCHARGE","SERVICE_CHARGE","OTHER_TAX","TOURISM_TAX"],"default":"VAT"},"value":{"type":"number","description":"Value of the tax based on the unit used (if the unit provided is AMOUNT, we expect the value to be based on the currency used in the CorporateCheckout)","minimum":0},"unit":{"type":"string","description":"Unit of the tax value (AMOUNT or PERCENT)","enum":["AMOUNT","PERCENT"],"default":"PERCENT"},"basis":{"type":"string","description":"Basis of the tax value (FLAT_FEE or PER_QUANTITY)","enum":["FLAT_FEE","PER_QUANTITY"],"default":"PER_QUANTITY"},"applyTo":{"type":"string","description":"Indicates what base value the tax will be applied to. Some taxes are accumulated on the total price of the item plus other taxes","enum":["NET_PRICE","VAT","BED_TAX","CITY_HOTEL_FEES","COUNTRY_TAX","CITY_TAX","ENERGY_CHARGE","FEDERAL_TAX","GST","INCLUSION","LODGING_TAX","MAINTENANCE_FEE","OCCUPANCY_TAX","PACKAGE_RATE_FEE","ROOM_TAX","RESORT_FEES","SALES_TAX","STATE_PROVINCE_TAX","SURCHARGE","SERVICE_CHARGE","OTHER_TAX","TOURISM_TAX"],"default":"NET_PRICE"}},"additionalProperties":false},"CancellationPolicy":{"type":"object","required":["reference","penalties"],"properties":{"reference":{"type":"string","description":"Reference date for penalty calculation","enum":["PAYMENT_DATE","START_PERIOD"]},"penalties":{"type":"array","description":"List of penalties applicable to the item","items":{"$ref":"#/components/schemas/BasePenalty"},"minItems":1},"description":{"type":"string","description":"Description of the cancellation policy"}},"additionalProperties":false},"BasePenalty":{"type":"object","required":["type","value"],"properties":{"type":{"type":"string","enum":["OFFSET_PENALTY","DATE_PENALTY"]},"value":{"$ref":"#/components/schemas/CancellationPenaltyValue"}},"oneOf":[{"properties":{"type":{"enum":["OFFSET_PENALTY"]},"offset":{"$ref":"#/components/schemas/CancellationPenaltyOffset"}},"required":["offset"]},{"properties":{"type":{"enum":["DATE_PENALTY"]},"until":{"type":"string","format":"date-time","description":"The date after which the penalty will be applied"}},"required":["until"]}],"additionalProperties":false},"CancellationPenaltyValue":{"type":"object","required":["amount","unit"],"properties":{"amount":{"type":"number","description":"Penalty amount","minimum":0},"unit":{"type":"string","description":"Penalty value unit","enum":["FIXED_AMOUNT","PERCENTAGE"]}},"additionalProperties":false},"CancellationPenaltyOffset":{"type":"object","required":["amount","unit"],"properties":{"amount":{"type":"number","description":"Offset amount","minimum":0},"unit":{"type":"string","description":"Offset time unit","enum":["DAYS","HOURS","MONTHS"]}},"additionalProperties":false},"Flight":{"type":"object","required":["category","period","departure","destination","airline","serviceClass"],"properties":{"category":{"type":"string","enum":["FLIGHT"]},"period":{"$ref":"#/components/schemas/Period"},"departure":{"type":"string","description":"Departure airport - 3-letter IATA airport code"},"destination":{"type":"string","description":"Destination airport - 3-letter IATA airport code"},"airline":{"type":"string","description":"Airline - 3-letter ICAO or 2-letter IATA airline code"},"serviceClass":{"type":"string","enum":["FIRST_CLASS","BUSINESS_CLASS","ECONOMY_CLASS","OTHER"]},"flightNumber":{"type":"string","description":"Flight number"},"fareClass":{"type":"string","description":"Fare class code"}},"additionalProperties":false},"Period":{"type":"object","required":["start","end"],"properties":{"start":{"type":"string","format":"date-time","description":"Start date/time using ISO 8601 format"},"end":{"type":"string","format":"date-time","description":"End date/time using ISO 8601 format"}},"additionalProperties":false},"Accommodation":{"type":"object","required":["category","period","location","accommodationType"],"properties":{"category":{"type":"string","enum":["ACCOMMODATION"]},"period":{"$ref":"#/components/schemas/Period"},"locationName":{"type":"string","description":"Location name (property name)"},"location":{"$ref":"#/components/schemas/Location"},"roomType":{"type":"string","enum":["APARTMENT","QUADRUPLE","SUITE","TRIPLE","TWIN","DOUBLE","SINGLE","STUDIO","FAMILY","TWIN_DOUBLE","DORMITORY_ROOM","BED_IN_DORMITORY","BUNGALOW","CHALET","HOLIDAY_HOME","VILLA","MOBILE_HOME","TENT"]},"accommodationType":{"type":"string","enum":["RESORT","HOSTEL","HOTEL","INN","LODGE","MOTEL","LOVE_HOTEL","KP_BUSINESS_HOTEL","CAPSULE_HOTEL","APARTMENT","BED_BREAKFAST","CAMPING","CHALET","BOAT","FARM_STAY","TENTED","VILLA","GUEST_HOUSE","APART_HOTEL","RIAD","RYOKAN","HOME_STAY","HOLIDAY_HOME","COUNTRY_HOUSE","HOLIDAY_PARK"]},"serviceClass":{"type":"string","enum":["FIRST_CLASS","BUSINESS_CLASS","ECONOMY_CLASS","OTHER"]}},"additionalProperties":false},"Location":{"type":"object","required":["city","country"],"properties":{"street":{"type":"string","description":"Street name"},"house":{"type":"string","description":"House number"},"zipCode":{"type":"string","description":"Postal code"},"city":{"type":"string","description":"City name"},"country":{"type":"string","description":"Country name"},"lat":{"type":"string","description":"Latitude of the location"},"lng":{"type":"string","description":"Longitude of the location"}},"additionalProperties":false},"Rail":{"type":"object","required":["category","period","departure","destination","serviceClass"],"properties":{"category":{"type":"string","enum":["RAIL"]},"period":{"$ref":"#/components/schemas/Period"},"departure":{"$ref":"#/components/schemas/Location"},"destination":{"$ref":"#/components/schemas/Location"},"serviceClass":{"type":"string","enum":["FIRST_CLASS","BUSINESS_CLASS","ECONOMY_CLASS","OTHER"]}},"additionalProperties":false},"RentalCar":{"type":"object","required":["category","period","pickUpLocation","dropOffLocation"],"properties":{"category":{"type":"string","enum":["RENTAL_CAR"]},"period":{"$ref":"#/components/schemas/Period"},"pickUpLocation":{"$ref":"#/components/schemas/Location"},"dropOffLocation":{"$ref":"#/components/schemas/Location"},"classificationCode":{"type":"string","description":"Vehicle classification code"}},"additionalProperties":false},"TaxiShuttle":{"type":"object","required":["category","period","pickUpLocation","dropOffLocation"],"properties":{"category":{"type":"string","enum":["TAXI_SHUTTLE"]},"period":{"$ref":"#/components/schemas/Period"},"pickUpLocation":{"$ref":"#/components/schemas/Location"},"dropOffLocation":{"$ref":"#/components/schemas/Location"}},"additionalProperties":false},"Parking":{"type":"object","required":["category","period","location"],"properties":{"category":{"type":"string","enum":["PARKING"]},"period":{"$ref":"#/components/schemas/Period"},"plateNumber":{"type":"string","description":"Plate number of the car"},"location":{"$ref":"#/components/schemas/Location"}}},"DatePeriodItem":{"type":"object","required":["category","period"],"properties":{"category":{"type":"string","enum":["OTHER_TRAVEL","TRAVEL_AGENCY","PUBLIC_TRANSPORTATION"]},"period":{"$ref":"#/components/schemas/Period"}},"additionalProperties":false},"Attachment":{"type":"object","required":["url","type"],"properties":{"url":{"type":"string","description":"URL to the file. (File size is limited to 10MB if uploaded to our system; otherwise, the URL must be publicly available and accessible at all times.)"},"type":{"type":"string","description":"Type of the attachment","enum":["INVOICE","PROPOSAL","CONTRACT","TERMS_AND_CONDITIONS","PICTURES","HEADER_IMAGE","OTHER"]}},"additionalProperties":false},"CheckoutEmail":{"type":"object","required":["subject","content","recipients"],"properties":{"subject":{"type":"string","description":"Subject of the email"},"content":{"type":"string","description":"Body of the email"},"recipients":{"type":"array","description":"List of recipients associated with the CorporateCheckout","items":{"type":"string","format":"email"},"minItems":1}},"additionalProperties":false}}}}
```

## The Attachment object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"Attachment":{"type":"object","required":["url","type"],"properties":{"url":{"type":"string","description":"URL to the file. (File size is limited to 10MB if uploaded to our system; otherwise, the URL must be publicly available and accessible at all times.)"},"type":{"type":"string","description":"Type of the attachment","enum":["INVOICE","PROPOSAL","CONTRACT","TERMS_AND_CONDITIONS","PICTURES","HEADER_IMAGE","OTHER"]}},"additionalProperties":false}}}}
```

## The CheckoutEmail object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"CheckoutEmail":{"type":"object","required":["subject","content","recipients"],"properties":{"subject":{"type":"string","description":"Subject of the email"},"content":{"type":"string","description":"Body of the email"},"recipients":{"type":"array","description":"List of recipients associated with the CorporateCheckout","items":{"type":"string","format":"email"},"minItems":1}},"additionalProperties":false}}}}
```

## The Item object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"Item":{"type":"object","required":["name","quantity","price","category"],"properties":{"name":{"type":"string","description":"Name of the item"},"category":{"type":"string","description":"Category of the item","enum":["FLIGHT","RENTAL_CAR","TAXI_SHUTTLE","ACCOMMODATION","EVENT","SERVICE","PUBLIC_TRANSPORTATION","MICRO_MOBILITY","PARKING","FUEL","FEE","F_AND_B","OTHER","RAIL","CONFERENCE","TRAVEL_AGENCY","OTHER_TRAVEL","ADVERTISING","MARKET_RESEARCH","CONFERENCE_NOT_TRAVEL","SUBSCRIPTION","LAP_SUPPLY","CONSULTING","HARDWARE","SOFTWARE_AND_IT","SOFTWARE_SUBSCRIPTION","TELECOM","OFFICE_SUPPLY","OFFICE_EQUIPMENT_AND_FURNITURE","RENT_AND_LEASE","UTILITIES","INSURANCE","LEGAL_FEE","ADMINISTRATIVE_SERVICE","RETAIL"]},"quantity":{"type":"object","$ref":"#/components/schemas/ItemQuantity"},"price":{"type":"number","description":"Price of the item depending on the quantity (amount and unit) provided. If FLAT_FEE then price is the total price for the item otherwise price is the price per unit","minimum":0},"description":{"type":"string","description":"Description of the item"},"order":{"type":"number","description":"The order of the item."},"stockId":{"type":"string","description":"External Stock identifier for the item."},"totalTax":{"type":"number","description":"Total tax amount in the currency specified in the CorporateCheckout. This value will be calculated based on the taxes if not provided","minimum":0},"total":{"type":"number","description":"Total amount of the items, price + totalTax. This value will be calculated based on the price and taxes if not provided","minimum":0},"taxes":{"type":"array","description":"List of taxes associated with the item","items":{"$ref":"#/components/schemas/ItemTax"}},"co2":{"type":"number","description":"Carbon dioxide pollution in kg","minimum":0},"cancellationPolicy":{"oneOf":[{"$ref":"#/components/schemas/CancellationPolicy"},{"type":"string","description":"String representation of cancellation policy"}]}},"additionalProperties":false,"oneOf":[{"$ref":"#/components/schemas/Flight"},{"$ref":"#/components/schemas/Accommodation"},{"$ref":"#/components/schemas/Rail"},{"$ref":"#/components/schemas/RentalCar"},{"$ref":"#/components/schemas/TaxiShuttle"},{"$ref":"#/components/schemas/Parking"},{"$ref":"#/components/schemas/DatePeriodItem"}]},"ItemQuantity":{"type":"object","required":["amount"],"properties":{"amount":{"type":"number","description":"Amount of the quantity","minimum":1},"unit":{"type":"string","description":"Unit of the quantity. If FLAT_FEE then price is the total price for the amount without tax, otherwise price is the price per unit","enum":["FLAT_FEE","PER_HOUR","PER_DAY","PER_NIGHT","PER_WEEK","PER_MONTH","PER_YEAR","PER_PERSON"],"default":"FLAT_FEE"}},"additionalProperties":false},"ItemTax":{"type":"object","required":["value","applyTo"],"properties":{"type":{"type":"string","description":"Type of the tax","enum":["NET_PRICE","VAT","BED_TAX","CITY_HOTEL_FEES","COUNTRY_TAX","CITY_TAX","ENERGY_CHARGE","FEDERAL_TAX","GST","INCLUSION","LODGING_TAX","MAINTENANCE_FEE","OCCUPANCY_TAX","PACKAGE_RATE_FEE","ROOM_TAX","RESORT_FEES","SALES_TAX","STATE_PROVINCE_TAX","SURCHARGE","SERVICE_CHARGE","OTHER_TAX","TOURISM_TAX"],"default":"VAT"},"value":{"type":"number","description":"Value of the tax based on the unit used (if the unit provided is AMOUNT, we expect the value to be based on the currency used in the CorporateCheckout)","minimum":0},"unit":{"type":"string","description":"Unit of the tax value (AMOUNT or PERCENT)","enum":["AMOUNT","PERCENT"],"default":"PERCENT"},"basis":{"type":"string","description":"Basis of the tax value (FLAT_FEE or PER_QUANTITY)","enum":["FLAT_FEE","PER_QUANTITY"],"default":"PER_QUANTITY"},"applyTo":{"type":"string","description":"Indicates what base value the tax will be applied to. Some taxes are accumulated on the total price of the item plus other taxes","enum":["NET_PRICE","VAT","BED_TAX","CITY_HOTEL_FEES","COUNTRY_TAX","CITY_TAX","ENERGY_CHARGE","FEDERAL_TAX","GST","INCLUSION","LODGING_TAX","MAINTENANCE_FEE","OCCUPANCY_TAX","PACKAGE_RATE_FEE","ROOM_TAX","RESORT_FEES","SALES_TAX","STATE_PROVINCE_TAX","SURCHARGE","SERVICE_CHARGE","OTHER_TAX","TOURISM_TAX"],"default":"NET_PRICE"}},"additionalProperties":false},"CancellationPolicy":{"type":"object","required":["reference","penalties"],"properties":{"reference":{"type":"string","description":"Reference date for penalty calculation","enum":["PAYMENT_DATE","START_PERIOD"]},"penalties":{"type":"array","description":"List of penalties applicable to the item","items":{"$ref":"#/components/schemas/BasePenalty"},"minItems":1},"description":{"type":"string","description":"Description of the cancellation policy"}},"additionalProperties":false},"BasePenalty":{"type":"object","required":["type","value"],"properties":{"type":{"type":"string","enum":["OFFSET_PENALTY","DATE_PENALTY"]},"value":{"$ref":"#/components/schemas/CancellationPenaltyValue"}},"oneOf":[{"properties":{"type":{"enum":["OFFSET_PENALTY"]},"offset":{"$ref":"#/components/schemas/CancellationPenaltyOffset"}},"required":["offset"]},{"properties":{"type":{"enum":["DATE_PENALTY"]},"until":{"type":"string","format":"date-time","description":"The date after which the penalty will be applied"}},"required":["until"]}],"additionalProperties":false},"CancellationPenaltyValue":{"type":"object","required":["amount","unit"],"properties":{"amount":{"type":"number","description":"Penalty amount","minimum":0},"unit":{"type":"string","description":"Penalty value unit","enum":["FIXED_AMOUNT","PERCENTAGE"]}},"additionalProperties":false},"CancellationPenaltyOffset":{"type":"object","required":["amount","unit"],"properties":{"amount":{"type":"number","description":"Offset amount","minimum":0},"unit":{"type":"string","description":"Offset time unit","enum":["DAYS","HOURS","MONTHS"]}},"additionalProperties":false},"Flight":{"type":"object","required":["category","period","departure","destination","airline","serviceClass"],"properties":{"category":{"type":"string","enum":["FLIGHT"]},"period":{"$ref":"#/components/schemas/Period"},"departure":{"type":"string","description":"Departure airport - 3-letter IATA airport code"},"destination":{"type":"string","description":"Destination airport - 3-letter IATA airport code"},"airline":{"type":"string","description":"Airline - 3-letter ICAO or 2-letter IATA airline code"},"serviceClass":{"type":"string","enum":["FIRST_CLASS","BUSINESS_CLASS","ECONOMY_CLASS","OTHER"]},"flightNumber":{"type":"string","description":"Flight number"},"fareClass":{"type":"string","description":"Fare class code"}},"additionalProperties":false},"Period":{"type":"object","required":["start","end"],"properties":{"start":{"type":"string","format":"date-time","description":"Start date/time using ISO 8601 format"},"end":{"type":"string","format":"date-time","description":"End date/time using ISO 8601 format"}},"additionalProperties":false},"Accommodation":{"type":"object","required":["category","period","location","accommodationType"],"properties":{"category":{"type":"string","enum":["ACCOMMODATION"]},"period":{"$ref":"#/components/schemas/Period"},"locationName":{"type":"string","description":"Location name (property name)"},"location":{"$ref":"#/components/schemas/Location"},"roomType":{"type":"string","enum":["APARTMENT","QUADRUPLE","SUITE","TRIPLE","TWIN","DOUBLE","SINGLE","STUDIO","FAMILY","TWIN_DOUBLE","DORMITORY_ROOM","BED_IN_DORMITORY","BUNGALOW","CHALET","HOLIDAY_HOME","VILLA","MOBILE_HOME","TENT"]},"accommodationType":{"type":"string","enum":["RESORT","HOSTEL","HOTEL","INN","LODGE","MOTEL","LOVE_HOTEL","KP_BUSINESS_HOTEL","CAPSULE_HOTEL","APARTMENT","BED_BREAKFAST","CAMPING","CHALET","BOAT","FARM_STAY","TENTED","VILLA","GUEST_HOUSE","APART_HOTEL","RIAD","RYOKAN","HOME_STAY","HOLIDAY_HOME","COUNTRY_HOUSE","HOLIDAY_PARK"]},"serviceClass":{"type":"string","enum":["FIRST_CLASS","BUSINESS_CLASS","ECONOMY_CLASS","OTHER"]}},"additionalProperties":false},"Location":{"type":"object","required":["city","country"],"properties":{"street":{"type":"string","description":"Street name"},"house":{"type":"string","description":"House number"},"zipCode":{"type":"string","description":"Postal code"},"city":{"type":"string","description":"City name"},"country":{"type":"string","description":"Country name"},"lat":{"type":"string","description":"Latitude of the location"},"lng":{"type":"string","description":"Longitude of the location"}},"additionalProperties":false},"Rail":{"type":"object","required":["category","period","departure","destination","serviceClass"],"properties":{"category":{"type":"string","enum":["RAIL"]},"period":{"$ref":"#/components/schemas/Period"},"departure":{"$ref":"#/components/schemas/Location"},"destination":{"$ref":"#/components/schemas/Location"},"serviceClass":{"type":"string","enum":["FIRST_CLASS","BUSINESS_CLASS","ECONOMY_CLASS","OTHER"]}},"additionalProperties":false},"RentalCar":{"type":"object","required":["category","period","pickUpLocation","dropOffLocation"],"properties":{"category":{"type":"string","enum":["RENTAL_CAR"]},"period":{"$ref":"#/components/schemas/Period"},"pickUpLocation":{"$ref":"#/components/schemas/Location"},"dropOffLocation":{"$ref":"#/components/schemas/Location"},"classificationCode":{"type":"string","description":"Vehicle classification code"}},"additionalProperties":false},"TaxiShuttle":{"type":"object","required":["category","period","pickUpLocation","dropOffLocation"],"properties":{"category":{"type":"string","enum":["TAXI_SHUTTLE"]},"period":{"$ref":"#/components/schemas/Period"},"pickUpLocation":{"$ref":"#/components/schemas/Location"},"dropOffLocation":{"$ref":"#/components/schemas/Location"}},"additionalProperties":false},"Parking":{"type":"object","required":["category","period","location"],"properties":{"category":{"type":"string","enum":["PARKING"]},"period":{"$ref":"#/components/schemas/Period"},"plateNumber":{"type":"string","description":"Plate number of the car"},"location":{"$ref":"#/components/schemas/Location"}}},"DatePeriodItem":{"type":"object","required":["category","period"],"properties":{"category":{"type":"string","enum":["OTHER_TRAVEL","TRAVEL_AGENCY","PUBLIC_TRANSPORTATION"]},"period":{"$ref":"#/components/schemas/Period"}},"additionalProperties":false}}}}
```

## The ItemQuantity object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"ItemQuantity":{"type":"object","required":["amount"],"properties":{"amount":{"type":"number","description":"Amount of the quantity","minimum":1},"unit":{"type":"string","description":"Unit of the quantity. If FLAT_FEE then price is the total price for the amount without tax, otherwise price is the price per unit","enum":["FLAT_FEE","PER_HOUR","PER_DAY","PER_NIGHT","PER_WEEK","PER_MONTH","PER_YEAR","PER_PERSON"],"default":"FLAT_FEE"}},"additionalProperties":false}}}}
```

## The ItemTax object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"ItemTax":{"type":"object","required":["value","applyTo"],"properties":{"type":{"type":"string","description":"Type of the tax","enum":["NET_PRICE","VAT","BED_TAX","CITY_HOTEL_FEES","COUNTRY_TAX","CITY_TAX","ENERGY_CHARGE","FEDERAL_TAX","GST","INCLUSION","LODGING_TAX","MAINTENANCE_FEE","OCCUPANCY_TAX","PACKAGE_RATE_FEE","ROOM_TAX","RESORT_FEES","SALES_TAX","STATE_PROVINCE_TAX","SURCHARGE","SERVICE_CHARGE","OTHER_TAX","TOURISM_TAX"],"default":"VAT"},"value":{"type":"number","description":"Value of the tax based on the unit used (if the unit provided is AMOUNT, we expect the value to be based on the currency used in the CorporateCheckout)","minimum":0},"unit":{"type":"string","description":"Unit of the tax value (AMOUNT or PERCENT)","enum":["AMOUNT","PERCENT"],"default":"PERCENT"},"basis":{"type":"string","description":"Basis of the tax value (FLAT_FEE or PER_QUANTITY)","enum":["FLAT_FEE","PER_QUANTITY"],"default":"PER_QUANTITY"},"applyTo":{"type":"string","description":"Indicates what base value the tax will be applied to. Some taxes are accumulated on the total price of the item plus other taxes","enum":["NET_PRICE","VAT","BED_TAX","CITY_HOTEL_FEES","COUNTRY_TAX","CITY_TAX","ENERGY_CHARGE","FEDERAL_TAX","GST","INCLUSION","LODGING_TAX","MAINTENANCE_FEE","OCCUPANCY_TAX","PACKAGE_RATE_FEE","ROOM_TAX","RESORT_FEES","SALES_TAX","STATE_PROVINCE_TAX","SURCHARGE","SERVICE_CHARGE","OTHER_TAX","TOURISM_TAX"],"default":"NET_PRICE"}},"additionalProperties":false}}}}
```

## The Flight object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"Flight":{"type":"object","required":["category","period","departure","destination","airline","serviceClass"],"properties":{"category":{"type":"string","enum":["FLIGHT"]},"period":{"$ref":"#/components/schemas/Period"},"departure":{"type":"string","description":"Departure airport - 3-letter IATA airport code"},"destination":{"type":"string","description":"Destination airport - 3-letter IATA airport code"},"airline":{"type":"string","description":"Airline - 3-letter ICAO or 2-letter IATA airline code"},"serviceClass":{"type":"string","enum":["FIRST_CLASS","BUSINESS_CLASS","ECONOMY_CLASS","OTHER"]},"flightNumber":{"type":"string","description":"Flight number"},"fareClass":{"type":"string","description":"Fare class code"}},"additionalProperties":false},"Period":{"type":"object","required":["start","end"],"properties":{"start":{"type":"string","format":"date-time","description":"Start date/time using ISO 8601 format"},"end":{"type":"string","format":"date-time","description":"End date/time using ISO 8601 format"}},"additionalProperties":false}}}}
```

## The Accommodation object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"Accommodation":{"type":"object","required":["category","period","location","accommodationType"],"properties":{"category":{"type":"string","enum":["ACCOMMODATION"]},"period":{"$ref":"#/components/schemas/Period"},"locationName":{"type":"string","description":"Location name (property name)"},"location":{"$ref":"#/components/schemas/Location"},"roomType":{"type":"string","enum":["APARTMENT","QUADRUPLE","SUITE","TRIPLE","TWIN","DOUBLE","SINGLE","STUDIO","FAMILY","TWIN_DOUBLE","DORMITORY_ROOM","BED_IN_DORMITORY","BUNGALOW","CHALET","HOLIDAY_HOME","VILLA","MOBILE_HOME","TENT"]},"accommodationType":{"type":"string","enum":["RESORT","HOSTEL","HOTEL","INN","LODGE","MOTEL","LOVE_HOTEL","KP_BUSINESS_HOTEL","CAPSULE_HOTEL","APARTMENT","BED_BREAKFAST","CAMPING","CHALET","BOAT","FARM_STAY","TENTED","VILLA","GUEST_HOUSE","APART_HOTEL","RIAD","RYOKAN","HOME_STAY","HOLIDAY_HOME","COUNTRY_HOUSE","HOLIDAY_PARK"]},"serviceClass":{"type":"string","enum":["FIRST_CLASS","BUSINESS_CLASS","ECONOMY_CLASS","OTHER"]}},"additionalProperties":false},"Period":{"type":"object","required":["start","end"],"properties":{"start":{"type":"string","format":"date-time","description":"Start date/time using ISO 8601 format"},"end":{"type":"string","format":"date-time","description":"End date/time using ISO 8601 format"}},"additionalProperties":false},"Location":{"type":"object","required":["city","country"],"properties":{"street":{"type":"string","description":"Street name"},"house":{"type":"string","description":"House number"},"zipCode":{"type":"string","description":"Postal code"},"city":{"type":"string","description":"City name"},"country":{"type":"string","description":"Country name"},"lat":{"type":"string","description":"Latitude of the location"},"lng":{"type":"string","description":"Longitude of the location"}},"additionalProperties":false}}}}
```

## The Parking object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"Parking":{"type":"object","required":["category","period","location"],"properties":{"category":{"type":"string","enum":["PARKING"]},"period":{"$ref":"#/components/schemas/Period"},"plateNumber":{"type":"string","description":"Plate number of the car"},"location":{"$ref":"#/components/schemas/Location"}}},"Period":{"type":"object","required":["start","end"],"properties":{"start":{"type":"string","format":"date-time","description":"Start date/time using ISO 8601 format"},"end":{"type":"string","format":"date-time","description":"End date/time using ISO 8601 format"}},"additionalProperties":false},"Location":{"type":"object","required":["city","country"],"properties":{"street":{"type":"string","description":"Street name"},"house":{"type":"string","description":"House number"},"zipCode":{"type":"string","description":"Postal code"},"city":{"type":"string","description":"City name"},"country":{"type":"string","description":"Country name"},"lat":{"type":"string","description":"Latitude of the location"},"lng":{"type":"string","description":"Longitude of the location"}},"additionalProperties":false}}}}
```

## The TaxiShuttle object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"TaxiShuttle":{"type":"object","required":["category","period","pickUpLocation","dropOffLocation"],"properties":{"category":{"type":"string","enum":["TAXI_SHUTTLE"]},"period":{"$ref":"#/components/schemas/Period"},"pickUpLocation":{"$ref":"#/components/schemas/Location"},"dropOffLocation":{"$ref":"#/components/schemas/Location"}},"additionalProperties":false},"Period":{"type":"object","required":["start","end"],"properties":{"start":{"type":"string","format":"date-time","description":"Start date/time using ISO 8601 format"},"end":{"type":"string","format":"date-time","description":"End date/time using ISO 8601 format"}},"additionalProperties":false},"Location":{"type":"object","required":["city","country"],"properties":{"street":{"type":"string","description":"Street name"},"house":{"type":"string","description":"House number"},"zipCode":{"type":"string","description":"Postal code"},"city":{"type":"string","description":"City name"},"country":{"type":"string","description":"Country name"},"lat":{"type":"string","description":"Latitude of the location"},"lng":{"type":"string","description":"Longitude of the location"}},"additionalProperties":false}}}}
```

## The RentalCar object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"RentalCar":{"type":"object","required":["category","period","pickUpLocation","dropOffLocation"],"properties":{"category":{"type":"string","enum":["RENTAL_CAR"]},"period":{"$ref":"#/components/schemas/Period"},"pickUpLocation":{"$ref":"#/components/schemas/Location"},"dropOffLocation":{"$ref":"#/components/schemas/Location"},"classificationCode":{"type":"string","description":"Vehicle classification code"}},"additionalProperties":false},"Period":{"type":"object","required":["start","end"],"properties":{"start":{"type":"string","format":"date-time","description":"Start date/time using ISO 8601 format"},"end":{"type":"string","format":"date-time","description":"End date/time using ISO 8601 format"}},"additionalProperties":false},"Location":{"type":"object","required":["city","country"],"properties":{"street":{"type":"string","description":"Street name"},"house":{"type":"string","description":"House number"},"zipCode":{"type":"string","description":"Postal code"},"city":{"type":"string","description":"City name"},"country":{"type":"string","description":"Country name"},"lat":{"type":"string","description":"Latitude of the location"},"lng":{"type":"string","description":"Longitude of the location"}},"additionalProperties":false}}}}
```

## The Rail object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"Rail":{"type":"object","required":["category","period","departure","destination","serviceClass"],"properties":{"category":{"type":"string","enum":["RAIL"]},"period":{"$ref":"#/components/schemas/Period"},"departure":{"$ref":"#/components/schemas/Location"},"destination":{"$ref":"#/components/schemas/Location"},"serviceClass":{"type":"string","enum":["FIRST_CLASS","BUSINESS_CLASS","ECONOMY_CLASS","OTHER"]}},"additionalProperties":false},"Period":{"type":"object","required":["start","end"],"properties":{"start":{"type":"string","format":"date-time","description":"Start date/time using ISO 8601 format"},"end":{"type":"string","format":"date-time","description":"End date/time using ISO 8601 format"}},"additionalProperties":false},"Location":{"type":"object","required":["city","country"],"properties":{"street":{"type":"string","description":"Street name"},"house":{"type":"string","description":"House number"},"zipCode":{"type":"string","description":"Postal code"},"city":{"type":"string","description":"City name"},"country":{"type":"string","description":"Country name"},"lat":{"type":"string","description":"Latitude of the location"},"lng":{"type":"string","description":"Longitude of the location"}},"additionalProperties":false}}}}
```

## The DatePeriodItem object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"DatePeriodItem":{"type":"object","required":["category","period"],"properties":{"category":{"type":"string","enum":["OTHER_TRAVEL","TRAVEL_AGENCY","PUBLIC_TRANSPORTATION"]},"period":{"$ref":"#/components/schemas/Period"}},"additionalProperties":false},"Period":{"type":"object","required":["start","end"],"properties":{"start":{"type":"string","format":"date-time","description":"Start date/time using ISO 8601 format"},"end":{"type":"string","format":"date-time","description":"End date/time using ISO 8601 format"}},"additionalProperties":false}}}}
```

## The Location object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"Location":{"type":"object","required":["city","country"],"properties":{"street":{"type":"string","description":"Street name"},"house":{"type":"string","description":"House number"},"zipCode":{"type":"string","description":"Postal code"},"city":{"type":"string","description":"City name"},"country":{"type":"string","description":"Country name"},"lat":{"type":"string","description":"Latitude of the location"},"lng":{"type":"string","description":"Longitude of the location"}},"additionalProperties":false}}}}
```

## The Period object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"Period":{"type":"object","required":["start","end"],"properties":{"start":{"type":"string","format":"date-time","description":"Start date/time using ISO 8601 format"},"end":{"type":"string","format":"date-time","description":"End date/time using ISO 8601 format"}},"additionalProperties":false}}}}
```

## The ValidationError object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"ValidationError":{"type":"object","properties":{"message":{"type":"array","items":{"type":"string"}},"error":{"type":"string"},"statusCode":{"type":"number"}}}}}}
```

## The CancellationReq object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"CancellationReq":{"type":"object","required":["itemsOrder"],"properties":{"itemsOrder":{"type":"array","description":"Array of item order numbers to cancel, order numbers start from 1","items":{"type":"number","minimum":1},"minItems":1},"amount":{"type":"number","description":"Specific refund amount. If not provided or 0, the refundable amount will be calculated based on cancellation policy","minimum":0},"invoiceTitle":{"type":"string","description":"Title of the cancellation invoice"},"invoiceNumber":{"type":"string","description":"Invoice number for the cancellation"}},"additionalProperties":false}}}}
```

## The CancellationPolicy object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"CancellationPolicy":{"type":"object","required":["reference","penalties"],"properties":{"reference":{"type":"string","description":"Reference date for penalty calculation","enum":["PAYMENT_DATE","START_PERIOD"]},"penalties":{"type":"array","description":"List of penalties applicable to the item","items":{"$ref":"#/components/schemas/BasePenalty"},"minItems":1},"description":{"type":"string","description":"Description of the cancellation policy"}},"additionalProperties":false},"BasePenalty":{"type":"object","required":["type","value"],"properties":{"type":{"type":"string","enum":["OFFSET_PENALTY","DATE_PENALTY"]},"value":{"$ref":"#/components/schemas/CancellationPenaltyValue"}},"oneOf":[{"properties":{"type":{"enum":["OFFSET_PENALTY"]},"offset":{"$ref":"#/components/schemas/CancellationPenaltyOffset"}},"required":["offset"]},{"properties":{"type":{"enum":["DATE_PENALTY"]},"until":{"type":"string","format":"date-time","description":"The date after which the penalty will be applied"}},"required":["until"]}],"additionalProperties":false},"CancellationPenaltyValue":{"type":"object","required":["amount","unit"],"properties":{"amount":{"type":"number","description":"Penalty amount","minimum":0},"unit":{"type":"string","description":"Penalty value unit","enum":["FIXED_AMOUNT","PERCENTAGE"]}},"additionalProperties":false},"CancellationPenaltyOffset":{"type":"object","required":["amount","unit"],"properties":{"amount":{"type":"number","description":"Offset amount","minimum":0},"unit":{"type":"string","description":"Offset time unit","enum":["DAYS","HOURS","MONTHS"]}},"additionalProperties":false}}}}
```

## The BasePenalty object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"BasePenalty":{"type":"object","required":["type","value"],"properties":{"type":{"type":"string","enum":["OFFSET_PENALTY","DATE_PENALTY"]},"value":{"$ref":"#/components/schemas/CancellationPenaltyValue"}},"oneOf":[{"properties":{"type":{"enum":["OFFSET_PENALTY"]},"offset":{"$ref":"#/components/schemas/CancellationPenaltyOffset"}},"required":["offset"]},{"properties":{"type":{"enum":["DATE_PENALTY"]},"until":{"type":"string","format":"date-time","description":"The date after which the penalty will be applied"}},"required":["until"]}],"additionalProperties":false},"CancellationPenaltyValue":{"type":"object","required":["amount","unit"],"properties":{"amount":{"type":"number","description":"Penalty amount","minimum":0},"unit":{"type":"string","description":"Penalty value unit","enum":["FIXED_AMOUNT","PERCENTAGE"]}},"additionalProperties":false},"CancellationPenaltyOffset":{"type":"object","required":["amount","unit"],"properties":{"amount":{"type":"number","description":"Offset amount","minimum":0},"unit":{"type":"string","description":"Offset time unit","enum":["DAYS","HOURS","MONTHS"]}},"additionalProperties":false}}}}
```

## The CancellationPenaltyValue object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"CancellationPenaltyValue":{"type":"object","required":["amount","unit"],"properties":{"amount":{"type":"number","description":"Penalty amount","minimum":0},"unit":{"type":"string","description":"Penalty value unit","enum":["FIXED_AMOUNT","PERCENTAGE"]}},"additionalProperties":false}}}}
```

## The CancellationPenaltyOffset object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"CancellationPenaltyOffset":{"type":"object","required":["amount","unit"],"properties":{"amount":{"type":"number","description":"Offset amount","minimum":0},"unit":{"type":"string","description":"Offset time unit","enum":["DAYS","HOURS","MONTHS"]}},"additionalProperties":false}}}}
```

## The FailedContractStatusDto object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"FailedContractStatusDto":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the failed contract"},"refrence":{"type":"string","description":"Transaction reference number"},"createdAt":{"type":"string","format":"date-time","description":"Creation timestamp"},"errors":{"type":"array","description":"List of errors that occurred during transaction processing","items":{"$ref":"#/components/schemas/ContractStepError"}},"contractId":{"type":"string","description":"Transaction identifier"}},"additionalProperties":false},"ContractStepError":{"type":"object","required":["fieldName","message"],"properties":{"fieldName":{"type":"string","description":"Name of the field that caused the error"},"message":{"type":"string","description":"Error message describing the issue"}},"additionalProperties":false}}}}
```

## The ContractStepError object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"ContractStepError":{"type":"object","required":["fieldName","message"],"properties":{"fieldName":{"type":"string","description":"Name of the field that caused the error"},"message":{"type":"string","description":"Error message describing the issue"}},"additionalProperties":false}}}}
```

## The DetectDto object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"DetectDto":{"type":"object","required":["screenshot","content","url"],"properties":{"screenshot":{"type":"string","description":"Base64 encoded screenshot of the page"},"content":{"type":"string","description":"HTML content of the page"},"url":{"type":"string","format":"uri","description":"URL of the page to detect"}},"additionalProperties":false}}}}
```

## The IPageable object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"IPageable":{"type":"object","properties":{"content":{"type":"array","description":"Array of items for the current page","items":{}},"page":{"type":"object","properties":{"totalElements":{"type":"number","description":"Total number of elements across all pages"},"totalPages":{"type":"number","description":"Total number of pages"},"size":{"type":"number","description":"Number of elements per page"},"number":{"type":"number","description":"Current page number (0-based)"}}}},"additionalProperties":false}}}}
```

## The Filter object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"Filter":{"type":"object","required":["field","operator","value"],"properties":{"field":{"type":"string","description":"Field name to filter by"},"operator":{"type":"string","description":"Filter operator","enum":["EQUALS","NOT_EQUALS","CONTAINS","STARTS_WITH","ENDS_WITH","GREATER_THAN","LESS_THAN","GREATER_THAN_OR_EQUAL","LESS_THAN_OR_EQUAL"]},"value":{"description":"Value to filter by"}},"additionalProperties":false}}}}
```

## The StatusResponse object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"StatusResponse":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["PENDING","CONFIRMED","CANCELLED","PAID","FAILED"],"description":"Current status of the transaction"},"checkout":{"$ref":"#/components/schemas/CheckoutInfo","description":"Detailed checkout information (only present when status is PAID)"}},"additionalProperties":false},"CheckoutInfo":{"type":"object","required":["reference","payment","customer","billing"],"properties":{"reference":{"type":"string","description":"Contract reference key"},"payment":{"$ref":"#/components/schemas/PaymentInfo"},"customer":{"$ref":"#/components/schemas/CustomerInfo"},"beneficiary":{"$ref":"#/components/schemas/BeneficiaryInfo"},"billing":{"$ref":"#/components/schemas/BillingInfo"},"card":{"type":"object","description":"Payment card information","additionalProperties":true},"reporting":{"type":"object","description":"Additional reporting data","additionalProperties":true}},"additionalProperties":false},"PaymentInfo":{"type":"object","required":["reference","provider"],"properties":{"reference":{"type":"string","description":"Payment reference"},"provider":{"type":"string","description":"Payment provider name (e.g., 'Stripe', 'PayPal')"}},"additionalProperties":false},"CustomerInfo":{"type":"object","required":["firstName","lastName"],"properties":{"firstName":{"type":"string","description":"Customer first name"},"lastName":{"type":"string","description":"Customer last name"},"email":{"type":"string","format":"email","description":"Customer email address"},"phone":{"type":"string","description":"Customer phone number"},"address":{"$ref":"#/components/schemas/Address"}},"additionalProperties":false},"BeneficiaryInfo":{"type":"object","required":["firstName","lastName","email"],"properties":{"firstName":{"type":"string","description":"Beneficiary first name"},"lastName":{"type":"string","description":"Beneficiary last name"},"email":{"type":"string","format":"email","description":"Beneficiary email address"}},"additionalProperties":false},"BillingInfo":{"type":"object","properties":{"name":{"type":"string","description":"Billing name"},"email":{"type":"string","format":"email","description":"Billing email address"},"address":{"$ref":"#/components/schemas/Address"},"externalIds":{"type":"object","description":"External company identifiers","additionalProperties":true}},"additionalProperties":false}}}}
```

## The CheckoutInfo object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"CheckoutInfo":{"type":"object","required":["reference","payment","customer","billing"],"properties":{"reference":{"type":"string","description":"Contract reference key"},"payment":{"$ref":"#/components/schemas/PaymentInfo"},"customer":{"$ref":"#/components/schemas/CustomerInfo"},"beneficiary":{"$ref":"#/components/schemas/BeneficiaryInfo"},"billing":{"$ref":"#/components/schemas/BillingInfo"},"card":{"type":"object","description":"Payment card information","additionalProperties":true},"reporting":{"type":"object","description":"Additional reporting data","additionalProperties":true}},"additionalProperties":false},"PaymentInfo":{"type":"object","required":["reference","provider"],"properties":{"reference":{"type":"string","description":"Payment reference"},"provider":{"type":"string","description":"Payment provider name (e.g., 'Stripe', 'PayPal')"}},"additionalProperties":false},"CustomerInfo":{"type":"object","required":["firstName","lastName"],"properties":{"firstName":{"type":"string","description":"Customer first name"},"lastName":{"type":"string","description":"Customer last name"},"email":{"type":"string","format":"email","description":"Customer email address"},"phone":{"type":"string","description":"Customer phone number"},"address":{"$ref":"#/components/schemas/Address"}},"additionalProperties":false},"BeneficiaryInfo":{"type":"object","required":["firstName","lastName","email"],"properties":{"firstName":{"type":"string","description":"Beneficiary first name"},"lastName":{"type":"string","description":"Beneficiary last name"},"email":{"type":"string","format":"email","description":"Beneficiary email address"}},"additionalProperties":false},"BillingInfo":{"type":"object","properties":{"name":{"type":"string","description":"Billing name"},"email":{"type":"string","format":"email","description":"Billing email address"},"address":{"$ref":"#/components/schemas/Address"},"externalIds":{"type":"object","description":"External company identifiers","additionalProperties":true}},"additionalProperties":false}}}}
```

## The PaymentInfo object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"PaymentInfo":{"type":"object","required":["reference","provider"],"properties":{"reference":{"type":"string","description":"Payment reference"},"provider":{"type":"string","description":"Payment provider name (e.g., 'Stripe', 'PayPal')"}},"additionalProperties":false}}}}
```

## The CustomerInfo object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"CustomerInfo":{"type":"object","required":["firstName","lastName"],"properties":{"firstName":{"type":"string","description":"Customer first name"},"lastName":{"type":"string","description":"Customer last name"},"email":{"type":"string","format":"email","description":"Customer email address"},"phone":{"type":"string","description":"Customer phone number"},"address":{"$ref":"#/components/schemas/Address"}},"additionalProperties":false}}}}
```

## The BeneficiaryInfo object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"BeneficiaryInfo":{"type":"object","required":["firstName","lastName","email"],"properties":{"firstName":{"type":"string","description":"Beneficiary first name"},"lastName":{"type":"string","description":"Beneficiary last name"},"email":{"type":"string","format":"email","description":"Beneficiary email address"}},"additionalProperties":false}}}}
```

## The BillingInfo object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"BillingInfo":{"type":"object","properties":{"name":{"type":"string","description":"Billing name"},"email":{"type":"string","format":"email","description":"Billing email address"},"address":{"$ref":"#/components/schemas/Address"},"externalIds":{"type":"object","description":"External company identifiers","additionalProperties":true}},"additionalProperties":false}}}}
```

## The UpdateCorporateCheckout object

```json
{"openapi":"3.0.0","info":{"title":"1-CP API Docs","version":"0.0.1"},"components":{"schemas":{"UpdateCorporateCheckout":{"type":"object","properties":{"externalIds":{"type":"object","description":"External company identifiers","additionalProperties":true},"title":{"type":"string","description":"Title of contract"},"note":{"type":"string","description":"Note"},"attachments":{"type":"array","description":"List of attachments associated with the CorporateCheckout","items":{"$ref":"#/components/schemas/Attachment"}}}},"Attachment":{"type":"object","required":["url","type"],"properties":{"url":{"type":"string","description":"URL to the file. (File size is limited to 10MB if uploaded to our system; otherwise, the URL must be publicly available and accessible at all times.)"},"type":{"type":"string","description":"Type of the attachment","enum":["INVOICE","PROPOSAL","CONTRACT","TERMS_AND_CONDITIONS","PICTURES","HEADER_IMAGE","OTHER"]}},"additionalProperties":false}}}}
```


# Testing & Development

Testing and development resources for 1-CP Corporate Checkout

This section provides everything you need to test and validate your 1-CP Corporate Checkout integration, from environment setup to certification requirements.

## 🌍 Environment Overview

1-CP operates two main environments to support your development lifecycle:

### Staging Environment (`*.1-cp.io`)

* **Purpose**: Development, testing, and integration validation
* **Dashboard**: [dash.1-cp.io](https://dash.1-cp.io)
* **API Base**: `https://api.1-cp.io`
* **Features**: Full feature parity with production, safe for testing

### Production Environment (`*.1-cp.com`)

* **Purpose**: Live transactions and production workloads
* **Dashboard**: [dash.1-cp.com](https://dash.1-cp.com)
* **API Base**: `https://api.1-cp.com`
* **Features**: Live payment processing, real money transactions

## 📋 Testing Workflow

### 1. Environment Setup

Start by configuring your staging environment with test credentials and business units.

**→** [**Test Environment Setup**](/integration-and-development/testing/test-credentials)

### 2. Integration Testing

Validate your integration using our comprehensive test scenarios and provider-specific test cards.

**→ Payment Provider Test Cards:**

* [Stripe Test Credentials](/configuration-and-setup/payment/receiving/stripe-test-credentials)
* [Gateway Test Credentials](/configuration-and-setup/payment/receiving/gateway-test-credentials)

### 3. Error Handling

Ensure your application handles all error scenarios gracefully.

**→** [**Error Messages & Troubleshooting**](/integration-and-development/testing/error-messages)

### 4. Certification

Complete our certification process to validate your integration before going live.

**→** [**Certification Process**](/integration-and-development/testing/certification)

## 🔧 Testing Best Practices

### Comprehensive Test Coverage

* ✅ **Happy Path**: Successful transaction flows
* ✅ **Error Scenarios**: Payment failures, network issues, validation errors
* ✅ **Edge Cases**: Expired cards, insufficient funds, currency mismatches
* ✅ **User Experience**: Loading states, error messages, mobile responsiveness
* ✅ **Webhooks**: Event delivery, retry logic, signature verification

### Data Management

* Use realistic but obviously fake test data
* Implement proper data cleanup procedures
* Test with various currencies and payment methods
* Validate tax calculation scenarios

### Security Testing

* Verify SSL/TLS implementation
* Test webhook signature validation
* Validate input sanitization
* Check authorization and authentication flows

## 🚀 Ready to Start Testing?

1. [**Set up your test environment**](/integration-and-development/testing/test-credentials) with staging credentials
2. **Configure payment methods** using provider-specific test cards
3. **Run through certification scenarios** to validate your integration
4. **Handle error cases** to ensure robust error handling

Need help? Contact our support team at <support@one-cp.com> or check our comprehensive error handling guide.


# Test Environment Setup

Test environment setup and general credentials for 1-CP Corporate Checkout

This page covers the general testing environment setup for 1-CP Corporate Checkout. For payment provider-specific test cards, see the individual payment configuration sections.

## 🌍 Environment Configuration

### Staging Environment (`*.1-cp.io`)

* **API Base URL**: `https://api.1-cp.io`
* **Dashboard URL**: `https://dash.1-cp.io`
* **Checkout URL**: `https://checkout.1-cp.io`
* **Purpose**: Development, testing, and integration validation

### Production Environment (`*.1-cp.com`)

* **API Base URL**: `https://api.1-cp.com`
* **Dashboard URL**: `https://dash.1-cp.com`
* **Checkout URL**: `https://checkout.1-cp.com`
* **Purpose**: Live transactions and production workloads

## 🔑 Test API Credentials

### Getting Your Test Credentials

1. Register at [Staging Dashboard](https://dash.1-cp.io)
2. Navigate to **Config** → **Widget**
3. Create a test widget to get your `client-id` and `client-secret`
4. Use these credentials for all staging API calls

### Authentication Example

```javascript
// Staging environment configuration
const config = {
  env: "sandbox",
  apiBase: "https://api.1-cp.io",
  clientId: "your-staging-client-id",
  clientSecret: "your-staging-client-secret",
};
```

## 🏢 Test Business Units

### Default Test Business Unit

* **Name**: Test Corporate BU
* **Currency**: EUR, USD (multi-currency enabled)
* **Features**: All payment methods enabled
* **Location**: Available in staging dashboard

### Creating Additional Test Business Units

1. Log in to [dash.1-cp.io](https://dash.1-cp.io)
2. Navigate to **Organization** → **Business Units**
3. Create new business unit with test data
4. Configure payment methods and permissions

## 👥 Test User Accounts

### Test Admin User

* **Email**: `admin@test-company.example`
* **Role**: Admin (full access)
* **Business Unit**: Test Corporate BU
* **Permissions**: All resources (read, write, admin)

### Test Employee User

* **Email**: `employee@test-company.example`
* **Role**: User (limited access)
* **Business Unit**: Test Corporate BU
* **Permissions**: Transaction creation only

## ⚙️ SDK Configuration for Testing

### Web SDK Test Setup

```javascript
import { init } from "@one-cp/web-checkout";

init({
  transactionID: "your-test-transaction-id",
  widgetID: "your-test-widget-id",
  config: {
    env: "sandbox", // ← Important: Use sandbox environment
    mode: "lightbox",
  },
  onSuccess: (data) => {
    console.log("Test transaction completed!", data);
  },
  onError: (error) => {
    console.error("Test transaction failed:", error);
  },
});
```

### Backend API Configuration

```javascript
// Node.js example for staging environment
const axios = require("axios");

const oneCP = axios.create({
  baseURL: "https://api.1-cp.io",
  headers: {
    Authorization: `Bearer ${stagingAccessToken}`,
    "Content-Type": "application/json",
  },
});
```

## 💰 Test Transaction Limits

### Staging Environment Limits

* **Minimum Amount**: €0.01 / $0.01
* **Maximum Amount**: €10,000 / $10,000
* **Daily Limit**: €50,000 / $50,000 per business unit
* **Monthly Limit**: No limit in staging

### Test Amount Guidelines

* Use round numbers for easy verification (€100.00, $250.00)
* Test both small amounts (€1.00) and larger amounts (€1,000.00)
* Include decimal precision testing (€123.45)

## 📊 Test Data Guidelines

### Customer Information

Use realistic but obviously fake data:

```json
{
  "customer": {
    "firstName": "John",
    "lastName": "Doe",
    "email": "john.doe@test-company.example",
    "phone": "+49 30 12345678"
  },
  "billing": {
    "name": "Test Company GmbH",
    "email": "billing@test-company.example",
    "address": {
      "street": "Test Street",
      "house": "123",
      "city": "Berlin",
      "country": "Germany",
      "zipCode": "10115"
    }
  }
}
```

### Transaction Data

* **Reference Numbers**: Use prefixes like `TEST-`, `DEMO-`, `STAGING-`
* **Descriptions**: Clear indication of test nature
* **Categories**: Use all available categories (ACCOMMODATION, FLIGHT, etc.)

## 🔗 Webhook Testing

### Test Webhook Endpoints

For local development and testing:

* **ngrok**: `https://ngrok.com` - For local testing with public URLs
* **webhook.site**: `https://webhook.site` - For quick webhook testing
* **requestbin.com**: `https://requestbin.com` - For inspecting webhook payloads

### Webhook Configuration

```javascript
// Example webhook endpoint for testing
app.post("/test-webhook", (req, res) => {
  console.log("Received webhook:", req.body);

  // Verify webhook signature in production
  const signature = req.headers["x-one-cp-signature"];

  // Process webhook event
  const { event, data } = req.body;
  console.log(`Event: ${event}`, data);

  res.status(200).send("OK");
});
```

### Test Webhook Events

All webhook events are triggered in staging:

* `transaction.created`
* `transaction.updated`
* `transaction.completed`
* `payment.completed`
* `payment.failed`

## 🧪 Testing Best Practices

### Test Scenarios Checklist

* [ ] **Successful Payment Flow**: Complete transaction end-to-end
* [ ] **Failed Payment Handling**: Test error scenarios and user experience
* [ ] **Webhook Processing**: Verify all webhook events are handled correctly
* [ ] **Multi-currency**: Test with EUR, USD, and other supported currencies
* [ ] **User Permissions**: Test with different user roles and business units
* [ ] **Mobile Responsiveness**: Test on various screen sizes
* [ ] **Network Issues**: Test timeout and retry scenarios

### Data Cleanup

* Test transactions are automatically purged after 30 days in staging
* No real money is processed in staging environment
* All test data is clearly marked in the dashboard
* Use consistent test data prefixes for easy identification

## 🔧 Rate Limits in Testing

### Staging Environment Limits

* **API Calls**: 1,000 requests/minute
* **Transaction Creation**: 100 transactions/minute
* **Webhook Delivery**: 500 events/minute

*Note: Production limits are more restrictive. Contact* [*support@one-cp.com*](mailto:support@one-cp.com) *for production rate limit information.*

## 🎯 Provider-Specific Test Credentials

For actual test card numbers and provider-specific testing scenarios:

* [**Stripe Test Cards**](/configuration-and-setup/payment/receiving/stripe-test-credentials) - Stripe-specific test cards and scenarios
* [**Gateway Test Cards**](/configuration-and-setup/payment/receiving/gateway-test-credentials) - Gateway Payment sandbox credentials

## ❗ Troubleshooting Test Environment

### Common Issues

**Invalid API Credentials**

* Ensure you're using staging credentials from dash.1-cp.io
* Verify your widget configuration is active
* Check that your client-id and client-secret are correct

**CORS Errors**

* Verify your domain is whitelisted in widget configuration
* Check that you're using the correct staging URLs
* Ensure proper headers are set in your requests

**Payment Failures**

* Verify you're using correct test cards for the payment provider
* Check that the payment method is enabled in your business unit
* Ensure currency compatibility between transaction and payment method

### Getting Help

* **Test Environment Issues**: <support@one-cp.com>
* **Integration Questions**: Check our [certification guide](/integration-and-development/testing/certification)
* **API Documentation**: [docs.one-cp.com/api-reference](https://docs.one-cp.com/api-reference)
* **Error Reference**: [Error Messages & Troubleshooting](/integration-and-development/testing/error-messages)


# Certification Process

As part of our integration process, we require partners and third-party vendors to undergo a certification program that demonstrates their ability to successfully integrate with our systems. To support this process, we have developed a comprehensive set of integration test cases that cover key functionalities and interfaces.

These test cases are designed to evaluate the integrator's ability to Properly connect to our Checkout API. The data is required in the test cases in this [file](https://docs.google.com/spreadsheets/d/1AA1ytmx9vw_ka3tDYwZujwFOm8KfvxU5khx7vSOQDhY/edit?gid=827023198#gid=827023198). When executing each test case, please save the generated transaction ID for that specific test. This will allow us to track which tests were run and correlate them with the results. You can see an explanation of data structures and their properties in our [Checkout API](https://docs.one-cp.com/api-reference).

### Test Cases

The required request body for each case.

#### Accommodation

```json
{
  "title": "Accommodation Proposal",
  "currency": "USD",
  "items": [
    {
      "name": "accommodation",
      "category": "ACCOMMODATION",
      "price": 2500,
      "quantity": {
        "amount": 2,
        "unit": "FLAT_FEE"
      },
      "period": {
        "start": "2024-11-22T13:21:39.932+00:00",
        "end": "2024-11-24T13:21:39.932+00:00"
      },
      "accommodationType": "HOTEL",
      "roomType": "APARTMENT",
      "description": "Booking a nice Apartment",
      "location": {
        "street": "Münchener Str.",
        "house": "59",
        "postCode": "60329",
        "city": "Frankfurt am Main",
        "country": "Germany"
      },
      "locationName": "Frankfurt am Main",
      "taxes": [
        {
          "type": "VAT",
          "value": 10,
          "unit": "PERCENT",
          "basis": "FLAT_FEE",
          "applyTo": "NET_PRICE"
        }
      ],
      "co2": 22.9
    }
  ],
  "email": {
    "recipients": ["user@example.com"],
    "subject": "Accommodation Proposal",
    "content": "Nice One Room Apartment with a Terrace"
  },
  "attachments": [
    {
      "type": "CONTRACT",
      "url": "https://www.example.com/image.png"
    }
  ]
}
```

#### Parking

```json
{
  "title": "Parking Proposal",
  "currency": "EUR",
  "items": [
    {
      "name": "Parking offer",
      "category": "PARKING",
      "price": 600,
      "quantity": {
        "amount": 3,
        "unit": "PER_HOUR"
      },
      "description": "The park is available from 9 am to 12 pm",
      "taxes": [
        {
          "type": "VAT",
          "value": 2,
          "unit": "PERCENT",
          "basis": "FLAT_FEE",
          "applyTo": "NET_PRICE"
        }
      ]
    }
  ],
  "note": "The park is available from 9 am to 12 pm",
  "attachments": [
    {
      "type": "PICTURES",
      "url": "https://www.example.com/image.png"
    },
    {
      "type": "HEADER_IMAGE",
      "url": "https://www.example.com/header-image.png"
    }
  ]
}
```

#### Accommodation and Parking

```json
{
  "title": "Accommodation + Parking Proposal",
  "currency": "EUR",
  "items": [
    {
      "name": "Parking offer",
      "category": "PARKING",
      "price": 600,
      "quantity": {
        "amount": 3,
        "unit": "PER_HOUR"
      },
      "description": "The park is available from 9 am to 12 pm",
      "taxes": [
        {
          "type": "VAT",
          "value": 2,
          "unit": "PERCENT",
          "basis": "FLAT_FEE",
          "applyTo": "NET_PRICE"
        }
      ]
    },
    {
      "name": "accommodation",
      "category": "ACCOMMODATION",
      "price": 2500,
      "quantity": {
        "amount": 2,
        "unit": "FLAT_FEE"
      },
      "period": {
        "start": "2024-11-22T13:21:39.932+00:00",
        "end": "2024-11-24T13:21:39.932+00:00"
      },
      "accommodationType": "HOTEL",
      "roomType": "APARTMENT",
      "description": "Booking a nice Apartment",
      "location": {
        "street": "Münchener Str.",
        "house": "59",
        "postCode": "60329",
        "city": "Frankfurt am Main",
        "country": "Germany"
      },
      "locationName": "Frankfurt am Main",
      "taxes": [
        {
          "type": "VAT",
          "value": 6,
          "unit": "PERCENT",
          "basis": "FLAT_FEE",
          "applyTo": "NET_PRICE"
        }
      ]
    }
  ],
  "note": "Accommodation and Parking offer"
}
```

#### Flight

```json
{
  "title": "Flight Proposal",
  "currency": "EUR",
  "items": [
    {
      "name": "Flight",
      "category": "FLIGHT",
      "price": 1000,
      "quantity": {
        "amount": 1,
        "unit": "FLAT_FEE"
      },
      "period": {
        "start": "2024-09-16T12:00:39.932+00:00",
        "end": "2024-09-16T14:00:39.932+00:00"
      },
      "description": "The flight will take three hours, One seat has been reserved.",
      "flightNumber": "1334HY",
      "departure": "FRA",
      "destination": "LBG",
      "airline": "DLH",
      "serviceClass": "BUSINESS_CLASS",
      "taxes": [
        {
          "type": "COUNTRY_TAX",
          "value": 10,
          "unit": "PERCENT",
          "basis": "FLAT_FEE",
          "applyTo": "NET_PRICE"
        }
      ]
    }
  ],
  "email": {
    "subject": "Flight offer",
    "content": "The flight will take three hours, One seat has been reserved."
  }
}
```

#### Rental Car

```json
{
  "title": "Rental car Proposal",
  "currency": "EUR",
  "items":[
     {
        "name": "Rental car offer",
        "category": "RENTAL_CAR",
        "price":4000,
        "quantity": {
           "amount": 5,
           "unit": "PER_DAY"
        },
        "period":{
           "start": "2024-10-01T12:00:39.932+00:00",
           "end": "2024-10-06T14:00:39.932+00:00"
        },
        "description": "This reservation will be for five days.",
        "pickUpLocation": {
           "street": "Ellis Road",
           "house": "59",
           "postCode": "60549",
           "city": "Frankfurt am Main",
           "country": "Germany"
        },
        "dropOffLocation": {
           "street": "Große Fischerstraße",
           "house": "22",
           "postCode": "60311",
           "city": "Frankfurt am Main",
           "country": "Germany"
        }
        "taxes":[
           {
              "type": "VAT",
              "value": 20,
              "unit": "PERCENT",
              "basis": "PER_QUANTITY",
              "applyTo": "NET_PRICE"
           }
        ]
     }
  ],
  "email":{
     "subject": "Rental car offer",
     "content": "This reservation will be for five days.",
  }
}

```

#### Taxi Shuttle

```json
  "title": "Taxi shuttle Proposal",
  "currency": "USD",
  "items":[
     {
        "name": "Taxi shuttle offer",
        "category": "TAXI_SHUTTLE",
        "price":2000,
        "quantity":{
           "amount": 3,
           "unit": "PER_DAY"
        },
        "period":{
           "start": "2024-10-01T12:00:39.932+00:00",
           "end": "2024-10-04T14:00:39.932+00:00"
        },
        "pickUpLocation":{
           "street": "Ellis Road",
           "house": "59",
           "postCode": "60549",
           "city": "Frankfurt am Main",
           "country": "Germany"
        },
        "dropOffLocation":{
           "street": "Große Fischerstraße",
           "house": "22",
           "postCode": "60311",
           "city": "Frankfurt am Main",
           "country": "Germany"
        },
        "taxes":[
           {
              "type": "VAT",
              "value":20,
              "unit": "PERCENT",
              "basis": "PER_QUANTITY",
              "applyTo": "NET_PRICE"
           },
           {
              "type": "CITY_TAX",
              "value": 10,
              "unit": "PERCENT",
              "basis": "PER_QUANTITY",
              "applyTo": "NET_PRICE"
           }
        ]
     }
  ],
  "email":{
     "subject": "Taxi shuttle offer",
     "content": "This reservation will be for three days."
  },
  "attachments":[
       {
           "type": "OTHER",
           "url": "https://www.example.com/file.pdf"
       }
   ]
}
```

#### Rail

```json
{
  "title": "Rail Proposal",
  "currency": "USD",
  "items": [
    {
      "name": "Rail offer",
      "category": "RAIL",
      "price": 1000,
      "quantity": {
        "amount": 24,
        "unit": "PER_HOUR"
      },
      "serviceClass": "BUSINESS_CLASS",
      "departure": {
        "street": "Westermarkt ",
        "house": "74",
        "postCode": "1016 DL",
        "city": "Amsterdam",
        "country": "Netherlands"
      },
      "destination": {
        "street": "Keizersgracht",
        "house": "703",
        "postCode": "1017 DW",
        "city": "Amsterdam",
        "country": "Netherlands"
      },
      "taxes": [
        {
          "type": "VAT",
          "value": 20,
          "unit": "PERCENT",
          "basis": "PER_QUANTITY",
          "applyTo": "NET_PRICE"
        }
      ]
    }
  ]
}
```

#### Transaction with No Tax

```json
{
  "title": "Flight Proposal",
  "currency": "EUR",
  "items": [
    {
      "name": "Flight",
      "category": "FLIGHT",
      "price": 1000,
      "quantity": {
        "amount": 1,
        "unit": "FLAT_FEE"
      },
      "period": {
        "start": "2024-09-16T12:00:39.932+00:00",
        "end": "2024-09-16T14:00:39.932+00:00"
      },
      "description": "The flight will take three hours, One seat has been reserved.",
      "flightNumber": "1334HY",
      "departure": "FRA",
      "destination": "LBG",
      "airline": "DLH",
      "serviceClass": "BUSINESS_CLASS"
    }
  ],
  "attachments": [
    {
      "type": "PROPOSAL",
      "url": "https://www.example.com/proposal-12.png"
    }
  ]
}
```


# Error Messages & Troubleshooting

Error Messages for Payment Processing

This page describes the possible error messages you may encounter with your transactions in testing or production environment.

| Error message                                                                                  | Description                                                                                              | Testing env          | Production env       |
| ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------- | -------------------- |
| Some configuration is missing. Please review your settings.                                    | Payment config information is missing for example account-id, api-key, merchant-id or password           | :white\_check\_mark: | :white\_check\_mark: |
| There are issues with the customer’s profile. Please review the information.                   | Stripe Customer issue                                                                                    | :white\_check\_mark: | :white\_check\_mark: |
| We couldn't link the payment method to your profile. Please try again or use a different card. | Failed to create the Stripe payment method. The card you entered is not one of the supported test cards. | :white\_check\_mark: | :x:                  |
| The transaction currency is not supported by the selected payment method                       | Contract currency is not compatible with selected payment method                                         | :white\_check\_mark: | :white\_check\_mark: |
| Payment authentication has failed. Please try again.                                           | Failed 3D-secure process                                                                                 | :white\_check\_mark: | :white\_check\_mark: |
| The payment method is invalid. Please check your card details or use a different card          | Stripe payment method issue you should use another payment card or method                                | :white\_check\_mark: | :white\_check\_mark: |
| Some payment details are missing. Please review and complete your payment configuration.       | No payment configuration is set up to complete transactions with the selected payment method             | :white\_check\_mark: | :white\_check\_mark: |


# Payment Configuration

Complete payment configuration guide for 1-CP Corporate Checkout

This section provides comprehensive guidance for configuring payment methods in 1-CP Corporate Checkout. Our platform supports both receiving payments from customers and issuing corporate payments through various providers and methods.

## 💳 Payment Methods Overview

### Supported Payment Types

#### **Receiving Payments**

Accept payments from customers and clients:

* **Credit/Debit Cards**: Visa, Mastercard, American Express, Discover, JCB, Diners Club
* **Digital Wallets**: PayPal (via Stripe integration)
* **Bank Transfers**: Direct bank account payments
* **Regional Methods**: SEPA, Sofort, iDEAL, China UnionPay

#### **Issuing Payments**

Corporate payment solutions for business expenses:

* **Virtual Credit Cards**: AirPlus corporate card solutions
* **Corporate Accounts**: Integrated expense management
* **Travel Cards**: Specialized travel and accommodation payments

## 🌍 Supported Regions & Currencies

### Global Coverage

* **Europe**: EUR, GBP, CHF, SEK, NOK, DKK, PLN, CZK, HUF, BGN, RON
* **North America**: USD, CAD, MXN
* **Asia-Pacific**: JPY, KRW, CNY, HKD, SGD, AUD, NZD, MYR, THB, PHP, IDR, INR
* **Middle East & Africa**: ILS, TRY, ZAR
* **Latin America**: BRL

### Regional Payment Methods

* **Europe**: SEPA transfers, local banking networks
* **Asia**: China UnionPay, local payment networks
* **Americas**: ACH transfers, local banking solutions

## ⚙️ Configuration Workflow

### 1. Choose Your Payment Strategy

Determine which payment methods you need based on:

* **Customer Base**: Geographic distribution of your customers
* **Business Model**: B2B vs B2C requirements
* **Transaction Types**: One-time vs recurring payments
* **Compliance Requirements**: Industry-specific regulations

### 2. Configure Payment Providers

Set up your preferred payment service providers:

#### **For Receiving Payments**

* [**Stripe Configuration**](/configuration-and-setup/payment/receiving/stripe-config) - Global card processing with advanced features
* [**Gateway Configuration**](https://github.com/One-Cp/one-cp-docs/blob/main/payment/receiving/geteway-config.md) - European-focused payment processing
* [**PayPal via Stripe**](/configuration-and-setup/payment/receiving/stripe-paypal) - Digital wallet integration

#### **For Issuing Payments**

* [**AirPlus Configuration**](/configuration-and-setup/payment/issuing/airplus-config) - Corporate virtual card solutions

### 3. Set Up Business Unit Mappings

Configure which payment methods are available for each business unit:

* Map payment configurations to specific business units
* Set up approval workflows and spending limits
* Configure reporting and expense tracking

### 4. Test Your Configuration

Validate your setup using provider-specific test credentials:

* [**Stripe Test Credentials**](/configuration-and-setup/payment/receiving/stripe-test-credentials)
* [**Gateway Test Credentials**](https://github.com/One-Cp/one-cp-docs/blob/main/payment/receiving/Gateway-test-credentials.md)

## 🏢 Enterprise Features

### Advanced Payment Controls

* **Spending Limits**: Set transaction and daily limits per business unit
* **Approval Workflows**: Multi-level approval for high-value transactions
* **Cost Center Allocation**: Automatic expense categorization and reporting
* **Multi-Currency Support**: Real-time exchange rates and currency conversion

### Compliance & Security

* **PCI DSS Compliant 1**: Highest payment security infrastructure
* **3D Secure**: Enhanced authentication for card transactions
* **Fraud Detection**: AI-powered fraud prevention and risk assessment
* **GDPR Compliance**: Full data protection regulation compliance

### Reporting & Analytics

* **Real-time Dashboards**: Transaction monitoring and analytics
* **Customizable Reports**: Export capabilities for accounting systems
* **Expense Management**: Integration with corporate expense platforms
* **Tax Calculation**: Automated tax processing for multiple jurisdictions

## 🚀 Getting Started

### Quick Setup Checklist

1. **\[ ] Choose Payment Providers** - Select providers based on your geographic needs
2. **\[ ] Create Business Units** - Set up organizational structure in dashboard
3. **\[ ] Configure Payment Methods** - Enable payment options for each business unit
4. **\[ ] Set Up Webhooks** - Configure real-time event notifications
5. **\[ ] Test Integration** - Validate setup using test credentials
6. **\[ ] Go Live** - Switch to production environment

### Configuration Resources

#### **Receiving Payments**

Set up payment acceptance for customer transactions: **→** [**Receiving Payment Configuration**](/configuration-and-setup/payment/receiving)

#### **Issuing Payments**

Configure corporate payment solutions: **→** [**Issuing Payment Configuration**](/configuration-and-setup/payment/issuing)

## 💡 Best Practices

### Payment Method Selection

* **Start with Major Cards**: Visa and Mastercard cover majority of transactions
* **Add Regional Methods**: Include local payment preferences for your markets
* **Consider Digital Wallets**: PayPal and other wallets improve conversion rates
* **Plan for Growth**: Choose providers that scale with your business

### Security Considerations

* Always use HTTPS for all payment-related communications
* Implement proper webhook signature verification
* Store sensitive payment data only when absolutely necessary
* Regular security audits and compliance reviews

### User Experience

* Provide clear payment method options and fees
* Implement proper error handling and user feedback
* Optimize for mobile devices and various screen sizes
* Test payment flows regularly across different browsers and devices

## 📞 Need Help?

* **Configuration Support**: <support@one-cp.com>
* **Technical Integration**: Check our [API documentation](https://docs.one-cp.com/api-reference)
* **Testing Resources**: See our [testing guide](/integration-and-development/testing)
* **Emergency Support**: Available 24/7 for critical payment issues

***

Ready to configure your payment methods? Start with our [receiving payment setup](/configuration-and-setup/payment/receiving) or [issuing payment configuration](/configuration-and-setup/payment/issuing) guides.


# Receiving Payments

Configure payment acceptance and receiving methods

The Receiving Payment Configuration enables your business to accept payments from customers and clients through various payment methods and providers. This section guides you through setting up payment acceptance with our supported payment service providers.

## 🎯 Overview

Receiving payments allows you to:

* **Accept Customer Payments**: Process transactions from your clients and customers
* **Multiple Payment Methods**: Support cards, digital wallets, and bank transfers
* **Global Reach**: Accept payments in multiple currencies and regions
* **Secure Processing**: PCI DSS compliant payment handling

## 💳 Supported Payment Providers

### Stripe

**Global payment processing with comprehensive features**

* **Coverage**: Worldwide payment processing
* **Methods**: Credit/debit cards, digital wallets, bank transfers
* **Features**: 3D Secure, fraud detection, subscription billing
* **Currencies**: 135+ currencies supported

**→** [**Stripe Configuration Guide**](/configuration-and-setup/payment/receiving/stripe-config)\
**→** [**Stripe Test Credentials**](/configuration-and-setup/payment/receiving/stripe-test-credentials)

### Gateway Payment

**European-focused payment processing**

* **Coverage**: European markets with local expertise
* **Methods**: Cards, SEPA transfers, local payment methods
* **Features**: DCC (Dynamic Currency Conversion), 3D Secure
* **Currencies**: All major European currencies

**→** [**Gateway Configuration Guide**](/configuration-and-setup/payment/receiving/gateway-config)\
**→** [**Gateway Test Credentials**](/configuration-and-setup/payment/receiving/gateway-test-credentials)

### PayPal (via Stripe)

**Digital wallet integration for broader payment acceptance**

* **Coverage**: Global PayPal acceptance
* **Methods**: PayPal accounts, PayPal Credit
* **Features**: Buyer protection, instant payments
* **Integration**: Seamless Stripe-PayPal connection

**→** [**PayPal Integration Guide**](/configuration-and-setup/payment/receiving/stripe-paypal)

## ⚙️ Configuration Process

### Step 1: Choose Your Provider

Select payment providers based on:

#### **Geographic Considerations**

* **Global Business**: Stripe for worldwide coverage
* **European Focus**: Gateway for European markets
* **Digital Wallets**: PayPal for customer preference

#### **Business Requirements**

* **Transaction Volume**: Consider processing fees and volume discounts
* **Payment Methods**: Ensure provider supports your required methods
* **Features**: Advanced features like subscriptions, marketplaces
* **Compliance**: Regional compliance requirements

### Step 2: Provider Setup

Each provider requires specific configuration:

#### **Stripe Setup**

1. Create Stripe account or use existing account
2. Connect Stripe account to 1-CP platform
3. Configure webhook endpoints for real-time updates
4. Select payment methods and currencies
5. Test integration with test credentials

#### **Gateway Setup**

1. Obtain Gateway merchant credentials
2. Configure Gateway payment settings in 1-CP
3. Set up webhook notifications
4. Enable desired payment methods
5. Validate setup with test transactions

#### **PayPal Setup**

1. Configure Stripe account (prerequisite)
2. Enable PayPal payment method in Stripe
3. Configure PayPal-specific settings
4. Test PayPal payment flow
5. Verify webhook delivery for PayPal events

### Step 3: Business Unit Mapping

Configure which payment methods are available for each business unit:

```
Business Unit A (Europe)
├── Stripe (Cards + SEPA)
├── Gateway (Cards + Local Methods)
└── PayPal (Digital Wallet)

Business Unit B (Americas)
├── Stripe (Cards + ACH)
└── PayPal (Digital Wallet)

Business Unit C (Asia-Pacific)
├── Stripe (Cards + Local Methods)
└── PayPal (Digital Wallet)
```

### Step 4: Testing & Validation

Thoroughly test your payment configuration:

#### **Test Scenarios**

* [ ] Successful card payments (Visa, Mastercard, Amex)
* [ ] 3D Secure authentication flows
* [ ] Payment method failures and error handling
* [ ] Currency conversion and multi-currency transactions
* [ ] Webhook event delivery and processing
* [ ] Refund and partial refund processing

#### **Provider-Specific Testing**

* [**Stripe Test Cards**](/configuration-and-setup/payment/receiving/stripe-test-credentials) - Comprehensive test scenarios
* [**Gateway Test Cards**](/configuration-and-setup/payment/receiving/gateway-test-credentials) - European-specific testing

## 🔗 Integration with Business Units

### Business Unit Association

Payment configurations are linked to specific business units:

* **Merchant Business Unit**: The business unit receiving payments
* **Configuration Scope**: Payment methods available for that business unit
* **Permissions**: User access control for payment configuration

### Getting Help

* **Configuration Issues**: <support@one-cp.com>
* **Provider-Specific Problems**: Check provider documentation
* **Integration Questions**: [API Reference](https://docs.one-cp.com/api-reference)
* **Testing Problems**: [Error Messages Guide](https://github.com/One-Cp/one-cp-docs/blob/main/payment/testing/error-messages.md)

## 🚀 Next Steps

1. [**Choose Your Provider**](/configuration-and-setup/payment/receiving/stripe-config) - Start with Stripe for global coverage
2. [**Configure Payment Methods**](/configuration-and-setup/payment/receiving/gateway-config) - Add Gateway for European markets
3. [**Enable Digital Wallets**](/configuration-and-setup/payment/receiving/stripe-paypal) - Add PayPal for customer preference
4. [**Test Your Setup**](https://github.com/One-Cp/one-cp-docs/blob/main/payment/testing/README.md) - Validate configuration with test transactions
5. [**Go Live**](https://github.com/One-Cp/one-cp-docs/blob/main/payment/testing/README.md) - Switch to production environment

Ready to start accepting payments? Begin with our [Stripe configuration guide](/configuration-and-setup/payment/receiving/stripe-config) for the most comprehensive payment processing setup.


# Stripe Configuration

#### **Set Up a Stripe Payment Configuration**

**Step 1: Define the Configuration**

1. Navigate to the **Payment Configuration Module**.
2. Create a new configuration by selecting **Receiving** as the configuration type.
3. Specify the **Provider Business Unit (BU)** associated with this configuration.

<figure><img src="https://3149150666-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8c7vcYvS5xbYvIdXUIaO%2Fuploads%2Fgit-blob-8efe149f41988c4f48c640aff5490f57b9fd2639%2Fstripe%20config.png?alt=media" alt=""><figcaption><p>Receiving Config For Stripe PSP</p></figcaption></figure>

***

**Step 2: Connect Your Stripe Account**

Click the Connect button and follow the on-screen instructions to complete the connection process. This will securely grant 1-CP access to your Stripe account.

**Step 3: Specify Approved Payment Methods**

After Connection completed successfully, the available payment method will be displayed

1. Define the payment methods that will be allowed for contracts under this configuration.
2. Only the payment methods specified here will be available in the contract.

<figure><img src="https://3149150666-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8c7vcYvS5xbYvIdXUIaO%2Fuploads%2Fgit-blob-3c65e3677a604effca00e211c99ef2e74e3d7042%2Fstripe%20config%20connection.png?alt=media" alt=""><figcaption><p>Successful Connection With Stripe</p></figcaption></figure>

***

#### Set up a Payment Mapping

**Step 1: Choose the Relevant Payment Configuration**

Select the **Receiving Payment Configuration** created earlier.

**Step 2: Apply the Configuration**

1. Specify **on whom** this configuration will be applied. This includes:
   * **Business Unit**: Select the relevant Business Unit.
   * **Company**: Choose the specific company.
   * **Widget**: If applicable, select the widget.
2. Ensure the selected configuration aligns with the payment methods approved in the **Payment Configuration**.

<figure><img src="https://3149150666-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8c7vcYvS5xbYvIdXUIaO%2Fuploads%2Fgit-blob-4faec4fe0569fb47e35bb590b7295fd2b9d88d43%2Fstripe%20config%20mapping.png?alt=media" alt=""><figcaption><p>Receiving Payment Mapping Config</p></figcaption></figure>

***

#### Checkout Process for Receiving Configuration

During the checkout phase, the user finalizes the payment by selecting an appropriate payment method from the predefined **Payment Cards** or **Payment Methods**. This process ensures that only approved payment methods, as defined in the **Payment Configuration**, are used.

<figure><img src="https://3149150666-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8c7vcYvS5xbYvIdXUIaO%2Fuploads%2Fgit-blob-02bed2bda0de17f9a99927ae4b3a9b2965664504%2Fsummery%20step.PNG?alt=media" alt=""><figcaption><p>Checkout Payment Cards and Methods</p></figcaption></figure>

* **The user has two options**:
  * **Select Payment Card or Methods**: Select payment methods from the list of previously added and approved payment cards and methods.
  * **Add a New Payment Card**: If the desired card is not available, the user can add a new card from the set of allowed payment methods defined in the configuration.

<figure><img src="https://3149150666-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8c7vcYvS5xbYvIdXUIaO%2Fuploads%2Fgit-blob-1bbbad65e87d0d1011f32be5a98c2ceb1240fc23%2Fpayment%20step%20with%20stripe.PNG?alt=media" alt=""><figcaption><p>Payment Card Selection</p></figcaption></figure>

***


# Stripe Test Credentials

## Visa

<table><thead><tr><th width="315">Card Number</th><th width="144">CVV</th><th>Limit</th><th>3D Secure</th></tr></thead><tbody><tr><td><code>4000 0000 0000 3220</code><br><code>4000 0000 0000 3055</code><br><code>4000 0084 0000 1629</code><br><code>4242 4242 4242 4242</code></td><td><code>123</code><br><code>123</code><br><code>123</code><br><code>123</code></td><td><code>No</code><br><code>No</code><br><code>No</code><br><code>Yes</code></td><td><code>1</code> <code>2</code><br><code>3</code><br><code>4</code><br><code>5</code></td></tr></tbody></table>

## Visa Debit

<table><thead><tr><th width="317">Card Number</th><th>CVV</th><th>Limit</th><th>3D Secure</th></tr></thead><tbody><tr><td><code>4000 0566 5566 5556</code></td><td><code>123</code></td><td><code>No</code></td><td><code>5</code></td></tr></tbody></table>

## Mastercard

<table><thead><tr><th width="315">Card Number</th><th>CVV</th><th>Limit</th><th>3D Secure</th></tr></thead><tbody><tr><td><code>5555 5555 5555 4444</code></td><td><code>123</code></td><td><code>No</code></td><td><code>5</code></td></tr></tbody></table>

## MasterCard Debit

<table><thead><tr><th width="324">Card Number</th><th>CVV</th><th>Limit</th><th>3D Secure</th></tr></thead><tbody><tr><td><code>5200 8282 8282 8210</code></td><td><code>123</code></td><td><code>No</code></td><td><code>5</code></td></tr></tbody></table>

## MasterCard Prepaid

<table><thead><tr><th width="324">Card Number</th><th>CVV</th><th>Limit</th><th>3D Secure</th></tr></thead><tbody><tr><td><code>5105 1051 0510 5100</code></td><td><code>123</code></td><td><code>No</code></td><td><code>5</code></td></tr></tbody></table>

## American Express

<table><thead><tr><th width="316">Card Number</th><th>CVV</th><th>Limit</th><th>3D Secure</th></tr></thead><tbody><tr><td><code>3782 822463 10005</code><br><code>3714 496353 98431</code></td><td><code>1234</code><br><code>1234</code></td><td><code>No</code><br><code>No</code></td><td><code>5</code><br><code>5</code></td></tr></tbody></table>

## Discover

<table><thead><tr><th width="317">Card Number</th><th>CVV</th><th>Limit</th><th>3D Secure</th></tr></thead><tbody><tr><td><code>6011 1111 1111 1117</code><br><code>6011 0009 9013 9424</code></td><td><code>123</code><br><code>123</code></td><td><code>No</code><br><code>Yes</code></td><td><code>5</code><br><code>5</code></td></tr></tbody></table>

## Diners Club

<table><thead><tr><th width="320">Card Number</th><th>CVV</th><th>Limit</th><th>3D Secure</th></tr></thead><tbody><tr><td><code>3600 001000 0014</code></td><td><code>123</code></td><td><code>No</code></td><td><code>5</code></td></tr></tbody></table>

## JCB

<table><thead><tr><th width="320">Card Number</th><th>CVV</th><th>Limit</th><th>3D Secure</th></tr></thead><tbody><tr><td><code>3566 0020 2036 0505</code></td><td><code>123</code></td><td><code>No</code></td><td><code>5</code></td></tr></tbody></table>

## China Union Pay

<table><thead><tr><th width="317">Card Number</th><th>CVV</th><th>Limit</th><th>3D Secure</th></tr></thead><tbody><tr><td><code>6200 0000 0000 0005</code></td><td><code>123</code></td><td><code>No</code><br></td><td><code>5</code></td></tr></tbody></table>

For more detailed information and additional Stripe test scenarios, please refer to the following [link](https://docs.stripe.com/testing).


# Stripe PayPal Integration

#### **Set Up a Stripe-PayPal Payment Configuration**

**Step 1: Define the Configuration**

1. Navigate to the **Payment Configuration Module**.
2. Create a new configuration by selecting **Receiving** as the configuration type.
3. Specify the **Provider Business Unit (BU)** associated with this configuration.

**Step 2: Create a restricted API key**

A restricted API key only allows the level of access that you specify. Follow these steps to set up a restricted API key in Stripe:

1. Use the **Developers Dashboard** to create a restricted API key.
2. Click Create restricted key.
3. Choose **Building your own integration**.
4. Give the key a descriptive Key name.
5. Select the following permissions

| **Resource Type** | **Permission** |
| ----------------- | -------------- |
| Charges           | Write          |
| Payment Intents   | Write          |
| Customers         | Write          |
| Events            | Read           |
| Payment Methods   | Write          |

6. Create key.
7. Enter created API key in the config.

<figure><img src="https://3149150666-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8c7vcYvS5xbYvIdXUIaO%2Fuploads%2Fgit-blob-ff28072a9f9c7b4033d544bf86e7f98e99563b05%2Fstripe%20paypal%20config.png?alt=media" alt=""><figcaption><p>Receiving Config For Stripe Paypal PSP</p></figcaption></figure>

**Step 3: Configure the Webhook Endpoint**

Once the configuration is saved, go to Edit Config — you’ll see your **generated Endpoint URL** there. Follow these steps to configure your webhook in Stripe:

1. In your Stripe Dashboard, navigate to **Developers → Workbench**.
2. Open the **Webhooks** tab in Workbench.
3. Click **Add destination**.
4. Under Events from, choose Your Account
5. Select the API version **2025-05-28.basil**.
6. Go to the All events tab, scroll down to the **Refund** section, and select:
   * refund.failed
   * refund.updated
7. Click Continue to proceed to the Destination Type page, then choose **Webhook Endpoint**.
8. Enter a descriptive name for the destination, paste the **generated Endpoint URL** and Click **create Destination**.

**Step 4: Add the Signing Secret**

Copy the Signing Secret from Stripe and paste it into your config. Once added, save the configuration to complete the setup.

<figure><img src="https://3149150666-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8c7vcYvS5xbYvIdXUIaO%2Fuploads%2Fgit-blob-d1e713b1f0cbb49119c07b76c709056c9609f202%2Fedit%20paypal%20config.png?alt=media" alt=""><figcaption><p>Edit Receiving Config For Stripe Paypal PSP</p></figcaption></figure>

***

#### Set up a Payment Mapping

**Step 1: Choose the Relevant Payment Configuration**

Select the **Receiving Payment Configuration** created earlier.

**Step 2: Apply the Configuration**

1. Specify **on whom** this configuration will be applied. This includes:
   * **Business Unit**: Select the relevant Business Unit.
   * **Company**: Choose the specific company.
   * **Widget**: If applicable, select the widget.

<figure><img src="https://3149150666-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8c7vcYvS5xbYvIdXUIaO%2Fuploads%2Fgit-blob-d73e1cb25a7fb942fd43d35e919ec14119f585a1%2Fstripe%20paypal%20mapping.png?alt=media" alt=""><figcaption><p>Receiving Payment Mapping Config</p></figcaption></figure>

***

#### Checkout Process for Receiving Configuration

During the checkout phase, the user finalizes the payment by selecting PayPal payment method.

<figure><img src="https://3149150666-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8c7vcYvS5xbYvIdXUIaO%2Fuploads%2Fgit-blob-d86956c631ae6d6bc8226b298fc79b8f9ec408ed%2Fsummery%20paypal.PNG?alt=media" alt=""><figcaption><p>Checkout PayPal</p></figcaption></figure>


# Gateway Configuration

#### **Set Up a Payment Configuration**

**Step 1: Define the Configuration**

1. Navigate to the **Payment Configuration Module**.
2. Create a new configuration by selecting **Receiving** as the configuration type.
3. Select your payment acquirer and enable the payment methods you use.
4. Specify the **Provider Business Unit (BU)** associated with this configuration.
5. Enter merchant ID and password.

**Step 2: Specify Approved Payment Methods**

1. Define the payment methods that will be allowed for contracts under this configuration.
2. Only the payment methods specified here will be available in the contract.

<figure><img src="https://3149150666-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8c7vcYvS5xbYvIdXUIaO%2Fuploads%2Fgit-blob-c22a5844a3d58add5f288fd092c4579973111ae8%2Freceiving%20payment%20config%20planet.png?alt=media" alt=""><figcaption><p>Receiving/Acquirer Config</p></figcaption></figure>

***

#### Set up a Payment Mapping

**Step 1: Choose the Relevant Payment Configuration**

* Select the **Receiving Payment Configuration** created earlier.

**Step 2: Apply the Configuration**

1. Specify **on whom** this configuration will be applied. This includes:
   * **Business Unit**: Select the relevant Business Unit.
   * **Company**: Choose the specific company.
   * **Widget**: If applicable, select the widget.
2. Ensure the selected configuration aligns with the payment methods approved in the **Payment Configuration**.

<figure><img src="https://3149150666-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8c7vcYvS5xbYvIdXUIaO%2Fuploads%2Fgit-blob-7be89919d11eac4e7dd6cfbbb1d3ac85031d2e7c%2Freceiving%20payment%20mapping%20planet.png?alt=media" alt=""><figcaption><p>Receiving Payment Mapping Config</p></figcaption></figure>

***

#### Checkout Process for Receiving Configuration

During the checkout phase, the user finalizes the payment by selecting an appropriate payment method from the predefined **Payment Cards**. This process ensures that only approved payment methods, as defined in the **Payment Configuration**, are used.

<figure><img src="https://3149150666-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8c7vcYvS5xbYvIdXUIaO%2Fuploads%2Fgit-blob-ea2a9107680670f2a7d8e5e5ef6474a8e34d05aa%2Fsummery%20card.PNG?alt=media" alt=""><figcaption><p>Checkout Payment Cards</p></figcaption></figure>

* **The user has two options**:
  * **Select Payment Card**: Select a card from the list of previously added and approved payment cards.
  * **Add a New Payment Card**: If the desired card is not available, the user can add a new card from the set of allowed payment methods defined in the configuration.

<figure><img src="https://3149150666-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8c7vcYvS5xbYvIdXUIaO%2Fuploads%2Fgit-blob-a3bc4bbd1783d3503b5c15e3c323eb689e7e87da%2Fchoice%20payment%20card.PNG?alt=media" alt=""><figcaption><p>Payment Card Selection</p></figcaption></figure>

***


# Gateway Test Credentials

Gateway Test Credentials

Use these credentials in your sandbox environment to test out Corporate Checkout. The testing credentials below are only supported in our sandbox environment. For production tests, you will be required to proceed with real payments if you wish to test it.

## Credit and debit cards

You can use any of the following cards to test out your integrations. The tokens listed represent PCI Proxy's aliases for the corresponding card number.

\
Use a card stating a limit and an amount within the ranges described below to test decline scenarios. For any card listed below, you may use the expiry date `06/28`. You may update the month and year to the new expiry date if you own test credentials with an older expiry date.

Depending on the `amount` and if a limit is set on a specific card, one of the following 4 rules may be applied:

* `0` to `9000` (≤ 90.00): Transaction is authorized.
* `9001` to `10000` (>90.00 and ≤ 100.00): Transaction is declined. This simulates a case where the card has reached its limit or has the wrong expiry date.
* `11001` or higher (>100.00): Transaction is declined. The card was reported lost or stolen.\\

3D Secure is enabled by default. You can test 5 scenarios depending on which card you use:

* `1` Challenge authenticated
* `2` Challenge declined
* `3` Frictionless authenticated
* `4` Frictionless declined
* `5` Not enrolled (transaction will be authorized)

Use the following passwords when prompted:

| Password | Outcome       |
| -------- | ------------- |
| `4444`   | Authenticated |
| `4009`   | Declined      |

For DCC tests, please use the Visa test card `4242 4242 4242 4242` and a merchant that is enabled for DCC. Pass the amount `840` for triggering a flow with the user currency set to `USD` and `756` for the currency `CHF`. Please note that your merchant currency cannot be the same as the user currency to render the DCC selection.

## Test Cards

## 1. Payment Sandbox

### Visa

<table><thead><tr><th width="315">Card Number</th><th width="144">CVV</th><th>Limit</th><th>3D Secure</th></tr></thead><tbody><tr><td><code>4111 1111 1111 1111</code><br><code>4000 0010 0000 0018</code><br><code>4000 0010 0000 0034</code><br><code>4242 4242 4242 4242</code></td><td><code>123</code><br><code>123</code><br><code>123</code><br><code>123</code></td><td><code>No</code><br><code>No</code><br><code>No</code><br><code>Yes</code></td><td><code>1</code> <code>2</code><br><code>3</code><br><code>4</code><br><code>5</code></td></tr></tbody></table>

### Visa Debit

<table><thead><tr><th width="317">Card Number</th><th>CVV</th><th>Limit</th><th>3D Secure</th></tr></thead><tbody><tr><td><code>4444 0901 0101 0103</code></td><td><code>123</code></td><td><code>No</code></td><td><code>5</code></td></tr></tbody></table>

### Mastercard

<table><thead><tr><th width="315">Card Number</th><th>CVV</th><th>Limit</th><th>3D Secure</th></tr></thead><tbody><tr><td><code>5404 0000 0000 0001</code><br><code>5100 0010 0000 0014</code><br><code>5200 0000 0000 0007</code><br><code>5100 0010 0000 0030</code></td><td><code>123</code><br><code>123</code><br><code>123</code><br><code>123</code></td><td><code>Yes</code><br><code>No</code><br><code>No</code><br><code>No</code></td><td><code>1</code> <code>2</code><br><code>3</code><br><code>3</code><br><code>4</code></td></tr></tbody></table>

### MasterCard Debit

<table><thead><tr><th width="324">Card Number</th><th>CVV</th><th>Limit</th><th>3D Secure</th></tr></thead><tbody><tr><td><code>5500 0000 0000 0004</code></td><td><code>123</code></td><td><code>No</code></td><td><code>3</code></td></tr></tbody></table>

### American Express

<table><thead><tr><th width="316">Card Number</th><th>CVV</th><th>Limit</th><th>3D Secure</th></tr></thead><tbody><tr><td><code>3400 00100 000024</code><br><code>3400 00100 000016</code><br><code>3400 00100 000032</code><br><code>3758 111111 11115</code></td><td><code>1234</code><br><code>1234</code><br><code>1234</code><br><code>1234</code></td><td><code>No</code><br><code>No</code><br><code>No</code><br><code>Yes</code></td><td><code>1</code> <code>2</code><br><code>3</code><br><code>4</code><br><code>5</code></td></tr></tbody></table>

### Diners Club

<table><thead><tr><th width="320">Card Number</th><th>CVV</th><th>Limit</th><th>3D Secure</th></tr></thead><tbody><tr><td><code>3600 001000 0014</code><br><code>3600 001000 0022</code><br><code>3600 001000 0006</code><br><code>3600 001000 0030</code></td><td><code>123</code><br><code>123</code><br><code>123</code><br><code>123</code></td><td><code>No</code><br><code>Yes</code><br><code>No</code><br><code>No</code></td><td><code>1</code> <code>2</code><br><code>1</code> <code>2</code><br><code>3</code><br><code>4</code></td></tr></tbody></table>

### Discover

<table><thead><tr><th width="317">Card Number</th><th>CVV</th><th>Limit</th><th>3D Secure</th></tr></thead><tbody><tr><td><code>6011 4200 0000 0004</code><br><code>6011 0009 9803 4767</code></td><td><code>123</code><br><code>123</code></td><td><code>No</code><br><code>Yes</code></td><td><code>5</code><br><code>5</code></td></tr></tbody></table>

### JCB

<table><thead><tr><th width="317">Card Number</th><th>CVV</th><th>Limit</th><th>3D Secure</th></tr></thead><tbody><tr><td><code>3569 9900 1003 0442</code><br><code>3569 9900 1003 0400</code></td><td><code>123</code><br><code>123</code></td><td><code>Yes</code><br><code>No</code></td><td><code>3</code><br><code>5</code></td></tr></tbody></table>

### China Union Pay

<table><thead><tr><th width="317">Card Number</th><th>CVV</th><th>Limit</th><th>3D Secure</th></tr></thead><tbody><tr><td><code>8100 0000 0000 0002</code><br><code>8100 0000 0000 0010</code></td><td><code>123</code><br><code>123</code></td><td><code>No</code><br><code>Yes</code></td><td><code>3</code><br><code>5</code></td></tr></tbody></table>

### Maestro

<table><thead><tr><th width="315">Card Number</th><th>CVV</th><th>Limit</th><th>3D Secure</th></tr></thead><tbody><tr><td><code>6759 0000 0000 0026</code><br><code>6759 0000 0000 0018</code></td><td><code>123</code><br><code>123</code></td><td><code>Yes</code><br><code>No</code></td><td><code>1</code> <code>2</code><br><code>3</code></td></tr></tbody></table>

### Bank accounts

You can use the following credentials to test bank account integrations.

| Field          | Number                   |
| -------------- | ------------------------ |
| IBAN           | `DE85123456781234512345` |
| Account number | `31510604`               |
| Branch Code    | `100000`                 |


# Issuing Payments

Configure corporate payment solutions and virtual card issuing

The Issuing Payment Configuration enables your business to provide corporate payment solutions, including virtual credit cards and integrated expense management for employee transactions and business expenses.

## 🎯 Overview

Issuing payments allows you to:

* **Corporate Payment Solutions**: Provide virtual credit cards for employee expenses
* **Expense Management**: Integrated tracking and reporting for business expenses
* **Budget Control**: Set spending limits and approval workflows
* **Real-time Monitoring**: Track corporate spending in real-time

## 💳 Supported Issuing Solutions

### AirPlus Virtual Cards

**Corporate virtual credit card solutions for business expenses**

* **Coverage**: Global corporate payment solution
* **Card Types**: Virtual Mastercard credit cards
* **Features**: Real-time issuance, spending controls, detailed reporting
* **Integration**: Seamless expense management and accounting integration

**→** [**AirPlus Configuration Guide**](/configuration-and-setup/payment/issuing/airplus-config)

## ⚙️ How Issuing Payments Work

### Virtual Card Issuance Flow

```
Employee Request → Approval Workflow → Virtual Card Creation → Transaction Processing → Expense Reporting
```

1. **Employee Initiates**: Employee requests payment for business expense
2. **Approval Process**: Optional approval workflow based on amount/policy
3. **Card Issuance**: Virtual card created with specific limits and validity
4. **Payment Processing**: Transaction processed through issuing provider
5. **Expense Tracking**: Automatic categorization and reporting

### Integration with Receiving Payments

> **Important Prerequisite**: To use AirPlus virtual card issuing, you must have a **Receiving Payment Configuration** that includes **Mastercard** payment method. This ensures the merchant can accept the virtual cards issued through AirPlus.

## 🏢 Business Unit Integration

### Client Business Unit Association

* **Configuration Scope**: Issuing configurations are linked to Client Business Units
* **Employee Access**: Determines which employees can request virtual cards
* **Spending Policies**: Business unit-specific spending rules and limits
* **Reporting Structure**: Expense reporting aligned with business unit hierarchy

### Typical Use Cases

#### **Travel & Accommodation**

* Hotel bookings and accommodation expenses
* Flight reservations and travel-related costs
* Ground transportation and taxi services
* Meal allowances and business dining

#### **Corporate Procurement**

* Office supplies and equipment purchases
* Software subscriptions and licensing
* Professional services and consulting
* Marketing and event expenses

#### **Employee Expenses**

* Business meal reimbursements
* Client entertainment expenses
* Training and conference fees
* Remote work equipment purchases

## ⚙️ Configuration Process

### Step 1: Prerequisites Setup

Before configuring issuing payments:

1. **Verify Receiving Configuration**: Ensure you have a receiving payment configuration that accepts Mastercard
2. **Business Unit Setup**: Configure your client business units in the dashboard
3. **User Permissions**: Set up user roles and permissions for expense management
4. **Approval Workflows**: Define approval processes for different expense types

### Step 2: AirPlus Configuration

Follow the detailed configuration guide:

**→** [**AirPlus Configuration Guide**](/configuration-and-setup/payment/issuing/airplus-config)

Key configuration steps:

* Define required AirPlus data fields
* Set up company data field mapping
* Configure approval workflows
* Test virtual card issuance

### Step 3: Field Configuration

Configure required fields for expense tracking:

#### **Mandatory Fields** (must be completed by employees)

* **Accounting Unit (AE)**: Department or cost center identifier
* **Cost Center (KS)**: Specific budget allocation code
* **Employee Number (PK)**: Employee identification
* **Project Number (PR)**: Project-specific expense tracking

#### **Optional Fields** (can be completed if needed)

* **Order Number (AU)**: Purchase order reference
* **Department Code (DS)**: Additional departmental classification
* **Internal Account (IK)**: Internal accounting reference
* **Destination (R2)**: Travel destination for travel expenses

#### **Not Used** (fields that won't appear in the interface)

* Fields not relevant to your business processes

### Step 4: Company Data Mapping

Map your internal systems to AirPlus fields:

```json
{
  "fieldMapping": {
    "costCenter": "KS",
    "employeeId": "PK",
    "projectCode": "PR",
    "departmentCode": "DS",
    "accountingUnit": "AE"
  }
}
```

## 💼 Employee Checkout Process

### Step 1: Expense Request

Employee initiates expense request through checkout interface:

* Select "Reporting" to view required fields
* Complete all mandatory fields (marked as required)
* Fill optional fields if needed for expense tracking

### Step 2: Field Completion

System displays fields based on configuration:

* **Mandatory fields**: Must be completed before proceeding
* **Optional fields**: Can be completed for better expense tracking
* **Not used fields**: Will not appear in the interface

### Step 3: Virtual Card Issuance

After field completion:

* Virtual card is issued instantly for approved amounts
* Card details provided for immediate use
* Transaction limits applied based on business unit policy

### Step 4: Expense Reporting

Automatic expense categorization and reporting:

* Real-time transaction monitoring
* Automatic categorization based on completed fields
* Integration with accounting systems
* Compliance reporting for auditing

## 🔧 Advanced Features

### Spending Controls

* **Transaction Limits**: Set maximum transaction amounts
* **Category Restrictions**: Limit purchases to specific merchant categories
* **Time-based Controls**: Set card validity periods
* **Geographic Restrictions**: Limit usage by location

### Approval Workflows

* **Amount-based Approval**: Automatic approval under threshold, manual approval above
* **Manager Approval**: Route requests through employee's direct manager
* **Finance Approval**: Additional approval for specific expense categories
* **Multi-level Approval**: Complex approval chains for high-value expenses

### Reporting & Analytics

* **Real-time Dashboards**: Monitor corporate spending across business units
* **Expense Categories**: Detailed breakdown by expense type and purpose
* **Employee Spending**: Individual and team spending analysis
* **Budget Tracking**: Monitor against allocated budgets and forecasts

## 💡 Best Practices

### Field Configuration

* **Start Simple**: Begin with essential fields only, add complexity as needed
* **User Training**: Ensure employees understand field requirements
* **Consistent Mapping**: Maintain consistent field mapping across business units
* **Regular Review**: Periodically review field requirements and usage

### Approval Workflows

* **Clear Policies**: Define clear spending policies and approval thresholds
* **Automated Rules**: Use automation for routine, low-value expenses
* **Exception Handling**: Define processes for urgent or exceptional expenses
* **Audit Trail**: Maintain complete audit trail for all approvals

### Security & Compliance

* **Role-based Access**: Limit access to expense management features
* **Regular Audits**: Conduct regular audits of virtual card usage
* **Policy Compliance**: Ensure expenses comply with corporate policies
* **Data Protection**: Protect sensitive employee and financial data

## 🛠️ Troubleshooting

### Common Issues

**Virtual Cards Not Being Issued**

* Verify receiving payment configuration includes Mastercard
* Check business unit mapping and user permissions
* Ensure all mandatory fields are properly configured
* Validate AirPlus integration credentials

**Field Mapping Issues**

* Verify company data field mapping is correctly configured
* Check that mapped fields exist in your internal systems
* Ensure field data types match expected formats
* Validate field length limitations

**Approval Workflow Problems**

* Check approval workflow configuration and user assignments
* Verify approver permissions and notification settings
* Ensure approval thresholds are properly configured
* Test approval workflows with test transactions

### Getting Help

* **Configuration Support**: <support@one-cp.com>
* **AirPlus Integration**: Check AirPlus documentation and support
* **Technical Issues**: [API Reference](https://docs.one-cp.com/api-reference)
* **Best Practices**: Contact customer success team

## 🚀 Getting Started

1. [**Check Prerequisites**](#step-1-prerequisites-setup) - Verify receiving payment configuration
2. [**Configure AirPlus**](/configuration-and-setup/payment/issuing/airplus-config) - Set up virtual card issuance
3. [**Map Company Data**](/configuration-and-setup/payment/issuing/airplus-config#3-company-data-field-mapping) - Connect your internal systems
4. [**Test Integration**](https://github.com/One-Cp/one-cp-docs/blob/main/payment/testing/README.md) - Validate setup with test transactions
5. [**Train Users**](#field-configuration) - Ensure employees understand the expense process

Ready to start issuing corporate payments? Begin with our [AirPlus configuration guide](/configuration-and-setup/payment/issuing/airplus-config) to set up virtual card solutions for your business.


# AirPlus Configuration

#### Steps to Set Up an AirPlus Payment Configuration

**Step 1: Define the Configuration**

1. Navigate to the **Payment Configuration Module**.
2. Create a new configuration by selecting **Issuing** as the configuration type.
3. Specify the **Client Business Unit (BU)** associated with this configuration.

**Step 2: Configure AirPlus Fields**

* Define the fields required for AirPlus payments. These fields include:
  * **Accounting Unit (AE)**
  * **Accounting Code (AK)**
  * **Order Number (AU)**
  * **Departure Date (BD)**
  * **Department Code (DS)**
  * **Internal Account (IK)**
  * **Cost Center (KS)**
  * **Employee Number (PK)**
  * **Project Number (PR)**
  * **Destination (R2)**
* For each field, specify whether it is:
  * **Mandatory**: Must be filled by the user.
  * **Optional**: This can be filled by the user but is not required.
  * **Not Used**: The field will not appear in the configuration.

<figure><img src="https://3149150666-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8c7vcYvS5xbYvIdXUIaO%2Fuploads%2Fgit-blob-d071538bcc5c6f6b9b7ce8c2ab72233ff7518da1%2Fissuing%20payment%20config%20airplus.png?alt=media" alt=""><figcaption><p>Cards Payments Issuing Config (AirPlus)</p></figcaption></figure>

***

### 3. Company Data Field Mapping

The Company Data Field Mapping must be configured to ensure seamless integration with Issuing Payment Configuration. This involves mapping the fields in the system to the corresponding fields in the Issuing Payment Configuration.

#### **Steps to Configure Company Data Field Mapping:**

1. Navigate to the **Company Data Field Mapping** section.
2. Map each field in the system to its corresponding field in the AirPlus configuration. For example:
   * Map the **Accounting Unit (AE)** in the system to the **Accounting Unit** in AirPlus.
   * Map **Cost Center (KS)** in the system to **Cost Center** in AirPlus.
3. Ensure that all mandatory fields are properly mapped to avoid errors during the checkout process.

<figure><img src="https://3149150666-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8c7vcYvS5xbYvIdXUIaO%2Fuploads%2Fgit-blob-35406a4e306c7a010dbbc257e9922ac75dda4cdf%2Fcompany%20data%20field%20mapping.png?alt=media" alt=""><figcaption><p>Company Data Field Mapping</p></figcaption></figure>

***

### 4. Checkout Process for AirPlus Payments

During the checkout phase, the user completes the payment process by filling in the required AirPlus fields. This process ensures that all mandatory fields are filled, and the payment is processed seamlessly.

#### **Steps to Complete the Payment:**

1. **Select Reporting**:
   * The user selects **Reporting** to display all the fields required for the Issuing payment card + required fields missing by any reporting requirements.
   * Fields marked as **Not Used** will not appear in the form.

<figure><img src="https://3149150666-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8c7vcYvS5xbYvIdXUIaO%2Fuploads%2Fgit-blob-691f4bf99ed5e7d0736af2a3f8a0bbce82557ad6%2Freporting.png?alt=media" alt=""><figcaption><p>Reporting Data Displayed Accordingly</p></figcaption></figure>

2. **Fill in Mandatory Fields**:
   * The user fills in all fields marked as **Mandatory**.
   * Optional fields can be filled if needed.

<figure><img src="https://3149150666-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8c7vcYvS5xbYvIdXUIaO%2Fuploads%2Fgit-blob-01270096d2433713a2a8f6c77b2fe22b0c3f29a0%2Freporting%20details.png?alt=media" alt=""><figcaption><p>Reporting Fields Fulfilment</p></figcaption></figure>

3. **Submit Payment**:
   * Once all mandatory fields are filled, the user submits the payment.
   * The system validates the fields and processes the payment using AirPlus.


# Webhooks & Events

Reporting Webhook Configuration

This document provides detailed instructions for configuring the Reporting Webhook within your contract creation, signing, and payment system. This webhook allows real-time updates and notifications based on specified triggers and conditions.

### Accessing the Webhook Configuration

To configure the Reporting Webhook, follow these steps:

1. Navigate to **Dashboard** -> **Configurations** -> **Reporting**.
2. Click **New Reporting**.
3. From the list, choose **Webhook** and click **Next**. You will be presented with the webhook configuration page.

*Note: Screenshot of webhook configuration interface will be added here.*

### Webhook Configuration Settings

The webhook configuration page contains several settings that you need to fill out. Below is a detailed description of each setting:

#### Business Units (Required)

Select the Business Units to which this configuration will be linked. This is a mandatory field.

#### Triggers (Required)

Select the triggers that will activate the webhook. You can choose multiple triggers from the following options:

| Trigger     | When it fires                                               |
| ----------- | ----------------------------------------------------------- |
| `create`    | Contract (transaction) is created                           |
| `update`    | Any field on the contract (transaction) is updated          |
| `send`      | Contract (transaction) email is dispatched to the recipient |
| `review`    | Recipient reviews the contract through the checkout         |
| `expired`   | Contract reaches its expiry date/time                       |
| `confirmed` | Contract is confirmed/accepted by the recipient             |
| `paid`      | Payment is successfully completed                           |
| `canceled`  | Contract is canceled                                        |

#### Payload URL (Required)

Enter the Webhook URL where the payload will be sent. This is a mandatory field.

#### Content Type (Required)

Select the content type for the payload. This is a mandatory field. The available options are:

* `application/json`
* `application/x-www-form-urlencoded`

#### Secret (Optional)

Enter a secret value that will be used to compute an HMAC-SHA256 hash.

#### SSL Verification (Required)

Select the SSL verification option. This is a mandatory field and contains the following options:

* **Enable SSL verification** (default)
* **Disable SSL verification**

This setting determines if SSL verification is required when making HTTP or HTTPS requests.

#### Data to Receive (Required)

Select the type of data you want the webhook to receive. This is a mandatory field and contains the following options:

* **Only Update Status**
* **Send me everything** (default)

Choose whether to receive only the status update of the contract or all the data of the contract along with the status.

#### Assignments Fields (Optional)

Provide an array of field names that define which extra field data to report for each company that belongs to the Business Units. This field is optional.

#### Data Field Mapping (Optional)

Provide an array of field names that define how each field in the transaction (contract) is mapped to the properties in the pushback report. This field is optional.

### Example Configuration

Here is an example of how to fill out the configuration:

* **Business Units**: Provider BU
* **Triggers**: create, update, send
* **Payload URL**: `https://example.com/webhook`
* **Content-Type**: `application/json`
* **Secret**: `your_secret_key`
* **SSL Verification**: Enable SSL verification
* **Data to Receive**: Send me everything

By following these steps and filling out the configuration settings as described, you can successfully set up the Reporting Webhook to meet your specific needs.

For further assistance or troubleshooting, please refer to the support documentation or contact our support team.

## Webhook Payload Envelope

Every webhook delivery wraps the contract payload in a standard envelope. The envelope contains the following fields:

| Field        | Description                                                        |
| ------------ | ------------------------------------------------------------------ |
| `eventId`    | Globally unique identifier for this event (use for idempotency)    |
| `eventType`  | Trigger name that caused this delivery (e.g. `contract.confirmed`) |
| `apiVersion` | API version that produced this payload                             |
| `timestamp`  | ISO-8601 UTC timestamp of the first dispatch attempt               |
| `data`       | Full contract payload (or status-only if configured)               |

> **`contract.confirmed` and `contract.paid` events** — when **"Send me everything"** is selected, the `data` object includes a `checkout` field with fully resolved customer, beneficiary, billing, payment, and card data (no raw IDs). See the payload examples below.

### Request Headers

Every delivery also includes the following HTTP headers:

| Header                | Description                                                      |
| --------------------- | ---------------------------------------------------------------- |
| `X-Webhook-Id`        | The `eventId` of the delivery (same as in the envelope body)     |
| `X-Webhook-Timestamp` | Unix epoch (seconds) — used in signature computation             |
| `X-Webhook-Signature` | HMAC-SHA256 signature — only present when a Secret is configured |

***

## HMAC Signature Verification

When you configure a **Secret**, every delivery includes an `X-Webhook-Signature` header. Verify it to confirm the request is genuine and has not been tampered with.

### How to verify

To verify a delivery, compute an HMAC-SHA256 hash over the string formed by concatenating the timestamp, a dot (`.`), and the raw request body — using your configured secret as the key. Compare the resulting hex string against the value in the `X-Webhook-Signature` header.

The `X-Webhook-Timestamp` header contains the Unix epoch (seconds) used in the signature. **Reject any delivery where the timestamp is more than 5 minutes old** to prevent replay attacks.

> **Important:** Always use a timing-safe string comparison when checking the signature to prevent timing attacks.

***

## Retry Behaviour

If your endpoint does not return a `2xx` response, or the connection times out, the delivery is retried automatically using exponential back-off with ±10% random jitter.

| Attempt         | Delay before retry |
| --------------- | ------------------ |
| 1st (immediate) | —                  |
| 2nd retry       | \~1 minute         |
| 3rd retry       | \~5 minutes        |
| 4th retry       | \~15 minutes       |
| 5th retry       | \~1 hour           |
| 6th retry       | \~6 hours          |
| 7th retry       | \~24 hours         |
| 8th retry       | \~24 hours         |

After 8 failed attempts the delivery is marked **ERROR** and no further automatic retries are made. You can trigger a manual retry from the **Dashboard → Contracts → \[Contract] → Reporting Events** panel.

### Delivery Statuses

| Status     | Meaning                                                 |
| ---------- | ------------------------------------------------------- |
| `PENDING`  | Delivery queued, first attempt not yet made             |
| `RETRYING` | One or more failed attempts; waiting for the next retry |
| `SEND`     | Endpoint returned 2xx                                   |
| `ERROR`    | All retry attempts exhausted                            |

***

## Idempotency

Each delivery carries a unique `eventId`. If you receive the same `eventId` more than once (e.g. after a network failure caused the delivery to be retried even though you already processed it), you should deduplicate on your side using this field.

***

## Payload Examples

### `contract.confirmed` — "Send me everything"

Sent when a contract is confirmed. Includes full checkout and payment schedule with resolved data.

```json
{
  "eventId": "evt_5f8d9c0b-9e2b-4b8d-b4e8-9b9d9d2a1f11",
  "eventType": "contract.confirmed",
  "apiVersion": "2025-04-01",
  "timestamp": "2025-04-22T10:33:51Z",
  "data": {
    "id": "C-2025-000123",
    "status": "CONFIRMED",
    "title": "Enterprise Travel Plan",
    "currency": "EUR",
    "externalIds": {
      "sap_id": "12345"
    },
    "items": [...],
    "checkout": {
      "reference": "ABC123",
      "payment": {
        "reference": "stripe-ch-001",
        "provider": "STRIPE"
      },
      "customer": {
        "firstName": "John",
        "lastName": "Doe",
        "email": "john.doe@example.com",
        "phone": "+49123456789",
        "address": {
          "street": "Main St",
          "house": "1",
          "city": "Berlin",
          "country": "DE",
          "zipCode": "10115"
        }
      },
      "beneficiary": {
        "firstName": "Jane",
        "lastName": "Smith",
        "email": "jane.smith@example.com"
      },
      "billing": {
        "name": "ACME Corp",
        "address": {
          "street": "Corp Ave",
          "house": "42",
          "city": "Munich",
          "country": "DE",
          "zipCode": "80331"
        },
        "externalIds": {
          "sap_id": "67890"
        },
        "identifiers": {
          "VATIN": "DE123456789"
        }
      },
      "card": {
        "masked": "411111****1111",
        "expiryMonth": "12",
        "expiryYear": "2027",
        "cardHolder": {
          "first": "John",
          "last": "Doe"
        }
      },
      "reporting": {
        "costCenter": "CC-001"
      }
    },
    "paymentSchedule": {
      "type": "ONCE",
      "dueDate": "2025-05-01",
      "paymentTerms": "NET30",
      "events": [
        {
          "id": "pe_001",
          "type": "PAYMENT",
          "paymentDate": "2025-05-01",
          "value": 1500.0,
          "unit": "AMOUNT",
          "status": "PENDING"
        }
      ]
    }
  }
}
```

### `contract.paid` — "Send me everything"

Sent when payment is successfully completed. Includes the same full checkout structure as `contract.confirmed`, with the payment event status updated to `PAID` and the payment reference resolved.

```json
{
  "eventId": "evt_7a1c3d22-b3f4-4c9e-a0d1-1c2b3d4e5f60",
  "eventType": "contract.paid",
  "apiVersion": "2025-04-01",
  "timestamp": "2025-05-01T14:22:09Z",
  "data": {
    "id": "C-2025-000123",
    "status": "PAID",
    "title": "Enterprise Travel Plan",
    "currency": "EUR",
    "externalIds": {
      "sap_id": "12345"
    },
    "items": [...],
    "checkout": {
      "reference": "ABC123",
      "payment": {
        "reference": "stripe-ch-001",
        "provider": "STRIPE"
      },
      "customer": {
        "firstName": "John",
        "lastName": "Doe",
        "email": "john.doe@example.com",
        "phone": "+49123456789",
        "address": {
          "street": "Main St",
          "house": "1",
          "city": "Berlin",
          "country": "DE",
          "zipCode": "10115"
        }
      },
      "beneficiary": {
        "firstName": "Jane",
        "lastName": "Smith",
        "email": "jane.smith@example.com"
      },
      "billing": {
        "name": "ACME Corp",
        "address": {
          "street": "Corp Ave",
          "house": "42",
          "city": "Munich",
          "country": "DE",
          "zipCode": "80331"
        },
        "externalIds": {
          "sap_id": "67890"
        },
        "identifiers": {
          "VATIN": "DE123456789"
        }
      },
      "card": {
        "masked": "411111****1111",
        "expiryMonth": "12",
        "expiryYear": "2027",
        "cardHolder": {
          "first": "John",
          "last": "Doe"
        }
      },
      "reporting": {
        "costCenter": "CC-001"
      }
    },
    "paymentSchedule": {
      "type": "ONCE",
      "dueDate": "2025-05-01",
      "paymentTerms": "NET30",
      "events": [
        {
          "id": "pe_001",
          "type": "PAYMENT",
          "paymentDate": "2025-05-01",
          "value": 1500.0,
          "unit": "AMOUNT",
          "status": "PAID"
        }
      ]
    }
  }
}
```

### `contract.paid` — "Only Update Status"

Sent when payment is completed. Only the envelope fields and contract status are included.

```json
{
  "eventId": "evt_7a1c3d22-b3f4-4c9e-a0d1-1c2b3d4e5f60",
  "eventType": "contract.paid",
  "apiVersion": "2025-04-01",
  "timestamp": "2025-05-01T14:22:09Z",
  "data": {
    "status": "PAID"
  }
}
```

### `contract.confirmed` — "Only Update Status"

```json
{
  "eventId": "evt_5f8d9c0b-9e2b-4b8d-b4e8-9b9d9d2a1f11",
  "eventType": "contract.confirmed",
  "apiVersion": "2025-04-01",
  "timestamp": "2025-04-22T10:33:51Z",
  "data": {
    "status": "CONFIRMED"
  }
}
```

***

## Signature Verification — Code Examples

### Node.js

```js
const crypto = require("crypto");

function verifyWebhookSignature(
  secret,
  timestampHeader,
  body,
  signatureHeader,
) {
  // Reject deliveries older than 5 minutes
  const now = Math.floor(Date.now() / 1000);
  if (Math.abs(now - Number(timestampHeader)) > 300) {
    return false;
  }

  const expected = crypto
    .createHmac("sha256", secret)
    .update(`${timestampHeader}.${body}`)
    .digest("hex");

  const received = signatureHeader.replace(/^sha256=/, "");

  // Use timing-safe comparison to prevent timing attacks
  return crypto.timingSafeEqual(
    Buffer.from(expected, "hex"),
    Buffer.from(received, "hex"),
  );
}

// Express example
app.post("/webhook", express.raw({ type: "application/json" }), (req, res) => {
  const valid = verifyWebhookSignature(
    process.env.WEBHOOK_SECRET,
    req.headers["X-Webhook-Timestamp"],
    req.body.toString(), // raw bytes as string
    req.headers["X-Webhook-Signature"],
  );
  if (!valid) return res.status(401).send("Invalid signature");
  // process req.body ...
  res.sendStatus(200);
});
```

### Python

```python
import hashlib
import hmac
import time

def verify_webhook_signature(secret: str, timestamp: str, body: str, signature: str) -> bool:
    # Reject deliveries older than 5 minutes
    if abs(time.time() - int(timestamp)) > 300:
        return False

    expected = hmac.new(
        secret.encode(),
        f"{timestamp}.{body}".encode(),
        hashlib.sha256
    ).hexdigest()

    received = signature.removeprefix("sha256=")

    # Use constant-time comparison to prevent timing attacks
    return hmac.compare_digest(expected, received)

# Flask example
from flask import Flask, request, abort

app = Flask(__name__)

@app.route('/webhook', methods=['POST'])
def webhook():
    raw_body = request.get_data(as_text=True)
    valid = verify_webhook_signature(
        secret=os.environ['WEBHOOK_SECRET'],
        timestamp=request.headers.get('X-Webhook-Timestamp', ''),
        body=raw_body,
        signature=request.headers.get('X-Webhook-Signature', '')
    )
    if not valid:
        abort(401)
    # process request.json ...
    return '', 200
```

***

All data is access-controlled and only shows deliveries belonging to your accessible Business Units.


# Users & Permissions

Permission Control System Documentation

## Overview

The permission control system ensures secure and organized access to resources (such as Auth Configs, Business Units, Companies, Configs, Groups, Payment Methods, Permissions, Profile Providers, Report Configs, Transactions, User Profiles, and Widgets). It allows roles (Read, Write, Admin) to be assigned to individual users or groups, controlling how resources are accessed and managed over a certain Business Unit.

*Note: Permission system architecture diagram will be added here.*

Permissions are structured to allow either direct assignment to users or through group memberships. This ensures that access control is scalable and easily managed.

## Creating and Managing Groups

### Creating a New Group

1. Navigate to **Organization > Users & Permissions > Grouping Tab**.
2. Click on **Create New Group**.
3. Provide a group name and select the relevant business unit.
4. Use filters to select users for the group.
5. Click **Save** to finalize the group.

*Note: Group creation interface screenshot will be added here.*

### Managing Group Details

You can edit existing groups by:

* Renaming the group.
* Modifying filters to update the group's members.

### Group Inheritance of Permissions

All its members inherit permissions assigned to a group, simplifying access management for large teams.

> **Note:** A user can be a member of more than one group, inheriting the permissions from each group they are part of.

## Assigning Permissions

### Assigning Permissions to Groups or Individual Users

Navigate to **Organization > Users & Permissions > Permissions** Tab.

### 1. Creating a New Permission:

* Provide a unique name for the permission and select the relevant Business Unit.
* Choose the user or group to whom this permission will apply.
* Define the access level (Read, Write, Admin, or No Role) for each resource within the selected Business Unit.
* Click **Create** to complete the permission setup.

*Note: Permission creation interface screenshot will be added here.*

### 2. Editing an Existing Permission:

* Select the permission you wish to edit, then click **Edit**.
* Modify Name, Business Unit, Access Name ( User, Group ), or access levels as needed.
* Click **Save** to implement the updates.

**Expanding Permissions Details**

A detailed view will expand beneath the row when you click on a group or user entry in the table. This view shows the permissions granted for each resource:

* Green circles with a checkmark (✔️) indicate granted permissions write or admin.
* Red circles with a cross (❌) indicate permissions that are not granted.
* Orange circles with a checkmark **(✔️)** indicate granted permissions read-only.

*Note: Permission details view screenshot will be added here.*

### Best Practices

* Regularly audit group memberships and user roles to maintain accurate access control.
* Use groups to standardize permissions for teams or departments.
* Limit the Admin role to trusted personnel who require full access.

***


# Currency Codes

Currency Codes and Minor Units

In your API requests, you must provide transaction amounts by specifying a currency code and a value. Given the number of currency decimals, the value must be specified in minor units for most APIs.

## **Minor Units**

Our [CheckOut API](https://docs.one-cp.com/api-reference) expects you to submit transaction amount values in **minor units**: the smallest unit of a currency, depending on the number of decimals.

Most currencies have two decimals. Some currencies do not have decimals, and some have three decimals. For example:

* **GBP 10**: GBP has two decimals, so in minor units, you need to submit an amount of *1000*
* **JPY 10**: JPY has no decimals, so in minor units, you need to submit an amount of *10*
* **BHD 10**: BHD has three decimals, so in minor units, you need to submit an amount of *10000*

This page lists the supported currency codes and explains what minor units are.

## Currency codes: <a href="#currency-codes" id="currency-codes"></a>

<table><thead><tr><th width="249">Code</th><th>Currency</th><th>Decimals</th></tr></thead><tbody><tr><td>AUD</td><td>Australian Dollar</td><td>2</td></tr><tr><td>BGN</td><td>New Bulgarian Lev</td><td>2</td></tr><tr><td>BRL</td><td>Brazilian Real</td><td>2</td></tr><tr><td>CAD</td><td>Canadian Dollar</td><td>2</td></tr><tr><td>CHF</td><td>Swiss Franc</td><td>2</td></tr><tr><td>CNY</td><td>Chinese yuan renminbi</td><td>2</td></tr><tr><td>CZK</td><td>Czech Koruna</td><td>2</td></tr><tr><td>DKK</td><td>Danish Krone</td><td>2</td></tr><tr><td>EUR</td><td>Euro</td><td>2</td></tr><tr><td>GBP</td><td>Pound Sterling</td><td>2</td></tr><tr><td>HKD</td><td>Hong Kong Dollar</td><td>2</td></tr><tr><td>HUF</td><td>Hungarian Forint</td><td>2</td></tr><tr><td>IDR</td><td>Indonesian Rupiah</td><td>0 (differs from standard)</td></tr><tr><td>ILS</td><td>New Israeli Scheqel</td><td>2</td></tr><tr><td>INR</td><td>Indian Rupee</td><td>2</td></tr><tr><td>ISK</td><td>Iceland Krona</td><td>2 (differs from standard)</td></tr><tr><td>JPY</td><td>Japanese Yen</td><td>0</td></tr><tr><td>KRW</td><td>South-Korean Won</td><td>0</td></tr><tr><td>MXN</td><td>Mexican Peso</td><td>2</td></tr><tr><td>MYR</td><td>Malaysian Ringgit</td><td>2</td></tr><tr><td>NOK</td><td>Norwegian Krone</td><td>2</td></tr><tr><td>NZD</td><td>New Zealand Dollar</td><td>2</td></tr><tr><td>PHP</td><td>Philippine Peso</td><td>2</td></tr><tr><td>PLN</td><td>New Polish Zloty</td><td>2</td></tr><tr><td>RON</td><td>New Romanian Lei</td><td>2</td></tr><tr><td>SEK</td><td>Swedish Krona</td><td>2</td></tr><tr><td>SGD</td><td>Singapore Dollar</td><td>2</td></tr><tr><td>THB</td><td>Thai Baht</td><td>2</td></tr><tr><td>TRY</td><td>New Turkish Lira</td><td>2</td></tr><tr><td>USD</td><td>US Dollars</td><td>2</td></tr><tr><td>ZAR</td><td>South African Rand</td><td>2</td></tr></tbody></table>

## Different numbers of decimals <a href="#note" id="note"></a>

For CLP, CVE, IDR, and ISK the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) standard has a different number of decimals than shown in our currency codes table above. When submitting amounts in minor units, the decimals in the table on this page are leading.

For example, ISK has zero decimals in the ISO 4217 standard, but to submit an ISK amount to Adyen you have to use two decimals as shown in the table.


# Tax Calculation

Totals and Tax Calculation System

## Introduction

The tax calculation system calculates the total tax and item total based on various parameters such as item price, quantity, tax types, tax values, and units. The calculation is recursive and backward, starting from the last applied tax.

## Parameters

* **Item Price (price)**: An integer value representing the single unit price of the item. It follows the Currency Codes and Minor Units specified [here](/reference-materials/currency-codes).
* **Item Quantity (quantity)**: An integer value representing the quantity of the item.\
  Item quantity consists of two properties:\
  \- amount: integer value\
  \- per: ( FLAT\_FEE | PER\_HOUR | PER\_DAY | PER\_NIGHT | PER\_WEEK | PER\_MONTH | PER\_YEAR | PER\_PERSON )
* **Tax Type (type)**:

```
VAT, BED_TAX, CITY_HOTEL_FEES, COUNTRY_TAX, CITY_TAX, ENERGY_CHARGE,
FEDERAL_TAX, GST, INCLUSION, LODGING_TAX, MAINTENANCE_FEE, OCCUPANCY_TAX,
PACKAGE_RATE_FEE, ROOM_TAX, RESORT_FEES, SALES_TAX, STATE_PROVINCE_TAX,
SURCHARGE, SERVICE_CHARGE, OTHER_TAX, TOURISM_TAX
```

* **Tax Value (value)**: An integer representing the tax value. If the tax unit is PERCENT, it represents a percentage of the item price. If the tax unit is AMOUNT, it is a constant value following the Currency Codes and Minor Units specified [here](/reference-materials/currency-codes).
* **Tax Unit (unit)**: AMOUNT or PERCENT.
* **Tax Applied To (apply\_to)**: Refers to any of the previous tax types in the item taxes list or "NET\_PRICE" for the first tax.
* **Tax Per**: FLAT\_FEE or PER\_QUANTITY.

## Calculation Logic

The tax calculation is recursive and backward, starting from the last applied tax backward to the item value. The total tax and item total are calculated accordingly.

### Examples

#### Case 1

* Item (price: 49999 (499.99 USD), quantity: 2)
* Taxes:

| Tax Type | Tax Value | Tax Per       | Apply To   | Tax Per Item    | Total Tax       |
| -------- | --------- | ------------- | ---------- | --------------- | --------------- |
| VAT      | 20 %      | PER\_QUANTITY | NET\_PRICE | 10000 (100 USD) | 20000 (200 USD) |

* Item Total: 119998 (1199.98 USD)
* Total Tax: 20000 (200 USD)

#### Case 2

* Item (price: 10000 (100 USD), quantity: 1)
* Taxes:

| Tax Type         | Tax Value | Tax Per   | Apply To   | Tax Per Item    | Total Tax       |
| ---------------- | --------- | --------- | ---------- | --------------- | --------------- |
| VAT              | 10 %      | FLAT\_FEE | NET\_PRICE | 1000 (10 USD)   | 1000 (10 USD)   |
| BED\_TAX         | 20 %      | FLAT\_FEE | VAT        | 2200 (22 USD)   | 2200 (22 USD)   |
| MAINTENANCE\_FEE | 15 %      | FLAT\_FEE | BED\_TAX   | 1980 (19.8 USD) | 1980 (19.8 USD) |

* Item Total: 15180 (151.8 USD)
* Total Tax: 5180 (51.8 USD)

#### Case 3

* Item (price: 10000 (100 USD), quantity: 2)
* Taxes:

| Tax Type         | Tax Value | Tax Per       | Apply To   | Tax Per Item    | Total Tax       |
| ---------------- | --------- | ------------- | ---------- | --------------- | --------------- |
| VAT              | 10 %      | PER\_QUANTITY | NET\_PRICE | 1000 (10 USD)   | 2000 (20 USD)   |
| BED\_TAX         | 20 %      | PER\_QUANTITY | VAT        | 2200 (22 USD)   | 4400 (44 USD)   |
| MAINTENANCE\_FEE | 15 %      | PER\_QUANTITY | BED\_TAX   | 1980 (19.8 USD) | 3960 (39.6 USD) |

* Item Total: 30360 (303.6 USD)
* Total Tax: 10360 (103.6 USD)

#### Case 4

* Item (price: 10000 (100 USD), quantity: 1)
* Taxes:

| Tax Type         | Tax Value | Tax Per       | Apply To     | Tax Per Item     | Total Tax        |
| ---------------- | --------- | ------------- | ------------ | ---------------- | ---------------- |
| VAT              | 10 %      | PER\_QUANTITY | NET\_PRICE   | 1000 (10 USD)    | 1000 (10 USD)    |
| BED\_TAX         | 20 %      | PER\_QUANTITY | VAT          | 2200 (22 USD)    | 2200 (22 USD)    |
| FEDERAL\_TAX     | 7 %       | PER\_QUANTITY | NET\_PRICE   | 700 (7 USD)      | 700 (7 USD)      |
| MAINTENANCE\_FEE | 15 %      | PER\_QUANTITY | FEDERAL\_TAX | 1605 (16.05 USD) | 1605 (16.05 USD) |

* Item Total: 15505 (155.05 USD)
* Total Tax: 5505 (55.05 USD)

#### Case 5

* Item (price: 10000 (100 USD), quantity: 3)
* Taxes:

| Tax Type         | Tax Value | Tax Per       | Apply To     | Tax Per Item     | Total Tax        |
| ---------------- | --------- | ------------- | ------------ | ---------------- | ---------------- |
| VAT              | 10 %      | PER\_QUANTITY | NET\_PRICE   | 1000 (10 USD)    | 3000 (30 USD)    |
| BED\_TAX         | 20 %      | PER\_QUANTITY | VAT          | 2200 (22 USD)    | 6600 (66 USD)    |
| FEDERAL\_TAX     | 7 %       | PER\_QUANTITY | NET\_PRICE   | 700 (7 USD)      | 2100 (21 USD)    |
| MAINTENANCE\_FEE | 15 %      | PER\_QUANTITY | FEDERAL\_TAX | 1605 (16.05 USD) | 4815 (48.15 USD) |

* Item Total: 46515 (465.15 USD)
* Total Tax: 16515 (165.15 USD)

#### Case 6

* Item (price: 4400 (44 USD), quantity: 1)
* Taxes:

| Tax Type | Tax Value | Tax Per   | Apply To   | Tax Per Item   | Total Tax      |
| -------- | --------- | --------- | ---------- | -------------- | -------------- |
| VAT      | 7 %       | FLAT\_FEE | NET\_PRICE | 308 (3.08 USD) | 308 (3.08 USD) |
| BED\_TAX | 3 %       | FLAT\_FEE | VAT        | 144 (1.44 USD) | 144 (1.44 USD) |

* Item Total: 4849 (48.49 USD)
* Total Tax: 449 (4.49 USD)

#### Case 7

* Item (price: 4400 (44 USD), quantity: 3)
* Taxes:

| Tax Type | Tax Value | Tax Per       | Apply To   | Tax Per Item   | Total Tax      |
| -------- | --------- | ------------- | ---------- | -------------- | -------------- |
| VAT      | 7 %       | PER\_QUANTITY | NET\_PRICE | 308 (3.08 USD) | 924 (9.24 USD) |
| BED\_TAX | 3 %       | PER\_QUANTITY | VAT        | 144 (1.44 USD) | 423 (4.23 USD) |

* Item Total: 14547 (145.47 USD)
* Total Tax: 1347 (13.47 USD)

#### Case 8

* Item (price: 4400 (44 USD), quantity: 1)
* Taxes:

<table><thead><tr><th width="139">Tax Type</th><th width="104">Tax Value</th><th width="166">Tax Per</th><th width="190">Apply To</th><th>Tax Per Item</th><th>Total Tax</th></tr></thead><tbody><tr><td>VAT</td><td>10 %</td><td>PER_QUANTITY</td><td>NET_PRICE</td><td>440 (4.4 USD)</td><td>440 (4.4 USD)</td></tr><tr><td>BED_TAX</td><td>3 %</td><td>PER_QUANTITY</td><td>VAT</td><td>145 (1.45 USD)</td><td>145 (1.45 USD)</td></tr><tr><td>MAINTENANCE_FEE</td><td>7 %</td><td>PER_QUANTITY</td><td>NET_PRICE</td><td>308 (3.08 USD)</td><td>308 (3.08 USD)</td></tr><tr><td>BED_TAX</td><td>15 %</td><td>PER_QUANTITY</td><td>MAINTENANCE_FEE</td><td>706 (7.06 USD)</td><td>706 (7.06 USD)</td></tr></tbody></table>

* Item Total: 5999 (59.99 USD)
* Total Tax: 1599 (15.99 USD)

#### Case 9

* Item (price: 4400 (44 USD), quantity: 2)
* Taxes:

| Tax Type         | Tax Value | Tax Per       | Apply To         | Tax Per Item   | Total Tax        |
| ---------------- | --------- | ------------- | ---------------- | -------------- | ---------------- |
| VAT              | 10 %      | PER\_QUANTITY | NET\_PRICE       | 440 (4.4 USD)  | 880 (8.8 USD)    |
| BED\_TAX         | 3 %       | PER\_QUANTITY | VAT              | 145 (1.45 USD) | 290 (2.9 USD)    |
| MAINTENANCE\_FEE | 7 %       | PER\_QUANTITY | NET\_PRICE       | 308 (3.08 USD) | 616 (6.16 USD)   |
| BED\_TAX         | 15 %      | PER\_QUANTITY | MAINTENANCE\_FEE | 706 (7.06 USD) | 1412 (14.12 USD) |

* Item Total: 11998 (119.98 USD)
* Total Tax: 3198 (31.98 USD)

#### Case 10

* Item (price: 50 (0.50 USD), quantity: 3)
* Taxes:

| Tax Type | Tax Value | Tax Per   | Apply To   | Tax Per Item | Total Tax    |
| -------- | --------- | --------- | ---------- | ------------ | ------------ |
| VAT      | 7 %       | FLAT\_FEE | NET\_PRICE | 4 (0.04 USD) | 4 (0.04 USD) |
| BED\_TAX | 3 %       | FLAT\_FEE | VAT        | 0            | 0            |

* Item Total: 154 (1.54 USD)
* Total Tax: 4 (0.04 USD)

#### Case 11

* Item (price: 100 (1 USD), quantity: 2)
* Taxes:

| Tax Type     | Tax Value | Tax Per       | Apply To         | Tax Per Item  | Total Tax     |
| ------------ | --------- | ------------- | ---------------- | ------------- | ------------- |
| VAT          | 10 %      | PER\_QUANTITY | NET\_PRICE       | 10 (0.1 USD)  | 20 (0.2 USD)  |
| BED\_TAX     | 20 %      | FLAT\_FEE     | VAT              | 22 (0.22 USD) | 22 (0.22 USD) |
| COUNTRY\_TAX | 15 %      | FLAT\_FEE     | MAINTENANCE\_FEE | 0             | 0             |

* Item Total: 242 (2.42 USD)
* Total Tax: 42 (0.42 USD)


