> For the complete documentation index, see [llms.txt](https://docs.one-cp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.one-cp.com/integration-and-development/api-reference.md).

# 🪄 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}}}}
```
