For the complete documentation index, see llms.txt. This page is also available as Markdown.

🪄 API Reference

💳 Payment processing and transactions

Check API Connection Status

get
/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.

Responses
201

Connection established successfully.

application/json
statusstringOptional

Connection status indicator

Example: ready
providerstringOptional

Unique identifier of the authenticated provider

Example: 667999d063824b596cf82155
get/status
GET /status HTTP/1.1
Host: api.1-cp.io
Accept: */*
{
  "status": "ready",
  "provider": "667999d063824b596cf82155"
}

Get transaction Status

get
/status/{transactionId}

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.

Path parameters
transactionIdstringRequired
Responses
200

Transaction status retrieved successfully

application/json
statusstring · enumRequired

Current status of the transaction

Possible values:
get/status/{transactionId}
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": "john.doe@example.com",
      "phone": "+1234567890",
      "address": null
    },
    "beneficiary": {
      "firstName": "Jane",
      "lastName": "Smith",
      "email": "jane.smith@example.com"
    },
    "billing": {
      "name": "ACME Corporation",
      "email": "1-cp+ABC123@one-cp.com",
      "address": null,
      "externalIds": {
        "sap_id": "12345",
        "crm_id": "CRM_67890"
      }
    },
    "card": {
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "reporting": {
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  }
}

Initialize Corporate Checkout Transaction

post
/initialize

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.

Body
currencystringRequired

Currency of the CorporateCheckout

Example: EUR
titlestringRequired

Title of the CorporateCheckout

Example: Off site event
notestringOptional

Additional notes about the CorporateCheckout. (Internal note only - not visible to the customer)

Example: Internal note
restrictedMethodsstring · enumOptional

Payment methods that the provider has deactivated

Possible values:
Responses
201

Transaction created successfully with unique identifier

application/json
transactionIdstringOptional

Unique identifier for the created transaction

Example: 667999d063824b596cf82155
post/initialize
POST /initialize HTTP/1.1
Host: api.1-cp.io
Content-Type: application/json
Accept: */*
Content-Length: 605

{
  "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": [
      "user@example.com"
    ]
  },
  "restrictedMethods": "ECA"
}
{
  "transactionId": "667999d063824b596cf82155"
}

Cancel Transaction and Process Refund (JSON)

patch
/cancel/{transactionId}

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
Path parameters
transactionIdstringRequired
Body
itemsOrdernumber[] · min: 1Required

Array of item order numbers to cancel, order numbers start from 1

Example: [1,2]
amountnumberOptional

Specific refund amount. If not provided or 0, the refundable amount will be calculated based on cancellation policy

Example: 1000
invoiceTitlestringOptional

Title of the cancellation invoice

Example: Cancellation Invoice
invoiceNumberstringOptional

Invoice number for the cancellation

Example: INV-2024-001
Responses
200

Cancellation processed successfully

application/json
statusstring · enumOptional

Result of the cancellation operation

Possible values:
errorMessagestringOptional

Error details if status is FAILED, null if SUCCESS

Example: error.message
patch/cancel/{transactionId}
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"
}

Cancel Transaction and Process Refund (with File Upload)

patch
/cancel/{transactionId}/invoice

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
Path parameters
transactionIdstringRequired
Body
itemsOrdernumber[] · min: 1Required

Array of item order numbers to cancel, order numbers start from 1

Example: [1,2]
amountnumberOptional

Specific refund amount. If not provided or 0, the refundable amount will be calculated based on cancellation policy

Example: 1000
invoiceTitlestringOptional

Title of the cancellation invoice

Example: Cancellation Invoice
invoiceNumberstringOptional

Invoice number for the cancellation

Example: INV-2024-001
Responses
200

Cancellation processed successfully

application/json
statusstring · enumOptional

Result of the cancellation operation

Possible values:
errorMessagestringOptional

Error details if status is FAILED, null if SUCCESS

Example: error.message
patch/cancel/{transactionId}/invoice
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"
}

Update Transaction info

put
/{transactionId}
Path parameters
transactionIdstringRequired
Body
titlestringOptional

Title of contract

Example: Booking
notestringOptional

Note

Example: Note text
Responses
200

Transaction updated successfully

application/json
messagestringOptionalExample: Updated successfully
put/{transactionId}
PUT /{transactionId} HTTP/1.1
Host: api.1-cp.io
Content-Type: application/json
Accept: */*
Content-Length: 155

{
  "externalIds": {
    "sap_id": "12345",
    "crm_id": "CRM_67890"
  },
  "title": "Booking",
  "note": "Note text",
  "attachments": [
    {
      "url": "http://file_url.pdf",
      "type": "INVOICE"
    }
  ]
}
{
  "message": "Updated successfully"
}

Last updated