Create Pricing Feed
1 min
POST
https://api.upstartcommerce.com/v1/pricingfeed
Header Parameters
- x-upstart-tenantstringrequiredDescription
- x-upstart-sitestringrequiredDescription
Form Parameters
- filetypestring<csv>requiredAllowedcsv
- filestring<csv>requiredFormatbinaryAllowedcsv
Responses
202
- FeedIdDescription
- idstringrequiredDescription
400
- ValidationErrorResponseDescription
- namestringrequired
- codestringrequired
- detailstring[]required
- reasonstring
401
- ErrorResponseDescription
- namestringrequired
- codestringrequired
- detailstringrequired
- reasonstring
curl
curl --request POST \
--url https://api.upstartcommerce.com/v1/pricingfeed \
--header 'accept: application/json' \
--header 'content-type: multipart/form-data' \
--header 'x-upstart-tenant: string' \
--header 'x-upstart-site: string' \
--form 'filetype="csv"' \
--form 'file=@"/path/to/file"'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "multipart/form-data");
myHeaders.append("x-upstart-tenant", "string");
myHeaders.append("x-upstart-site", "string");
var formdata = new FormData();
formdata.append("filetype", "csv");
formdata.append("file", fileInput.files[0], "file");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: formdata,
redirect: 'follow'
};
fetch("https://api.upstartcommerce.com/v1/pricingfeed", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "net/http"
url = URI("https://api.upstartcommerce.com/v1/pricingfeed")
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"] = "multipart/form-data"
request["x-upstart-tenant"] = "string"
request["x-upstart-site"] = "string"
form_data = [['filetype', File.open('undefined')],['file', File.open('/path/to/file')]]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
python
import requests
url = "https://api.upstartcommerce.com/v1/pricingfeed"
payload = {}
files=[
('file',('file',open('/path/to/file','rb'),'application/octet-stream'))
]
headers = {
'accept': 'application/json',
'content-type': 'multipart/form-data',
'x-upstart-tenant': 'string',
'x-upstart-site': 'string'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
202
// Feed file created with feed ID
{
"id": ""
}GENERATED
// Feed file created with feed ID
{
"id": ""
}New Feed ID
{
"id": "123456789 "
}400
// The request contained information that the server was unable to process. Appropriate errors are provided in the response body.
{
"name": "",
"code": "",
"detail": [
""
],
"reason": ""
}401
// The provided credentials were not valid for this endpoint. It may be that they are expired or that the user's roles are insufficient.
{
"name": "",
"code": "",
"detail": "",
"reason": ""
}