Create a Card Program
1 min
POST
https://api.sandbox.tripleup.dev/partner/card-programs
Body Parameters
- bodyobject
- card_binsCardProgramCardBinsDescription
- default_country_codeUSDefaultedCountryCodeDefaultUS
- CountryCode
- default_postal_codePostalCoderequiredExampleDescription
- external_idCardProgramExternalIdrequiredDescription
- ExternalId
- nameCardProgramNamerequiredDescription
- descriptionCardProgramDescriptionDescription
- program_currencyCurrencyCoderequiredExampleDescriptionDefaultUSD
- loyalty_unitCardProgramLoyaltyUnitDescription
- loyalty_conversion_rateCardProgramLoyaltyConversionRateExampleDescription
- publisher_external_idPublisherExternalIdDescription
- ExternalId
Responses
201
- CardProgram
- card_binsCardProgramCardBinsDescription
- created_atTimestamprequiredExampleDescription
- default_country_codeUSDefaultedCountryCodeDefaultUS
- CountryCode
- default_postal_codePostalCoderequiredExampleDescription
- descriptionCardProgramDescriptionDescription
- external_idCardProgramExternalIdrequiredDescription
- ExternalId
- idEntityIdrequiredExampleDescription
- loyalty_unitCardProgramLoyaltyUnitDescription
- loyalty_conversion_rateCardProgramLoyaltyConversionRateExampleDescription
- nameCardProgramNamerequiredDescription
- program_currencyCurrencyCoderequiredExampleDescriptionDefaultUSD
- publisher_idEntityIdrequiredExampleDescription
- updated_atTimestamprequiredExampleDescription
400
- object
- status_codeintegerrequiredDescription
- contentobjectrequiredDescription
- detailsErrorResponseDetailsDescription
- error_messagestringrequiredDescriptionDefaultThe request is malformed.
- exceptionstring<TripleBadRequestError>requiredDescription
403
- object
- status_codeintegerrequiredDescription
- contentobjectrequiredDescription
- detailsErrorResponseDetailsDescription
- error_messagestringrequiredDescriptionDefaultClient authentication failed.
- exceptionstring<TripleNotAuthenticatedError>requiredDescription
404
- object
- status_codeintegerrequiredDescription
- contentobjectrequiredDescription
- detailsErrorResponseDetailsDescription
- error_messagestringrequiredDescriptionDefaultThe url path or path parameter is invalid.
- exceptionstring<TripleInvalidPathError>requiredDescription
409
- object
- status_codeintegerrequiredDescription
- contentobjectrequiredDescription
- detailsErrorResponseDetailsDescription
- error_messagestringrequiredDescriptionDefaultThe request was well-formed but violated entity integrity constraints.
- exceptionstring<TripleIntegrityError>requiredDescription
415
- object
- status_codeintegerrequiredDescription
- contentobjectrequiredDescription
- detailsErrorResponseDetailsDescription
- error_messagestringrequiredDescriptionDefaultThe request defined an unsupported media type.
- exceptionstring<TripleUnsupportedMediaType>requiredDescription
422
- object
- status_codeintegerrequiredDescription
- contentobjectrequiredDescription
- detailsErrorResponseDetailsDescription
- error_messagestringrequiredDescriptionDefaultThe request was well-formed but could not be processed.
- exceptionstring<TripleUnprocessableEntity>requiredDescription
500
- object
- status_codeintegerrequiredDescription
- contentobjectrequiredDescription
- detailsErrorResponseDetailsDescription
- error_messagestringrequiredDescriptionDefaultTriple was unable to process the request due to an internal error.
- exceptionstring<TripleInternalServerError>requiredDescription
501
- object
- status_codeintegerrequiredDescription
- contentobjectrequiredDescription
- detailsErrorResponseDetailsDescription
- error_messagestringrequiredDescriptionDefaultThe request failed because it requires a feature that is not yet implemented.
- exceptionstring<TripleNotImplementedError>requiredDescription
503
- object
- status_codeintegerrequiredDescription
- contentobjectrequiredDescription
- detailsErrorResponseDetailsDescription
- error_messagestringrequiredDescriptionDefaultThe request failed due to a triple service interruption.
- exceptionstring<TripleServiceUnavailable>requiredDescription
curl
curl --request POST \
--url https://api.sandbox.tripleup.dev/partner/card-programs \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"default_country_code": {},
"default_postal_code": "15206",
"external_id": {},
"name": "",
"program_currency": "USD",
"publisher_external_id": {}
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"default_country_code": {},
"default_postal_code": "15206",
"external_id": {},
"name": "",
"program_currency": "USD",
"publisher_external_id": {}
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.sandbox.tripleup.dev/partner/card-programs", 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.sandbox.tripleup.dev/partner/card-programs")
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({
"default_country_code": {},
"default_postal_code": "15206",
"external_id": {},
"name": "",
"program_currency": "USD",
"publisher_external_id": {}
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.sandbox.tripleup.dev/partner/card-programs"
payload = json.dumps({
"default_country_code": {},
"default_postal_code": "15206",
"external_id": {},
"name": "",
"program_currency": "USD",
"publisher_external_id": {}
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
201
// Card Program
{
"card_bins": [
""
],
"created_at": "2021-12-01T01:59:59.000Z",
"default_country_code": {},
"default_postal_code": "15206",
"description": "",
"external_id": {},
"id": "triple-abc-123",
"loyalty_unit": "",
"loyalty_conversion_rate": 100,
"name": "",
"program_currency": "USD",
"publisher_id": "triple-abc-123",
"updated_at": "2021-12-01T01:59:59.000Z"
}400
// TripleBadRequestError
{
"status_code": 0,
"content": {
"details": [
""
],
"error_message": "",
"exception": ""
}
}403
// TripleNotAuthenticatedError
{
"status_code": 0,
"content": {
"details": [
""
],
"error_message": "",
"exception": ""
}
}404
// TripleInvalidPathError
{
"status_code": 0,
"content": {
"details": [
""
],
"error_message": "",
"exception": ""
}
}409
// TripleIntegrityError
{
"status_code": 0,
"content": {
"details": [
""
],
"error_message": "",
"exception": ""
}
}415
// TripleUnsupportedMediaType
{
"status_code": 0,
"content": {
"details": [
""
],
"error_message": "",
"exception": ""
}
}422
// TripleUnprocessableEntity
{
"status_code": 0,
"content": {
"details": [
""
],
"error_message": "",
"exception": ""
}
}500
// TripleInternalServerError
{
"status_code": 0,
"content": {
"details": [
""
],
"error_message": "",
"exception": ""
}
}501
// TripleNotImplementedError
{
"status_code": 0,
"content": {
"details": [
""
],
"error_message": "",
"exception": ""
}
}503
// TripleServiceUnavailable
{
"status_code": 0,
"content": {
"details": [
""
],
"error_message": "",
"exception": ""
}
}Creates a card program.
default_country_code may be set to the country associated with the card program. It defaults to US if it is not specified.
default_postal_code must be set to a postal code associated with the card program (e.g. domicile, other). The actual value is left to the discretion of the caller.
NB: The default_postal_code will be used in lieu of proximity_target if one is not specified during a CardAccount instance request for associated offers. If default_postal_code is not set for the card account, the CardProgram default_postal_code for the program will be used instead.