Create customers (recommended method)
Updated version of the /customers endpoint. /customersBatch (this endpoint) is recommended to use over /customers. The response mirrors the request and also includes the results or errors per account.
Request
- Base URLhttps://api.trueaccord.com/api/v1
- Authnone declared
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
Example request
{
"responses": [
{
"dateOfBirth": {
"day": 6,
"month": 4,
"year": 2012
},
"addresses": [
{
"streetLine1": "101 N First St",
"streetLine2": "Apt 2",
"city": "San Jose",
"state": "CA",
"zipcode": "55555",
"countryCode": "US"
}
],
"emails": [
{
"email": "example@trueaccord.com"
}
],
"comments": [
{
"comment": "Transaction failed due to insufficient funds."
}
],
"reference": "MyRef",
"debts": [
{
"initialPrincipal": {
"amount": 30000,
"currency": "USD"
},
"initialInterest": {
"amount": 30000,
"currency": "USD"
},
"initialFees": {
"amount": 30000,
"currency": "USD"
},
"postChargeOffInformation": {
"balanceAtChargeOff": {
"amount": 30000,
"currency": "USD"
},
"feesAccruedSinceChargeOff": {
"amount": 30000,
"currency": "USD"
},
"interestAccruedSinceChargeOff": {
"amount": 30000,
"currency": "USD"
},
"totalPaidSinceChargeOff": {
"amount": 30000,
"currency": "USD"
}
}
}
],
"ssn": "123456789"
}
],
"customersWithAddedDebts": [
{
"meta": {
"id": "3ef84ff19ddc",
"isActive": true
},
"dateOfBirth": {
"day": 6,
"month": 4,
"year": 2012
},
"addresses": [
{
"streetLine1": "101 N First St",
"streetLine2": "Apt 2",
"city": "San Jose",
"state": "CA",
"zipcode": "55555",
"countryCode": "US"
}
],
"emails": [
{
"email": "example@trueaccord.com"
}
],
"comments": [
{
"comment": "Transaction failed due to insufficient funds."
}
],
"reference": "MyRef",
"debts": [
{
"initialPrincipal": {
"amount": 30000,
"currency": "USD"
},
"initialInterest": {
"amount": 30000,
"currency": "USD"
},
"initialFees": {
"amount": 30000,
"currency": "USD"
},
"postChargeOffInformation": {
"balanceAtChargeOff": {
"amount": 30000,
"currency": "USD"
},
"feesAccruedSinceChargeOff": {
"amount": 30000,
"currency": "USD"
},
"interestAccruedSinceChargeOff": {
"amount": 30000,
"currency": "USD"
},
"totalPaidSinceChargeOff": {
"amount": 30000,
"currency": "USD"
}
}
}
],
"ssn": "123456789"
}
]
}Response
In the case where the request succeeds, the response will mirror your request but with an additional meta field that can be used in the future to reference the customer objects you have created. If addDebtsIfPossible is flagged, the response will mirror your request with new customers, and also include a flag for isAddedDebt if an existing customer had another debt placed.
If there are any duplicate references/transaction ids or any other issues with a placed customer, it will be visible in the response with the flag isError.
Example response
{
"responses": [
{
"isAddedDebt": true,
"customer": {
"meta": {
"id": "3ef84ff19ddc",
"isActive": true
},
"dateOfBirth": {
"day": 6,
"month": 4,
"year": 2012
},
"addresses": [
{
"streetLine1": "101 N First St",
"streetLine2": "Apt 2",
"city": "San Jose",
"state": "CA",
"zipcode": "55555",
"countryCode": "US"
}
],
"emails": [
{
"email": "example@trueaccord.com"
}
],
"comments": [
{
"comment": "Transaction failed due to insufficient funds."
}
],
"reference": "MyRef",
"debts": [
{
"initialPrincipal": {
"amount": 30000,
"currency": "USD"
},
"initialInterest": {
"amount": 30000,
"currency": "USD"
},
"initialFees": {
"amount": 30000,
"currency": "USD"
},
"postChargeOffInformation": {
"balanceAtChargeOff": {
"amount": 30000,
"currency": "USD"
},
"feesAccruedSinceChargeOff": {
"amount": 30000,
"currency": "USD"
},
"interestAccruedSinceChargeOff": {
"amount": 30000,
"currency": "USD"
},
"totalPaidSinceChargeOff": {
"amount": 30000,
"currency": "USD"
}
}
}
],
"ssn": "123456789"
}
}
]
}Changes
No recorded changes to this operation across all 1 revision of this API.