Introduction
Welcome to Fonteva Service Api's. This documentation will outline how to use Fonteva Api's on the Salesforce platform. We
leverage the core Salesforce REST Api infrastructure to deliver our Api's. All authentication is done using core Salesforce Auth
These API's cover standard CRUD services to action services such as paying for an order, processing a scheduled payment etc.
Almost all service API's return camel cased field values from the desired object. For example if there is a field named
OrderApi__Is_Posted__c
it will come through as isPosted
. The response that is returned by the API is identical to the
response that is provided via the APEX API.
Search Request
The Search Request object is something that is used to help filter out the results based on search criteria/fields. The following parameters can be used in junction with each other or own their own.
Parameter | Required | Type | Description |
---|---|---|---|
filter | false | string | URL-encoded SOQL filter |
limit | false | integer | Number of records to return as maximum |
fields | false | string | Comma separated list of field api names to return for each record |
id | false | string | Comma separated list of Salesforce Id's to query by |
sort | false | string | Comma separated list of field api names to sort by |
sorDir | false | string | Direction of sort. Defaults to ASC. |
Filter By Id
The ability to filter records by Salesforce Id's directly. This is similar to executing a SOQL call with a where clause.
Verb: GET
Host: MY-INSTANCE.salesforce.com
URI : /services/apexrest/FDService/AssignmentService?id=a0of200000Ia5YMAAZ,a0of200000IbDZUAA3"
Authorization: Bearer SESSIONID
Filter By Where Clause
The ability to filter records by more than Salesforce Id's. The Where clause needs to be URL-encoded to work. For example
take the following SOQL clause orderapi__is_active__c = true AND orderapi__badge_type__c = 'a0mf2000007uHNAAA2'
and it will
become orderapi__is_active__c%3Dtrue+AND+orderapi__badge_type__c%3D%27a0mf2000007uHNAAA2%27
Verb: GET
Host: MY-INSTANCE.salesforce.com
URI : /services/apexrest/FDService/AssignmentService?filter=orderapi__is_active__c%3Dtrue+AND+orderapi__badge_type__c%3D%27a0mf2000007uHNAAA2%27
Authorization: Bearer SESSIONID
Limit Fields
The ability to reduce the number of fields that are returned to directly match what is needed.
Verb: GET
Host: MY-INSTANCE.salesforce.com
URI : /services/apexrest/FDService/AssignmentService?fields=id,orderapi__contact__c
Authorization: Bearer SESSIONID
EPayment Line Map Service
Create EPayments
Verb: POST
Host: MY-INSTANCE.salesforce.com
URI : /services/apexrest/FDService/EPaymentLineMapService
Authorization: Bearer SESSIONID
JSON structure required to post
[
{
"id": "a1W1g0000029SVY",
"contact": "0031g00000tUOFV",
"paymentAmount": 33.00,
"lines": [{
"id": "a1U1g000000s42I",
"item": "a1C1g00000151o4"
},
{
"id": "a1U1g000000s42J",
"item": "a1C1g000001520X"
}
]
}
]
The above command returns JSON structured like this:
{
"statusMessage": null,
"statusCode": null,
"metadata": {},
"errors": [],
"errorMap": null,
"data": [
{
"fieldToPackageMap": {},
"additionalFields": {},
"total": 3.00,
"taxPercent": null,
"taxOverride": false,
"systemModstamp": null,
"subtotal": null,
"subscriptionPlan": null,
"subscription": null,
"status": null,
"salesOrderLine": "a1U1g000000s42JEAQ",
"salesOrder": "a1W1g0000029SVYEA2",
"salePrice": 3.00,
"quantity": null,
"priceRule": null,
"priceOverride": false,
"paymentMethod": null,
"parentForeignKey": "sEwMaSkVpUW1ygGe4elww9tW2vdFEK",
"name": null,
"listPrice": null,
"lastModifiedDate": null,
"lastModifiedById": null,
"itemClass": "a1A1g000002CvqlEAC",
"item": "a1C1g000001520XEAQ",
"isTax": true,
"isRenewal": false,
"isDeleted": false,
"invoiceLine": null,
"invoice": null,
"id": null,
"gLAccount": "a151g000007hKxeAAE",
"foreignKey": "xQitXnE4rWtBZs8FxWjQgBLClUgvpK",
"ePaymentLine": null,
"ePayment": null,
"endDate": null,
"currencyISOCode": null,
"createdDate": null,
"createdById": null,
"contact": "0031g00000tUOFVAA4",
"businessGroup": "a0s1g000004YNLgAAO",
"autoCalculateActivationDate": true,
"activityType": null,
"activationDate": null
},
{
"fieldToPackageMap": {},
"additionalFields": {},
"total": 30.00,
"taxPercent": null,
"taxOverride": false,
"systemModstamp": null,
"subtotal": null,
"subscriptionPlan": null,
"subscription": null,
"status": null,
"salesOrderLine": "a1U1g000000s42IEAQ",
"salesOrder": "a1W1g0000029SVYEA2",
"salePrice": 30.00,
"quantity": null,
"priceRule": "a1L1g000001YRbDEAW",
"priceOverride": false,
"paymentMethod": null,
"parentForeignKey": null,
"name": null,
"listPrice": null,
"lastModifiedDate": null,
"lastModifiedById": null,
"itemClass": "a1A1g000002CvrXEAS",
"item": "a1C1g00000151o4EAA",
"isTax": false,
"isRenewal": false,
"isDeleted": false,
"invoiceLine": null,
"invoice": null,
"id": null,
"gLAccount": "a151g000007hKxcAAE",
"foreignKey": "sEwMaSkVpUW1ygGe4elww9tW2vdFEK",
"ePaymentLine": null,
"ePayment": null,
"endDate": null,
"currencyISOCode": null,
"createdDate": null,
"createdById": null,
"contact": "0031g00000tUOFVAA4",
"businessGroup": "a0s1g000004YNLgAAO",
"autoCalculateActivationDate": true,
"activityType": null,
"activationDate": null
}
]
}
This endpoint will generate EPayment records.
HTTP Request
POST https://MY-INSTANCE.salesforce.com/services/apexrest/FDService/EPaymentLineMapService
Installment Scheduled Service
Create Installments
Verb: POST
Host: MY-INSTANCE.salesforce.com
URI : /services/apexrest/FDService/InstallmentScheduleService
Authorization: Bearer SESSIONID
JSON structure required to post
[{
"id": "a1W1g0000029LvtEAE",
"lines": [
{
"id": "a1U1g000000rzyK",
"isSubscription": true,
"isRenewal": true,
"subscriptionPlan": "a1f1g000001eTZ7",
"subscription": "a1g1g000001HL0U",
"postingEntity": "Account",
"salesOrder": "a1W1g0000029LvtEAE",
"totalInstallmentPrice": 10,
"total": 5,
"salePrice": 5
}
]
}]
The above command returns JSON structured like this:
{
"statusMessage": null,
"statusCode": null,
"metadata": {},
"errors": [],
"errorMap": null,
"data": [
{
"fieldToPackageMap": {},
"additionalFields": null,
"token": null,
"term": null,
"systemMessage": null,
"succeeded": false,
"subscription": null,
"scheduledDate": "2022-11-04",
"salesOrder": "a1W1g0000029LvtEAE",
"processedDate": null,
"paymentMethod": null,
"paymentGateway": null,
"paymentDescription": "Recurring Payment (REF:000000142)",
"noAutoPayment": false,
"name": "0000000019",
"isProcessed": false,
"isPaymentProcessed": false,
"isCancelled": false,
"invoice": null,
"id": "a1Y1g000001JnbGEAS",
"hasErrors": false,
"ePaymentCreated": false,
"customScheduledPayment": false,
"currencyISOCode": null,
"apiResponse": null,
"amount": 10
}
]
}
This endpoint creates an installment.
HTTP Request
POST https://MY-INSTANCE.salesforce.com/services/apexrest/FDService/InstallmentScheduleService
Item Price Service
Get Price of Items
Verb: GET
Host: MY-INSTANCE.salesforce.com
URI : /services/apexrest/FDService/ItemPriceService
Authorization: Bearer SESSIONID
The above command returns JSON structured like this:
[
{
"item": "a1C1g00000151rmEAA",
"contact": "0031g00000tUOFVAA4",
"quantity": 1
}
]
The above command returns JSON structured like this:
{
"statusMessage": null,
"statusCode": null,
"metadata": {},
"errors": [],
"errorMap": null,
"data": [
{
"fieldToPackageMap": null,
"additionalFields": null,
"targetCurrency": null,
"subPlan": null,
"sourceSObjectId": null,
"sourcePrice": null,
"sourceCurrency": null,
"sourceCode": null,
"quantity": 1,
"priceRuleCurrencyJSON": null,
"priceRule": {
"fieldToPackageMap": {},
"additionalFields": {},
"ticketType": null,
"taxInclusivePrice": 25.00,
"systemModstamp": "2022-10-18T08:14:29.000Z",
"startDate": null,
"scheduleItem": null,
"requiredSubscriptionPlans": null,
"requiredSourceCodes": null,
"requiredBadgeTypes": null,
"priceRuleVariables": [],
"price": 25.00,
"ownerId": "0051g000009jVLsAAM",
"numTimesUsed": 1,
"name": "DEFAULT",
"minQuantity": null,
"minAssignments": null,
"maxQuantity": null,
"maxNumAvailable": null,
"maxAssignments": null,
"limitPerContact": null,
"limitPerAccount": null,
"lastModifiedDate": "2022-10-18T08:14:29.000Z",
"lastModifiedById": "0051g000009jVLsAAM",
"itemClass": null,
"item": "a1C1g00000151rmEAA",
"isPromotionalPrice": false,
"isOnSitePrice": false,
"isMultiCurrency": true,
"isEarlyBirdPrice": false,
"isDeleted": false,
"isDefault": true,
"isActive": true,
"id": "a1L1g000001YRbJEAW",
"endDate": null,
"currentNumAvailable": null,
"currencyISOCode": "USD",
"createdDate": "2022-10-18T08:09:51.000Z",
"createdById": "0051g000009jVLsAAM",
"additionalCurrenciesJSON": null
},
"item": "a1C1g00000151rmEAA",
"convertPrice": null,
"convertedTaxIncludedPrice": null,
"convertedRate": null,
"convertedPrice": null,
"contact": "0031g00000tUOFVAA4",
"badgeTypes": null,
"badgesTypes": null,
"badges": null,
"account": null
}
]
}
This endpoint retrieves prices for Items.
HTTP Request
GET https://MY-INSTANCE.salesforce.com/services/apexrest/FDService/ItemPriceService
Journal Service
Create Transactions
Verb: POST
Host: MY-INSTANCE.salesforce.com
URI : /services/apexrest/FDService/JournalService
Authorization: Bearer SESSIONID
JSON structure required to post
[
{
"id": "a1W1g0000029Gpz",
"contact": "0031g00000tUOFV",
"postingEntity": "Invoice",
"overallTotal": 25.00,
"isPosted": true,
"isVoided": false,
"lines": [{
"id": "a1U1g000000rtJ4",
"item": "a1C1g00000151rm",
"amount": 25.00,
"quantity": 1
}]
}
]
The above command returns JSON structured like this:
{
"statusMessage": null,
"statusCode": null,
"metadata": {},
"errors": [],
"errorMap": null,
"data": [
{
"fieldToPackageMap": {},
"additionalFields": null,
"type": "Receivable",
"transactionDate": "2022-10-31",
"totalDebits": 0.00,
"totalCredits": 0.00,
"SystemModstamp": "2022-11-08T10:33:58.000Z",
"subscription": null,
"sourceCode": null,
"salesOrder": "a1W1g0000029GpzEAE",
"receiptType": null,
"receipt": null,
"OwnerId": null,
"numLines": 0,
"Name": "0000000020",
"memo": "Posting Sales Order #000000131",
"lines": null,
"LastViewedDate": null,
"LastReferencedDate": null,
"LastModifiedDate": "2022-11-08T10:33:58.000Z",
"LastModifiedById": "0051g000009jVLsAAM",
"LastActivityDate": null,
"isValid": false,
"IsDeleted": false,
"invoice": null,
"id": "a1j1g000001FjKOAA0",
"entity": "Contact",
"customerLink": "<a href=\"/0031g00000tUOFV\" target=\"\">Marc Benioff</a>",
"currencyISOCode": "USD",
"creditMemoLine": null,
"creditMemo": null,
"CreatedDate": "2022-11-08T10:33:58.000Z",
"CreatedById": "0051g000009jVLsAAM",
"contact": "0031g00000tUOFVAA4",
"businessGroup": "a0s1g000004YNLgAAO",
"batch": null,
"account": "0011g000011AWaGAAW"
}
]
}
This endpoint will generate Transactions.
HTTP Request
POST https://MY-INSTANCE.salesforce.com/services/apexrest/FDService/JournalService
Order Payment Service
Create Order Payment
Verb: POST
Host: MY-INSTANCE.salesforce.com
URI : /services/apexrest/FDService/OrderPaymentService
Authorization: Bearer SESSIONID
The above command returns JSON structured like this:
{
"record" : "a1W1g0000029Gpz",
"paymentGateway": "a1H1g000007wTvg",
"paymentMethodId" : "a1I1g00000A7or5",
"paymentMethodToken" : "2bENqWlXTgWt0C9gTmkVI2NAm63"
}
The above command returns JSON structured like this:
{
"statusMessage": null,
"statusCode": null,
"metadata": {},
"errors": [],
"errorMap": null,
"data": {
"fieldToPackageMap": {},
"additionalFields": null,
"receiptId": "a1P1g000001tDacEAE",
"errorMessage": null,
"epaymentId": "a141g000003ByXYAA0",
"checkoutUrl": null,
"checkoutForm": null
}
}
This endpoint pays for Sales Order/Epayment. Requires a JSON to be Posted to the endpoint. The record id must be specified to make sure that payment goes through. This endpoint responds with receipt id if successful.
HTTP Request
GET https://MY-INSTANCE.salesforce.com/services/apexrest/FDService/OrderPaymentService
Order Service
Get Orders
Verb: GET
Host: MY-INSTANCE.salesforce.com
URI : /services/apexrest/FDService/OrderService
Authorization: Bearer SESSIONID
The above command returns JSON structured like this:
{
"statusMessage": null,
"statusCode": null,
"metadata": {},
"errors": [],
"errorMap": null,
"data": [
{
"fieldToPackageMap": {},
"additionalFields": null,
"voidReason": null,
"voidDescription": null,
"validPaymentMethod": false,
"total": 121.00,
"status": "Open",
"startDate": null,
"sourceCode": null,
"shippingStreet": null,
"shippingState": null,
"shippingPostalCode": null,
"shippingCountry": null,
"shippingCity": null,
"scheduleType": "Simple Receipt",
"scheduleFrequency": null,
"salesOrderStatus": "Draft",
"salesOrderR": null,
"requirePaymentMethod": false,
"receipt": null,
"postingStatus": null,
"postingEntity": "Receipt",
"postedDate": null,
"paymentTerms": "a1J1g000002G5G4EAK",
"paymentMethod": null,
"paymentGateway": null,
"paymentAmount": null,
"paidDate": null,
"overallTotal": null,
"numberOfInstallments": null,
"name": "000000120",
"lines": null,
"LastModifiedDate": "2022-10-19 03:19:11",
"isVoided": false,
"isScheduled": false,
"isProforma": false,
"isPosted": false,
"isPendingPayment": false,
"isOpen": null,
"isMultiCurrencyOrg": true,
"isInvoiced": false,
"isClosed": false,
"invoiceDate": null,
"id": "a1W1g0000029GOrEAM",
"hasSubscription": false,
"hasInstallments": false,
"generateInstallments": false,
"epayment": null,
"entity": "Contact",
"dueDate": null,
"currencyISOCode": "USD",
"creditsApplied": null,
"creditsAndAdjustments": null,
"CreatedDate": "2022-10-18T12:50:41.000Z",
"contact": "0031g00000tULuVAAW",
"closedDate": null,
"calculateShippingDetails": true,
"calculateBillingDetails": true,
"businessGroup": "a0s1g000004YNLXAA4",
"billingStreet": null,
"billingState": null,
"billingPostalCode": null,
"billingCountry": null,
"billingCity": null,
"balanceDue": 0.00,
"amountRefunded": null,
"amountPaid": null,
"adjustmentReason": null,
"account": "0011g000011AWHwAAO"
},
{
"fieldToPackageMap": {},
"additionalFields": null,
"voidReason": null,
"voidDescription": null,
"validPaymentMethod": false,
"total": 25.00,
"status": "Open",
"startDate": null,
"sourceCode": null,
"shippingStreet": null,
"shippingState": null,
"shippingPostalCode": null,
"shippingCountry": null,
"shippingCity": null,
"scheduleType": "Simple Receipt",
"scheduleFrequency": null,
"salesOrderStatus": "Draft",
"salesOrderR": null,
"requirePaymentMethod": false,
"receipt": null,
"postingStatus": null,
"postingEntity": "Receipt",
"postedDate": null,
"paymentTerms": "a1J1g000002G5G4EAK",
"paymentMethod": null,
"paymentGateway": null,
"paymentAmount": null,
"paidDate": null,
"overallTotal": 25.00,
"numberOfInstallments": null,
"name": "000000127",
"lines": null,
"LastModifiedDate": "2022-11-01 00:06:17",
"isVoided": false,
"isScheduled": false,
"isProforma": true,
"isPosted": false,
"isPendingPayment": false,
"isOpen": null,
"isMultiCurrencyOrg": true,
"isInvoiced": false,
"isClosed": false,
"invoiceDate": null,
"id": "a1W1g0000029GpfEAE",
"hasSubscription": false,
"hasInstallments": false,
"generateInstallments": false,
"epayment": null,
"entity": "Account",
"dueDate": null,
"currencyISOCode": "USD",
"creditsApplied": 0.00,
"creditsAndAdjustments": 0.00,
"CreatedDate": "2022-10-19T10:09:17.000Z",
"contact": "0031g00000tULuVAAW",
"closedDate": null,
"calculateShippingDetails": true,
"calculateBillingDetails": true,
"businessGroup": "a0s1g000004YNLXAA4",
"billingStreet": null,
"billingState": null,
"billingPostalCode": null,
"billingCountry": null,
"billingCity": null,
"balanceDue": 25.00,
"amountRefunded": 0.00,
"amountPaid": 0.00,
"adjustmentReason": null,
"account": "0011g000011AWHwAAO"
}
]
}
This endpoint retrieves Sales Orders (OrderApi_Sales_Order_c).
HTTP Request
GET https://MY-INSTANCE.salesforce.com/services/apexrest/FDService/OrderService
Query Parameters
Search Request can be provided to further filter these results as query parameters.
Create Order
Verb: POST
Host: MY-INSTANCE.salesforce.com
URI : /services/apexrest/FDService/OrderService
Authorization: Bearer SESSIONID
The above command returns JSON structured like this:
{
"statusMessage": null,
"statusCode": null,
"metadata": {},
"errors": [],
"errorMap": null,
"data": {
"fieldToPackageMap": {},
"additionalFields": null,
"voidReason": null,
"voidDescription": null,
"validPaymentMethod": false,
"total": 0.00,
"status": "Open",
"startDate": null,
"sourceCode": null,
"shippingStreet": null,
"shippingState": null,
"shippingPostalCode": null,
"shippingCountry": null,
"shippingCity": null,
"scheduleType": "Simple Receipt",
"scheduleFrequency": null,
"salesOrderStatus": "Draft",
"salesOrderR": null,
"requirePaymentMethod": false,
"receipt": null,
"postingStatus": null,
"postingEntity": "Receipt",
"postedDate": null,
"paymentTerms": null,
"paymentMethod": null,
"paymentGateway": null,
"paymentAmount": null,
"paidDate": null,
"overallTotal": null,
"numberOfInstallments": null,
"name": "000000142",
"lines": null,
"LastModifiedDate": "2022-11-02 05:58:40",
"isVoided": false,
"isScheduled": false,
"isProforma": false,
"isPosted": false,
"isPendingPayment": false,
"isOpen": null,
"isMultiCurrencyOrg": true,
"isInvoiced": false,
"isClosed": false,
"invoiceDate": null,
"id": "a1W1g0000029LvtEAE",
"hasSubscription": false,
"hasInstallments": false,
"generateInstallments": false,
"epayment": null,
"entity": "Account",
"dueDate": null,
"currencyISOCode": "USD",
"creditsApplied": null,
"creditsAndAdjustments": null,
"CreatedDate": "2022-11-02T12:58:40.000Z",
"contact": null,
"closedDate": null,
"calculateShippingDetails": true,
"calculateBillingDetails": true,
"businessGroup": null,
"billingStreet": null,
"billingState": null,
"billingPostalCode": null,
"billingCountry": null,
"billingCity": null,
"balanceDue": 0.00,
"amountRefunded": null,
"amountPaid": null,
"adjustmentReason": null,
"account": null
}
}
This endpoint creates a Sales Order. Requires JSON to be posted to endpoint.
HTTP Request
POST https://MY-INSTANCE.salesforce.com/services/apexrest/FDService/OrderService
Create Order Lines
Verb: POST
Host: MY-INSTANCE.salesforce.com
URI : /services/apexrest/FDService/OrderService
Authorization: Bearer SESSIONID
JSON structure required to post
{
"id": "a1N1U000001abZyUAI",
"lines": [
{
"item": "a181U0000002EHU",
"salesOrder": "a1N1U000001abZyUAI"
}
]
}
The above command returns JSON structured like this:
{
"statusMessage": null,
"statusCode": null,
"metadata": {},
"errors": [],
"errorMap": null,
"data": {
"fieldToPackageMap": {},
"additionalFields": null,
"voidReason": null,
"voidDescription": null,
"validPaymentMethod": false,
"total": 0.00,
"status": "Open",
"startDate": null,
"sourceCode": null,
"shippingStreet": null,
"shippingState": null,
"shippingPostalCode": null,
"shippingCountry": null,
"shippingCity": null,
"scheduleType": "Simple Receipt",
"scheduleFrequency": null,
"salesOrderStatus": "Draft",
"salesOrderR": null,
"requirePaymentMethod": false,
"receipt": null,
"postingStatus": null,
"postingEntity": "Receipt",
"postedDate": null,
"paymentTerms": null,
"paymentMethod": null,
"paymentGateway": null,
"paymentAmount": null,
"paidDate": null,
"overallTotal": null,
"numberOfInstallments": null,
"name": "000000142",
"lines": [
{
"fieldToPackageMap": {},
"additionalFields": null,
"totalWithTax": null,
"totalInstallmentPrice": 0.00,
"total": 25.00,
"ticketType": null,
"taxPercent": 0.0000,
"taxOverride": false,
"taxAmount": null,
"systemOverride": false,
"SystemModstamp": "2022-11-02T13:01:45.000Z",
"subtotal": 25.00,
"subscriptionStartDate": null,
"subscriptionPlan": null,
"subscription": null,
"sponsorPackage": null,
"shippingTrackingNumber": null,
"shippingStreet": null,
"shippingState": null,
"shippingPostalCode": null,
"shippingMethod": null,
"shippingCountry": null,
"shippingContact": null,
"shippingCity": null,
"scheduleItem": null,
"salesOrderLineR": null,
"salesOrderLine": null,
"salesOrder": "a1W1g0000029LvtEAE",
"salePrice": 25.00,
"requirePaymentMethod": false,
"requiredPackageItems": 0.0,
"quantity": 1,
"priceRule": "a1L1g000001YRbJEAW",
"priceOverride": false,
"postedDate": null,
"paymentPriority": null,
"paymentMethod": null,
"paymentAmount": null,
"parentTotalInstallmentPrice": 0.00,
"parentTotal": 0.00,
"parentIsInstallmentCalculated": false,
"parentForeignKey": null,
"packageItem": null,
"overallTotal": 25.00,
"name": "0000000244",
"listPrice": 25.00,
"lines": null,
"lineDescription": "Fonteva Mug",
"LastModifiedDate": "2022-11-02 06:01:45",
"LastModifiedById": "0051g000009jVLsAAM",
"itemTaxPercent": 0.0000,
"itemClass": "a1A1g000002CuKZEA0",
"item": "a1C1g00000151rmEAA",
"isValid": true,
"isUnappliedPayment": false,
"isTax": false,
"isSubscription": false,
"isShippingRate": false,
"isRequiredScheduleItem": false,
"isRequiredPackageItem": false,
"isRenewal": false,
"isPosted": false,
"isMultiCurrencyOrg": true,
"isLinePosted": false,
"isInstallmentCalculated": false,
"IsDeleted": false,
"isAmendment": false,
"isAdjustment": false,
"incomplete": false,
"id": "a1U1g000000rzyKEAQ",
"gLAccount": "a151g000007hKxcAAE",
"foreignKey": "cEKkFWacIfNyniV7bfvVWOWUS3b41P",
"event": null,
"entity": "Account",
"endDate": null,
"enableAutoRenew": false,
"doNotCollectPayment": false,
"displayItem": false,
"disableScheduling": false,
"deferredRevenueAdjustment": false,
"currencyISOCode": "USD",
"creditsApplied": 0.00,
"creditNote": null,
"creditMemo": null,
"CreatedDate": "2022-11-02 06:01:45",
"CreatedById": null,
"conversionRate": 0E-9,
"contact": null,
"calculateShippingDetails": false,
"businessGroup": "a0s1g000004YNLgAAO",
"balanceDue": 25.00,
"autoRenew": false,
"autoCalculateActivationDate": true,
"autoAssignRule": null,
"autoAssignContact": false,
"autoAssignAccountContacts": false,
"autoAssign": false,
"attendee": null,
"assignmentsAvailable": null,
"assignmentsAllowed": null,
"aRAccount": "a151g000007hKxhAAE",
"amountRefunded": 0.00,
"amountPaid": 0.00,
"adjustments": 0.00,
"adjustmentReason": null,
"activeAssignments": 0,
"activationDate": null,
"account": null
}
],
"LastModifiedDate": "2022-11-02 05:58:40",
"isVoided": false,
"isScheduled": false,
"isProforma": false,
"isPosted": false,
"isPendingPayment": false,
"isOpen": null,
"isMultiCurrencyOrg": true,
"isInvoiced": false,
"isClosed": false,
"invoiceDate": null,
"id": "a1W1g0000029LvtEAE",
"hasSubscription": false,
"hasInstallments": false,
"generateInstallments": false,
"epayment": null,
"entity": "Account",
"dueDate": null,
"currencyISOCode": "USD",
"creditsApplied": null,
"creditsAndAdjustments": null,
"CreatedDate": "2022-11-02T12:58:40.000Z",
"contact": null,
"closedDate": null,
"calculateShippingDetails": true,
"calculateBillingDetails": true,
"businessGroup": null,
"billingStreet": null,
"billingState": null,
"billingPostalCode": null,
"billingCountry": null,
"billingCity": null,
"balanceDue": 0.00,
"amountRefunded": null,
"amountPaid": null,
"adjustmentReason": null,
"account": null
}
}
This endpoint creates/updates a Sales Order Lines. Requires JSON to be posted to endpoint. If no Sales Order is provided in the lines array it will auto associate to Sales Order. This solution also allows user to create Order and Order Lines using one REST Api call.
HTTP Request
POST https://MY-INSTANCE.salesforce.com/services/apexrest/FDService/OrderService
Update Orders
Verb: PUT
Host: MY-INSTANCE.salesforce.com
URI : /services/apexrest/FDService/OrderService
Authorization: Bearer SESSIONID
JSON structure required to post
{
"id": "a1W1g0000029LvtEAE",
"isProforma": true
}
The above command returns JSON structured like this:
{
"statusMessage": null,
"statusCode": null,
"metadata": {},
"errors": [],
"errorMap": null,
"data": {
"fieldToPackageMap": {},
"additionalFields": null,
"voidReason": null,
"voidDescription": null,
"validPaymentMethod": false,
"total": 25.00,
"status": "Open",
"startDate": null,
"sourceCode": null,
"shippingStreet": null,
"shippingState": null,
"shippingPostalCode": null,
"shippingCountry": null,
"shippingCity": null,
"scheduleType": "Simple Receipt",
"scheduleFrequency": null,
"salesOrderStatus": "Draft",
"salesOrderR": null,
"requirePaymentMethod": false,
"receipt": null,
"postingStatus": null,
"postingEntity": "Receipt",
"postedDate": null,
"paymentTerms": "a1J1g000002G5G4EAK",
"paymentMethod": null,
"paymentGateway": null,
"paymentAmount": null,
"paidDate": null,
"overallTotal": 25.00,
"numberOfInstallments": null,
"name": "000000142",
"lines": null,
"LastModifiedDate": "2022-11-02 06:57:22",
"isVoided": false,
"isScheduled": false,
"isProforma": true,
"isPosted": false,
"isPendingPayment": false,
"isOpen": null,
"isMultiCurrencyOrg": true,
"isInvoiced": false,
"isClosed": false,
"invoiceDate": null,
"id": "a1W1g0000029LvtEAE",
"hasSubscription": false,
"hasInstallments": false,
"generateInstallments": false,
"epayment": null,
"entity": "Account",
"dueDate": null,
"currencyISOCode": "USD",
"creditsApplied": 0.00,
"creditsAndAdjustments": 0.00,
"CreatedDate": "2022-11-02T12:58:40.000Z",
"contact": "0031g00000tULuVAAW",
"closedDate": null,
"calculateShippingDetails": true,
"calculateBillingDetails": true,
"businessGroup": "a0s1g000004YNLXAA4",
"billingStreet": null,
"billingState": null,
"billingPostalCode": null,
"billingCountry": null,
"billingCity": null,
"balanceDue": 25.00,
"amountRefunded": 0.00,
"amountPaid": 0.00,
"adjustmentReason": null,
"account": "0011g000011AWHwAAO"
}
}
This endpoint allows updates of Sales Order and Sales Order Lines
HTTP Request
PUT https://MY-INSTANCE.salesforce.com/services/apexrest/FDService/OrderService
Delete Orders
Verb: DELETE
Host: MY-INSTANCE.salesforce.com
URI : /services/apexrest/FDService/OrderService?id=a1W1g0000029LvtEAE
Authorization: Bearer SESSIONID
The above command returns JSON structured like this:
{
"statusMessage": null,
"statusCode": null,
"metadata": {},
"errors": [],
"errorMap": {},
"data": null
}
This endpoint deletes Sales Order using a comma separated list of ids.
Request Detail
Parameter | Required | Type | Description |
---|---|---|---|
id | true | string | Comma separated list of Salesforce Id's to delete. Must be Sales Order. |
HTTP Request
DELETE https://MY-INSTANCE.salesforce.com/services/apexrest/FDService/OrderService
Delete Order Lines
Verb: DELETE
Host: MY-INSTANCE.salesforce.com
URI : /services/apexrest/FDService/OrderService?id=a1U1g000000rtIz
Authorization: Bearer SESSIONID
The above command returns JSON structured like this:
{
"statusMessage": null,
"statusCode": null,
"metadata": {},
"errors": [],
"errorMap": {},
"data": null
}
This endpoint deletes Sales Order Line using a comma separated list of ids.
Request Detail
Parameter | Required | Type | Description |
---|---|---|---|
id | true | string | Comma separated list of Salesforce Id's to delete. Must be Sales Order Line. |
HTTP Request
DELETE https://MY-INSTANCE.salesforce.com/services/apexrest/FDService/OrderService
Record Match Service
Get Record Match
Verb: POST
Host: MY-INSTANCE.salesforce.com
URI : /services/apexrest/FDService/RecordMatchService
Authorization: Bearer SESSIONID
JSON structure required to post
{
"recordToMatch": {
"attributes": {"type": "Contact"},
"id": "0031g00000tUOFV",
"email": "test@email.com"
},
"store": {
"attributes": {"type": "OrderApi__Store__c"},
"id": "a1d1g000002DQEZ",
"name": "Foundation Store"
},
"storeId": "a1d1g000002DQEZ"
}
The above command returns JSON structured like this:
{
"statusMessage": null,
"statusCode": null,
"metadata": {},
"errors": [],
"errorMap": null,
"data": {
"attributes": {
"type": "Contact",
"url": "/services/data/v56.0/sobjects/Contact/0031g00000tUOFV"
},
"Email": "mark@abcd.com",
"OrderApi__Potential_Duplicate_Contacts__c": "",
"OrderApi__Personal_Email__c": "mark@abcd.com",
"Id": "0031g00000tUOFV"
}
}
This endpoint returns if a contact already exist. Requires JSON to be posted to endpoint.
HTTP Request
POST https://MY-INSTANCE.salesforce.com/services/apexrest/FDService/RecordMatchService
Schedule Payment Charge Service
Create Schedule Payment Charge
Verb: POST
Host: MY-INSTANCE.salesforce.com
URI : /services/apexrest/FDService/ScheduledPaymentChargeService
Authorization: Bearer SESSIONID
JSON structure required to post
{
"id": "a1Y1g000001JkiF",
"paymentMethod": "a1I1g00000A7kbJEAR",
"amount": 10
}
The above command returns JSON structured like this:
{
"statusMessage": null,
"statusCode": null,
"metadata": {},
"errors": [],
"errorMap": null,
"data": {
"fieldToPackageMap": {},
"additionalFields": null,
"token": "M9zbetAM5jS6hW1zUew557YKn36",
"term": null,
"systemMessage": "Succeeded!",
"succeeded": true,
"subscription": null,
"scheduledDate": "2022-10-20",
"salesOrder": "a1W1g0000029GppEAE",
"processedDate": "2022-10-21",
"paymentMethod": "a1I1g00000A7kbJEAR",
"paymentGateway": "a1H1g000007wTvgEAE",
"paymentDescription": "Invoice #000000132",
"noAutoPayment": false,
"name": "0000000002",
"isProcessed": true,
"isPaymentProcessed": true,
"isCancelled": false,
"invoice": "a191g000001T6Z1AAK",
"id": "a1Y1g000001JkiFEAS",
"hasErrors": false,
"ePaymentCreated": true,
"customScheduledPayment": false,
"currencyISOCode": null,
"apiResponse": "{\"fieldToPackageMap\":{},\"additionalFields\":null,\"transactions\":[{\"updated_at\":\"2022-11-01T10:13:50.000Z\",\"transaction_type\":\"Purchase\",\"token\":\"62aDKGgsPHXzj1FfLtho5qdf59S\",\"succeeded\":true,\"storeSobject\":null,\"storeId\":null,\"state\":\"succeeded\",\"signature\":null,\"setup_updated_at\":null,\"setup_success\":null,\"setup_message\":null,\"setup_error_code\":null,\"setup_created_at\":null,\"setup_checkout_url\":null,\"retain_on_success\":false,\"reference_token\":null,\"redirect_url\":\"https://enterprise-customization-c4-dev-ed.my.salesforce-sites.com/apex/orderapi__epayment_post?_CONFIRMATIONTOKEN=VmpFPSxNakF5TWkweE1TMHdORlF4TURveE16bzFNQzR4T0ROYSxScFJmMHN3ZWJ1amlLYTFSdzE3MUM0LE5UVXpNbVJs&common.udd.actions.ActionsUtilORIG_URI=%2Fapex%2Forderapi__epayment_post?transaction_type=OffsiteVerify\",\"redirect_updated_at\":null,\"redirect_success\":null,\"redirect_result_uknown\":null,\"redirect_pending\":null,\"redirect_message\":null,\"redirect_fraud_review\":null,\"redirect_error_detail\":null,\"redirect_error_code\":null,\"redirect_cvv_message\":null,\"redirect_cvv_code\":null,\"redirect_created_at\":null,\"redirect_cancelled\":null,\"redirect_avs_message\":null,\"redirect_avs_code\":null,\"pending\":null,\"payment_method_token\":null,\"payment_method\":{\"zip\":\"11206\",\"year\":2040,\"verification_value\":\"\",\"updated_at\":\"2022-11-01T06:57:18.000Z\",\"token\":\"M9zbetAM5jS6hW1zUew557YKn36\",\"test\":true,\"storage_state\":\"retained\",\"state\":null,\"retain_on_success\":null,\"phone\":null,\"payment_method_type\":\"credit_card\",\"month\":1,\"last_name\":\"U2\",\"last_four_digits\":\"1111\",\"full_name\":\"Jay U2\",\"first_six_digits\":\"411111\",\"first_name\":\"Jay\",\"errors\":[],\"email\":null,\"eligible_for_card_updater\":false,\"cvv\":null,\"created_at\":\"2022-10-21T10:58:56.000Z\",\"country\":null,\"city\":null,\"card_type\":\"visa\",\"bank_routing_number\":null,\"bank_name\":null,\"bank_account_type\":null,\"address2\":null,\"address1\":\"123 Melrose Street\",\"account_number\":null,\"account_holder_type\":null},\"path\":null,\"order_id\":null,\"on_test_gateway\":true,\"message\":\"Succeeded!\",\"merchant_name_descriptor\":null,\"merchant_location_descriptor\":null,\"isMultiCurrencyOrganization\":null,\"ip\":null,\"gatewaySpecificResponseFields\":{},\"gatewaySpecificFields\":null,\"gateway_transaction_id\":\"57\",\"gateway_token\":\"LGGYpsdC6cxSd1q9ToHur7qkcts\",\"gateway_specific_response_fields\":null,\"gateway_specific_fields\":null,\"gateway\":null,\"fields\":null,\"errors\":[],\"error_detail\":null,\"error_code\":null,\"email\":null,\"description\":null,\"cvv_message\":null,\"cvv_code\":null,\"custom_payment_type\":null,\"currency_code\":\"USD\",\"created_at\":\"2022-11-01T10:13:50.000Z\",\"checkout_url\":null,\"checkout_form\":null,\"cancelled\":null,\"callback_url\":\"https://enterprise-customization-c4-dev-ed.my.salesforce-sites.com/services/apexrest/OrderApi/epayment?transaction_type=OffsiteVerify\",\"callback_updated_at\":null,\"callback_success\":null,\"callback_result_uknown\":null,\"callback_pending\":null,\"callback_message\":null,\"callback_fraud_review\":null,\"callback_error_detail\":null,\"callback_error_code\":null,\"callback_cvv_message\":null,\"callback_cvv_code\":null,\"callback_created_at\":null,\"callback_conversations\":null,\"callback_cancelled\":null,\"callback_avs_message\":null,\"callback_avs_code\":null,\"avs_message\":null,\"avs_code\":null,\"attempt_3dsecure\":false,\"amount\":1000,\"algorithm\":null}],\"payment_methods\":[],\"http_status_message\":\"OK\",\"http_status_code\":200,\"gateways\":[],\"gateway_specific_response_fields\":{},\"gateway_specific_fields\":{},\"errors\":[]}",
"amount": 0
}
}
This endpoint process the schedule payment and returns the result.
HTTP Request
POST https://MY-INSTANCE.salesforce.com/services/apexrest/FDService/ScheduledPaymentChargeService
Subscription Renewal Service
Create Subscription Renewal
The Search Request object is something that is used to help filter out the results based on search criteria/fields. The following parameters can be used in junction with each other or own their own.
Parameter | Required | Type | Description |
---|---|---|---|
subscriptionId | true | string | Salesforce Id |
Verb: POST
Host: MY-INSTANCE.salesforce.com
URI: /services/apexrest/FDService/SubscriptionRenewalService?subscriptionId=a1g1g000001H428
Authorization: Bearer SESSIONID
The above command returns JSON structured like this:
{
"statusMessage": null,
"statusCode": null,
"metadata": {},
"errors": [],
"errorMap": null,
"data": {
"fieldToPackageMap": {},
"additionalFields": {},
"voidReason": null,
"voidDescription": null,
"validPaymentMethod": false,
"total": 40,
"status": "Open",
"startDate": null,
"sourceCode": null,
"shippingStreet": null,
"shippingState": null,
"shippingPostalCode": null,
"shippingCountry": null,
"shippingCity": null,
"scheduleType": "Simple Receipt",
"scheduleFrequency": null,
"salesOrderStatus": "Draft",
"salesOrderR": null,
"requirePaymentMethod": true,
"receipt": null,
"postingStatus": null,
"postingEntity": "Receipt",
"postedDate": null,
"paymentTerms": "a1J1g000002G5G4EAK",
"paymentMethod": null,
"paymentGateway": null,
"paymentAmount": null,
"paidDate": null,
"overallTotal": 120,
"numberOfInstallments": null,
"name": "000000140",
"lines": [
{
"fieldToPackageMap": {},
"additionalFields": null,
"totalWithTax": null,
"totalInstallmentPrice": 120,
"total": 40,
"ticketType": null,
"taxPercent": 0,
"taxOverride": false,
"taxAmount": null,
"systemOverride": true,
"SystemModstamp": "2022-11-01T10:18:38.000Z",
"subtotal": 40,
"subscriptionStartDate": "2022-10-22",
"subscriptionPlan": "a1f1g000001eTZ7AAM",
"subscription": "a1g1g000001H428AAC",
"sponsorPackage": null,
"shippingTrackingNumber": null,
"shippingStreet": null,
"shippingState": null,
"shippingPostalCode": null,
"shippingMethod": null,
"shippingCountry": null,
"shippingContact": null,
"shippingCity": null,
"scheduleItem": null,
"salesOrderLineR": null,
"salesOrderLine": null,
"salesOrder": "a1W1g0000029LqoEAE",
"salePrice": 40,
"requirePaymentMethod": false,
"requiredPackageItems": 1,
"quantity": 1,
"priceRule": "a1L1g000001YRXLEA4",
"priceOverride": true,
"postedDate": null,
"paymentPriority": null,
"paymentMethod": null,
"paymentAmount": null,
"parentTotalInstallmentPrice": 0,
"parentTotal": 0,
"parentIsInstallmentCalculated": false,
"parentForeignKey": null,
"packageItem": null,
"overallTotal": 120,
"name": "0000000242",
"listPrice": 120,
"lines": null,
"lineDescription": "vel",
"LastModifiedDate": "2022-11-01 03:18:38",
"LastModifiedById": "0051g000009jVLsAAM",
"itemTaxPercent": 0,
"itemClass": "a1A1g000002CuKPEA0",
"item": "a1C1g000001520mEAA",
"isValid": true,
"isUnappliedPayment": false,
"isTax": false,
"isSubscription": true,
"isShippingRate": false,
"isRequiredScheduleItem": false,
"isRequiredPackageItem": false,
"isRenewal": true,
"isPosted": false,
"isMultiCurrencyOrg": true,
"isLinePosted": false,
"isInstallmentCalculated": true,
"IsDeleted": false,
"isAmendment": false,
"isAdjustment": false,
"incomplete": false,
"id": "a1U1g000000rzjlEAA",
"gLAccount": "a151g000007hKxcAAE",
"foreignKey": "l8V3757vkncezppMYXxd5TPNMBFKCj",
"event": null,
"entity": "Contact",
"endDate": "2023-06-30",
"enableAutoRenew": false,
"doNotCollectPayment": false,
"displayItem": false,
"disableScheduling": false,
"deferredRevenueAdjustment": false,
"currencyISOCode": "USD",
"creditsApplied": 0,
"creditNote": null,
"creditMemo": null,
"CreatedDate": "2022-11-01 03:18:38",
"CreatedById": null,
"conversionRate": 0,
"contact": "0031g00000tUOD3AAO",
"calculateShippingDetails": false,
"businessGroup": "a0s1g000004YNLgAAO",
"balanceDue": 120,
"autoRenew": false,
"autoCalculateActivationDate": true,
"autoAssignRule": "Contact",
"autoAssignContact": true,
"autoAssignAccountContacts": false,
"autoAssign": true,
"attendee": null,
"assignmentsAvailable": 2,
"assignmentsAllowed": 2,
"aRAccount": "a151g000007hKxhAAE",
"amountRefunded": 0,
"amountPaid": 0,
"adjustments": 0,
"adjustmentReason": null,
"activeAssignments": 0,
"activationDate": "2022-10-22",
"account": "0011g000011AWYpAAO"
},
{
"fieldToPackageMap": {},
"additionalFields": null,
"totalWithTax": null,
"totalInstallmentPrice": 0,
"total": 0,
"ticketType": null,
"taxPercent": 0,
"taxOverride": false,
"taxAmount": null,
"systemOverride": true,
"SystemModstamp": "2022-11-01T10:18:39.000Z",
"subtotal": 0,
"subscriptionStartDate": "2023-07-01",
"subscriptionPlan": null,
"subscription": "a1g1g000001H428AAC",
"sponsorPackage": null,
"shippingTrackingNumber": null,
"shippingStreet": null,
"shippingState": null,
"shippingPostalCode": null,
"shippingMethod": null,
"shippingCountry": null,
"shippingContact": null,
"shippingCity": null,
"scheduleItem": null,
"salesOrderLineR": null,
"salesOrderLine": "a1U1g000000rzjlEAA",
"salesOrder": "a1W1g0000029LqoEAE",
"salePrice": 0,
"requirePaymentMethod": false,
"requiredPackageItems": 0,
"quantity": 1,
"priceRule": null,
"priceOverride": true,
"postedDate": null,
"paymentPriority": null,
"paymentMethod": null,
"paymentAmount": null,
"parentTotalInstallmentPrice": 120,
"parentTotal": 40,
"parentIsInstallmentCalculated": true,
"parentForeignKey": "l8V3757vkncezppMYXxd5TPNMBFKCj",
"packageItem": "a1G1g000005S7iEEAS",
"overallTotal": 0,
"name": "0000000243",
"listPrice": 25,
"lines": null,
"lineDescription": "Item line Description",
"LastModifiedDate": "2022-11-01 03:18:39",
"LastModifiedById": "0051g000009jVLsAAM",
"itemTaxPercent": 0,
"itemClass": "a1A1g000002CuKZEA0",
"item": "a1C1g00000151qcEAA",
"isValid": true,
"isUnappliedPayment": false,
"isTax": false,
"isSubscription": false,
"isShippingRate": false,
"isRequiredScheduleItem": false,
"isRequiredPackageItem": true,
"isRenewal": true,
"isPosted": false,
"isMultiCurrencyOrg": true,
"isLinePosted": false,
"isInstallmentCalculated": true,
"IsDeleted": false,
"isAmendment": false,
"isAdjustment": false,
"incomplete": false,
"id": "a1U1g000000rzjmEAA",
"gLAccount": "a151g000007hKxcAAE",
"foreignKey": "vqW7Ao96kozh6yflHsSKXyXz7a6ZMp",
"event": null,
"entity": "Contact",
"endDate": "2024-06-30",
"enableAutoRenew": false,
"doNotCollectPayment": false,
"displayItem": true,
"disableScheduling": false,
"deferredRevenueAdjustment": false,
"currencyISOCode": "USD",
"creditsApplied": 0,
"creditNote": null,
"creditMemo": null,
"CreatedDate": "2022-11-01 03:18:38",
"CreatedById": null,
"conversionRate": 0,
"contact": "0031g00000tUOD3AAO",
"calculateShippingDetails": false,
"businessGroup": "a0s1g000004YNLgAAO",
"balanceDue": 0,
"autoRenew": false,
"autoCalculateActivationDate": true,
"autoAssignRule": null,
"autoAssignContact": false,
"autoAssignAccountContacts": false,
"autoAssign": false,
"attendee": null,
"assignmentsAvailable": null,
"assignmentsAllowed": null,
"aRAccount": "a151g000007hKxhAAE",
"amountRefunded": 0,
"amountPaid": 0,
"adjustments": 0,
"adjustmentReason": null,
"activeAssignments": 0,
"activationDate": "2022-10-22",
"account": "0011g000011AWYpAAO"
}
],
"LastModifiedDate": "2022-11-01 03:18:41",
"isVoided": false,
"isScheduled": false,
"isProforma": false,
"isPosted": false,
"isPendingPayment": false,
"isOpen": null,
"isMultiCurrencyOrg": true,
"isInvoiced": false,
"isClosed": false,
"invoiceDate": null,
"id": "a1W1g0000029LqoEAE",
"hasSubscription": true,
"hasInstallments": false,
"generateInstallments": false,
"epayment": null,
"entity": "Contact",
"dueDate": null,
"currencyISOCode": "USD",
"creditsApplied": 0,
"creditsAndAdjustments": 0,
"CreatedDate": "2022-11-01T10:18:35.000Z",
"contact": "0031g00000tUOD3AAO",
"closedDate": null,
"calculateShippingDetails": true,
"calculateBillingDetails": true,
"businessGroup": "a0s1g000004YNLgAAO",
"billingStreet": null,
"billingState": null,
"billingPostalCode": null,
"billingCountry": null,
"billingCity": null,
"balanceDue": 120,
"amountRefunded": 0,
"amountPaid": 0,
"adjustmentReason": null,
"account": "0011g000011AWYpAAO"
}
}
This endpoint returns a renewed subscription.
HTTP Request
POST https://MY-INSTANCE.salesforce.com/services/apexrest/FDService/SubscriptionRenewalService
Errors
The Fonteva Service API uses the following error codes:
Error Code | Meaning |
---|---|
400 | Bad Request -- Your request is invalid. |
401 | Unauthorized -- Your session id is wrong. |
403 | Forbidden -- The object/record requested is hidden for administrators only. |
405 | Method Not Allowed -- You tried to access a service with an invalid method. |
406 | Not Acceptable -- You requested a format that isn't json. |
500 | Internal Server Error -- We had a problem with our server. Try again later. |
503 | Service Unavailable -- We're temporarily offline for maintenance. Please try again later. |