Create Metadata Mappings
1 min
POST
https://api.nue.io/v1/stripe/metadata-mapping
Body Parameters
- bodyCreateMetadataMappingRequestrequiredDescription
- metadataMappingListMetadataMapping[]requiredDescription
- idstring<uuid>DescriptionFormatuuid
- sourceObjectstringExampleDescription
- sourceFieldstringExampleDescription
- sourceValuestringDescription
- targetObjectstringrequiredExampleDescription
- targetFieldstringrequiredExampleDescription
Responses
200
- integerDescription
400
- ErrorResponse
- errorobject
- codestringExampleDescription
- messagestringExampleDescription
- detailsstring[]Example
[ "Target field 'oid' is read-only" ]
Description
401
- ErrorResponse
- errorobject
- codestringExampleDescription
- messagestringExampleDescription
- detailsstring[]Example
[ "Target field 'oid' is read-only" ]
Description
curl
curl --request POST \
--url https://api.nue.io/v1/stripe/metadata-mapping \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"metadataMappingList": [
{
"targetObject": "Customer",
"targetField": "address.postal_code"
}
]
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"metadataMappingList": [
{
"targetObject": "Customer",
"targetField": "address.postal_code"
}
]
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.nue.io/v1/stripe/metadata-mapping", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.nue.io/v1/stripe/metadata-mapping")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump({
"metadataMappingList": [
{
"targetObject": "Customer",
"targetField": "address.postal_code"
}
]
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.nue.io/v1/stripe/metadata-mapping"
payload = json.dumps({
"metadataMappingList": [
{
"targetObject": "Customer",
"targetField": "address.postal_code"
}
]
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// Metadata mappings created successfully. Returns the number of mappings registered in this request.
0GENERATED
// Metadata mappings created successfully. Returns the number of mappings registered in this request.
0Success Response
2400
// Bad Request - Invalid mapping configuration
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid mapping configuration",
"details": [
""
]
}
}GENERATED
// Bad Request - Invalid mapping configuration
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid mapping configuration",
"details": [
""
]
}
}Invalid Target Field
{
"error": {
"code": "INTEGRATION_MAPPING_TARGET_FIELD_NOT_PERMIT",
"message": "Target field 'oid' is not allowed for mapping",
"details": [
"Stripe field 'oid' is read-only and cannot be mapped"
]
}
}401
// Unauthorized - Invalid or missing API key
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid mapping configuration",
"details": [
""
]
}
}