Setting the Initial Value for Multi-Currency Events by Using the Event Management API

This procedure describes how to use the Event Management API to set the initial value for multi-currency events.

Prerequisites

Context

The POST /events endpoint of the Event Management API enables you to set the initial value for multi-currency events.

Procedure

Use the POST /events endpoint to set the initial value for multi-currency events.

Example:

POST {{runtime_URL}}/events?user=myUser&passwordAdapter=PasswordAdapter1&realm=mySite
Where:
  • user: It is the ID of the user for whom the Event Management API will perform the action. This is a required parameter.

  • passwordAdapter: It is the password for authenticating the user, such as PasswordAdapter1. This is a required parameter.

  • realm: It is your site name. This is a required parameter.

To define the initial value, at a minimum, the request body must contain the following elements in participantValue:
  • In the moneyValue field, specify the amount and currency to set the event currency.

  • In the supplierValue field, specify the amount and currency to set the initial value.

To define (add) the set of currency conversion rate, at a minimum, the request body must contain the following elements:
  • isMulticurrencyEnabled=true

  • The currencyConversionRateSet entry must include the following fields:

    • name: The name for the currency exchange rate set. For example: System Currency Conversion Rates

    • uniqueName for fromCurrency: The unique name for the currency (currency code). For example: USD or JPY

    • uniqueName for toCurrency: The unique name for the currency (currency code). For example: BRL or EUR

Optionally, you can specify the following fields in the currencyConversionRateSet entry:
  • setId: The unique ID for the currency conversion rate set. For example: CCRS1486

  • name: The name for the currency conversion rate set. For example: BRL:USD, ARS:USD, AUD:USD, NZD:USD.

  • rate: The currency conversion rate as a decimal value. For example, 0.6924 or 1.916.

  • name for fromCurrency: The name of the currency from which the monetary value is converted. For example: Brazilian Real or Euro.

  • name for toCurrency: The name for the currency to which the monetary value is converted. For example: US Dollar or Japanese Yen.

Use the following data model for the request body to set the initial value for multi-currency events:

{
    "title": "Multicurrency API event",
    "currency": "USD",
    "baseLanguage": "en",
    "regions": [],
    "departments": [],
    "supplierInvitations": [
        {
            "mainContact": {
                "uniqueName": "tphillips",
                "passwordAdapter": "SourcingSupplierUser"
            },
            "organization": {
                "name": "CMX Technology",
                "systemID": "sid501",
                "smVendorID": null,
                "erpVendorID": "0000001021"
            }
        }
    ],
    "templateDocumentInternalId": "WS11948228",
    "items": [
        {
            "title": "Item 1",
            "description": "Item 1",
            "terms": [
                {
                    "title": "originalItemID",
                    "value": {
                        "simpleValue": "33bdc2a6-884c-44af-a146-ae57836db67e"
                    }
                },
                {
                    "title": "Price",
                    "fieldId": "PRICE",
                    "hasParticipantSpecificValues": true,
                    "participantInitialValues": [
                        {
                            "invitationId": "sid501",
                            "userId": "tphillips",
                            "participantValue": {
                                "moneyValue": {
                                    "amount": "200",
                                    "currency": "USD"
                                },
                                "supplierValue": {
                                    "amount": "1000",
                                    "currency": "BRL"

                                }
                            }
                        }
                    ]
                },
                {
                    "title": "Quantity",
                    "fieldId": "QUANTITY",
                    "fromValue": {
                        "quantityValue": {
                            "amount": "10.0000000000",
                            "unitOfMeasureName": "par.",
                            "unitOfMeasureCode": "PAR"
                        }
                    },
                    "value": {
                        "quantityValue": {
                            "amount": "10.0000000000",
                            "unitOfMeasureName": "par.",
                            "unitOfMeasureCode": "PAR"
                        }
                    }
                },
                {
                    "title": "Extended Price",
                    "fieldId": "EXTENDEDPRICE",
                    "acceptableValues": "LimitedRange",
                    "requiredType": 1,
                    "participantVisibility": 1,
                    "isFormula": true,
                    "formula": "'Price'*'Quantity'",
                    "formulaDefinition": "_THIS_THIS_PRICE*_THIS_THIS_QUANTITY",
                    "formulaCurrentAlias": "Extended_Price",
                    "formulaForEditing": "'Price'*'Quantity'"
                }
            ],
            "itemType": 4,
            "commodity": {
                "uniqueName": "M",
                "domain": "custom",
                "name": "Bens"
            },
            "competitiveTermFieldId": "EXTENDEDPRICE",
            "currency": {
                "uniqueName": "USD",
                "name": "USD"
            }
        }
    ],
    "timingMultiple": 1,
    "timingUnit": 2,
    "isTest": false,
    "isMulticurrencyEnabled": true,
    "currencyConversionRateSet": {
        "setId": "CCRS1"
    }
}
					

