πͺ API Reference
π³ Payment processing and transactions
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.
Connection established successfully.
Invalid authentication credentials provided.
Access denied - insufficient permissions.
GET /status HTTP/1.1
Host: api.1-cp.io
Accept: */*
{
"status": "ready",
"provider": "667999d063824b596cf82155"
}
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.
Transaction status retrieved successfully
Invalid transaction ID format
Invalid authentication credentials or unauthorized access to contract
Contract not found with the provided transaction ID
GET /status/{transactionId} HTTP/1.1
Host: api.1-cp.io
Accept: */*
{
"status": "PENDING",
"checkout": {
"reference": "ABC123",
"payment": {
"reference": "ABC123",
"provider": "Stripe"
},
"customer": {
"firstName": "John",
"lastName": "Doe",
"email": "[email protected]",
"phone": "+1234567890",
"address": null
},
"beneficiary": {
"firstName": "Jane",
"lastName": "Smith",
"email": "[email protected]"
},
"billing": {
"name": "ACME Corporation",
"email": "[email protected]",
"address": null,
"externalIds": {
"sap_id": "12345",
"crm_id": "CRM_67890"
}
},
"card": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"reporting": {
"ANY_ADDITIONAL_PROPERTY": "anything"
}
}
}
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.
Currency of the CorporateCheckout
EUR
Title of the CorporateCheckout
Off site event
Additional notes about the CorporateCheckout. (Internal note only - not visible to the customer)
Internal note
Transaction created successfully with unique identifier
Invalid request data - validation errors in the request body
Authentication failed - invalid credentials
Access denied - insufficient permissions
POST /initialize HTTP/1.1
Host: api.1-cp.io
Content-Type: application/json
Accept: */*
Content-Length: 579
{
"currency": "EUR",
"items": [
{
"category": "FLIGHT",
"period": {
"start": "2024-04-16T12:07:05.159Z",
"end": "2024-04-16T15:07:05.159Z"
},
"departure": "FRA",
"destination": "MUC",
"airline": "LH",
"serviceClass": "ECONOMY_CLASS",
"flightNumber": "LH441",
"fareClass": "Y"
}
],
"refIDs": {
"google-id": "667999d063824b596cf82155sdfwew334435"
},
"title": "Off site event",
"attachments": [
{
"url": "http://file_url.pdf",
"type": "INVOICE"
}
],
"note": "Internal note",
"email": {
"subject": "Your booking confirmation",
"content": "Thank you for your booking. Please find your details below.",
"recipients": [
"[email protected]"
]
}
}
{
"transactionId": "667999d063824b596cf82155"
}
Cancels items in an existing contract and processes refunds based on cancellation policies.
**Features:**
- Partial or full cancellation support
- Automatic refund calculation based on cancellation policies
- Real-time refund processing
- JSON format only (no file upload)
**Cancellation Process:**
1. Validate contract status and permissions
2. Calculate refundable amount based on cancellation policy
3. Process refund transaction
4. Update contract status
5. Generate cancellation receipt
Cancellation processed successfully
Invalid request data or contract status does not allow cancellation
Authentication failed - invalid credentials
Access denied - insufficient permissions
Contract not found with the provided ID
Internal server error or refund processing failure
PATCH /cancel/{transactionId} HTTP/1.1
Host: api.1-cp.io
Content-Type: application/json
Accept: */*
Content-Length: 103
{
"itemsOrder": [
1,
2
],
"amount": 1000,
"invoiceTitle": "Cancellation Invoice",
"invoiceNumber": "INV-2024-001"
}
{
"status": "SUCCESS",
"errorMessage": "error.message"
}
Cancels items in an existing contract and processes refunds based on cancellation policies.
**Features:**
- Partial or full cancellation support
- Automatic refund calculation based on cancellation policies
- Optional invoice file upload for documentation
- Real-time refund processing
- Multipart/form-data format with optional file attachment
**Cancellation Process:**
1. Validate contract status and permissions
2. Calculate refundable amount based on cancellation policy
3. Process refund transaction
4. Update contract status
5. Generate cancellation receipt
Cancellation processed successfully
Invalid request data or contract status does not allow cancellation
Authentication failed - invalid credentials
Access denied - insufficient permissions
Contract not found with the provided ID
Internal server error or refund processing failure
PATCH /cancel/{transactionId}/invoice HTTP/1.1
Host: api.1-cp.io
Content-Type: multipart/form-data
Accept: */*
Content-Length: 103
{
"itemsOrder": [
1,
2
],
"amount": 1000,
"invoiceTitle": "Cancellation Invoice",
"invoiceNumber": "INV-2024-001"
}
{
"status": "SUCCESS",
"errorMessage": "error.message"
}