# SFMC

## Executes the Journey Builder push update action.

> \
> \<strong>Authorization:\</strong> Requires valid tenant context via TenantConfigurationAccessControlled attribute. JWT token validation enforces authenticity of the SFMC request.\
> \
> \<strong>Use Cases:\</strong> Triggered by Salesforce Journey Builder when a contact/customer enters this activity node during an active journey. Updates one or more wallet passes with data provided by the journey (e.g., dynamic offer text from campaign variables, additional metadata). Supports multi-pass updates identified by email, custom ID, or direct pass ID.\
> \
> \<strong>Behavior:\</strong> Validates JWT signature against configured SFMC signing key. Parses inArguments from JWT payload to extract pass identifiers, pass type, and optional additional data. Queries the pass repository to locate matching passes. Schedules async update tasks via MediatR for each matching pass, associating them with the journey ID for tracking. Emits push update events for audit logging. Returns 404 if no passes match the provided identifiers; otherwise returns 200 with success confirmation.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"SFMC"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"paths":{"/api/{tenantId}/webhooks/listeners/sfmc/actions/pushupdate/execute":{"post":{"tags":["SFMC"],"summary":"Executes the Journey Builder push update action.","description":"\n<strong>Authorization:</strong> Requires valid tenant context via TenantConfigurationAccessControlled attribute. JWT token validation enforces authenticity of the SFMC request.\n\n<strong>Use Cases:</strong> Triggered by Salesforce Journey Builder when a contact/customer enters this activity node during an active journey. Updates one or more wallet passes with data provided by the journey (e.g., dynamic offer text from campaign variables, additional metadata). Supports multi-pass updates identified by email, custom ID, or direct pass ID.\n\n<strong>Behavior:</strong> Validates JWT signature against configured SFMC signing key. Parses inArguments from JWT payload to extract pass identifiers, pass type, and optional additional data. Queries the pass repository to locate matching passes. Schedules async update tasks via MediatR for each matching pass, associating them with the journey ID for tracking. Emits push update events for audit logging. Returns 404 if no passes match the provided identifiers; otherwise returns 200 with success confirmation.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Pass updates scheduled."},"404":{"description":"No matching passes found for provided identifiers.","content":{"text/plain":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}},"text/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProblemDetails"},{"$ref":"#/components/schemas/HttpValidationProblemDetails"}]}}}},"500":{"description":"Unexpected server error."}}}}},"components":{"schemas":{"ProblemDetails":{"type":"object","properties":{"type":{"type":["null","string"]},"title":{"type":["null","string"]},"status":{"type":["null","integer"],"format":"int32"},"detail":{"type":["null","string"]},"instance":{"type":["null","string"]}},"additionalProperties":{}},"HttpValidationProblemDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ProblemDetails"}],"properties":{"errors":{"type":["null","object"],"additionalProperties":{"type":"array","items":{"type":"string"}}}},"additionalProperties":{}}}}}
```

## Handles publish handshakes from Journey Builder.

> \
> \<strong>Authorization:\</strong> Requires valid tenant context via TenantConfigurationAccessControlled attribute.\
> \
> \<strong>Use Cases:\</strong> Salesforce Journey Builder initiates a publish handshake when a Journey containing this custom activity is published. This endpoint acknowledges receipt of the publish event and confirms the action is ready to execute within active journeys.\
> \
> \<strong>Behavior:\</strong> Accepts the JWT-encoded publish notification from SFMC, logs the event for audit purposes, and returns a success response. The endpoint validates the request format but does not perform additional validation at publish time; validation occurs during journey execution.

```json
{"openapi":"3.1.1","info":{"title":"Neostore internal API","version":"v1"},"tags":[{"name":"SFMC"}],"servers":[{"url":"https://app.neostore.cloud","description":"Production Server"},{"url":"https://app-qa.neostore.cloud","description":"Staging Server"}],"paths":{"/api/{tenantId}/webhooks/listeners/sfmc/actions/pushupdate/publish":{"post":{"tags":["SFMC"],"summary":"Handles publish handshakes from Journey Builder.","description":"\n<strong>Authorization:</strong> Requires valid tenant context via TenantConfigurationAccessControlled attribute.\n\n<strong>Use Cases:</strong> Salesforce Journey Builder initiates a publish handshake when a Journey containing this custom activity is published. This endpoint acknowledges receipt of the publish event and confirms the action is ready to execute within active journeys.\n\n<strong>Behavior:</strong> Accepts the JWT-encoded publish notification from SFMC, logs the event for audit purposes, and returns a success response. The endpoint validates the request format but does not perform additional validation at publish time; validation occurs during journey execution.","parameters":[{"name":"tenantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Publish handshake acknowledged."},"500":{"description":"Unexpected server error."}}}}}}
```