The Event Management API returns the details of the multi-currency event status.

For example:

{
	"payload": {
		"title": "Multicurrency API event",
		"description": "",
		"internalId": "Doc14647967",
		"currency": "USD",
		"status": "Draft",
		"baseLanguage": "en",
		"eventTypeName": "RFP",
		"eventStateName": "NewState",
		"owner": {
			"uniqueName": "customersupportadmin",
			"passwordAdapter": "PasswordAdapter1",
			"name": "Customer Support Admin",
			"isRecommended": false
		},
		"requestId": "",
		"documentVersion": 1,
		"hasAward": false,
		"eventOrigin": "3",
		"templateProjectInternalId": "WS11948228",
		"templateEventInternalId": "Doc11948232",
		"regions": [
		],
		"departments": [
		],
		"commodities": [
		],
		"sourcingProjectCustomFields": [
			{
				"fieldId": "cus_test_date1",
				"fieldName": "test_date1",
				"fieldDataType": "dateValue",
				"subContent": {
					"flexMasterDataFields": {
					}
				},
				"templateProperties": [
					"DateField",
					"DefaultDocumentField",
					"FollowOnProjectSyncOnCreateField",
					"SubprojectSyncOnCreateField",
					"ExternalIntegrationField"
				],
				"visibilityConstraint": {
					"expression": null,
					"expressionEvaluation": true,
					"constraintCollectionMap": null,
					"validationMessage": null
				},
				"editabilityConstraint": {
					"expression": null,
					"expressionEvaluation": true,
					"constraintCollectionMap": null,
					"validationMessage": null
				},
				"validityConstraint": {
					"expression": null,
					"expressionEvaluation": true,
					"constraintCollectionMap": null,
					"validationMessage": null
				},
				"instanceOfSubContent": {
					"flexMasterDataFields": {
					}
				},
				"customField": true
			},
			...		
		],
		"compositeEventStateName": "NewState",
		"parentProjectId": "WS14647963",
		"supplierInvitations": [
		],
		"teams": [
			{
				"uniqueName": "PG14647965",
				"name": "Project Owner",
				"isGlobal": false,
				"isDeletable": false,
				"isOwner": true,
				"isEditable": true,
				"roles": [
					{
						"uniqueName": "ProjectManager",
						"name": "Project Owner"
					}
				],
				"childGroups": null,
				"users": [
					{
						"uniqueName": "customersupportadmin",
						"passwordAdapter": "PasswordAdapter1",
						"name": "Customer Support Admin",
						"emailAddress": "aribacustomersupportadmin@gmail.com",
						"organization": "Canonical Realm: BASF ",
						"orgName": "Canonical Realm: BASF ",
						"timeZoneID": "US/Pacific",
						"localeID": "en",
						"isRecommended": false,
						"orgANId": "AN02002584076"
					}
				]
			},
			{
				"uniqueName": "PG14647966",
				"name": "Surrogate Bidders",
				"isGlobal": false,
				"isDeletable": false,
				"isOwner": false,
				"isEditable": true,
				"roles": [
					{
						"uniqueName": "TeamMemberObserver",
						"name": "Observer Team Member"
					},
					{
						"uniqueName": "Surrogate Bidder",
						"name": "Surrogate Bidder"
					}
				],
				"childGroups": [
					{
						"uniqueName": "Surrogate Bidders",
						"name": "Surrogate Bidders",
						"isGlobal": true,
						"isDeletable": false,
						"isOwner": false,
						"isEditable": false,
						"roles": null,
						"childGroups": null,
						"users": null
					}
				],
				"users": null
			}
		],
		"items": [
			{
				"itemId": "1617767",
				"title": "Totals",
				"rollUpTerms": [
					{
						"title": "Extended Price",
						"fieldId": "EXTENDEDPRICE",
						"valueTypeName": "Money",
						"isMultiValue": false,
						"acceptableValues": "LimitedRange",
						"precision": 2,
						"isRequirement": false,
						"requiredType": 1,
						"enableParticipantComments": false,
						"rollup": true,
						"historicValueProperty": 1,
						"reserveValueProperty": 1,
						"participantVisibility": 1,
						"isFormula": true,
						"formula": "Rollup(\"Variable_not_found\")",
						"formulaDefinition": "Rollup(\"_THIS_THIS_EXTENDEDPRICE\")",
						"formulaCurrentAlias": "Extended_Price",
						"formulaForEditing": "Rollup(\"Variable_not_found\")",
						"isDeleteable": true,
						"canChangeValidValues": true,
						"columnDisplay": true,
						"rankOrder": 0,
						"sourceType": 2,
						"protection": 55,
						"requiredTypeValidChoices": {
							"Yes, Owner Required": 2,
							"No, Owner Optional - Participant Cannot Respond": 8,
							"Yes, Owner Required - Participant Optional": 6,
							"Not Required": 0,
							"Yes, Participant Required": 1
						},
						"prerequisiteReviewStatus": 0,
						"hasParticipantSpecificValues": false,
						"allowParticipantOtherValue": false,
						"hideResponseFromEachOther": true,
						"teamAccessControl": [
						],
						"additionalEditorGroups": [
						]
					}
				],
				"itemType": 1,
				"section": true
			},
			...
					}
				],
				"supplierDisplayNumber": "1.0",
				"buyerDisplayNumber": "1.0",
				"itemType": 3,
				"parentItem": "1617767",
				"numbering": 1,
				"isRequirement": true,
				"competitiveTermFieldId": "",
				"isCompetitiveTermEditable": true,
				"externalSystemCorrelationId": "Retail_1QUE116128_Event",
				"currency": {
					"uniqueName": "USD",
					"name": "US Dollar"
				},
				"currencyConversionRateSet": {
					"setId": "CCRS3453",
					"name": "System Currency Conversion Rates",
					"customCurrencyConversionRates": [
						{
							"name": "BRL:USD",
							"rate": 0.33985200000000000000,
							"fromCurrency": {
								"uniqueName": "BRL",
								"name": "Brazilian Real"
							},
							"toCurrency": {
								"uniqueName": "USD",
								"name": "US Dollar"
							}
						},
						...
						}
					]
				},
				"weight": 0,
				"teamAccessControl": [
				],
				"additionalEditorGroups": [
				],
				"invitedSuppliers": [
				],
				"hasItemInvitees": false,
				"question": true,
				"bidOnUnit": true
			},
			...
				}
			]
		},
		"isSupplierAnonymizationActive": false,
		"isManualInterventionActive": false,
		"subProject": true,
		"externalIntegrationSupported": false
	},
	"messages": [
		"Event create succeeded."
	]
}
					

To troubleshoot your queries to the Event Management API, refer to Error Messages Returned by the Event Management API.