Checkout API
1-CP Corporate Checkout API
Overview
This documentation provides a detailed guide on how to use the Client API to create transactions. The API uses a POST endpoint and is authenticated using Basic Auth with base64 encoding of the client ID and the client secret.
Authentication
Authentication Details
When accessing the Client API, authentication is handled through Basic Auth. This requires the combination of your client ID and client secret, which must be converted into a base64 string. The resulting encoded string is then used as the value of the Authorization header in the format shown below:
Here's a step-by-step process to prepare the Authorization header:
Combine: Concatenate your client ID and client secret with a colon, like this:
client_id:client_secret
.Encode: Convert this string to its base64 representation.
Insert: Place the base64 string into the Authorization header with the "Basic" prefix.
This method securely transmits your credentials to allow API access. Always ensure that your base64 encoded string is correctly formatted to avoid authentication errors.
The API uses Basic Auth for authentication. The client ID and secret should be encoded in base64 and included in the Authorization header.
Example:
Endpoint :
1- POST /transactions
Request Body
The request body should be a JSON object that matches the CorporateCheckout
the structure described below.
CorporateCheckout Object
refIDs
Map
External identifiers associated with the CorporateCheckout.
title
string
Title of the CorporateCheckout.
currency
string
Currency code for the CorporateCheckout.
items
List of items included in the CorporateCheckout.
attachments
List of attachments associated with the CorporateCheckout.
note
string
Additional notes about the CorporateCheckout. (Internal note only - not visible to the customer)
Email content Subject and recipients which will be recieve the contract email.
Item Object
This is the basic item properties:
stockId
string
Extenal Stock identifier for the item.
name
string
Name of the item.
category
enum
description
string
Description of the item.
price
number
Price of the item.
quantity
Quantity details of the item.
totalTax
number
Total tax applicable to the item. This value will be calculated based on the taxes
in case it is not provided(exp. 10)
total
number
Total cost of the item including taxes. This value will be calculated based on the taxes and the price
in case it is not provided(exp. 1350)
taxes
List of taxes applicable to the item
co2
number
Carbon dioxide pollution.
cancellationPolicy
CancellationPolicy
cancellation policy applicable to the item.
There are nine types of items that need additional properties in addition to the basic properties.
period
Time period for which the item is valid.
location
Location address.
locationName
string
Location name (property name)
accommodationType
enum
roomType
enum
Types
Location Object
street
string
Street name.
house
string
Number of Apartment.
postCode
string
ZipCode.
city
string
City name.
country
string
Country name
lat
string
Latitude of the Location.
lng
string
Longitude of the Location.
Either street/house combination or latitude/longitude combination must be present
Period Object
start
date time
Start Date/time using the ISO 8601 localized to the time zone at origin/ start.
end
date time
End Date/time using the ISO 8601 localized to the time zone at destination/ end.
Item Quantity Object
amount
number
Amount of the quantity. Min is 1
unit
enum
Unit of the quantity : FLAT_FEE
, PER_HOUR
PER_DAY
, PER_NIGHT
, PER_WEEK
, PER_MONTH
, PER_YEAR
, PER_PERSON
. Default value FLAT_FEE
Item Tax Object
type
enum
value
number
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).
unit
enum
Unit of the tax value. AMOUNT
, PERCENT
. Default PERCENT
basis
enum
Basis of the tax calculation: FLAT_FEE
, PER_QUANTITY
. Default PER_QUANTITY
applyTo
enum
Attachment Object
url
string
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
string
Type of the attachment: INVOICE
, PROPOSAL
, TERMS_CONDITIONS
, PICTURES
, HEADER_IMAGE
, OTHER.
CheckoutEmail Object
recipients
Recipient emails
List of recipients associated with the CorporateCheckout.
subject
string
The email subject that well be send to the Recipient list
content
string
The email content that well be send to the Recipient list
SetUp Cancellation of Item
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 Cancelation Policy and Always refund the full amount (default 1-CP Policy will applied).
Basically we have two reference date to do cancellation:
Start period date (it is used with items that have a period property only)
Payment date (it is used with all items)
you can determine the refrence date through CncellationPolicy.reference property.
Cancellation Policy
description
string
no
Description of applicable penalty
reference
enum
yes
Type of refrence Enum: [PAYMENT_DATE, START_PERIOD]
penalties
array of Penalty
yes
List of penalties applicable to the item.
Penalties types
There are two models for determining the penalty:
DatePenalty: based on dates explicitly
OffsetPenalty: based on offsets relative to the reference
The CancellationPolicy.penalties should be of one type, either DatePenalty or OffsetPenalty. Not both types together.
DatePenalty
type
enum
yes
Type of Penalty Enum: [DATE_PENALTY]
value
CancellationPenaltyValue
yes
Value of Penalty
until
Date
yes
The date after which the penalty will be applied
OffsetPenalty
type
enum
yes
Type of Penalty Enum: [OFFSET_PENALTY]
value
CancellationPenaltyValue
yes
Value of Penalty
offset
CancellationPenaltyOffset
yes
The time offset which will be applied
condition
string
no
Penalty Condition
CancellationPenaltyValue
amount
number
yes
Penalty amount
unit
enum
yes
Penalty value unit Enum: [FIXED_AMOUNT, PERCENTAGE]
CancellationPenaltyOffset
amount
number
yes
Penalty amount
unit
enum
yes
Penalty offset unit Enum:[DAYS, HOURS, MONTHS]
Example Request
Response
The response will contain the created transaction ID, as the following:
Error Handling In Post Transaction Request
If there are any errors in the request, the API will return an appropriate error message with a status code indicating the type of error.
Example:
Last updated