younifyd
Menu

Gift Certificates Search

Search for gift certificates.

POST/organizations/{organizationId}/gift-certificates

Use it in a workflow

  1. Add a step and choose the Salesforce Commerce Cloud connector.
  2. Pick the Gift Certificates Search action (under Gift Certificates (Data API)).
  3. Fill in the fields below, then reference the result from later steps as {{giftCertificatesSearch.response.data}}.

Request

Path parameters

organizationIdstringrequired

An identifier for the organization the request is being made by

Query parameters

siteIdstringrequired

The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.

Request body

Enter the body as JSON in the step's Body field.

limitinteger (int32)

Maximum records to retrieve per request, not to exceed 200.

queryobjectrequired

A set of objects that define criteria used to select records. A query can contain one of the following: * `MatchAllQuery` - Matches all documents. * `TermQuery` - Matches one or more documents against one or more document fields. * `TextQuery` - Matches text against one or more fields. * `BoolQuery` - Allows construction of a logical expression of multiple queries. * `FilteredQuery` - Allows a filter to be applied to a query. * `NestedQuery` - Allows you to query on nested documents. - _Only supported by some Commerce APIs. For more details, see the endpoint descriptions in the API documentation._

boolQueryobject3 fields

A boolean query allows construction of full logical expression trees that are composed of other queries (usually term queries and text queries). A boolean query has three sets of clauses: - `must`, which combines as an `AND` operator. - `should`, which combines as an `OR` operator. - `must_not`, which combines as a `NOT` operator. If `must`, `mustNot`, or `should` appear in the same boolean query, they are combined logically using the `AND` operator. For example: (must-1 AND must-1 AND ...) AND (should-1 OR should-2 OR ...) AND NOT (must_not-1 OR must_not-2 OR ...)

filteredQueryobject2 fields

Allows to filter the result of a possibly complex query using a possibly complex filter.

matchAllQueryobject

Matches all documents (namespace and document type). This query comes in handy if you just want to filter a search result or really do not have any constraints.

nestedQueryobject3 fields

Allows you to query nested documents that are part of a larger document. Say, for example, that you have a main product with variations in one big document, and you want to constrain a search to main products that have variations that match multiple constraints. A `NestedQuery` is only supported by some Commerce APIs. For more details, see the endpoint descriptions in the API documentation.

termQueryobject3 fields

A term query matches one or more values against one or more document fields. A document is considered a hit if one of the values matches exactly with at least one of the given fields. The operator `is` can only take one value, while `one_of` can take multiple values. If multiple fields are specified, they are combined using a logical `OR` operator. **Limitations:** * The `greater` and `less` operators are not supported under certain conditions. Both operators are permitted unless the API documentation states otherwise. * A subset of Commerce APIs handle queries with multiple fields differently. If the query has multiple fields, the query is internally handled as a logical `OR` of `DisjointMaxQueries` (with the dismax matching a value against all fields). The dismax makes sure that a document carrying a single term in multiple fields does not get higher scores than a document matching multiple terms in multiple fields.

textQueryobject2 fields

A text query is used to match some text (for example, a search phrase possibly consisting of multiple terms) against one or more fields. When multiple fields are provided, the phrase conceptually forms a logical `OR` over the fields. In this case, the terms of the phrase basically have to match within the text, that would result in concatenating all given fields.

sortsarray<object>

The list of sort clauses configured for the search request. Sort clauses are optional. See the description of the search endpoint for details on the default sorting behavior that is used when explicit sorts are not passed.

fieldanyrequired

The name of the field to sort on.

sortOrderstring

The sort order to be applied when sorting. When omitted, the default sort order (asc) is used.

One ofascdescDefault "asc"

offsetinteger (int32)

The zero-based index of the first hit/data to include in the result.

Default 0

json
{
  "query": {
    "filteredQuery": {
      "query": {
        "textQuery": {
          "fields": [
            "couponId"
          ],
          "searchPhrase": "disabled"
        }
      },
      "filter": {
        "termFilter": {
          "field": "enabled",
          "operator": "is",
          "values": [
            false
          ]
        }
      }
    }
  },
  "limit": 10,
  "sorts": [
    {
      "field": "couponId",
      "sortOrder": "desc"
    }
  ],
  "offset": 0
}

Response

Returns 200 with an object. Read it in later steps with {{giftCertificatesSearch.response.data.<field>}}.

hitsarray<object>
amountany

The gift certificate amount. The user cannot change the gift certificate amount after the creation of the gift certificate.

balanceobject

The gift certificate balance. This is a computed attribute and cannot be modified.

creationDatestring (date-time)

Returns the value of attribute 'creationDate'.

descriptionstring

The description of the gift certificate.

enabledboolean

The enabled flag of the gift certificate.

lastModifiedstring (date-time)

Returns the value of attribute 'lastModified'.

maskedGiftCertificateCodestring

Masked code.

merchantIdstring

The merchant ID of the gift certificate. This is a unique attribute. This is a computed attribute and cannot be modified. This is used to get, update and the delete gift certificates.

messagestring

The message to the recipient of the gift certificate.

orderNostring

The order number of the gift certificate.

recipientEmailstring

The email address of the recipient of the gift certificate.

recipientNamestring

The recipient of the gift certificate.

senderNamestring

The sender of the gift certificate.

statusstring

The status of the gift certificate. While creating a gift certificate, user can set the status to either "pending" or "issued" only.

One ofissuedpartially_redeemedpendingredeemed

transactionsarray<object>4 fields

The transactions of the gift certificate.

json
{
  "hits": [
    {
      "amount": null,
      "balance": {},
      "creationDate": 1578516896.641,
      "description": "A gift certificate for birthday.\n",
      "enabled": true,
      "lastModified": 1578516896.641,
      "maskedGiftCertificateCode": "*******XQTY",
      "merchantId": "Macy's1256489\n",
      "message": "This gift certificate is to be given as birthday present\n",
      "orderNo": "MyOrder5421\n",
      "recipientEmail": "my-recipient-email@gmail.com\n",
      "recipientName": "Jane Doe\n"
    }
  ]
}

Need more? See the Salesforce Commerce Cloud guide for connection setup and behaviour shared by every action.