Stakeholder Role | ||
SalesForce will consume the SAP Price Condition API proxy exposed on the API Management Platform, providing the Price Conditions data, the type of call (synch / asynch), and the call back URL (if asynch) The API proxy triggers an integration flow in SAP Cloud Integration.
The diagram must include the following information:
The EA names of the interfaced applications, partners or marketplaces (see EA reference)The location of each interfaced applications: AWS landing ZoneSite if local deploymentSaaS (SAP / Google / AWS / other Cloud)PaaS (SAP / Google / AWS)The EA business object name being transferred (see EA reference)For both the southbound and northbound interface, provide the following technical detailsThe protocol used (HTTPS, FTPS, RFC, etc)The URL used to reach the inbound/outbound destinationThe authentication mechanism used (BASIC, OAuth, …)The data format used (json, xml, plain file, …)
Integration Flow name | SAP_Pricing_API |
Source Application (EA name) | Salesforce Community Cloud |
Source Protocol | REST |
Source Authentication Mechanism | OAuth authentication |
Source Format | json |
Business Object (EA Name) | Pricing |
Target Application (EA name) | SAP WP1 - SD |
Target Protocol | RFC |
Target Authentication Mechanism | Basic Authentication |
Target Format | XML |
Orchestration | [Source Trigger, Integration Platform Trigger, Target Trigger] |
Trigger Frequency | |
Volumetry [unit] | [x] [unit]/[period] |
This section contains platform specific technical implementation details and its content will vary depending on the integration solution used. Adapt the content according to the actual needs.
Https: /priceConditions/bulk
NA
ENABLE_LOG: define if we want to log some data
ENABLE_LOG: define if we want to log some data
SERVICE_CREDENTIALS_NAME: define the credentials for the basic authentication of SAP Alert Notification API
SERVICE_RESOURCE_EVENTS_URL: define the endpoint of the SAP Alert Notification API
It is an asynchronous process based on 2 integration flows (the first one to call SAP, the second one to update Salesforce with the SAP results).
In the integration flow “Z_PRICE_CONDITIONS”
In the integration flow “Z_Price_Conditions_Integration”, the integration process reads the datastore “Z_SD_CRM_CREATE_PRICING” and call the Salesforce API to update Salesforce with the SAP results
The user that calls this integration flow should have the role SAP_Pricing
Components of the local integration process
This integration flow is divided in 3 integration processes:
Example: Integration process to call the API on Salesforce Prod
For each API provider, provide the following information:
API Provider: SCPI_NON_HR_DEV | |
Description | Define the connection details for integration flows hosted on SCPI Non HR (DEV env) |
Type | [Cloud Integration] |
Host/Port | |
Catalog Service details (oData) | |
API Provider: SCPI_NON_HR_PROD | |
Description | Define the connection details for integration flows hosted on SCPI Non HR (PROD env) |
Type | [Cloud Integration] |
Host/Port | |
Catalog Service details (oData) | |
For each API proxy, provide the following information:
API Proxy: SAP_Pricing_API | |
Description | This API updates the Pricing Condition in SAP. It is called by Salesforce Core |
Host Alias | |
Base Path | /v1/pricing/ |
Target Endpoint (provider) | SCPI_NON_HR_PROD |
Target Endpoint Path | /http |
Link to the API specification | |
Describe the authentication mechanism protecting the access to the API
KVM Name | Usage |
APIM_SCP_CRED | Contains the credentials for the basic authentication to SCPI NON HR |
Describe the API Flow and the policies in place
All the policies below allow to validate the JSON request
Link to the OPENAPI specifications
For each API product, provide the following information:
API Product: SAP_Price_Condition_API | |
Description | SAP Price Condition API |
API list |
|
Permissions | Discovery: SalesInternalDev Subscription: SalesInternalDev |
Rate Plan | NA |
[]
Environment | Vault | Password ID | Usage |
[Details the certificates involved in the connections to the source/destination apps and how to manage their lifecycle]
[Link to related file]
[Link to related file]
[To be detailed]
[Guidance to be detailed]
Describe the common and specific monitoring activities related to the integration flow
Check the Credentials in Postman
URL : https://login.salesforce.com/services/oauth2/token
Grant_type : password
Describe the common and specific error handling and logging activities related to the integration flow
The displayed error message in SCPI is :
org.apache.camel.CamelException: Exception occurred during the XMLtoJSON conversion : Missing ';' in XML entity
Solution : undeploy/redeploy the integration flow
Describe the common and specific alerting actions related to the integration flow
Assumptions:
95% of quotes have less than 50 OQLI Pricing Conditions
1% of quotes my have more than to 200 OQLI
In future when the sold to group is implemented there is a possibility of quotes with up to 3000 OQLI (Pricing Conditions). Therefore these quotes should be internally splitted by salesforce into multiple bulks
Single call to API Gateway cannot take more 5 seconds (governor limits)
Salesforce Approach:
* Standard Quotes (up to 500 OQLI) will be sent from SF to API gateway via continuation that is safe from concurrent call perspective
* Very Large Quotes (bigger than 500 OQLI = quotes with multiple sold to) will be internally divided in salesforce into bulks and sent to API Gateways using queable approach that is not as safe from governor limits perspective but allows to address CPU limits per transaction.
Landscape:
.
SALESFORCE landscape is more complex than SAP therefore we need to ensure that multiple test SF environments. To achieve this we need to add source system id to the call to API to be able to identity the system to which we should send the response.
Security:
API cloud integration should store credentials to all SF instances to ensure to be able to connect to them when we are sending the response.
Integration Flow
For quotes smaller than 600 OQLI
Authorization and caching api gateway access token
SAP API GATEWAY Pricing Condition interface:
Request,
Method Post,
URL :https://dev-api.solvay.com/v1/pricing/priceConditions/bulk,
AUTHORIZATION: Bearer
BODY:
{
"source": "salesforceint",
"target": "WQ1",
"quoteId": "string",
"priceConditions": [
{
"quoteLineItemId": "string",
"customerId": "string",
"materialId": "string",
"conditionType": "string",
"table": "string",
"salesOrganization": "string",
"distributionChannel": "string",
"incoterm": "string",
"plant": "string", // optional
"validityStartDate": "2023-08-30",
"validityEndDate": "2023-08-30",
"conditionCurrency": "string",
"pricingUnit": "string",
"pricingUnitOfMeasure": "string",
“scaleType”:”A”, //default value
"scales": [ // at least one scale and always sorted by quantity they need to put into sap into order
{
"quantity": "string", // optional but only when there is one scale
"amount": "string"
}
],
"priceJustification": "string" // optional
}
]
}
Response OK
BODY:
{"message":"acknowledged"}
In case of internal issues in SAP we are retrieving “fault” attribute in the body and then inside the fault there is a “description” attribute with human friendly error. SAP Integration team will provide the close list of descritions that can be mapped and for example translated on SF side.
Response KO
BODY:
{
"fault": {
"description": "Invalid Json request",
"detail": {
"ErrorCode": "303",
"ErrorDataPath": "/priceConditions/0/scales/0/xxxx",
"ErrorSchemaPath": "",
"ErrorMsg": "Additional properties not allowed"
}
}
}
BODY:
{
"fault": {
"description": "Internal error",
}
}
Possible error Descriptions:
Http status | Description | Comments | |
1 | 400 | Invalid Json request | |
2 | |||
3 | |||
4 | |||
Examples
{
"source": "sfUAT",
"quoteId": "12345",
"target": "WQ1" ,
"priceConditions": [
{
"quoteLineItemId": "12345",
"customerId": "65429",
"materialId": "143742",
"conditionType": "PRE",
"table": "999",
"salesOrganization": "NL05",
"distributionChannel": "6X",
"incoterm": "CIP",
"plant": "string",
"validityStartDate": "2023-08-30",
"validityEndDate": "2023-08-30",
"conditionCurrency": "EUR",
"pricingUnit": "1",
"pricingUnitOfMeasure": "KG",
"scales": [ // at least one scale and always sorted by quantity
{
"quantity": "string",
"amount": "string"
}
],
"priceJustification": "string"
},
{
"quoteLineItemId": "12345",
"customerId": "65429",
"materialId": "143742",
"conditionType": "PRE",
"table": "999",
"salesOrganization": "NL05",
"distributionChannel": "6X",
"incoterm": "CIP",
"plant": "string",
"validityStartDate": "2023-08-30",
"validityEndDate": "2023-08-30",
"conditionCurrency": "EUR",
"pricingUnit": "1",
"pricingUnitOfMeasure": "KG",
"scales": [ // at least one scale and always sorted by quantity
{
"quantity": "string",
"amount": "string"
},
{
"quantity": "string",
"amount": "string"
},
{
"quantity": "string",
"amount": "string"
}
],
"priceJustification": "string"
},
{
"quoteLineItemId": "12345",
"customerId": "65429",
"materialId": "143742",
"conditionType": "PRE",
"table": "999",
"salesOrganization": "NL05",
"distributionChannel": "6X",
"incoterm": "CIP",
"plant": "string",
"validityStartDate": "2023-08-30",
"validityEndDate": "2023-08-30",
"conditionCurrency": "EUR",
"pricingUnit": "1",
"pricingUnitOfMeasure": "KG",
"scales": [ // at least one scale and always sorted by quantity
{
"quantity": "string",
"amount": "string"
}
],
"priceJustification": "string"
}
]
},
[{
"sourceId": "sfUAT",
"tartgetId": "PF1"
"pricingCondioions":[{
"quoteId": "12345",
"quoteLineItemId": "12345",
"customerId": "12345",
"materialId": "12345",
"conditionType": "string",
"table": "string",
"salesOrganization": "FR04",
"distributionChannel": "12",
"incoterm": "string",
"plant": "string",
"validityStartDate": "2023-08-02",
"validityEndDate": "2024-08-02",
"conditionCurrency": "EURO",
"pricingUnit": "12",
"pricingUnitOfMeasure": "KG",
"scales": [ // aways sorted by quantity
{
"quantity": "100",
"amount": "1000"
}, {
"quantity": "200",
"amount": "900"
}, {
"quantity": "500",
"amount": "850"
}
],
"priceJustification": "test"
},
{
"quoteId": "12345",
"quoteLineItemId": "12345",
"customerId": "12345",
"materialId": "12345",
"conditionType": "string",
"table": "string",
"salesOrganization": "FR04",
"distributionChannel": "12",
"incoterm": "string",
"plant": "string",
"validityStartDate": "2023-08-02",
"validityEndDate": "2024-08-02",
"conditionCurrency": "EURO",
"pricingUnit": "12",
"pricingUnitOfMeasure": "KG",
"scales": [ // no scaling prices only one quantity and amount
{
"quantity": "500", // minimum amount
"amount": "999"
}
],
"priceJustification": "test"
},{
"sourceId": "sfUAT",
"tartgetID": "WP1"
"pricingCondioions":[{
"quoteId": "12345",
"quoteLineItemId": "12345",
"customerId": "12345",
"materialId": "12345",
"conditionType": "string",
"table": "string",
"salesOrganization": "FR04",
"distributionChannel": "12",
"incoterm": "string",
"plant": "string",
"validityStartDate": "2023-08-02",
"validityEndDate": "2024-08-02",
"conditionCurrency": "EURO",
"pricingUnit": "12",
"pricingUnitOfMeasure": "KG",
"scales": [ // aways sorted by quantity
{
"quantity": "100",
"amount": "1000"
}, {
"quantity": "200",
"amount": "900"
}, {
"quantity": "500",
"amount": "850"
}
],
"priceJustification": "test"
},
{
"quoteId": "12345",
"quoteLineItemId": "12345",
"customerId": "12345",
"materialId": "12345",
"conditionType": "string",
"table": "string",
"salesOrganization": "FR04",
"distributionChannel": "12",
"incoterm": "string",
"plant": "string",
"validityStartDate": "2023-08-02",
"validityEndDate": "2024-08-02",
"conditionCurrency": "EURO",
"pricingUnit": "12",
"pricingUnitOfMeasure": "KG",
"scales": [ // no scaling prices only one quantity and amount
{
"quantity": "500", // minimum amount
"amount": "999"
}
],
"priceJustification": "test"
}
]
}]
SF DEV INTEGRATION CREDENTIALS (env without real data)
DEV 2 : (removed)
User name: sap_pc.integration@solvay.com.crm.pricingdv2
Password: TurboMacarena99%2
Consumer Key: 3MVG92u_V3UMpV.hVLkz3fgxWmnvxkc27lsaeKNTexEQudwfFDLS2C1JN5LDMp6gsa8oaZPqaF9UdcpjQkggf
Consumer Secret: 53F5EC1267F550F0AB892E8F8C6C047390AC8BA76DE2FC6C98C8C70073B40CFB
Test Email for salesforce Update Issues
Bartosz.borowiec-ext@solvay.com
DEV 3:
User name: sap_pc.integration@solvay.com.crm.pricingdv3
Password: TurboMacarena66%2
Consumer Key: 3MVG97srI77Z1g79BWZAT8wphYP8PSd5l_zQarKVNjt.QkHzQpHBw8EbpXi4dZbTCSgtuAp7bnlKzfXEMJsUr
Consumer Secret: 2C8A221894EDF82E77C0EBFF53F48FE2DFD2FF75532AF55C683B34534FF52B90
Security Token:
dNovjH5Y6U59cwYnPytQ7vH2a
Test Email for salesforce Update Issues
Bartosz.borowiec-ext@solvay.com
MNTINT:
Username: sap_pc.integration@solvay.com.crm.mntprojint
Password: Macarena99%
Consumer Key: 3MVG9vYM8JyKwjKbXeQ6pzb_bqSo07b0zo_lY7qvGzTKwGaeF3GLzdYdXC1lKdr58fG70uDguQWUaUys7pIl1
3MVG9vYM8JyKwjKbXeQ6pzb_bqZBuizocP1LR3Lylv2FS9zdPLjTTc7c5mfNXozCD89buFbTOmgkn.HS5LMEA
Consumer Secret:
073D86DC7D3C893EE54DA9EC1A89278243CFE8037D6E975277354868D7ED096C
4F32A05222844BD4DFD4831C9E00D763F8D462E2C14DA9C590A80A2F84F71E01
Security Token:dcIL9sLtFGV58reWheBCuWBMC
Macarena99%dcIL9sLtFGV58reWheBCuWBMC
Macarena100%OHfGHE7tP4gsLVtEeZ6OJXjsK
INT:
Username (Subject Alias for JWT token):sap_pc.integration@solvay.com.crm.int
Password: N/A
Consumer Key(Issuer Alias for JWT token):
3MVG9Yq55Et8XwXP9iVZfmDtOoVskzmZ6v3dlYChiaArvU8V.rsa42ebbWcymR5Hai2WEE0G4xQAGiWkzxNzN
Consumer Secret: N/A
Certificate:
-----BEGIN CERTIFICATE-----
MIIEJzCCAw+gAwIBAgIIBlm1isLDxbgwDQYJKoZIhvcNAQELBQAwdTELMAkGA1UE
BhMCRlIxDzANBgNVBAoTBnNvbHZheTELMA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XvwYY
QPCvNw4OXFNVESnYKv7oVN8bkbAv4ys0EtNB0R+z/8aTk8hfZVySUw4Gn4MWhAwc
Qiko9SDPbINnLLPAkmsGqsxWPmsWZYTT71bd3txSD6X5I5oQv9U1Ocj3ceugTJKY
TaiPDWLKh04f3Zx0whDb43Ry4iCCugPCI52ZFt/mGI2XvNPGEeajc0wb/bAqVSRJ
CKAsCHGX+M1mU4WDh42wUMsexrnrhNFr8YXQgmI+Q7+06WCcQe+NB1DaPknf7rRQ
RzEbfnPd3I/7H4s=
-----END CERTIFICATE-----
UAT:
Username (Subject Alias for JWT token): sap_pc.integration@solvay.com.crm.uat
Password: Macarena66%
Consumer Key (Issuer Alias for JWT token):
3MVG9Yq55Et8XwXP9iVZfmDtOoQrGtb75XhcvwQPNjkNFkrVZQH1_V54pr697PNBLDPvMevN2VNfYQDx11ULT
Consumer Secret: C82E69A0238DC77636830326BAB9BCD22F330CA10A2CCB76C5CD8D4446666ED2
Security Token:g2M5Hd4W3ey32x3l25F4X3Ep
Certificate:
-----BEGIN CERTIFICATE-----
MIIEJzCCAw+gAwIBAgIIWy+gaeDBiP4wDQYJKoZIhvcNAQELBQAwdTELMAkGA1UE
BhMCRlIxDzANBgNVBAoTBnNvbHZheTELMAkGA1UECxMCRFQxHTAbBgNVBAMMFFNG
VUFUX0pXVC5zb2x2YXkuY29tMSkwJwYJKoZIhvcNAQkBFhphcGltLm9wZXJhdGlv
bnNAc29sdmF5LmNvbTAeFw0yNDA0MzAwNzQ4MDBaFw0yNTA0MzAwNzQ4MDBaMHUx
CzAJBgNVBAYTAkZSMQ8wDQYDVQQKEwZzb2x2YXkxCzAJBgNVBAsTAkRUMR0wGwYD
VQQDDBRTRlVBVF9KV1Quc29sdmF5LmNvbTEpMCcGCSqGSIb3DQEJARYaYXBpbS5v
cGVyYXRpb25zQHNvbHZheS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
AoIBAQDXYfdXVOMezqgnjcrDTcoV/Ruc0GU0uZaoj5WdpnSovoIzCQUANVUrHuuw
mvbKNfbgXHoKCn3oXb6X17SYPjBjiLArpv5E/umcNme93e5IeO/zojXR3Y5xucle
Ci4C8cfKrSu5G5Kf/rTygxDqo/lP8pKvgzSxCmWLRpIaebZYTu+TfKodre/d5g1J
/0qVOM+kHPSziRBCN/IXXhVgbEq8yJ3rTGiQ/m/AvqpItz/WPETXyukTiw6o97Y1
awZy3Nt/W89Y8y1Dhcq9K7zeemyJpjTdwWGLTMuBQcMnYO7ONR4Vx6wFFyXtvH3e
R/9cmM1I6DKZ58x/ogTD5885dJRHAgMBAAGjgbowgbcwDAYDVR0TAQH/BAIwADAd
BgNVHQ4EFgQUKows952pKa6eqjYn5y+ButTPVf4wCwYDVR0PBAQDAgPoMCcGA1Ud
JQQgMB4GCCsGAQUFBwMBBggrBgEFBQcDAgYIKwYBBQUHAwMwHwYDVR0RBBgwFoIU
U0ZVQVRfSldULnNvbHZheS5jb20wEQYJYIZIAYb4QgEBBAQDAgZAMB4GCWCGSAGG
+EIBDQQRFg94Y2EgY2VydGlmaWNhdGUwDQYJKoZIhvcNAQELBQADggEBAIwbScSy
vJYpwWs5PHvijrU2sK3ux8H7f1r/YzCrjR4GkVSQJnVxOHx2+7v0ublVb49sP/cU
z/HuLjyb3Caoh7H+m3SlmC8g4CiBApoe1iEOVCaksmospaCqzHVsPokY/7grsN6g
cJnJQssXd2vwcLmsNj89DRVPsRw9O+q6C9PxZj8vJdEaJYrvo/t4JvnYhZzV8/XK
WOlJXw4WHaxDCFvWoFDd0tCTgmXZPvdomkWzt9Ugcz4j1qfnTm7nunGBSQISNm4Q
XOuHReHBZ5xlQGTgHm3lUOH9N4iO9l6lyt7hbxCl2TB0DWPLGb1j0JuojgqqdDzX
adTAycwqBAKKv+o=
-----END CERTIFICATE-----
PROD:
Username: sap_pc.integration@solvay.com.crm
Password: Please contact Salesforce Release Manager
Consumer Key: Please contact Salesforce Release Manager
Consumer Secret: Please contact Salesforce Release Manager
Security Token:Please contact Salesforce Release Manager
Certificate: Please contact Salesforce Release Manager
Call back message from SAP Cloud Integation to SF:
Important: Maximum number of record updated in one bulk is 200
Method PATCH,
URL : {{_endpoint}}/services/data/v{{version}}/composite/sobjects,
BODY:
{
"allOrNone": "false",
"records" : [{
"attributes" : {"type" : "SLV44_ONE_Quote_Line_Item__c"},
"id" : "a247E000004HtCSQA0",
"PP_PC_Integration_Status__c" : "Fail",
"PP_PC_Integration_Code__c" : "A",
"PP_PC_Integration_Message__c" : "Something went really wrong... Rethink your behaviour",
"PP_PC_Integration_SAPRecordNumber__c" : ""
},{
"attributes" : {"type" : "SLV44_ONE_Quote_Line_Item__c"},
"id" : "a247E000005FaBZQA0",
"PP_PC_Integration_Status__c" : "Integrated",
"PP_PC_Integration_Code__c" : "",
"PP_PC_Integration_Message__c" : "",
"PP_PC_Integration_SAPRecordNumber__c" : "1234567"
}]
}
RETURN:
[
{
"id": "a247E000004HtCSQA0",
"success": false,
"errors": [
{
"statusCode": "INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST",
"message": "PC Integration Status: bad value for restricted picklist field: Fail",
"fields": [
"PP_PC_Integration_Status__c"
]
}
]
},
{
"id": "a247E000005FaBZQA0",
"success": true,
"errors": []
}
]