Skip to content
TilloTech Docs

Choice Digital Processor and API

This page explains the Choice Digital integration from an operations and customer-service perspective: how an order moves through the system, which settings control the request shape, and what evidence is useful when investigating a failed or delayed gift-card order.

What Choice Digital does

Choice Digital is a digital card processor with catalogue support. The current application behaviour is synchronous: the processor calls the realtime order endpoint and expects the order to be processed and an activation URL to be returned in the same response.

The processor is configured as:

PropertyBehaviour
Processor typeSKU per product
ProcessingSynchronous
DeliveryDigital voucher/code
Balance lookupUnsupported
CancellationUnsupported
Issue completion ruleresponse_data.order_status=processed, a ready-for-activation card, and a valid activation URL

Order lifecycle

  1. A partner orders a Choice Digital brand through the normal gift-card API.
  2. The application reads the Choice Digital product reference and the partner’s funding-source identifier configured for the brand/partner relationship.
  3. Request middleware validates the customer fields required by the selected Choice Digital mode. The processor then builds a realtime order request with the product identifier, amount, and internal transaction reference.
  4. The client obtains and caches an OAuth bearer token, then sends POST /orders-realtime with the x-idempotency-key and x-tenant-id headers.
  5. The response is validated. The provider order_id becomes the processor reference and the provider activation URL becomes the card URL.

If the realtime response is missing a required field, has an unexpected status, fails authentication, or cannot be sent, the issue fails with an external or response-validation error and should be investigated using the processor interaction audit records.

!IMPORTANT Choice Digital uses an idempotency key based on the internal external-card identifier. This helps prevent accidental duplicate orders when the same request is retried.

Settings

Processor settings

The processor-level settings are environment-backed values in config/choice-digital.php:

SettingEnvironment variablePurpose
API base URICHOICE_DIGITAL_BASE_URIBase URL for Choice Digital API requests
Authentication URICHOICE_DIGITAL_AUTH_URIOAuth token endpoint
Client IDCHOICE_DIGITAL_CLIENT_IDOAuth client identifier
Client secretCHOICE_DIGITAL_CLIENT_SECRETOAuth client secret
AudienceCHOICE_DIGITAL_AUDIENCEOAuth audience value
Tenant IDCHOICE_DIGITAL_TENANT_IDDefault tenant header
TimeoutCHOICE_DIGITAL_TIMEOUTHTTP client timeout
Personalisation defaultCHOICE_DIGITAL_IS_PERSONALISATION_REQUIREDOptional default controlling whether recipient name and email are sent
Fulfillment parameters defaultCHOICE_DIGITAL_IS_FULFILMENT_PARAMETERS_REQUIREDOptional default controlling whether name, email, address, phone number, and state details are sent

The API client caches the access token and attaches both the bearer token and tenant ID to provider requests. These values should stay in processor configuration rather than support notes.

Brand settings

Each Choice Digital-enabled brand must provide the product identifier expected by the realtime order endpoint. The processor type is SKU_PER_PRODUCT, so the same configured product value is reused rather than looking up a separate SKU per denomination.

The processor supports two mutually exclusive customer-information modes. Configure only one for a Choice Digital brand; is_fulfilment_parameters_required includes the recipient name and email checks as well as the physical-address checks.

SettingRequest validationChoice Digital payloadOperational use
is_personalisation_requiredRequires fulfilment_parameters.to_first_name, fulfilment_parameters.to_last_name, and a valid fulfilment_parameters.to_email.Sends card.customer_info.entity_type=individual, first_name, last_name, and email_address; no address fields are added.Use when the order needs recipient personalisation but not a physical address.
is_fulfilment_parameters_requiredFor Choice Digital, requires to_first_name, to_last_name, to_email, address_1, city, postal_code, and country; address_2, phone, and state are optional. country must be US or us, and the postal code must match the supported four-digit, five-digit, ZIP+4, or ABC-123 formats.Sends the recipient name/email and the supplied fulfilment details under card.customer_info; the provider field names are address1, address2, city, postal_code, country, phone, and state.Use for brands whose fulfilment requires physical customer details.

Both settings are resolved by Brand: a non-empty brand attribute overrides the corresponding processor-level environment default. Do not enable both, Personalisation is a subset, so either disable both or enable one. The middleware evaluates isPersonalisationRequired() first and returns after those checks.

The application method is named isFulfillmentParametersRequired(), and configuration and brand attribute use is_fulfilment_parameters_required.

Brands can override the tenant header with a tenant_id attribute; otherwise the processor uses the default tenant configured in config/choice-digital.php. The funding source comes from the partner-brand identifier rather than a standalone brand attribute. The funding_source_id must be present for the Buyer/brand relationship and is entered through the Management Hub approval configuration.

If the brand is mapped to the wrong Choice Digital product, the provider may reject the order or return voucher data for the wrong product.

!IMPORTANT Choice Digital exposes a funding-sources operation that can be used operationally to monitor a Buyer’s funding_source_id and approval status. It is not currently integrated into this processor; confirm the configured funding source and approval status through the approved onboarding process.

API operations

