Create New Finance Offer
1 min
POST
https://api.upstartcommerce.com/v1/finance-offers
Header Parameters
- x-upstart-tenantstringrequiredDescription
Body Parameters
- bodyCreateFinanceOfferrequiredDescription
- activationDatestring<date-time>DescriptionFormatdate-time
- currencystringrequiredExampleDescription
- deactivationDatestring<date-time>DescriptionFormatdate-time
- descriptionstringrequiredExampleDescription
- downPaymentDownPaymentDescription
- AbsoluteDownPayment
- amountnumberrequiredExample
- RelativeDownPayment
- percentnumber<double>requiredExampleFormatdoubleMinimum0Maximum1
- DeliveryAndTaxes
- typestringrequiredDefaultDeliveryAndTaxes
- enabledbooleanrequiredDescription
- financeOfferTypeFinanceOfferTyperequired
- idstring<uuid>Formatuuid
- internalNamestringrequiredExampleDescription
- minimumMonthlyPaymentnumberExampleDescriptionMinimum0
- minimumPurchaseAmountnumberrequiredExampleDescriptionMinimum0
- namestringrequiredExampleDescription
- promotionalPeriodMonthsinteger<int32>requiredExampleDescriptionFormatint32Minimum0
- providerProviderrequired
- providerFinanceOfferIdProviderFinanceOfferIdrequired
- siteIdsstring[]
- sortOrderinteger<int32>requiredExampleDescriptionFormatint32Minimum0
- tiersTier[]requiredDescription
- promotionalFeenumberrequiredDescriptionMinimum0Maximum100
Responses
201
- FinanceOfferDescription
- idstring<uuid>requiredFormatuuid
- activationDatestring<date-time>ExampleDescriptionFormatdate-time
- creationDatestring<date-time>requiredExampleDescriptionFormatdate-time
- currencystringrequiredExampleDescription
- deactivationDatestring<date-time>ExampleDescriptionFormatdate-time
- descriptionstringrequiredExampleDescription
- downPaymentDownPaymentDescription
- AbsoluteDownPayment
- amountnumberrequiredExample
- RelativeDownPayment
- percentnumber<double>requiredExampleFormatdoubleMinimum0Maximum1
- DeliveryAndTaxes
- typestringrequiredDefaultDeliveryAndTaxes
- enabledbooleanrequiredDescription
- financeOfferTypeFinanceOfferTyperequired
- internalNamestringrequiredExampleDescription
- minimumMonthlyPaymentnumberExampleDescriptionMinimum0
- minimumPurchaseAmountnumberrequiredExampleDescriptionMinimum0
- namestringrequiredExampleDescription
- promotionalPeriodMonthsinteger<int32>requiredExampleDescriptionFormatint32Minimum0
- providerProviderrequired
- providerFinanceOfferIdProviderFinanceOfferIdrequired
- siteIdsstring[]required
- sortOrderinteger<int32>requiredExampleDescriptionFormatint32Minimum0
- tiersTier[]requiredDescription
- promotionalFeenumberrequiredDescriptionMinimum0Maximum100
- productBasedOfferbooleanrequiredExampleDescription
Response Headers
- etag
- last-modified
400
- ValidationErrorResponse
- namestringrequired
- codestringrequired
- detailobject
401
- ErrorResponse
- namestringrequired
- codestringrequired
- detailstringrequired
- reasonstring
curl
curl --request POST \
--url https://api.upstartcommerce.com/v1/finance-offers \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-upstart-tenant: string' \
--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": false,
"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");
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": false,
"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: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.upstartcommerce.com/v1/finance-offers", 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")
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["x-upstart-tenant"] = "string"
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": false,
"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"
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": False,
"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'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
201
// Success-finance offer created.
{
"id": "",
"activationDate": "2017-07-21T17:32:28Z",
"creationDate": "2017-07-21T17:32:28Z",
"currency": "USD",
"deactivationDate": "2017-07-21T17:32:28Z",
"description": "In accepting this offer you receive 6 months interest free when you spend over $1,000. After 6 months....",
"downPayment": {},
"enabled": false,
"financeOfferType": "",
"internalName": "6mos Free interest +$1000",
"minimumMonthlyPayment": 100,
"minimumPurchaseAmount": 1000,
"name": "Get 6 months free interest when you finance $1000 or more",
"promotionalPeriodMonths": 12,
"provider": "",
"providerFinanceOfferId": "",
"siteIds": [
""
],
"sortOrder": 1,
"tiers": [
""
],
"promotionalFee": 0,
"productBasedOffer": true
}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": ""
}