Toggle Finance Offer Availability
1 min
PATCH
https://api.upstartcommerce.com/v1/finance-offers/{offerId}
Path Parameters
- offerIdstring<uuid>requiredDescriptionFormatuuid
Header Parameters
- x-upstart-tenantstringrequiredDescription
- if-unmodified-sincestring<date-time>requiredExampleDescriptionFormatdate-time
- if-matchstringrequiredExampleDescription
Body Parameters
- bodyUpdateFinanceOfferAvailabilityrequired
- enabledbooleanrequired
Responses
200
- FinanceOfferAvailability
- idstring<uuid>requiredFormatuuid
- enabledbooleanrequired
Response Headers
- etag
- last-modified
400
- ValidationErrorResponse
- namestringrequired
- codestringrequired
- detailobject
401
- ErrorResponse
- namestringrequired
- codestringrequired
- detailstringrequired
- reasonstring
403
- ErrorResponse
- namestringrequired
- codestringrequired
- detailstringrequired
- reasonstring
404
- ErrorResponse
- namestringrequired
- codestringrequired
- detailstringrequired
- reasonstring
409
- ErrorResponse
- namestringrequired
- codestringrequired
- detailstringrequired
- reasonstring
curl
curl --request PATCH \
--url https://api.upstartcommerce.com/v1/finance-offers/{offerId} \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-upstart-tenant: string' \
--header 'if-unmodified-since: 2017-07-21T17:32:28Z' \
--header 'if-match: c8e2f90c27be55855f094477e24d6650' \
--data '{
"enabled": ""
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
myHeaders.append("x-upstart-tenant", "string");
myHeaders.append("if-unmodified-since", "2017-07-21T17:32:28Z");
myHeaders.append("if-match", "c8e2f90c27be55855f094477e24d6650");
var raw = JSON.stringify({
"enabled": ""
});
var requestOptions = {
method: 'PATCH',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.upstartcommerce.com/v1/finance-offers/{offerId}", 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.upstartcommerce.com/v1/finance-offers/{offerId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request["x-upstart-tenant"] = "string"
request["if-unmodified-since"] = "2017-07-21T17:32:28Z"
request["if-match"] = "c8e2f90c27be55855f094477e24d6650"
request.body = JSON.dump({
"enabled": ""
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.upstartcommerce.com/v1/finance-offers/{offerId}"
payload = json.dumps({
"enabled": ""
})
headers = {
'accept': 'application/json',
'content-type': 'application/json',
'x-upstart-tenant': 'string',
'if-unmodified-since': '2017-07-21T17:32:28Z',
'if-match': 'c8e2f90c27be55855f094477e24d6650'
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)
200
// Success-finance offer availability state updated.
{
"id": "",
"enabled": false
}400
// The request contained information that the server was unable to process. Appropriate errors are provided in the response body.
{
"name": "",
"code": "",
"detail": {}
}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": ""
}403
// An update to this resource requires the if-match and if-unmodified-since headers to be sent in order to process the request.
{
"name": "",
"code": "",
"detail": "",
"reason": ""
}404
// The requested resource was not found in the NoChannel system.
{
"name": "",
"code": "",
"detail": "",
"reason": ""
}409
// The copy of the resource you are modifying has been changed on the server. This request has not been processed to prevent data loss.
{
"name": "",
"code": "",
"detail": "",
"reason": ""
}