The application sends JSON REST requests to Choice Digital. The client exposes three operations:

OperationUseRequired data
POST /oauth/tokenRetrieve an access tokenClient ID, client secret, audience
POST /orders-realtimeCreate a realtime orderProduct identifier, amount, external card ID, tenant ID
GET /card-productsRetrieve catalogue dataBearer token, tenant ID, pagination

The realtime order request uses the internal external-card ID as the x-idempotency-key, which makes that value especially important when investigating duplicate-order concerns. When personalisation or fulfilment parameters are enabled for a brand, the corresponding customer details are included under card.customer_info.

Response mapping and validation

The interaction accepts an issue only when all of these values are present and valid:

Provider fieldRequired valueApplication result
response_data.order_idNon-empty stringStored as processor_reference.
response_data.order_statusprocessedConfirms the realtime order completed. Other values fail response validation; there is no separate polling flow in this integration.
response_data.card.card_idNon-empty stringConfirms provider card data is present.
response_data.card.external_card_idNon-empty stringConfirms the provider response contains the external transaction identifier.
response_data.card.card_statusready_for_activationConfirms the card can be activated.
response_data.card.activation_urlValid URLStored as the returned card URL.

The provider request uses funding_source_id, send_email, card.card_product_id, card.amount, and card.external_card_id. card.customer_info is omitted for an anonymous order. When present, it contains entity_type=individual, recipient name/email, and any non-null address, phone, or state fields; the country is uppercased before serialization.

Recent processor changes

The current branch extends Choice Digital ordering in these ways:

  • Added optional address fields to the issue request data and forwarded them from fulfilment_parameters through the synchronous processor interaction.
  • Added optional phone and state fields to the issue request data and forwarded them from fulfilment_parameters into Choice Digital card.customer_info.
  • Added the isFulfillmentParametersRequired() brand helper, the is_fulfilment_parameters_required processor default, and the corresponding Choice Digital issuer metadata so the setting can be configured at processor or brand level.
  • Made card.customer_info optional for anonymous orders and changed disabled address fields to null, so they are not serialized into the provider payload.
  • Added Choice Digital-specific validation for physical fulfilment: recipient name/email, address line 1, city, postal code, and US country; address line 2, phone number, and state remain optional.
  • Corrected the previous isFulfillmentParametersRequired() spelling and added tests for request payloads, address handling, response validation, and the new middleware rules.

Customer-service investigation

When an order fails, check these values in order:

  1. The requested brand, currency, and face value.
  2. The brand's Choice Digital product sku.
  3. The brand's is_personalisation_required and is_fulfilment_parameters_required attributes, plus the processor-level defaults when no brand override is set.
  4. Whether the request supplied the required recipient and address fields, plus any optional phone number or state, for the enabled settings.
  5. The sale's processor reference or external card identifier used for idempotency.
  6. The processor interaction audit request and response, including the card.customer_info fields sent to Choice Digital.
  7. Whether the OAuth token call and tenant header configuration succeeded.
  8. Whether the realtime order response returned the expected voucher data.

Do not manually place a replacement order until the original idempotency key and provider response have been reviewed. Reusing or changing the key incorrectly can hide whether the original purchase already succeeded.

Limitations and support contacts

Choice Digital balance checks and cancellations are not implemented by this processor. Requests involving either operation must be handled through the applicable refund, cancellation, or balance-verification procedure rather than through a Choice Digital transaction.

When escalating to the provider, include the internal sale identifier, idempotency key or processor reference, timestamps, and the relevant audit evidence. Do not include stored voucher codes or credentials unless the approved support process requires them.

  • app/Processors/ChoiceDigital/ChoiceDigitalProcessor.php — realtime order flow and card mapping.
  • app/Processors/Interaction/Integrations/ChoiceDigital/ChoiceDigitalProcessorInteraction.php — request construction and response validation.
  • app/Processors/Interaction/Issue/IssueRequestData.php — recipient and optional address fields passed into issue interactions.
  • app/Http/Middleware/V2/API/ValidateFulfilmentParametersAndPersonalisationMiddleware.php — API validation for the selected customer-information mode.
  • app/Brand.php — processor-default and brand-attribute resolution for isPersonalisationRequired and isFulfillmentParametersRequired flags.
  • app/Http/Clients/ChoiceDigital/ChoiceDigitalApi.php — OAuth, authenticated requests, and catalogue operations.
  • app/Http/Clients/ChoiceDigital/Requests/ — auth, realtime order, and catalogue request payloads.
  • app/CatalogueService/Jobs/ChoiceDigital/ChoiceDigitalCatalogueCollector.php — catalogue import logic.
  • config/choice-digital.php — processor environment settings.
  • tests/Unit/App/Http/Clients/ChoiceDigital/ChoiceDigitalApiTest.php — request payload and API transport coverage.
  • tests/Unit/Middleware/ValidateFulfilmentParametersAndPersonalisationMiddlewareTest.php — Choice Digital fulfilment validation coverage.
  • tests/Unit/Processors/Interaction/Integrations/ChoiceDigital/ChoiceDigitalProcessorInteractionTest.php — order lifecycle and failure scenarios.