Update Finance Offer
1 min
PUT
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
- bodyUpdateFinanceOfferrequiredDescription
- activationDatestring<date-time>DescriptionFormatdate-time
- currencystringrequiredExampleDescription
- deactivationDatestring<date-time>DescriptionFormatdate-time
- descriptionstringrequiredExampleDescription
- downPaymentDownPaymentDescription
- AbsoluteDownPayment
- amountnumberrequiredExample
- RelativeDownPayment
- percentnumber<double>requiredExampleFormatdoubleMinimum0Maximum1
- DeliveryAndTaxes
- typestringrequiredDefaultDeliveryAndTaxes
- enabledbooleanrequiredDescription
- financeOfferTypeFinanceOfferTyperequired
- internalNamestringrequiredExampleDescription
- minimumMonthlyPaymentnumberExampleDescriptionMinimum0
- minimumPurchaseAmountnumberrequiredExampleDescriptionMinimum0
- namestringrequiredExampleDescription
- promotionalPeriodMonthsinteger<int32>requiredExampleDescriptionFormatint32Minimum0
- providerProviderrequired
- providerFinanceOfferIdProviderFinanceOfferIdrequired
- siteIdsstring[]
- sortOrderinteger<int32>requiredExampleDescriptionFormatint32Minimum0
- tiersTier[]requiredDescription
- promotionalFeenumberrequiredDescriptionMinimum0Maximum100
Responses
200
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 PUT \
--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 '{
"currency": "USD",
"description": "In accepting this offer you receive 6 months interest free when you spend over $1,000. After 6 months....",
"downPayment": {
"amount": 500
},
"enabled": "",
"financeOfferType": "",
"internalName": "6mos Free interest +$1000",
"minimumPurchaseAmount": 1000,
"name": "Get 6 months free interest when you finance $1000 or more",
"promotionalPeriodMonths": 12,
"provider": "",
"providerFinanceOfferId": "",
"sortOrder": 1,
"tiers": [],
"promotionalFee": 0
}'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({
"currency": "USD",
"description": "In accepting this offer you receive 6 months interest free when you spend over $1,000. After 6 months....",
"downPayment": {
"amount": 500
},
"enabled": "",
"financeOfferType": "",
"internalName": "6mos Free interest +$1000",
"minimumPurchaseAmount": 1000,
"name": "Get 6 months free interest when you finance $1000 or more",
"promotionalPeriodMonths": 12,
"provider": "",
"providerFinanceOfferId": "",
"sortOrder": 1,
"tiers": [],
"promotionalFee": 0
});
var requestOptions = {
method: 'PUT',
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::Put.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({
"currency": "USD",
"description": "In accepting this offer you receive 6 months interest free when you spend over $1,000. After 6 months....",
"downPayment": {
"amount": 500
},
"enabled": "",
"financeOfferType": "",
"internalName": "6mos Free interest +$1000",
"minimumPurchaseAmount": 1000,
"name": "Get 6 months free interest when you finance $1000 or more",
"promotionalPeriodMonths": 12,
"provider": "",
"providerFinanceOfferId": "",
"sortOrder": 1,
"tiers": [],
"promotionalFee": 0
})
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({
"currency": "USD",
"description": "In accepting this offer you receive 6 months interest free when you spend over $1,000. After 6 months....",
"downPayment": {
"amount": 500
},
"enabled": "",
"financeOfferType": "",
"internalName": "6mos Free interest +$1000",
"minimumPurchaseAmount": 1000,
"name": "Get 6 months free interest when you finance $1000 or more",
"promotionalPeriodMonths": 12,
"provider": "",
"providerFinanceOfferId": "",
"sortOrder": 1,
"tiers": [],
"promotionalFee": 0
})
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("PUT", url, headers=headers, data=payload)
print(response.text)
200
// Success-finance offer updated.
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": ""
}