Create a FTP mapping
curl --request POST \
--url https://clarus-api.com/api/ftp_mapping_groups/{mapping_group_id}/mappings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "ftp_mappings",
"attributes": {
"account_id": 5,
"account_in_file": "ACME",
"customer_id": 200,
"customer_in_file": "CUST-200",
"delivery_address_id": 91,
"delivery_address_in_file": "DEL-A",
"collection_address_id": 17,
"collection_address_in_file": "COL-Z",
"mapping_fields": [
{
"file_format": "csv"
}
]
}
}
}
'import requests
url = "https://clarus-api.com/api/ftp_mapping_groups/{mapping_group_id}/mappings"
payload = { "data": {
"type": "ftp_mappings",
"attributes": {
"account_id": 5,
"account_in_file": "ACME",
"customer_id": 200,
"customer_in_file": "CUST-200",
"delivery_address_id": 91,
"delivery_address_in_file": "DEL-A",
"collection_address_id": 17,
"collection_address_in_file": "COL-Z",
"mapping_fields": [{ "file_format": "csv" }]
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
type: 'ftp_mappings',
attributes: {
account_id: 5,
account_in_file: 'ACME',
customer_id: 200,
customer_in_file: 'CUST-200',
delivery_address_id: 91,
delivery_address_in_file: 'DEL-A',
collection_address_id: 17,
collection_address_in_file: 'COL-Z',
mapping_fields: [{file_format: 'csv'}]
}
}
})
};
fetch('https://clarus-api.com/api/ftp_mapping_groups/{mapping_group_id}/mappings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": 5
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Mappings
Create a FTP mapping
Create a FTP mapping within its mapping group, linking an external entity to internal records.
POST
/
api
/
ftp_mapping_groups
/
{mapping_group_id}
/
mappings
Create a FTP mapping
curl --request POST \
--url https://clarus-api.com/api/ftp_mapping_groups/{mapping_group_id}/mappings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "ftp_mappings",
"attributes": {
"account_id": 5,
"account_in_file": "ACME",
"customer_id": 200,
"customer_in_file": "CUST-200",
"delivery_address_id": 91,
"delivery_address_in_file": "DEL-A",
"collection_address_id": 17,
"collection_address_in_file": "COL-Z",
"mapping_fields": [
{
"file_format": "csv"
}
]
}
}
}
'import requests
url = "https://clarus-api.com/api/ftp_mapping_groups/{mapping_group_id}/mappings"
payload = { "data": {
"type": "ftp_mappings",
"attributes": {
"account_id": 5,
"account_in_file": "ACME",
"customer_id": 200,
"customer_in_file": "CUST-200",
"delivery_address_id": 91,
"delivery_address_in_file": "DEL-A",
"collection_address_id": 17,
"collection_address_in_file": "COL-Z",
"mapping_fields": [{ "file_format": "csv" }]
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
type: 'ftp_mappings',
attributes: {
account_id: 5,
account_in_file: 'ACME',
customer_id: 200,
customer_in_file: 'CUST-200',
delivery_address_id: 91,
delivery_address_in_file: 'DEL-A',
collection_address_id: 17,
collection_address_in_file: 'COL-Z',
mapping_fields: [{file_format: 'csv'}]
}
}
})
};
fetch('https://clarus-api.com/api/ftp_mapping_groups/{mapping_group_id}/mappings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": 5
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Request Structure
{
"data": {
"type": "ftp_mappings",
"attributes": {
"account_id": 5,
"account_in_file": "ACME",
"customer_id": 200,
"customer_in_file": "CUST-200",
"mapping_fields": [{ "file_format": "csv" }]
}
}
}
*_in_file values) to internal Clarus records (account, customer, delivery/collection address). All fields are optional.Authorizations
OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.
The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.
Path Parameters
The FTP mapping group ID
Body
application/json
Show child attributes
Show child attributes
Response
Created successfully
Created record
⌘I

