Overview

Use the Loyalty Cards service to design templates for digital loyalty cards and coupons that <%- @partial('generalterm_tenant') %>s can offer as part of their loyalty programs. The Loyalty Cards service provides a REST interface that allows you to create, update, and view loyalty card and coupon templates for Google Wallet and Apple Wallet. You can also use this service to configure the certificate and merchant details you need to work with Apple Wallet and Google Wallet APIs. To access the configuration feature, click Configuration > Wallet Configuration in the Builder.

To manage and configure the Loyalty Cards service, you must have an administrator role for projects that use the service.

Scopes prevent unauthorized access to Loyalty microservices. The accepted scopes for the Loyalty Cards service are:

  • sap.loycard_view - View Google and Apple loyalty card and coupon templates.
  • sap.loycard_manage - Create and edit Google and Apple loyalty card and coupon templates.
The ability to delete digital loyalty card and coupon templates is not currently supported.


API Reference

/googleSettings

This resourceType defines the GET, POST, DELETE methods and their responses for a collection resource.

/googleSettings

get

Get Google Wallet configuration setting

Accepted scopes:

  • 'sap.loycard_view' - Required to get all Google settings
post

Create new Google Wallet configuration setting

Accepted scopes:

  • 'sap.loycard_manage' - Required to post Google setting
put

Update Google Wallet configuration setting

Accepted scopes:

  • 'sap.loycard_manage' - Required to update Google settings

/appleSettings

This resourceType defines the GET, POST, DELETE methods and their responses for a collection resource.

/appleSettings

get

Retrieves a list of all appleSettings in the collection.

post

Creates a new Apple settings.

Accepted scopes:

  • 'sap.loycard_manage' - Required to post appleSettings

/appleSettings/{type}

This resource type defines the GET, PUT, DELETE methods and their responses for a single element resource.

get

Gets an Apple settings based on type.

Accepted scopes:

  • 'sap.loycard_view' - Required to get appleSetting
put

Updates an Apple settings.

Accepted scopes:

  • 'sap.loycard_manage' - Required to put appleSettings

/loyaltyCardTemplate

This resourceType defines the GET, POST, DELETE methods and their responses for a collection resource.

/loyaltyCardTemplate

get

Gets all the Loyalty Card templates

Accepted scopes:

  • 'sap.loycard_view' - Required to get all loyaltyCardTemplate
post

Creates a new Loyalty Card template.

Accepted scopes:

  • 'sap.loycard_manage' - Required to post loyaltyCardTemplate

/loyaltyCardTemplate/{templateId}

This resource type defines the GET, PUT, DELETE methods and their responses for a single element resource.

get

Gets a Loyalty Card template based on template id.

Accepted scopes:

  • 'sap.loycard_view' - Required to get loyaltyCardTemplate
put

Updates a Loyalty Card template based on template id.

Accepted scopes:

  • 'sap.loycard_manage' - Required to PUT loyaltyCardTemplate

/{tierId}

This resource type defines the GET, PUT, DELETE methods and their responses for a single element resource.

/{tierId}

get

Gets a Loyalty Card template based on tierId

Accepted scopes:

  • 'sap.loycard_view' - Required to get loyaltyCardTemplate
put

Updates a single entity.

/couponTemplates

This resourceType defines the GET, POST, DELETE methods and their responses for a collection resource.

/couponTemplates

get

Gets all coupon templates

Accepted scopes:

  • 'sap.loycard_view' - Required to get couponTemplates
post

Creates a new coupon template

Accepted scopes:

  • 'sap.loycard_manage' - Required to post couponTemplates

/couponTemplates/{templateId}

This resource type defines the GET, PUT, DELETE methods and their responses for a single element resource.

get

Gets a coupon template based on template id

Accepted scopes:

  • 'sap.loycard_view' - Required to get couponTemplates
put

Updates a coupon template based on template id

Accepted scopes:

  • 'sap.loycard_manage' - Required to update couponTemplates

/secureMediaUri/{mediaId}

This resource type defines the GET, PUT, DELETE methods and their responses for a single element resource.

/secureMediaUri/{mediaId}

get

(Do not use) Gets Uri of secure media/certificate file.

Accepted scopes:

  • 'sap.loycard_view' - Required to get secureMediaUri

/migration/{release}

/migration/{release}

get

Migrates Loyalty Card data to relevant format for the latest release

Accepted scopes:

  • 'sap.loycard_view' - Required to do read operations


Error Types

For more information about error codes, see the detailed error description for each API operation in the API Reference. You can also check the standard error codes in the API best practices.


Scopes

Scopes are strings that allow you to specify the type of access that you need to resources and operations in the Loyalty Card service.

You must provide a proper scope that allows users to perform certain operations. Grant the scopes in an access token from the OAuth2 service. For more information about the authorization and authentication used in SAP Hybris services, and also about the scopes in general, see: Authorization Scopes

This table shows all of the scopes that the Loyalty Card service supports.

ScopeDescription
sap.loycard_viewUse this scope to view existing templates.
sap.loycard_manageUse this scope to create or modify existing templates.


Create a Google Account Setting

To use digital loyalty wallets on Android devices, create and configure your Google Merchant Accounts settings in the Loyalty Cards service as shown in this tutorial.

You must have a Google Merchant Account to use loyalty service digital wallets on Android devices. If you do not have a Google Merchant Account, you can register here.

To create and configure your Google Merchant Account settings in the Loyalty Cards service, you must provide these details:

  • Merchant Id: Obtain from Google Merchant Account
  • Certificate: Obtain from Google Merchant Account,
  • Service Account Email: Your Google Merchant Account email
  • Application Name: Obtain from Google Merchant Account
  • Latitude : Obtain from Google Merchant Account
  • Longitude: Obtain from Google Merchant Account
  • Merchant Name: Any convenient name
  • Barcode Type: Any convenient type

Request

This tutorial shows how to create and configure your Google Merchant Account settings.

  • Method: POST
  • Request URL: https://api.beta.yaas.io/hybris/loy-cards/v1/googleSettings
  • Content Type: multipart/form-data
  • Form Parameters: A P12 certificate file (required) and a text string (required)
  • Body: The request body must contain the field with the key name, model, and the type, text, the schema for which is shown in the example. The key for the Google Certificate is certificate, with the type p12.
    {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "title": "Merchant Details",
      "type": "object",
      "properties": {
          "merchantId": {
              "type": "string"
          },
          "merchantName": {
              "type": "string"
          },
          "serviceAccEmail": {
              "type": "string"
          },
          "certificate": {
              "description": "The P12 file url",
              "type": "string"
          },
          "barcodeType": {
              "enum": [
                  "CODE128",
                  "QRCODE",
                  "PDF417",
                  "AZTEC"
              ]
          },
          "applicationName": {
              "type": "string"
          },
          "createdBy": {
              "type": "string"
          },
          "updatedBy": {
              "type": "string"
          },
          "latitude": {
              "type": "string"
          },
          "longitude": {
              "type": "string"
          }
      },
      "required": [
          "merchantId",
          "merchantName",
          "serviceAccEmail",
          "certificate",
          "barcodeType",
          "applicationName",
          "latitude",
          "longitude"
      ]
    }
    
  • Example:
    {
     "merchantName":"Felton",
     "serviceAccEmail":"loyaltywallet2@sampleloyalty2.iam.gserviceaccount.com",
     "applicationName":"SampleLoyalty2",
     "merchantId":"3037655040395587734",
     "longitude":-49.0123,
     "latitude":23.345,
     "barcodeType":"CODE_128"
    }
    

Response

  • Status Code: 201

 


Get a Google account setting

This tutorial shows how to obtain a Google Merchant Account setting using a GET request.

Request

  • Method: GET
  • Request URL: https://api.beta.yaas.io/hybris/loy-cards/v1/googleSettings

Response

  • Status Code: 200
    {
     "$schema":"http://json-schema.org/draft-04/schema#",
     "title":"Merchant Details",
     "type":"object",
     "properties":{
        "merchantId":{
           "type":"string"
        },
        "merchantName":{
           "type":"string"
        },
        "serviceAccEmail":{
           "type":"string"
        },
        "certificate":{
           "description":"The P12 file url",
           "type":"string"
        },
        "barcodeType":{
           "enum":[
              "CODE128",
              "QRCODE",
              "PDF417",
              "AZTEC"
           ]
        },
        "applicationName":{
           "type":"string"
        },
        "createdBy":{
           "type":"string"
        },
        "updatedBy":{
           "type":"string"
        },
        "latitude":{
           "type":"string"
        },
        "longitude":{
           "type":"string"
        },
        "metadata":{
           "createdAt":{
              "type":"string"
           },
           "modifiedAt":{
              "type":"string"
           },
           "version":{
              "type":"string"
           }
        }
     },
     "required":[
        "merchantId",
        "merchantName",
        "serviceAccEmail",
        "certificate",
        "barcodeType",
        "applicationName",
        "latitude",
        "longitude"
     ]
    }
    
  • Example:
    {
     "applicationName":"SampleLoyalty2",
     "barcodeType":"QRCODE",
     "certificate":"576a1223192af6001d50be94",
     "createdBy":"navneet.kumar.pathak@sap.com",
     "id":"saploytest",
     "latitude":"23.345",
     "longitude":"-49.0123",
     "merchantId":"3037655040395587734",
     "merchantName":"Felton",
     "metadata":{
        "createdAt":"2016-04-06T05:43:29.869+0000",
        "modifiedAt":"2016-06-22T04:20:51.814+0000",
        "version":"21"
     },
     "serviceAccEmail":"loyaltywallet2@sampleloyalty2.iam.gserviceaccount.com",
     "updatedBy":"jyothi.b.bhat@sap.com"
    }
    

     


Update Google Account Setting

To update a Google Wallet setting, send the entire setting object, with the updated fields, in a PUT request. The service does not support partial updates.

This example shows how to update a Google Wallet setting.

Request

  • Method: PUT
  • Request URL: https://api.beta.yaas.io/hybris/loy-cards/v1/couponTemplates/{templateId}
  • Content Type: multipart/form-data
  • Form Parameters: A P12 certificate file (optional) and a text string (required)
  • Body: The request body must contain the field with key name, model, with the type, text, the schema for which is shown in the example. The key for the Google Certificate is certificate, which must have the type p12.
    {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "title": "Merchant Details",
      "type": "object",
      "properties": {
          "merchantId": {
              "type": "string"
          },
          "merchantName": {
              "type": "string"
          },
          "serviceAccEmail": {
              "type": "string"
          },
          "certificate": {
              "description": "The P12 file url",
              "type": "string"
          },
          "barcodeType": {
              "enum": [
                  "CODE128",
                  "QRCODE",
                  "PDF417",
                  "AZTEC"
              ]
          },
          "applicationName": {
              "type": "string"
          },
          "createdBy": {
              "type": "string"
          },
          "updatedBy": {
              "type": "string"
          },
          "latitude": {
              "type": "string"
          },
          "longitude": {
              "type": "string"
          }
      },
      "required": [
          "merchantId",
          "merchantName",
          "serviceAccEmail",
          "certificate",
          "barcodeType",
          "applicationName",
          "latitude",
          "longitude"
      ]
    }
    
  • Example:
    {
     "merchantName":"Felton",
     "serviceAccEmail":"loyaltywallet2@sampleloyalty2.iam.gserviceaccount.com",
     "applicationName":"SampleLoyalty2",
     "merchantId":"3037655040395587734",
     "longitude":-49.0123,
     "latitude":23.345,
     "barcodeType":"CODE_128",
     "certificate":"576a1223192af6001d50be94"
    }
    

Response

  • Status Code: 200

 


Create an Apple card account setting

To use digital loyalty cards on supported Apple iOS devices, create and configure your Apple Account card settings in the Loyalty Cards service as shown in this tutorial. In the Loyalty Cards service, you can create one Apple Account setting each for coupons and loyalty cards. You can update your settings later, at any time.

To use the Loyalty Cards service with digital wallets on Apple devices, you must have the Apple Account framework. To obtain the Apple Account framework, register on Apple’s developer site. You can register for an Apple developer account here.

To configure the Apple Account card settings in the Loyalty Cards service, you must provide these details:

  • Pass Type Identifier : Obtain from your Apple Account
  • Certificate: Obtain from your Apple Account
  • Certificate Password: Obtain from your Apple Account
  • Team Identifier: Obtain from your Apple Account
  • Organization Name Name of your organization
  • Certificate Private Key Alias: Obtain from your Apple Account

This tutorial shows how to configure the Apple Account card settings to use digital loyalty cards on Apple devices.

Request

  • Method: POST
  • Request URL: https://api.beta.yaas.io/hybris/loy-cards/v1/appleSettings
  • Content Type: multipart/form-data
  • Form Parameters: A P12 certificate file (required) and text in string format (required)
  • Body: The request body must contain the field with the key name, model, and the type, text (the schema is shown in the example). The key for the Apple Certificate is certificate, with the type p12.
    {
     "$schema":"http://json-schema.org/draft-04/schema#",
     "title":"Apple Settings",
     "type":"object",
     "properties":{
        "certificate":{
           "type":"string"
        },
        "password":{
           "type":"string",
           "encrypted":"true"
        },
        "pvtKeyAlias":{
           "type":"string"
        },
        "settingType":{
           "enum":[
              "COUPON",
              "LOYALTY_CARD"
           ]
        },
        "passTypeIdentifier":{
           "type":"string"
        },
        "teamIdentifier":{
           "type":"string"
        },
        "organisationName":{
           "type":"string"
        }
     },
     "required":[
        "password",
        "pvtKeyAlias",
        "settingType",
        "passTypeIdentifier",
        "teamIdentifier"
     ]
    }
    
  • Example:
    {
     "organisationName":"SAP",
     "passTypeIdentifier":"pass.com.sap.cec.marketing.cards.test",
     "password":"Loyalty1234",
     "pvtKeyAlias":"wallet",
     "settingType":"LOYALTY_CARD",
     "teamIdentifier":"J25PF2MPLA"
    }
    

Response

  • Status Code: 201

 


Get Apple Card Setting

This tutorial shows how to use a GET request to obtain an Apple Account card setting.

Request

  • Method: GET
  • Request URL: https://api.beta.yaas.io/hybris/loy-cards/v1/appleSettings/LOYALTY_CARD

Response

  • Status Code: 200
    {
     "$schema":"http://json-schema.org/draft-04/schema#",
     "title":"Apple Settings",
     "type":"object",
     "properties":{
        "certificate":{
           "type":"string"
        },
        "password":{
           "type":"string",
           "encrypted":"true"
        },
        "pvtKeyAlias":{
           "type":"string"
        },
        "settingType":{
           "enum":[
              "COUPON",
              "LOYALTY_CARD"
           ]
        },
        "passTypeIdentifier":{
           "type":"string"
        },
        "teamIdentifier":{
           "type":"string"
        },
        "organisationName":{
           "type":"string"
        },
        "metadata":{
           "createdAt":{
              "type":"string"
           },
           "modifiedAt":{
              "type":"string"
           },
           "version":{
              "type":"string"
           }
        }
     },
     "required":[
        "certificate",
        "password",
        "pvtKeyAlias",
        "settingType",
        "passTypeIdentifier",
        "teamIdentifier"
     ]
    }
    
  • Example:
    {
     "certificate":"5787501252a7d8001df27d14",
     "id":"LOYALTY_CARD",
     "metadata":{
        "createdAt":"2016-04-01T09:16:11.719+0000",
        "modifiedAt":"2016-07-14T08:40:50.616+0000",
        "version":"9"
     },
     "organisationName":"SAP",
     "passTypeIdentifier":"pass.com.sap.cec.marketing.cards.test",
     "password":"Loyalty1234",
     "pvtKeyAlias":"wallet",
     "settingType":"LOYALTY_CARD",
     "teamIdentifier":"J25PF2MPLA"
    }
    

     


Update Apple Card Setting

To update an Apple Account card setting, use a PUT request to send the entire setting object with the updated fields. The service does not support partial updates.

This example shows how to update an Apple Account card setting.

Request

  • Method: PUT
  • Request URL: https://api.beta.yaas.io/hybris/loy-cards/v1/appleSettings/LOYALTY_CARD
  • Content Type: multipart/form-data
  • Form Parameters: A P12 certificate file (optional), and a text string (required)
  • Body: The request body must contain a field with the key name, model, with the type, text (the schema is shown in the example). The key for the Apple Certificate is certificate, with the type p12.
    {
     "$schema":"http://json-schema.org/draft-04/schema#",
     "title":"Apple Settings",
     "type":"object",
     "properties":{
        "certificate":{
           "type":"string"
        },
        "password":{
           "type":"string",
           "encrypted":"true"
        },
        "pvtKeyAlias":{
           "type":"string"
        },
        "settingType":{
           "enum":[
              "COUPON",
              "LOYALTY_CARD"
           ]
        },
        "passTypeIdentifier":{
           "type":"string"
        },
        "teamIdentifier":{
           "type":"string"
        },
        "organisationName":{
           "type":"string"
        }
     },
     "required":[
        "password",
        "pvtKeyAlias",
        "settingType",
        "passTypeIdentifier",
        "teamIdentifier"
     ]
    }
    
  • Example:
    {
     "organisationName":"SAP",
     "passTypeIdentifier":"pass.com.sap.cec.marketing.cards.test",
     "password":"Loyalty1234",
     "pvtKeyAlias":"wallet",
     "settingType":"LOYALTY_CARD",
     "teamIdentifier":"J25PF2MPLA",
     "certificate":"5787537d52a7d8001df27d22"
    }
    

Response

  • Status Code: 200

 


Create an Apple coupon account setting

To create and use digital coupons on supported Apple iOS devices, create and configure your Apple Account coupon settings in the Loyalty Cards service as shown in this tutorial. You can create one Apple Account setting each for coupons and loyalty cards. You can update your settings later, at any time.

To use the Loyalty Cards service with digital wallets on Apple devices, you must have the Apple Account framework. To obtain the Apple Account framework, register on Apple’s developer site. You can register for an Apple developer account here.

To configure an Apple Account, you must provide these details:

  • Pass Type Identifier : Obtain from your Apple Account
  • Certificate: Obtain from your Apple Account
  • Certificate Password: Obtain from your Apple Account
  • Team Identifier: Obtain from your Apple Account
  • Organization Name Name of your organization
  • Certificate Private Key Alias: Obtain from your Apple Account

This tutorial shows how to configure the Apple Account coupon settings to use digital loyalty coupons on Apple devices.

Request

  • Method: POST
  • Request URL: https://api.beta.yaas.io/hybris/loy-cards/v1/appleSettings
  • Content Type: multipart/form-data
  • Form Parameters: A P12 certificate file (required), and a text string (required)
  • Body: The request body must contain a field with the key name, model, and the type, text (the schema is shown in the example). The key for the Apple Certificate is certificate, with the type p12.
    {
     "$schema":"http://json-schema.org/draft-04/schema#",
     "title":"Apple Settings",
     "type":"object",
     "properties":{
        "certificate":{
           "type":"string"
        },
        "password":{
           "type":"string",
           "encrypted":"true"
        },
        "pvtKeyAlias":{
           "type":"string"
        },
        "settingType":{
           "enum":[
              "COUPON",
              "LOYALTY_CARD"
           ]
        },
        "passTypeIdentifier":{
           "type":"string"
        },
        "teamIdentifier":{
           "type":"string"
        },
        "organisationName":{
           "type":"string"
        }
     },
     "required":[
        "password",
        "pvtKeyAlias",
        "settingType",
        "passTypeIdentifier",
        "teamIdentifier"
     ]
    }
    
  • Example:
    {
     "organisationName":"SAP",
     "passTypeIdentifier":"pass.com.sap.cec.marketing.coupon.test",
     "password":"Loyalty1234",
     "pvtKeyAlias":"wallet",
     "settingType":"COUPON",
     "teamIdentifier":"J25PF2MPLA"
    }
    

Response

  • Status Code: 201 ```

     


Get Apple Coupon Setting

This tutorial shows how to use a GET request to obtain an Apple Account coupon setting.

Request

  • Method: GET
  • Request URL: https://api.beta.yaas.io/hybris/loy-cards/v1/appleSettings/COUPON

Response

  • Status Code: 200
    {
     "$schema":"http://json-schema.org/draft-04/schema#",
     "title":"Apple Settings",
     "type":"object",
     "properties":{
        "certificate":{
           "type":"string"
        },
        "password":{
           "type":"string",
           "encrypted":"true"
        },
        "pvtKeyAlias":{
           "type":"string"
        },
        "settingType":{
           "enum":[
              "COUPON",
              "LOYALTY_CARD"
           ]
        },
        "passTypeIdentifier":{
           "type":"string"
        },
        "teamIdentifier":{
           "type":"string"
        },
        "organisationName":{
           "type":"string"
        },
        "metadata":{
           "createdAt":{
              "type":"string"
           },
           "modifiedAt":{
              "type":"string"
           },
           "version":{
              "type":"string"
           }
        }
     },
     "required":[
        "certificate",
        "password",
        "pvtKeyAlias",
        "settingType",
        "passTypeIdentifier",
        "teamIdentifier"
     ]
    }
    
  • Example:
    {
     "certificate":"5787548452a7d8001df27d2b",
     "id":"COUPON",
     "metadata":{
        "createdAt":"2016-04-01T09:17:09.366+0000",
        "modifiedAt":"2016-07-14T08:59:48.520+0000",
        "version":"8"
     },
     "organisationName":"SAP",
     "passTypeIdentifier":"pass.com.sap.cec.marketing.coupon.test",
     "password":"Loyalty1234",
     "pvtKeyAlias":"wallet",
     "settingType":"COUPON",
     "teamIdentifier":"J25PF2MPLA"
    }
    

     


Update Apple Coupon Setting

To update an Apple Account coupon setting, use a PUT request to send the entire setting object with the updated fields. The service does not support partial updates.

This example shows how to update an Apple Account coupon setting.

Request

  • Method: PUT
  • Request URL: https://api.beta.yaas.io/hybris/loy-cards/v1/appleSettings/COUPON
  • Content Type: multipart/form-data
  • Form Parameters: A P12 certificate file (optional), and a text string (required)
  • Body: The request body must contain a field with the key name, model, with the type, text (the schema is shown in the example). The key for the Apple Certificate is certificate, with the type p12.
    {
     "$schema":"http://json-schema.org/draft-04/schema#",
     "title":"Apple Settings",
     "type":"object",
     "properties":{
        "certificate":{
           "type":"string"
        },
        "password":{
           "type":"string",
           "encrypted":"true"
        },
        "pvtKeyAlias":{
           "type":"string"
        },
        "settingType":{
           "enum":[
              "COUPON",
              "LOYALTY_CARD"
           ]
        },
        "passTypeIdentifier":{
           "type":"string"
        },
        "teamIdentifier":{
           "type":"string"
        },
        "organisationName":{
           "type":"string"
        }
     },
     "required":[
        "password",
        "pvtKeyAlias",
        "settingType",
        "passTypeIdentifier",
        "teamIdentifier"
     ]
    }
    
  • Example:
    {
     "organisationName":"SAP",
     "passTypeIdentifier":"pass.com.sap.cec.marketing.coupon.test",
     "password":"Loyalty1234",
     "pvtKeyAlias":"wallet",
     "settingType":"COUPON",
     "teamIdentifier":"J25PF2MPLA",
     "certificate":"5787547b52a7d8001df27d2a"
    }
    

Response

  • Status Code: 200

 


Create a card template

Loyalty Card templates allow tenants to create and offer digital loyalty cards as part of their loyalty programs. To allow tenants to create Loyalty Card templates, you must create at least one tier. Tenants can create only one card template per tier.

To allow tenants to create Google templates, you must configure a Google Wallet account. To configure the account, click Configuration > Wallet Configuration in the Builder. For more information about how to create the account, see the SAP Hybris Loyalty Application Help.

Request

Follow this example to create a card template for a tier.

  • Method: POST
  • Request URL: https://api.beta.yaas.io/hybris/loy-cards/v1/loyaltyCardTemplate
  • Content Type: multipart/form-data
  • Form Parameters: A strip image file and a logo file (required), and a text string (required)
  • Body: The request body must contain the field with the key name model, with a type of text, the schema for which is shown in the example. The key for the Google Template Logo is programLogo. The Apple Template Logo is logo. The Apple Template Strip Image is stripImage. All images must be in the PNG file format.
    {
     "$schema":"http://json-schema.org/draft-04/schema#",
     "title":"Loyalty Card Template",
     "type":"object",
     "properties":{
        "id":{
           "type":"string"
        },
        "status":{
           "enum":[
              "ACTIVE",
              "INACTIVE"
           ]
        },
        "tierId":{
           "type":"string"
        },
        "createdBy":{
           "type":"string"
        },
        "modifiedBy":{
           "type":"string"
        },
        "termsAndConditions":{
           "$ref":"https://api.yaas.io/patterns/v1/schema-localized.json",
           "description":"Terms and Conditions of the Offer."
        },
        "appleLoyaltyCard":{
           "$schema":"http://json-schema.org/draft-04/schema#",
           "title":"Apple Wallet Template",
           "type":"object",
           "properties":{
              "bgColor":{
                 "type":"string"
              },
              "logo":{
                 "type":"string"
              },
              "stripImage":{
                 "type":"string"
              },
              "barcodeType":{
                 "enum":[
                    "PDF417",
                    "AZTEC",
                    "QRCODE",
                    "CODE128"
                 ]
              },
              "headerFields":{
                 "$schema":"http://json-schema.org/draft-04/schema#",
                 "title":"localized",
                 "oneOf":[
                    {
                       "$ref":"fieldCards",
                       "description":"value of property in default language"
                    },
                    {
                       "type":"object",
                       "description":"value of property in specific language",
                       "additionalProperties":{
                          "$ref":"fieldCards"
                       }
                    }
                 ],
                 "description":"Header fields of loyalty card"
              },
              "primaryFields":{
                 "$schema":"http://json-schema.org/draft-04/schema#",
                 "title":"localized",
                 "oneOf":[
                    {
                       "$ref":"fieldCards",
                       "description":"value of property in default language"
                    },
                    {
                       "type":"object",
                       "description":"value of property in specific language",
                       "additionalProperties":{
                          "$ref":"fieldCards"
                       }
                    }
                 ],
                 "description":"Primary fields of loyalty card"
              },
              "auxilaryFields":{
                 "$schema":"http://json-schema.org/draft-04/schema#",
                 "title":"localized",
                 "oneOf":[
                    {
                       "$ref":"fieldCards",
                       "description":"value of property in default language"
                    },
                    {
                       "type":"object",
                       "description":"value of property in specific language",
                       "additionalProperties":{
                          "$ref":"fieldCards"
                       }
                    }
                 ],
                 "description":"Auxiliary fields of loyalty card"
              },
              "logoText":{
                 "type":"string"
              },
              "foregroundColor":{
                 "type":"string"
              },
              "labelColor":{
                 "type":"string"
              }
           },
           "required":[
              "bgColor",
              "barcodeType",
              "logoText"
           ]
        },
        "googleLoyaltyCard":{
           "$schema":"http://json-schema.org/draft-04/schema#",
           "title":"Google Loyalty Card Template",
           "type":"object",
           "properties":{
              "className":{
                 "type":"string"
              },
              "issuerName":{
                 "type":"string"
              },
              "programLogo":{
                 "type":"string"
              },
              "programName":{
                 "type":"string"
              },
              "reviewStatus":{
                 "enum":[
                    "approved",
                    "draft",
                    "rejected",
                    "underReview"
                 ]
              },
              "validTimeInterval":{
                 "type":"string"
              },
              "hexFontColor":{
                 "type":"string"
              },
              "hexBackgroundColor":{
                 "type":"string"
              }
           },
           "required":[
              "className",
              "issuerName",
              "programName",
              "reviewStatus",
              "programLogo"
           ]
        }
     },
     "required":[
        "tierId",
        "termsAndConditions",
        "status"
     ]
    }
    
  • Example:
    {
     "termsAndConditions":{
        "en":"T and C En",
        "de":"T and C De",
        "ja":"T and C JA"
     },
     "tierId":"e8befd399be444fcbcdc2c48b95b8acb",
     "status":"ACTIVE",
     "googleLoyaltyCard":{
        "className":"e8befd399be444fcbcdc2c48b95b8acb",
        "issuerName":"Felton",
        "programName":"SatelliteOne",
        "reviewStatus":"DRAFT",
        "hexFontColor":"#141716",
        "hexBackgroundColor":"#7ee6c3"
     },
     "appleLoyaltyCard":{
        "bgColor":"#2be3a6",
        "barcodeType":"AZTEC",
        "headerFields":{
           "en":[
              {
                 "fieldNameCard":"MEMBER_NAME",
                 "label":"Member Name",
                 "position":0
              }
           ],
           "de":[
              {
                 "fieldNameCard":"MEMBER_NAME",
                 "label":"Member Name De",
                 "position":0
              }
           ],
           "ja":[
              {
                 "fieldNameCard":"MEMBER_NAME",
                 "label":"Member Name Ja",
                 "position":0
              }
           ]
        },
        "primaryFields":{
           "en":[
              {
                 "fieldNameCard":"TIER",
                 "label":"Tier",
                 "position":0
              }
           ],
           "de":[
              {
                 "fieldNameCard":"TIER",
                 "label":"Tier de",
                 "position":0
              }
           ],
           "ja":[
              {
                 "fieldNameCard":"TIER",
                 "label":"Tier Ja",
                 "position":0
              }
           ]
        },
        "auxilaryFields":{
           "en":[
              {
                 "fieldNameCard":"POINTS",
                 "label":"Points",
                 "position":0
              }
           ],
           "de":[
              {
                 "fieldNameCard":"POINTS",
                 "label":"Points de",
                 "position":0
              }
           ],
           "ja":[
              {
                 "fieldNameCard":"POINTS",
                 "label":"Points Ja",
                 "position":0
              }
           ]
        },
        "logoText":"MEMBER_NAME",
        "foregroundColor":"#1e2422",
        "labelColor":"#020d09"
     }
    }
    

Response

  • Status Code: 201

 


Get a Card Template by Template Id

This tutorial shows how to use a GET request to obtain a card template by template ID.

Request

  • Method: GET
  • Request URL: https://api.beta.yaas.io/hybris/loy-cards/v1/loyaltyCardTemplate/{templateId}

Response

  • Status Code: 200
    {
     "$schema":"http://json-schema.org/draft-04/schema#",
     "title":"Loyalty Card Template",
     "type":"object",
     "properties":{
        "id":{
           "type":"string"
        },
        "status":{
           "enum":[
              "ACTIVE",
              "INACTIVE"
           ]
        },
        "tierId":{
           "type":"string"
        },
        "createdBy":{
           "type":"string"
        },
        "modifiedBy":{
           "type":"string"
        },
        "termsAndConditions":{
           "$ref":"https://api.yaas.io/patterns/v1/schema-localized.json",
           "description":"Terms and Conditions of the Offer."
        },
        "appleLoyaltyCard":{
           "$schema":"http://json-schema.org/draft-04/schema#",
           "title":"Apple Wallet Template",
           "type":"object",
           "properties":{
              "bgColor":{
                 "type":"string"
              },
              "logo":{
                 "type":"string"
              },
              "stripImage":{
                 "type":"string"
              },
              "barcodeType":{
                 "enum":[
                    "PDF417",
                    "AZTEC",
                    "QRCODE",
                    "CODE128"
                 ]
              },
              "headerFields":{
                 "$schema":"http://json-schema.org/draft-04/schema#",
                 "title":"localized",
                 "oneOf":[
                    {
                       "$ref":"fieldCards",
                       "description":"value of property in default language"
                    },
                    {
                       "type":"object",
                       "description":"value of property in specific language",
                       "additionalProperties":{
                          "$ref":"fieldCards"
                       }
                    }
                 ],
                 "description":"Header fields of loyalty card"
              },
              "primaryFields":{
                 "$schema":"http://json-schema.org/draft-04/schema#",
                 "title":"localized",
                 "oneOf":[
                    {
                       "$ref":"fieldCards",
                       "description":"value of property in default language"
                    },
                    {
                       "type":"object",
                       "description":"value of property in specific language",
                       "additionalProperties":{
                          "$ref":"fieldCards"
                       }
                    }
                 ],
                 "description":"Primary fields of loyalty card"
              },
              "auxilaryFields":{
                 "$schema":"http://json-schema.org/draft-04/schema#",
                 "title":"localized",
                 "oneOf":[
                    {
                       "$ref":"fieldCards",
                       "description":"value of property in default language"
                    },
                    {
                       "type":"object",
                       "description":"value of property in specific language",
                       "additionalProperties":{
                          "$ref":"fieldCards"
                       }
                    }
                 ],
                 "description":"Auxiliary fields of loyalty card"
              },
              "logoText":{
                 "type":"string"
              },
              "foregroundColor":{
                 "type":"string"
              },
              "labelColor":{
                 "type":"string"
              }
           },
           "required":[
              "bgColor",
              "barcodeType",
              "logoText"
           ]
        },
        "googleLoyaltyCard":{
           "$schema":"http://json-schema.org/draft-04/schema#",
           "title":"Google Loyalty Card Template",
           "type":"object",
           "properties":{
              "className":{
                 "type":"string"
              },
              "issuerName":{
                 "type":"string"
              },
              "programLogo":{
                 "type":"string"
              },
              "programName":{
                 "type":"string"
              },
              "reviewStatus":{
                 "enum":[
                    "approved",
                    "draft",
                    "rejected",
                    "underReview"
                 ]
              },
              "validTimeInterval":{
                 "type":"string"
              },
              "hexFontColor":{
                 "type":"string"
              },
              "hexBackgroundColor":{
                 "type":"string"
              }
           },
           "required":[
              "className",
              "issuerName",
              "programName",
              "reviewStatus",
              "programLogo"
           ]
        },
        "metadata":{
           "createdAt":{
              "type":"string"
           },
           "modifiedAt":{
              "type":"string"
           },
           "version":{
              "type":"string"
           }
        }
     },
     "required":[
        "tierId",
        "termsAndConditions",
        "status"
     ]
    }
    
  • Example:
    {
     "appleLoyaltyCard":{
        "auxilaryFields":{
           "en":[
              {
                 "fieldNameCard":"POINTS",
                 "label":"pts",
                 "position":0.0
              },
              {
                 "fieldNameCard":"TIER",
                 "label":"tier",
                 "position":1.0
              }
           ],
           "de":[
              {
                 "fieldNameCard":"POINTS",
                 "label":"",
                 "position":0.0
              },
              {
                 "fieldNameCard":"TIER",
                 "label":"",
                 "position":1.0
              }
           ],
           "ja":[
              {
                 "fieldNameCard":"POINTS",
                 "label":"",
                 "position":0.0
              },
              {
                 "fieldNameCard":"TIER",
                 "label":"",
                 "position":1.0
              }
           ]
        },
        "barcodeType":"PDF_417",
        "bgColor":"#ba9b9b",
        "foregroundColor":"#190404",
        "headerFields":{
           "en":[
              {
                 "fieldNameCard":"PROGRAM_NAME",
                 "label":"LoyPro",
                 "position":0.0
              }
           ],
           "de":[
              {
                 "fieldNameCard":"PROGRAM_NAME",
                 "label":"",
                 "position":0.0
              }
           ],
           "ja":[
              {
                 "fieldNameCard":"PROGRAM_NAME",
                 "label":"",
                 "position":0.0
              }
           ]
        },
        "labelColor":"#080000",
        "logo":"https://api.stage.yaas.io/hybris/media/v2/public/files/5729a5da941b90001d16928a",
        "logoText":"MEMBER_NAME",
        "primaryFields":{
           "en":[
              {
                 "fieldNameCard":"MEMBER_NAME",
                 "label":"Mmeber Name",
                 "position":0.0
              }
           ],
           "de":[
              {
                 "fieldNameCard":"MEMBER_NAME",
                 "label":"",
                 "position":0.0
              }
           ],
           "ja":[
              {
                 "fieldNameCard":"MEMBER_NAME",
                 "label":"",
                 "position":0.0
              }
           ]
        },
        "stripImage":"https://api.stage.yaas.io/hybris/media/v2/public/files/5729a5da1a5270001dad36f1"
     },
     "createdBy":"jyothi.b.bhat@sap.com",
     "googleLoyaltyCard":{
        "className":"3037655040395587734.14a50736e5574fd09e73d080dca51a24",
        "hexBackgroundColor":"#591212",
        "hexFontColor":"#f7e4e4",
        "issuerName":"Felton",
        "programLogo":"https://api.stage.yaas.io/hybris/media/v2/public/files/5729a5d7941b90001d169289",
        "programName":"SatelliteOne",
        "reviewStatus":"APPROVED"
     },
     "id":"4ebc3b9e79a74af980c08c0553e52975",
     "metadata":{
        "createdAt":"2016-05-04T07:33:47.168+0000",
        "modifiedAt":"2016-07-13T09:32:11.765+0000",
        "version":"2"
     },
     "modifiedBy":"prateek.shastri@sap.com",
     "status":"ACTIVE",
     "termsAndConditions":{
        "en":"jsdknf",
        "de":"dsa",
        "ja":"sfdf"
     },
     "tierId":"14a50736e5574fd09e73d080dca51a24"
    }
    

     


Get a Card Template by Tier Id

This tutorial shows how to use a GET request to obtain a card template by tier ID.

Request

  • Method: GET
  • Request URL: https://api.beta.yaas.io/hybris/loy-cards/v1/loyaltyCardTemplate/{tierId}

Response

  • Status Code: 200
    {
     "$schema":"http://json-schema.org/draft-04/schema#",
     "title":"Loyalty Card Template",
     "type":"object",
     "properties":{
        "id":{
           "type":"string"
        },
        "status":{
           "enum":[
              "ACTIVE",
              "INACTIVE"
           ]
        },
        "tierId":{
           "type":"string"
        },
        "createdBy":{
           "type":"string"
        },
        "modifiedBy":{
           "type":"string"
        },
        "termsAndConditions":{
           "$ref":"https://api.yaas.io/patterns/v1/schema-localized.json",
           "description":"Terms and Conditions of the Offer."
        },
        "appleLoyaltyCard":{
           "$schema":"http://json-schema.org/draft-04/schema#",
           "title":"Apple Wallet Template",
           "type":"object",
           "properties":{
              "bgColor":{
                 "type":"string"
              },
              "logo":{
                 "type":"string"
              },
              "stripImage":{
                 "type":"string"
              },
              "barcodeType":{
                 "enum":[
                    "PDF417",
                    "AZTEC",
                    "QRCODE",
                    "CODE128"
                 ]
              },
              "headerFields":{
                 "$schema":"http://json-schema.org/draft-04/schema#",
                 "title":"localized",
                 "oneOf":[
                    {
                       "$ref":"fieldCards",
                       "description":"value of property in default language"
                    },
                    {
                       "type":"object",
                       "description":"value of property in specific language",
                       "additionalProperties":{
                          "$ref":"fieldCards"
                       }
                    }
                 ],
                 "description":"Header fields of loyalty card"
              },
              "primaryFields":{
                 "$schema":"http://json-schema.org/draft-04/schema#",
                 "title":"localized",
                 "oneOf":[
                    {
                       "$ref":"fieldCards",
                       "description":"value of property in default language"
                    },
                    {
                       "type":"object",
                       "description":"value of property in specific language",
                       "additionalProperties":{
                          "$ref":"fieldCards"
                       }
                    }
                 ],
                 "description":"Primary fields of loyalty card"
              },
              "auxilaryFields":{
                 "$schema":"http://json-schema.org/draft-04/schema#",
                 "title":"localized",
                 "oneOf":[
                    {
                       "$ref":"fieldCards",
                       "description":"value of property in default language"
                    },
                    {
                       "type":"object",
                       "description":"value of property in specific language",
                       "additionalProperties":{
                          "$ref":"fieldCards"
                       }
                    }
                 ],
                 "description":"Auxiliary fields of loyalty card"
              },
              "logoText":{
                 "type":"string"
              },
              "foregroundColor":{
                 "type":"string"
              },
              "labelColor":{
                 "type":"string"
              }
           },
           "required":[
              "bgColor",
              "barcodeType",
              "logoText"
           ]
        },
        "googleLoyaltyCard":{
           "$schema":"http://json-schema.org/draft-04/schema#",
           "title":"Google Loyalty Card Template",
           "type":"object",
           "properties":{
              "className":{
                 "type":"string"
              },
              "issuerName":{
                 "type":"string"
              },
              "programLogo":{
                 "type":"string"
              },
              "programName":{
                 "type":"string"
              },
              "reviewStatus":{
                 "enum":[
                    "approved",
                    "draft",
                    "rejected",
                    "underReview"
                 ]
              },
              "validTimeInterval":{
                 "type":"string"
              },
              "hexFontColor":{
                 "type":"string"
              },
              "hexBackgroundColor":{
                 "type":"string"
              }
           },
           "required":[
              "className",
              "issuerName",
              "programName",
              "reviewStatus",
              "programLogo"
           ]
        },
        "metadata":{
           "createdAt":{
              "type":"string"
           },
           "modifiedAt":{
              "type":"string"
           },
           "version":{
              "type":"string"
           }
        }
     },
     "required":[
        "tierId",
        "termsAndConditions",
        "status"
     ]
    }
    
  • Example:
    {
     "appleLoyaltyCard":{
        "auxilaryFields":{
           "en":[
              {
                 "fieldNameCard":"POINTS",
                 "label":"pts",
                 "position":0.0
              },
              {
                 "fieldNameCard":"TIER",
                 "label":"tier",
                 "position":1.0
              }
           ],
           "de":[
              {
                 "fieldNameCard":"POINTS",
                 "label":"",
                 "position":0.0
              },
              {
                 "fieldNameCard":"TIER",
                 "label":"",
                 "position":1.0
              }
           ],
           "ja":[
              {
                 "fieldNameCard":"POINTS",
                 "label":"",
                 "position":0.0
              },
              {
                 "fieldNameCard":"TIER",
                 "label":"",
                 "position":1.0
              }
           ]
        },
        "barcodeType":"PDF_417",
        "bgColor":"#ba9b9b",
        "foregroundColor":"#190404",
        "headerFields":{
           "en":[
              {
                 "fieldNameCard":"PROGRAM_NAME",
                 "label":"LoyPro",
                 "position":0.0
              }
           ],
           "de":[
              {
                 "fieldNameCard":"PROGRAM_NAME",
                 "label":"",
                 "position":0.0
              }
           ],
           "ja":[
              {
                 "fieldNameCard":"PROGRAM_NAME",
                 "label":"",
                 "position":0.0
              }
           ]
        },
        "labelColor":"#080000",
        "logo":"https://api.stage.yaas.io/hybris/media/v2/public/files/5729a5da941b90001d16928a",
        "logoText":"MEMBER_NAME",
        "primaryFields":{
           "en":[
              {
                 "fieldNameCard":"MEMBER_NAME",
                 "label":"Mmeber Name",
                 "position":0.0
              }
           ],
           "de":[
              {
                 "fieldNameCard":"MEMBER_NAME",
                 "label":"",
                 "position":0.0
              }
           ],
           "ja":[
              {
                 "fieldNameCard":"MEMBER_NAME",
                 "label":"",
                 "position":0.0
              }
           ]
        },
        "stripImage":"https://api.stage.yaas.io/hybris/media/v2/public/files/5729a5da1a5270001dad36f1"
     },
     "createdBy":"jyothi.b.bhat@sap.com",
     "googleLoyaltyCard":{
        "className":"3037655040395587734.14a50736e5574fd09e73d080dca51a24",
        "hexBackgroundColor":"#591212",
        "hexFontColor":"#f7e4e4",
        "issuerName":"Felton",
        "programLogo":"https://api.stage.yaas.io/hybris/media/v2/public/files/5729a5d7941b90001d169289",
        "programName":"SatelliteOne",
        "reviewStatus":"APPROVED"
     },
     "id":"4ebc3b9e79a74af980c08c0553e52975",
     "metadata":{
        "createdAt":"2016-05-04T07:33:47.168+0000",
        "modifiedAt":"2016-07-13T09:32:11.765+0000",
        "version":"2"
     },
     "modifiedBy":"prateek.shastri@sap.com",
     "status":"ACTIVE",
     "termsAndConditions":{
        "en":"jsdknf",
        "de":"dsa",
        "ja":"sfdf"
     },
     "tierId":"14a50736e5574fd09e73d080dca51a24"
    }
    

     


Get all Card Templates

The tutorial shows how to use a GET request to obtain all card templates in the system. To get a total count in the header of the response, pass the totalCount attribute as true, as shown in the example.

Request

  • Method: GET
  • Request URL: https://api.beta.yaas.io/hybris/loy-cards/v1/loyaltyCardTemplate?totalCount=true

Response

  • Status Code: 200
  • Example:
    {
     "templates":[
        {
           "appleLoyaltyCard":{
              "barcodeType":"PDF_417",
              "bgColor":"#993232",
              "foregroundColor":"#fce3e3",
              "labelColor":"#dbc3c3",
              "logo":"https://api.stage.yaas.io/hybris/media/v2/public/files/57171ac8676a5b001d551076",
              "logoText":"MEMBER_NAME",
              "stripImage":"https://api.stage.yaas.io/hybris/media/v2/public/files/57171ac8676a5b001d551077"
           },
           "createdBy":"jyothi.b.bhat@sap.com",
           "googleLoyaltyCardClassName":"a86ed549d5f34f5887005ddab3f3b440",
           "id":"7ad1144f10f54a8f8df84d8d14ddfbff",
           "metadata":{
              "createdAt":"2016-04-01T09:19:57.598+0000",
              "modifiedAt":"2016-04-20T05:59:39.001+0000",
              "version":"2"
           },
           "status":"ACTIVE",
           "termsAndConditions":{
              "en":"T & C",
              "de":"T and C DE",
              "ja":"T and C JA"
           },
           "tierId":"a86ed549d5f34f5887005ddab3f3b440",
           "updatedby":"prateek.shastri@sap.com"
        },
        {
           "appleLoyaltyCard":{
              "barcodeType":"AZTEC",
              "bgColor":"#362e2e",
              "foregroundColor":"#e3d1d1",
              "labelColor":"#e8dfdf",
              "logo":"https://api.stage.yaas.io/hybris/media/v2/public/files/570f57b8bba807001db14353",
              "logoText":"PROGRAM_NAME",
              "stripImage":"https://api.stage.yaas.io/hybris/media/v2/public/files/570f57b8bba807001db14354"
           },
           "createdBy":"jyothi.b.bhat@sap.com",
           "googleLoyaltyCardClassName":"1d340882801a40f8aabcca66540b09c8",
           "id":"3a322afb19bb4b38a4661ce20eb1bb9e",
           "metadata":{
              "createdAt":"2016-04-01T09:21:10.573+0000",
              "modifiedAt":"2016-04-20T05:58:44.535+0000",
              "version":"3"
           },
           "status":"ACTIVE",
           "termsAndConditions":{
              "en":"T & C",
              "de":"test",
              "ja":"test JA"
           },
           "tierId":"1d340882801a40f8aabcca66540b09c8",
           "updatedby":"prateek.shastri@sap.com"
        },
        {
           "appleLoyaltyCard":{
              "auxilaryFields":{
                 "en":[
                    {
                       "fieldNameCard":"POINTS",
                       "label":"Points EN",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldNameCard":"POINTS",
                       "label":"Points DE",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldNameCard":"POINTS",
                       "label":"Points JA",
                       "position":0.0
                    }
                 ]
              },
              "barcodeType":"QRCODE",
              "bgColor":"#5cd6c0",
              "foregroundColor":"#f2f2f2",
              "headerFields":{
                 "en":[
                    {
                       "fieldNameCard":"TIER",
                       "label":"Tier EN",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldNameCard":"TIER",
                       "label":"Tier DE",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldNameCard":"TIER",
                       "label":"Tier JA",
                       "position":0.0
                    }
                 ]
              },
              "labelColor":"#0b21e3",
              "logo":"https://api.stage.yaas.io/hybris/media/v2/public/files/5717188e349675001de4eaec",
              "logoText":"MEMBER_NAME",
              "primaryFields":{
                 "en":[
                    {
                       "fieldNameCard":"MEMBER_NAME",
                       "label":"Name EN",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldNameCard":"MEMBER_NAME",
                       "label":"Name DE",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldNameCard":"MEMBER_NAME",
                       "label":"Name JA",
                       "position":0.0
                    }
                 ]
              },
              "stripImage":"https://api.stage.yaas.io/hybris/media/v2/public/files/5717188e349675001de4eaed"
           },
           "createdBy":"prateek.shastri@sap.com",
           "googleLoyaltyCardClassName":"a2b14f17a4424b56994fc61e3af1a675",
           "id":"1749e55390a44f32979d0449e8e9feeb",
           "metadata":{
              "createdAt":"2016-04-20T05:50:06.775+0000",
              "modifiedAt":"2016-04-20T05:56:32.541+0000",
              "version":"3"
           },
           "status":"ACTIVE",
           "termsAndConditions":{
              "en":"T and C EN",
              "de":"T and C DE",
              "ja":"T and C JA"
           },
           "tierId":"a2b14f17a4424b56994fc61e3af1a675",
           "updatedby":"prateek.shastri@sap.com"
        },
        {
           "appleLoyaltyCard":{
              "auxilaryFields":{
                 "en":[
                    {
                       "fieldNameCard":"MEMBER_NAME",
                       "label":"Name",
                       "position":0.0
                    },
                    {
                       "fieldNameCard":"POINTS",
                       "label":"Points",
                       "position":1.0
                    }
                 ],
                 "de":[
                    {
                       "fieldNameCard":"MEMBER_NAME",
                       "label":"",
                       "position":0.0
                    },
                    {
                       "fieldNameCard":"POINTS",
                       "label":"",
                       "position":1.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldNameCard":"MEMBER_NAME",
                       "label":"",
                       "position":0.0
                    },
                    {
                       "fieldNameCard":"POINTS",
                       "label":"",
                       "position":1.0
                    }
                 ]
              },
              "barcodeType":"PDF_417",
              "bgColor":"#8c2020",
              "foregroundColor":"#fce3e3",
              "headerFields":{
                 "en":[
                    {
                       "fieldNameCard":"TIER",
                       "label":"Tier",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldNameCard":"",
                       "label":"",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldNameCard":"",
                       "label":"",
                       "position":0.0
                    }
                 ]
              },
              "labelColor":"#dbc3c3",
              "logo":"https://api.stage.yaas.io/hybris/media/v2/public/files/57171fb1349675001de4eaf5",
              "logoText":"PROGRAM_NAME",
              "stripImage":"https://api.stage.yaas.io/hybris/media/v2/public/files/57171fb1676a5b001d55107f"
           },
           "createdBy":"jyothi.b.bhat@sap.com",
           "googleLoyaltyCardClassName":"dd17c36127d146dab2036b37e7650ce2",
           "id":"3be7d60f451b4b17954f7bfd47477866",
           "metadata":{
              "createdAt":"2016-04-01T09:19:19.578+0000",
              "modifiedAt":"2016-05-24T04:53:43.911+0000",
              "version":"6"
           },
           "status":"ACTIVE",
           "termsAndConditions":{
              "en":"Terms and Conditions EN",
              "de":"Terms and Conditions DE",
              "ja":"Terms and Conditions JA"
           },
           "tierId":"dd17c36127d146dab2036b37e7650ce2",
           "updatedby":"jyothi.b.bhat@sap.com"
        },
        {
           "appleLoyaltyCard":{
              "auxilaryFields":{
                 "en":[
                    {
                       "fieldNameCard":"POINTS",
                       "label":"pts",
                       "position":0.0
                    },
                    {
                       "fieldNameCard":"TIER",
                       "label":"tier",
                       "position":1.0
                    }
                 ],
                 "de":[
                    {
                       "fieldNameCard":"POINTS",
                       "label":"",
                       "position":0.0
                    },
                    {
                       "fieldNameCard":"TIER",
                       "label":"",
                       "position":1.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldNameCard":"POINTS",
                       "label":"",
                       "position":0.0
                    },
                    {
                       "fieldNameCard":"TIER",
                       "label":"",
                       "position":1.0
                    }
                 ]
              },
              "barcodeType":"PDF_417",
              "bgColor":"#ba9b9b",
              "foregroundColor":"#190404",
              "headerFields":{
                 "en":[
                    {
                       "fieldNameCard":"PROGRAM_NAME",
                       "label":"LoyPro",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldNameCard":"PROGRAM_NAME",
                       "label":"",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldNameCard":"PROGRAM_NAME",
                       "label":"",
                       "position":0.0
                    }
                 ]
              },
              "labelColor":"#080000",
              "logo":"https://api.stage.yaas.io/hybris/media/v2/public/files/5717c743e6f8fb001d5b8e88",
              "logoText":"MEMBER_NAME",
              "primaryFields":{
                 "en":[
                    {
                       "fieldNameCard":"MEMBER_NAME",
                       "label":"Mmeber Name",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldNameCard":"MEMBER_NAME",
                       "label":"",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldNameCard":"MEMBER_NAME",
                       "label":"",
                       "position":0.0
                    }
                 ]
              },
              "stripImage":"https://api.stage.yaas.io/hybris/media/v2/public/files/5717c744adc4dd001de504d8"
           },
           "createdBy":"jyothi.b.bhat@sap.com",
           "googleLoyaltyCardClassName":"5381436b32304e81905da470cb4c5054",
           "id":"3e86c3cc14014a2c8d8c7e6b555a728a",
           "metadata":{
              "createdAt":"2016-04-20T18:15:32.313+0000",
              "modifiedAt":"2016-06-22T04:24:10.083+0000",
              "version":"2"
           },
           "status":"ACTIVE",
           "termsAndConditions":{
              "en":"jsdknf",
              "de":"dsa",
              "ja":"sfdf"
           },
           "tierId":"5381436b32304e81905da470cb4c5054",
           "updatedby":"labala.lohit.kumar.sahu@sap.com"
        },
        {
           "appleLoyaltyCard":{
              "auxilaryFields":{
                 "en":[
                    {
                       "fieldNameCard":"PROGRAM_NAME",
                       "label":"Pro NAme",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldNameCard":"PROGRAM_NAME",
                       "label":"",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldNameCard":"PROGRAM_NAME",
                       "label":"",
                       "position":0.0
                    }
                 ]
              },
              "barcodeType":"PDF_417",
              "bgColor":"#e3cfcf",
              "foregroundColor":"#000000",
              "headerFields":{
                 "en":[
                    {
                       "fieldNameCard":"TIER",
                       "label":"tier",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldNameCard":"TIER",
                       "label":"",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldNameCard":"TIER",
                       "label":"",
                       "position":0.0
                    }
                 ]
              },
              "labelColor":"#0d0000",
              "logo":"https://api.stage.yaas.io/hybris/media/v2/public/files/571d9913884350001d54cf3d",
              "logoText":"MEMBER_NAME",
              "primaryFields":{
                 "en":[
                    {
                       "fieldNameCard":"POINTS",
                       "label":"Pts",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldNameCard":"POINTS",
                       "label":"",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldNameCard":"POINTS",
                       "label":"",
                       "position":0.0
                    }
                 ]
              },
              "stripImage":"https://api.stage.yaas.io/hybris/media/v2/public/files/571d9913884350001d54cf3e"
           },
           "createdBy":"jyothi.b.bhat@sap.com",
           "id":"3143f604cd8a43f9bbc41f870fc20896",
           "metadata":{
              "createdAt":"2016-04-25T04:12:04.267+0000",
              "modifiedAt":"2016-04-25T04:12:04.267+0000",
              "version":"1"
           },
           "status":"ACTIVE",
           "termsAndConditions":{
              "en":"Abc",
              "de":"Abc in de",
              "ja":"Abc in Ja"
           },
           "tierId":"174f5d454cde4139bc722d56396ef334",
           "updatedby":"jyothi.b.bhat@sap.com"
        },
        {
           "appleLoyaltyCard":{
              "auxilaryFields":{
                 "en":[
                    {
                       "fieldNameCard":"POINTS",
                       "label":"pts",
                       "position":0.0
                    },
                    {
                       "fieldNameCard":"TIER",
                       "label":"tier",
                       "position":1.0
                    }
                 ],
                 "de":[
                    {
                       "fieldNameCard":"POINTS",
                       "label":"",
                       "position":0.0
                    },
                    {
                       "fieldNameCard":"TIER",
                       "label":"",
                       "position":1.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldNameCard":"POINTS",
                       "label":"",
                       "position":0.0
                    },
                    {
                       "fieldNameCard":"TIER",
                       "label":"",
                       "position":1.0
                    }
                 ]
              },
              "barcodeType":"PDF_417",
              "bgColor":"#ba9b9b",
              "foregroundColor":"#190404",
              "headerFields":{
                 "en":[
                    {
                       "fieldNameCard":"PROGRAM_NAME",
                       "label":"LoyPro",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldNameCard":"PROGRAM_NAME",
                       "label":"",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldNameCard":"PROGRAM_NAME",
                       "label":"",
                       "position":0.0
                    }
                 ]
              },
              "labelColor":"#080000",
              "logo":"https://api.stage.yaas.io/hybris/media/v2/public/files/5729a5da941b90001d16928a",
              "logoText":"MEMBER_NAME",
              "primaryFields":{
                 "en":[
                    {
                       "fieldNameCard":"MEMBER_NAME",
                       "label":"Mmeber Name",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldNameCard":"MEMBER_NAME",
                       "label":"",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldNameCard":"MEMBER_NAME",
                       "label":"",
                       "position":0.0
                    }
                 ]
              },
              "stripImage":"https://api.stage.yaas.io/hybris/media/v2/public/files/5729a5da1a5270001dad36f1"
           },
           "createdBy":"jyothi.b.bhat@sap.com",
           "googleLoyaltyCardClassName":"14a50736e5574fd09e73d080dca51a24",
           "id":"4ebc3b9e79a74af980c08c0553e52975",
           "metadata":{
              "createdAt":"2016-05-04T07:33:47.168+0000",
              "modifiedAt":"2016-07-13T09:32:11.765+0000",
              "version":"2"
           },
           "status":"ACTIVE",
           "termsAndConditions":{
              "en":"jsdknf",
              "de":"dsa",
              "ja":"sfdf"
           },
           "tierId":"14a50736e5574fd09e73d080dca51a24",
           "updatedby":"prateek.shastri@sap.com"
        },
        {
           "appleLoyaltyCard":{
              "auxilaryFields":{
                 "en":[
                    {
                       "fieldNameCard":"PROGRAM_NAME",
                       "label":"Loyalty Program Name",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldNameCard":"PROGRAM_NAME",
                       "label":"",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldNameCard":"PROGRAM_NAME",
                       "label":"",
                       "position":0.0
                    }
                 ]
              },
              "barcodeType":"QRCODE",
              "bgColor":"#bd2b2b",
              "foregroundColor":"#0beb49",
              "headerFields":{
                 "en":[
                    {
                       "fieldNameCard":"MEMBER_NAME",
                       "label":"Loyalty Member Name",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldNameCard":"MEMBER_NAME",
                       "label":"",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldNameCard":"MEMBER_NAME",
                       "label":"",
                       "position":0.0
                    }
                 ]
              },
              "labelColor":"#5bd97e",
              "logo":"https://api.stage.yaas.io/hybris/media/v2/public/files/5732f2a277c403001d6657fc",
              "logoText":"TIER",
              "primaryFields":{
                 "en":[
                    {
                       "fieldNameCard":"POINTS",
                       "label":"Available Points",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldNameCard":"POINTS",
                       "label":"",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldNameCard":"POINTS",
                       "label":"",
                       "position":0.0
                    }
                 ]
              },
              "stripImage":"https://api.stage.yaas.io/hybris/media/v2/public/files/5732f2a2c17c33001deeb715"
           },
           "createdBy":"labala.lohit.kumar.sahu@sap.com",
           "id":"abbeb14a0c4a471da65df93cf8963298",
           "metadata":{
              "createdAt":"2016-05-11T08:48:54.729+0000",
              "modifiedAt":"2016-07-13T08:05:41.212+0000",
              "version":"4"
           },
           "status":"ACTIVE",
           "termsAndConditions":{
              "en":"Confidential",
              "de":"Confidential",
              "ja":"Confidential"
           },
           "tierId":"4a68510791384bdb9125f21d8c813ed1",
           "updatedby":"prateek.shastri@sap.com"
        },
        {
           "appleLoyaltyCard":{
              "auxilaryFields":{
                 "en":[
                    {
                       "fieldNameCard":"TIER",
                       "label":"Tier",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldNameCard":"TIER",
                       "label":"Tier De",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldNameCard":"TIER",
                       "label":"Tier Ja",
                       "position":0.0
                    }
                 ]
              },
              "barcodeType":"AZTEC",
              "bgColor":"#e33434",
              "foregroundColor":"#c73636",
              "headerFields":{
                 "en":[
                    {
                       "fieldNameCard":"MEMBER_NAME",
                       "label":"Member",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldNameCard":"MEMBER_NAME",
                       "label":"Member De",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldNameCard":"MEMBER_NAME",
                       "label":"Mamber Ja",
                       "position":0.0
                    }
                 ]
              },
              "labelColor":"#080707",
              "logo":"https://api.stage.yaas.io/hybris/media/v2/public/files/578707fcf071a4001d993d33",
              "logoText":"MEMBER_NAME",
              "primaryFields":{
                 "en":[
                    {
                       "fieldNameCard":"POINTS",
                       "label":"Points",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldNameCard":"POINTS",
                       "label":"Points De",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldNameCard":"POINTS",
                       "label":"Points Ja",
                       "position":0.0
                    }
                 ]
              },
              "stripImage":"https://api.stage.yaas.io/hybris/media/v2/public/files/578707fdf071a4001d993d34"
           },
           "createdBy":"prateek.shastri@sap.com",
           "id":"425e0193015c469982b782cb9847ed23",
           "metadata":{
              "createdAt":"2016-07-14T03:33:17.860+0000",
              "modifiedAt":"2016-07-14T03:33:17.860+0000",
              "version":"1"
           },
           "status":"ACTIVE",
           "termsAndConditions":{
              "en":"T and C",
              "de":"T and C De",
              "ja":"T and C Ja"
           },
           "tierId":"b0a7780542ee4d6cb6d61014f5cfd825",
           "updatedby":"prateek.shastri@sap.com"
        },
        {
           "appleLoyaltyCard":{
              "auxilaryFields":{
                 "en":[
                    {
                       "fieldNameCard":"POINTS",
                       "label":"Points",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldNameCard":"POINTS",
                       "label":"Points de",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldNameCard":"POINTS",
                       "label":"Points ja",
                       "position":0.0
                    }
                 ]
              },
              "barcodeType":"QRCODE",
              "bgColor":"#d95252",
              "foregroundColor":"#0eb07f",
              "headerFields":{
                 "en":[
                    {
                       "fieldNameCard":"MEMBER_NAME",
                       "label":"Member Name",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldNameCard":"MEMBER_NAME",
                       "label":"Member Name de",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldNameCard":"MEMBER_NAME",
                       "label":"Member Name Ja",
                       "position":0.0
                    }
                 ]
              },
              "labelColor":"#222e2a",
              "logo":"https://api.stage.yaas.io/hybris/media/v2/public/files/57870e96f071a4001d993d48",
              "logoText":"TIER",
              "primaryFields":{
                 "en":[
                    {
                       "fieldNameCard":"TIER",
                       "label":"Tier",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldNameCard":"TIER",
                       "label":"Tier de",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldNameCard":"TIER",
                       "label":"Tier ja",
                       "position":0.0
                    }
                 ]
              },
              "stripImage":"https://api.stage.yaas.io/hybris/media/v2/public/files/57870e96f071a4001d993d49"
           },
           "createdBy":"prateek.shastri@sap.com",
           "id":"d45c6a58d9db487588086d78d57a8aed",
           "metadata":{
              "createdAt":"2016-07-14T04:01:26.942+0000",
              "modifiedAt":"2016-07-14T04:01:26.942+0000",
              "version":"1"
           },
           "status":"ACTIVE",
           "termsAndConditions":{
              "en":"T and C",
              "de":"T and C de",
              "ja":"T and C ja"
           },
           "tierId":"45ea2429b92a4632bf0580e38512153e",
           "updatedby":"prateek.shastri@sap.com"
        },
        {
           "appleLoyaltyCard":{
              "auxilaryFields":{
                 "en":[
                    {
                       "fieldNameCard":"POINTS",
                       "label":"Points",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldNameCard":"POINTS",
                       "label":"Points de",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldNameCard":"POINTS",
                       "label":"Points Ja",
                       "position":0.0
                    }
                 ]
              },
              "barcodeType":"AZTEC",
              "bgColor":"#20d498",
              "foregroundColor":"#1e2422",
              "headerFields":{
                 "en":[
                    {
                       "fieldNameCard":"MEMBER_NAME",
                       "label":"Member Name",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldNameCard":"MEMBER_NAME",
                       "label":"Member Name De",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldNameCard":"MEMBER_NAME",
                       "label":"Member Name Ja",
                       "position":0.0
                    }
                 ]
              },
              "labelColor":"#020d09",
              "logo":"https://api.stage.yaas.io/hybris/media/v2/public/files/57870f7652a7d8001df27a2f",
              "logoText":"MEMBER_NAME",
              "primaryFields":{
                 "en":[
                    {
                       "fieldNameCard":"TIER",
                       "label":"Tier",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldNameCard":"TIER",
                       "label":"Tier de",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldNameCard":"TIER",
                       "label":"Tier Ja",
                       "position":0.0
                    }
                 ]
              },
              "stripImage":"https://api.stage.yaas.io/hybris/media/v2/public/files/57870f76f071a4001d993d4b"
           },
           "createdBy":"prateek.shastri@sap.com",
           "googleLoyaltyCardClassName":"e8befd399be444fcbcdc2c48b95b8acb",
           "id":"f24b48aac97944ccacfad2778d193245",
           "metadata":{
              "createdAt":"2016-07-14T04:05:10.845+0000",
              "modifiedAt":"2016-07-14T04:10:43.460+0000",
              "version":"2"
           },
           "status":"ACTIVE",
           "termsAndConditions":{
              "en":"T and C En",
              "de":"T and C De",
              "ja":"T and C JA"
           },
           "tierId":"e8befd399be444fcbcdc2c48b95b8acb",
           "updatedby":"prateek.shastri@sap.com"
        }
     ],
     "totalCount":"11"
    }
    

     


Update a Card Template

To update a card template, use a PUT request to send the entire template object with the updated fields. The service does not support partial updates.

This example shows how to update a card template for a tier.

Request

  • Method: PUT
  • Request URL: https://api.beta.yaas.io/hybris/loy-cards/v1/loyaltyCardTemplate/{templateId}
  • Content Type: multipart/form-data
  • Form Parameters: A strip image file (optional), a logo file (optional), and a text string (required)
  • Body: The request body must contain a field with the key name, model, with a type of text (the schema is shown in the example). The key for the Google Template Logo is programLogo. The key for the Apple Template Logo is logo. The key for the Apple Template Strip Image is stripImage. Images must be in PNG file format, however, you do not have to send images when you update a template. You can send images only when it is necessary to update the images.
    {
     "$schema":"http://json-schema.org/draft-04/schema#",
     "title":"Loyalty Card Template",
     "type":"object",
     "properties":{
        "id":{
           "type":"string"
        },
        "status":{
           "enum":[
              "ACTIVE",
              "INACTIVE"
           ]
        },
        "tierId":{
           "type":"string"
        },
        "createdBy":{
           "type":"string"
        },
        "modifiedBy":{
           "type":"string"
        },
        "termsAndConditions":{
           "$ref":"https://api.yaas.io/patterns/v1/schema-localized.json",
           "description":"Terms and Conditions of the Offer."
        },
        "appleLoyaltyCard":{
           "$schema":"http://json-schema.org/draft-04/schema#",
           "title":"Apple Wallet Template",
           "type":"object",
           "properties":{
              "bgColor":{
                 "type":"string"
              },
              "logo":{
                 "type":"string"
              },
              "stripImage":{
                 "type":"string"
              },
              "barcodeType":{
                 "enum":[
                    "PDF417",
                    "AZTEC",
                    "QRCODE",
                    "CODE128"
                 ]
              },
              "headerFields":{
                 "$schema":"http://json-schema.org/draft-04/schema#",
                 "title":"localized",
                 "oneOf":[
                    {
                       "$ref":"fieldCards",
                       "description":"value of property in default language"
                    },
                    {
                       "type":"object",
                       "description":"value of property in specific language",
                       "additionalProperties":{
                          "$ref":"fieldCards"
                       }
                    }
                 ],
                 "description":"Header fields of loyalty card"
              },
              "primaryFields":{
                 "$schema":"http://json-schema.org/draft-04/schema#",
                 "title":"localized",
                 "oneOf":[
                    {
                       "$ref":"fieldCards",
                       "description":"value of property in default language"
                    },
                    {
                       "type":"object",
                       "description":"value of property in specific language",
                       "additionalProperties":{
                          "$ref":"fieldCards"
                       }
                    }
                 ],
                 "description":"Primary fields of loyalty card"
              },
              "auxilaryFields":{
                 "$schema":"http://json-schema.org/draft-04/schema#",
                 "title":"localized",
                 "oneOf":[
                    {
                       "$ref":"fieldCards",
                       "description":"value of property in default language"
                    },
                    {
                       "type":"object",
                       "description":"value of property in specific language",
                       "additionalProperties":{
                          "$ref":"fieldCards"
                       }
                    }
                 ],
                 "description":"Auxiliary fields of loyalty card"
              },
              "logoText":{
                 "type":"string"
              },
              "foregroundColor":{
                 "type":"string"
              },
              "labelColor":{
                 "type":"string"
              }
           },
           "required":[
              "bgColor",
              "barcodeType",
              "logoText"
           ]
        },
        "googleLoyaltyCard":{
           "$schema":"http://json-schema.org/draft-04/schema#",
           "title":"Google Loyalty Card Template",
           "type":"object",
           "properties":{
              "className":{
                 "type":"string"
              },
              "issuerName":{
                 "type":"string"
              },
              "programLogo":{
                 "type":"string"
              },
              "programName":{
                 "type":"string"
              },
              "reviewStatus":{
                 "enum":[
                    "approved",
                    "draft",
                    "rejected",
                    "underReview"
                 ]
              },
              "validTimeInterval":{
                 "type":"string"
              },
              "hexFontColor":{
                 "type":"string"
              },
              "hexBackgroundColor":{
                 "type":"string"
              }
           },
           "required":[
              "className",
              "issuerName",
              "programName",
              "reviewStatus",
              "programLogo"
           ]
        }
     },
     "required":[
        "tierId",
        "termsAndConditions",
        "status"
     ]
    }
    
  • Example:
    {
     "termsAndConditions":{
        "en":"jsdknf",
        "de":"dsa",
        "ja":"sfdf"
     },
     "tierId":"14a50736e5574fd09e73d080dca51a24",
     "id":"4ebc3b9e79a74af980c08c0553e52975",
     "status":"ACTIVE",
     "createdBy":"jyothi.b.bhat@sap.com",
     "modifiedBy":"jyothi.b.bhat@sap.com",
     "googleLoyaltyCard":{
        "className":"14a50736e5574fd09e73d080dca51a24",
        "issuerName":"Felton",
        "programName":"SatelliteOne",
        "reviewStatus":"UNDER_REVIEW",
        "hexFontColor":"#f7e4e4",
        "hexBackgroundColor":"#591212",
        "programLogo":"https://api.stage.yaas.io/hybris/media/v2/public/files/5729a5d7941b90001d169289"
     },
     "appleLoyaltyCard":{
        "bgColor":"#ba9b9b",
        "barcodeType":"PDF_417",
        "headerFields":{
           "en":[
              {
                 "fieldNameCard":"PROGRAM_NAME",
                 "label":"LoyPro",
                 "position":0
              }
           ],
           "de":[
              {
                 "fieldNameCard":"PROGRAM_NAME",
                 "label":"",
                 "position":0
              }
           ],
           "ja":[
              {
                 "fieldNameCard":"PROGRAM_NAME",
                 "label":"",
                 "position":0
              }
           ]
        },
        "primaryFields":{
           "en":[
              {
                 "fieldNameCard":"MEMBER_NAME",
                 "label":"Mmeber Name",
                 "position":0
              }
           ],
           "de":[
              {
                 "fieldNameCard":"MEMBER_NAME",
                 "label":"",
                 "position":0
              }
           ],
           "ja":[
              {
                 "fieldNameCard":"MEMBER_NAME",
                 "label":"",
                 "position":0
              }
           ]
        },
        "auxilaryFields":{
           "en":[
              {
                 "fieldNameCard":"POINTS",
                 "label":"pts",
                 "position":0
              },
              {
                 "fieldNameCard":"TIER",
                 "label":"tier",
                 "position":1
              }
           ],
           "de":[
              {
                 "fieldNameCard":"POINTS",
                 "label":"",
                 "position":0
              },
              {
                 "fieldNameCard":"TIER",
                 "label":"",
                 "position":1
              }
           ],
           "ja":[
              {
                 "fieldNameCard":"POINTS",
                 "label":"",
                 "position":0
              },
              {
                 "fieldNameCard":"TIER",
                 "label":"",
                 "position":1
              }
           ]
        },
        "logoText":"MEMBER_NAME",
        "foregroundColor":"#190404",
        "labelColor":"#080000",
        "logo":"https://api.stage.yaas.io/hybris/media/v2/public/files/5729a5da941b90001d16928a",
        "stripImage":"https://api.stage.yaas.io/hybris/media/v2/public/files/5729a5da1a5270001dad36f1"
     }
    }
    

Response

  • Status Code: 200

 


Create a coupon template

Coupon templates allow tenants to create and offer digital coupons as part of their loyalty programs. Coupon template names must be unique.

To allow tenants to create Google templates, you must configure a Google Wallet account. To configure the account, click Configuration > Wallet Configuration in the Builder. For more information about how to create the account, see the SAP Hybris Loyalty Application Help.

This tutorial shows how to create a coupon template.

Request

  • Method: POST
  • Request URL: https://api.beta.yaas.io/hybris/loy-cards/v1/couponTemplates
  • Content Type: multipart/form-data
  • Form Parameters: A strip image file (required), a logo file (required), and a text string (required)
  • Body: The request body must contain the field with the key name model, with a type of text (the schema is shown in the example). The key for the Google Template Logo is programLogo. The Apple Template Logo is logo. The Apple Template Strip Image is stripImage. All images must be in the PNG file format.
    {
     "$schema":"http://json-schema.org/draft-04/schema#",
     "title":"Loyalty Coupon Template",
     "type":"object",
     "properties":{
        "templateId":{
           "description":"A user-friendly business-oriented name of the template.",
           "type":"string"
        },
        "templateName":{
           "description":"The user-friendly business-oriented name of the template.",
           "type":"string"
        },
        "termsAndConditions":{
           "$ref":"https://api.yaas.io/patterns/v1/schema-localized.json",
           "description":"Terms and condition field of Loyalty Coupon."
        },
        "status":{
           "enum":[
              "Active",
              "Inactive"
           ]
        },
        "createdBy":{
           "type":"string"
        },
        "updatedBy":{
           "type":"string"
        },
        "googleCouponTemplate":{
           "$schema":"http://json-schema.org/draft-04/schema#",
           "title":"Offer class",
           "type":"object",
           "properties":{
              "id":{
                 "type":"string"
              },
              "infoModuleObject":{
                 "type":"object",
                 "$ref":"infoModuleObject"
              },
              "imageModuleData":{
                 "type":"object",
                 "$ref":"imageModuleData"
              },
              "validTimeInterval":{
                 "type":"object",
                 "$ref":"validTimeInterval"
              },
              "issuerName":{
                 "type":"string",
                 "maxLength":20
              },
              "provider":{
                 "type":"string",
                 "maxLength":12
              },
              "redemptionChannel":{
                 "type":"string"
              },
              "reviewStatus":{
                 "enum":[
                    "approved",
                    "draft",
                    "rejected",
                    "underReview"
                 ]
              },
              "title":{
                 "type":"string"
              },
              "details":{
                 "type":"string"
              },
              "renderSpecs":{
                 "type":"array",
                 "items":{
                    "$ref":"renderSpec"
                 }
              },
              "programLogo":{
                 "type":"string"
              }
           },
           "required":[
              "issuerName",
              "provider",
              "title",
              "details"
           ]
        },
        "appleCouponTemplate":{
           "$schema":"http://json-schema.org/draft-04/schema#",
           "title":"Apple Wallet coupon Template",
           "type":"object",
           "properties":{
              "bgColor":{
                 "type":"string"
              },
              "logo":{
                 "type":"string"
              },
              "stripImage":{
                 "type":"string"
              },
              "barcodeType":{
                 "enum":[
                    "PDF417",
                    "AZTEC",
                    "QRCODE"
                 ]
              },
              "headerFields":{
                 "$schema":"http://json-schema.org/draft-04/schema#",
                 "title":"localized",
                 "oneOf":[
                    {
                       "$ref":"fields",
                       "description":"value of property in default language"
                    },
                    {
                       "type":"object",
                       "description":"value of property in specific language",
                       "additionalProperties":{
                          "$ref":"fields"
                       }
                    }
                 ],
                 "description":"header fields of  coupon"
              },
              "primaryFields":{
                 "$schema":"http://json-schema.org/draft-04/schema#",
                 "title":"localized",
                 "oneOf":[
                    {
                       "$ref":"fields",
                       "description":"value of property in default language"
                    },
                    {
                       "type":"object",
                       "description":"value of property in specific language",
                       "additionalProperties":{
                          "$ref":"fields"
                       }
                    }
                 ],
                 "description":"primaryFields  of  coupon"
              },
              "auxilaryFields":{
                 "$schema":"http://json-schema.org/draft-04/schema#",
                 "title":"localized",
                 "oneOf":[
                    {
                       "$ref":"fields",
                       "description":"value of property in default language"
                    },
                    {
                       "type":"object",
                       "description":"value of property in specific language",
                       "additionalProperties":{
                          "$ref":"fields"
                       }
                    }
                 ],
                 "description":"auxilaryFields  of  coupon"
              },
              "logoText":{
                 "type":"string"
              },
              "foregroundColor":{
                 "type":"string"
              },
              "labelColor":{
                 "type":"string"
              }
           },
           "required":[
              "bgColor",
              "barcodeType",
              "logoText"
           ]
        }
     },
     "required":[
        "templateName",
        "termsAndConditions"
     ]
    }
    
  • Example:
    {
     "termsAndConditions":{
        "en":"T and C",
        "de":"T and C De",
        "ja":"T and C Ja"
     },
     "templateId":"",
     "status":"ACTIVE",
     "templateName":"Diwali Offer Template",
     "googleCouponTemplate":{
        "id":"",
        "details":"This template is for Diwali Offer",
        "provider":"Diwali Offer",
        "title":"Diwali Offer Template",
        "issuerName":"Felton",
        "redemptionChannel":"both",
        "reviewStatus":"DRAFT",
        "validTimeInterval":{
           "end":"2016-07-29T18:30:00.000Z"
        },
        "infoModuleObject":{
           "hexFontColor":"#292323",
           "hexBackgroundColor":"#e35252"
        }
     },
     "appleCouponTemplate":{
        "bgColor":"#4484b3",
        "barcodeType":"AZTEC",
        "headerFields":{
           "en":[
              {
                 "fieldName":"VALID_TO",
                 "label":"Valid To",
                 "position":0
              }
           ],
           "de":[
              {
                 "fieldName":"VALID_TO",
                 "label":"Valid To de",
                 "position":0
              }
           ],
           "ja":[
              {
                 "fieldName":"VALID_TO",
                 "label":"Valid To ja",
                 "position":0
              }
           ]
        },
        "primaryFields":{
           "en":[
              {
                 "fieldName":"OFFER_CODE",
                 "label":"Offer Code",
                 "position":0
              }
           ],
           "de":[
              {
                 "fieldName":"OFFER_CODE",
                 "label":"Offer Code de",
                 "position":0
              }
           ],
           "ja":[
              {
                 "fieldName":"OFFER_CODE",
                 "label":"Offer Code ja",
                 "position":0
              }
           ]
        },
        "auxilaryFields":{
           "en":[
              {
                 "fieldName":"OFFER_NAME",
                 "label":"Offer Name",
                 "position":0
              }
           ],
           "de":[
              {
                 "fieldName":"OFFER_NAME",
                 "label":"Offer Name de",
                 "position":0
              }
           ],
           "ja":[
              {
                 "fieldName":"OFFER_NAME",
                 "label":"Offer Name ja",
                 "position":0
              }
           ]
        },
        "logoText":"OFFER_DESCRIPTION",
        "foregroundColor":"#050505",
        "labelColor":"#e0c1c1"
     }
    }
    

Response

  • Status Code: 201

 


Get a Coupon Template by Template Id

This tutorial shows how to use a GET request to get a coupon template by template ID.

Request

  • Method: GET
  • Request URL: https://api.beta.yaas.io/hybris/loy-cards/v1/couponTemplates/{templateId}

Response

  • Status Code: 200
    {
     "$schema":"http://json-schema.org/draft-04/schema#",
     "title":"Loyalty Coupon Template",
     "type":"object",
     "properties":{
        "templateId":{
           "description":"The primary key of the template generated by service.",
           "type":"string"
        },
        "templateName":{
           "description":"The business (i.e. user friendly) name of the template.",
           "type":"string"
        },
        "termsAndConditions":{
           "$ref":"https://api.yaas.io/patterns/v1/schema-localized.json",
           "description":"Terms and condition field of loyalty coupon."
        },
        "status":{
           "enum":[
              "Active",
              "Inactive"
           ]
        },
        "createdBy":{
           "type":"string"
        },
        "updatedBy":{
           "type":"string"
        },
        "googleCouponTemplate":{
           "type":"string"
        },
        "appleCouponTemplate":{
           "type":"object",
           "$ref":"appleCouponTemplate"
        }
     },
     "required":[
        "templateName",
        "termsAndConditions",
        "status"
     ]
    }
    
  • Example:
    {
     "appleCouponTemplate":{
        "auxilaryFields":{
           "en":[
              {
                 "fieldName":"VALID_TO",
                 "label":"Val til",
                 "position":0.0
              },
              {
                 "fieldName":"OFFER_CODE",
                 "label":"Codeabc",
                 "position":1.0
              }
           ],
           "de":[
              {
                 "fieldName":"VALID_TO",
                 "label":"",
                 "position":0.0
              },
              {
                 "fieldName":"OFFER_CODE",
                 "label":"",
                 "position":1.0
              }
           ],
           "ja":[
              {
                 "fieldName":"VALID_TO",
                 "label":"",
                 "position":0.0
              },
              {
                 "fieldName":"OFFER_CODE",
                 "label":"",
                 "position":1.0
              }
           ]
        },
        "barcodeType":"QRCODE",
        "bgColor":"#ffffff",
        "foregroundColor":"#000000",
        "headerFields":{
           "en":[
              {
                 "fieldName":"OFFER_NAME",
                 "label":"off name",
                 "position":0.0
              }
           ],
           "de":[
              {
                 "fieldName":"OFFER_NAME",
                 "label":"",
                 "position":0.0
              }
           ],
           "ja":[
              {
                 "fieldName":"OFFER_NAME",
                 "label":"",
                 "position":0.0
              }
           ]
        },
        "labelColor":"#3d3d3d",
        "logo":"https://api.stage.yaas.io/hybris/media/v2/public/files/5717c7d0e6f8fb001d5b8e89",
        "logoText":"OFFER_NAME",
        "primaryFields":{
           "en":[
              {
                 "fieldName":"OFFER_DESCRIPTION",
                 "label":"Desc",
                 "position":0.0
              }
           ],
           "de":[
              {
                 "fieldName":"OFFER_DESCRIPTION",
                 "label":"",
                 "position":0.0
              }
           ],
           "ja":[
              {
                 "fieldName":"OFFER_DESCRIPTION",
                 "label":"",
                 "position":0.0
              }
           ]
        },
        "stripImage":"https://api.stage.yaas.io/hybris/media/v2/public/files/5717c7d0e6f8fb001d5b8e8a"
     },
     "createdBy":"jyothi.b.bhat@sap.com",
     "id":"0494b67e66164c39abc2ef85ebb16574",
     "metadata":{
        "createdAt":"2016-04-20T18:17:52.813+0000",
        "modifiedAt":"2016-04-27T04:08:51.624+0000",
        "version":"2"
     },
     "status":"ACTIVE",
     "templateId":"0494b67e66164c39abc2ef85ebb16574",
     "templateName":"April Coupon",
     "termsAndConditions":{
        "de":"abc",
        "ja":"efg",
        "en":"abc"
     },
     "updatedBy":"rahul.kashyap@sap.com"
    }
    

     


Get all coupon Templates

This tutorial shows how to use a GET request to obtain all coupon templates in the system. To get a total count in the header of the response, pass the totalCount attribute as true, as shown.

Request

  • Method: GET
  • Request URL: https://api.beta.yaas.io/hybris/loy-cards/v1/couponTemplates?totalCount=true

Response

  • Status Code: 200
  • Example:
    {
     "couponTemplates":[
        {
           "appleCouponTemplate":{
              "auxilaryFields":{
                 "en":[
                    {
                       "fieldName":"OFFER_NAME",
                       "label":"Name",
                       "position":0.0
                    },
                    {
                       "fieldName":"VALID_TO",
                       "label":"Vlaid til",
                       "position":1.0
                    },
                    {
                       "fieldName":"VALID_FROM",
                       "label":"dd",
                       "position":2.0
                    }
                 ]
              },
              "barcodeType":"AZTEC",
              "bgColor":"#e6c1c1",
              "foregroundColor":"#170404",
              "headerFields":{
                 "en":[
                    {
                       "fieldName":"OFFER_CODE",
                       "label":"Code",
                       "position":0.0
                    }
                 ]
              },
              "labelColor":"#0f0202",
              "logo":"https://api.stage.yaas.io/hybris/media/v2/public/files/56fe3e503ca0a9001d0b181a",
              "logoText":"OFFER_NAME",
              "primaryFields":{
                 "en":[
                    {
                       "fieldName":"OFFER_DESCRIPTION",
                       "label":"Desc",
                       "position":0.0
                    }
                 ]
              },
              "stripImage":"https://api.stage.yaas.io/hybris/media/v2/public/files/56fe3e513ca0a9001d0b181b"
           },
           "createdBy":"jyothi.b.bhat@sap.com",
           "id":"26e0aba26dd34ed59a7cac411e0ecdc4",
           "metadata":{
              "createdAt":"2016-04-01T09:24:33.809+0000",
              "modifiedAt":"2016-04-01T09:24:33.809+0000",
              "version":"1"
           },
           "status":"ACTIVE",
           "templateId":"26e0aba26dd34ed59a7cac411e0ecdc4",
           "templateName":"MyCoupons",
           "termsAndConditions":{
              "en":"T & C in Coupons"
           },
           "updatedBy":"jyothi.b.bhat@sap.com"
        },
        {
           "appleCouponTemplate":{
              "auxilaryFields":{
                 "en":[
                    {
                       "fieldName":"",
                       "label":"",
                       "position":0.0
                    },
                    {
                       "fieldName":"VALID_FROM",
                       "label":"Valid From",
                       "position":1.0
                    }
                 ],
                 "de":[
                    {
                       "fieldName":"",
                       "label":"",
                       "position":0.0
                    },
                    {
                       "fieldName":"VALID_FROM",
                       "label":"",
                       "position":1.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldName":"",
                       "label":"",
                       "position":0.0
                    },
                    {
                       "fieldName":"VALID_FROM",
                       "label":"",
                       "position":1.0
                    }
                 ]
              },
              "barcodeType":"AZTEC",
              "bgColor":"#cf8c8c",
              "foregroundColor":"#000000",
              "labelColor":"#000000",
              "logo":"https://api.stage.yaas.io/hybris/media/v2/public/files/5732f045c17c33001deeb70f",
              "logoText":"OFFER_DESCRIPTION",
              "primaryFields":{
                 "en":[
                    {
                       "fieldName":"OFFER_DESCRIPTION",
                       "label":"Desc",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldName":"OFFER_DESCRIPTION",
                       "label":"",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldName":"OFFER_DESCRIPTION",
                       "label":"",
                       "position":0.0
                    }
                 ]
              },
              "stripImage":"https://api.stage.yaas.io/hybris/media/v2/public/files/5732f04677c403001d6657f6"
           },
           "createdBy":"jyothi.b.bhat@sap.com",
           "id":"1d8494a500194a9b85699567b65a52b8",
           "metadata":{
              "createdAt":"2016-04-04T21:13:07.879+0000",
              "modifiedAt":"2016-05-11T08:45:01.701+0000",
              "version":"5"
           },
           "status":"ACTIVE",
           "templateId":"1d8494a500194a9b85699567b65a52b8",
           "templateName":"MyCoupon",
           "termsAndConditions":{
              "en":"T & C In Eng\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis",
              "de":"T & C In DE",
              "ko":"T & C In Ko",
              "ja":"T & C In Ja"
           },
           "updatedBy":"vikas.venugopal@sap.com"
        },
        {
           "appleCouponTemplate":{
              "barcodeType":"QRCODE",
              "bgColor":"#a84343",
              "foregroundColor":"#b86767",
              "headerFields":{
                 "en":[
                    {
                       "fieldName":"OFFER_NAME",
                       "label":"name english",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldName":"OFFER_NAME",
                       "label":"name gemanr",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldName":"OFFER_NAME",
                       "label":"name check",
                       "position":0.0
                    }
                 ]
              },
              "labelColor":"#a35656",
              "logo":"https://api.stage.yaas.io/hybris/media/v2/public/files/57049efa05dcb6001d0b4ecd",
              "logoText":"OFFER_NAME",
              "stripImage":"https://api.stage.yaas.io/hybris/media/v2/public/files/57049efbf0e0a9001d64c0d5"
           },
           "createdBy":"sunil.dayananda.nayak@sap.com",
           "id":"675a55fce0584cb8be44eedc650cff2a",
           "metadata":{
              "createdAt":"2016-04-06T05:30:35.885+0000",
              "modifiedAt":"2016-04-14T08:46:28.119+0000",
              "version":"7"
           },
           "status":"ACTIVE",
           "templateId":"675a55fce0584cb8be44eedc650cff2a",
           "templateName":"my first coupon",
           "termsAndConditions":{
              "en":"T and C",
              "de":"T and C",
              "ja":"T and C"
           },
           "updatedBy":"sunil.dayananda.nayak@sap.com"
        },
        {
           "createdBy":"jyothi.b.bhat@sap.com",
           "googleCouponTemplate":"a860dc40589a4cc3ba3cce2cb8c37c9b",
           "id":"a860dc40589a4cc3ba3cce2cb8c37c9b",
           "metadata":{
              "createdAt":"2016-05-23T06:19:54.905+0000",
              "modifiedAt":"2016-05-23T06:19:54.905+0000",
              "version":"1"
           },
           "status":"ACTIVE",
           "templateId":"a860dc40589a4cc3ba3cce2cb8c37c9b",
           "templateName":"GoogleCoup",
           "termsAndConditions":{
              "en":"T & C",
              "de":"T & C",
              "ja":"T & C"
           },
           "updatedBy":"jyothi.b.bhat@sap.com"
        },
        {
           "createdBy":"jyothi.b.bhat@sap.com",
           "googleCouponTemplate":"84b699a87a6949a7afb9bf6acbbb70ee",
           "id":"84b699a87a6949a7afb9bf6acbbb70ee",
           "metadata":{
              "createdAt":"2016-06-15T08:01:31.141+0000",
              "modifiedAt":"2016-06-15T08:01:31.141+0000",
              "version":"1"
           },
           "status":"ACTIVE",
           "templateId":"84b699a87a6949a7afb9bf6acbbb70ee",
           "templateName":"googWal",
           "termsAndConditions":{
              "en":"test",
              "de":"test",
              "ja":"test"
           },
           "updatedBy":"jyothi.b.bhat@sap.com"
        },
        {
           "appleCouponTemplate":{
              "auxilaryFields":{
                 "en":[
                    {
                       "fieldName":"VALID_TO",
                       "label":"Val til",
                       "position":0.0
                    },
                    {
                       "fieldName":"OFFER_CODE",
                       "label":"Codeabc",
                       "position":1.0
                    }
                 ],
                 "de":[
                    {
                       "fieldName":"VALID_TO",
                       "label":"",
                       "position":0.0
                    },
                    {
                       "fieldName":"OFFER_CODE",
                       "label":"",
                       "position":1.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldName":"VALID_TO",
                       "label":"",
                       "position":0.0
                    },
                    {
                       "fieldName":"OFFER_CODE",
                       "label":"",
                       "position":1.0
                    }
                 ]
              },
              "barcodeType":"QRCODE",
              "bgColor":"#ffffff",
              "foregroundColor":"#000000",
              "headerFields":{
                 "en":[
                    {
                       "fieldName":"OFFER_NAME",
                       "label":"off name",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldName":"OFFER_NAME",
                       "label":"",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldName":"OFFER_NAME",
                       "label":"",
                       "position":0.0
                    }
                 ]
              },
              "labelColor":"#3d3d3d",
              "logo":"https://api.stage.yaas.io/hybris/media/v2/public/files/5717c7d0e6f8fb001d5b8e89",
              "logoText":"OFFER_NAME",
              "primaryFields":{
                 "en":[
                    {
                       "fieldName":"OFFER_DESCRIPTION",
                       "label":"Desc",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldName":"OFFER_DESCRIPTION",
                       "label":"",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldName":"OFFER_DESCRIPTION",
                       "label":"",
                       "position":0.0
                    }
                 ]
              },
              "stripImage":"https://api.stage.yaas.io/hybris/media/v2/public/files/5717c7d0e6f8fb001d5b8e8a"
           },
           "createdBy":"jyothi.b.bhat@sap.com",
           "id":"0494b67e66164c39abc2ef85ebb16574",
           "metadata":{
              "createdAt":"2016-04-20T18:17:52.813+0000",
              "modifiedAt":"2016-04-27T04:08:51.624+0000",
              "version":"2"
           },
           "status":"ACTIVE",
           "templateId":"0494b67e66164c39abc2ef85ebb16574",
           "templateName":"April Coupon",
           "termsAndConditions":{
              "de":"abc",
              "ja":"efg",
              "en":"abc"
           },
           "updatedBy":"rahul.kashyap@sap.com"
        },
        {
           "appleCouponTemplate":{
              "auxilaryFields":{
                 "en":[
                    {
                       "fieldName":"OFFER_CODE",
                       "label":"Code",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldName":"OFFER_CODE",
                       "label":"",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldName":"OFFER_CODE",
                       "label":"",
                       "position":0.0
                    }
                 ]
              },
              "barcodeType":"PDF_417",
              "bgColor":"#d1b6b6",
              "foregroundColor":"#5e1919",
              "headerFields":{
                 "en":[
                    {
                       "fieldName":"OFFER_DESCRIPTION",
                       "label":"Desc",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldName":"OFFER_DESCRIPTION",
                       "label":"",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldName":"OFFER_DESCRIPTION",
                       "label":"",
                       "position":0.0
                    }
                 ]
              },
              "labelColor":"#e8caca",
              "logo":"https://api.stage.yaas.io/hybris/media/v2/public/files/57287aa0941b90001d169174",
              "logoText":"OFFER_NAME",
              "primaryFields":{
                 "en":[
                    {
                       "fieldName":"VALID_FROM",
                       "label":"Val from",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldName":"VALID_FROM",
                       "label":"",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldName":"VALID_FROM",
                       "label":"",
                       "position":0.0
                    }
                 ]
              },
              "stripImage":"https://api.stage.yaas.io/hybris/media/v2/public/files/57287aa1941b90001d169175"
           },
           "createdBy":"jyothi.b.bhat@sap.com",
           "id":"3fe48f7106334dd5ab16f9b832479545",
           "metadata":{
              "createdAt":"2016-05-03T10:17:05.388+0000",
              "modifiedAt":"2016-05-03T10:17:05.388+0000",
              "version":"1"
           },
           "status":"ACTIVE",
           "templateId":"3fe48f7106334dd5ab16f9b832479545",
           "templateName":"Coupon Test",
           "termsAndConditions":{
              "en":"Abc",
              "de":"Abc",
              "ja":"Abc"
           },
           "updatedBy":"jyothi.b.bhat@sap.com"
        },
        {
           "appleCouponTemplate":{
              "auxilaryFields":{
                 "en":[
                    {
                       "fieldName":"OFFER_DESCRIPTION",
                       "label":"desc",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldName":"OFFER_DESCRIPTION",
                       "label":"",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldName":"OFFER_DESCRIPTION",
                       "label":"",
                       "position":0.0
                    }
                 ]
              },
              "barcodeType":"AZTEC",
              "bgColor":"#752020",
              "foregroundColor":"#dec7c7",
              "headerFields":{
                 "en":[
                    {
                       "fieldName":"VALID_FROM",
                       "label":"val frm",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldName":"VALID_FROM",
                       "label":"",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldName":"VALID_FROM",
                       "label":"",
                       "position":0.0
                    }
                 ]
              },
              "labelColor":"#e6dfdf",
              "logo":"https://api.stage.yaas.io/hybris/media/v2/public/files/573156cbc17c33001deeb4e5",
              "logoText":"OFFER_NAME",
              "primaryFields":{
                 "en":[
                    {
                       "fieldName":"VALID_TO",
                       "label":"val til",
                       "position":0.0
                    }
                 ],
                 "de":[
                    {
                       "fieldName":"VALID_TO",
                       "label":"",
                       "position":0.0
                    }
                 ],
                 "ja":[
                    {
                       "fieldName":"VALID_TO",
                       "label":"",
                       "position":0.0
                    }
                 ]
              },
              "stripImage":"https://api.stage.yaas.io/hybris/media/v2/public/files/573156cb77c403001d6655d1"
           },
           "createdBy":"jyothi.b.bhat@sap.com",
           "id":"7d7123775ade4f3ca96bd9bfad9460e2",
           "metadata":{
              "createdAt":"2016-05-10T03:34:36.043+0000",
              "modifiedAt":"2016-05-11T08:46:03.447+0000",
              "version":"2"
           },
           "status":"ACTIVE",
           "templateId":"7d7123775ade4f3ca96bd9bfad9460e2",
           "templateName":"New Coupon Template",
           "termsAndConditions":{
              "en":"gggg",
              "de":"kjhkj",
              "ja":"jlkjklj"
           },
           "updatedBy":"vikas.venugopal@sap.com"
        }
     ],
     "totalCount":"8"
    }
    

     


Update a Coupon Template

To update a coupon template, use a PUT request to send the entire template object with the updated fields. The service does not support partial updates.

This example shows how to update a coupon template for a tier.

Request

  • Method: PUT
  • Request URL: https://api.beta.yaas.io/hybris/loy-cards/v1/couponTemplates/{templateId}
  • Content Type: multipart/form-data
  • Form Parameters: A strip image file (optional), a logo file (optional), and a text string (required)
  • Body: The request body must contain a field with key name, model, with the type text (the schema is shown in the example). The key for the Google Template Logo is programLogo. The key for the Apple Template Logo is logo. The key for the Apple Template Strip Image is stripImage. Images must be in PNG file format, however, you do not have to send images when you update a template. You can send images only when it is necessary to update the images.
    {
     "$schema":"http://json-schema.org/draft-04/schema#",
     "title":"Loyalty Card Template",
     "type":"object",
     "properties":{
        "id":{
           "type":"string"
        },
        "status":{
           "enum":[
              "ACTIVE",
              "INACTIVE"
           ]
        },
        "tierId":{
           "type":"string"
        },
        "createdBy":{
           "type":"string"
        },
        "modifiedBy":{
           "type":"string"
        },
        "termsAndConditions":{
           "$ref":"https://api.yaas.io/patterns/v1/schema-localized.json",
           "description":"Terms and Conditions of the Offer."
        },
        "appleLoyaltyCard":{
           "$schema":"http://json-schema.org/draft-04/schema#",
           "title":"Apple Wallet Template",
           "type":"object",
           "properties":{
              "bgColor":{
                 "type":"string"
              },
              "logo":{
                 "type":"string"
              },
              "stripImage":{
                 "type":"string"
              },
              "barcodeType":{
                 "enum":[
                    "PDF417",
                    "AZTEC",
                    "QRCODE",
                    "CODE128"
                 ]
              },
              "headerFields":{
                 "$schema":"http://json-schema.org/draft-04/schema#",
                 "title":"localized",
                 "oneOf":[
                    {
                       "$ref":"fieldCards",
                       "description":"value of property in default language"
                    },
                    {
                       "type":"object",
                       "description":"value of property in specific language",
                       "additionalProperties":{
                          "$ref":"fieldCards"
                       }
                    }
                 ],
                 "description":"Header fields of loyalty card"
              },
              "primaryFields":{
                 "$schema":"http://json-schema.org/draft-04/schema#",
                 "title":"localized",
                 "oneOf":[
                    {
                       "$ref":"fieldCards",
                       "description":"value of property in default language"
                    },
                    {
                       "type":"object",
                       "description":"value of property in specific language",
                       "additionalProperties":{
                          "$ref":"fieldCards"
                       }
                    }
                 ],
                 "description":"Primary fields of loyalty card"
              },
              "auxilaryFields":{
                 "$schema":"http://json-schema.org/draft-04/schema#",
                 "title":"localized",
                 "oneOf":[
                    {
                       "$ref":"fieldCards",
                       "description":"value of property in default language"
                    },
                    {
                       "type":"object",
                       "description":"value of property in specific language",
                       "additionalProperties":{
                          "$ref":"fieldCards"
                       }
                    }
                 ],
                 "description":"Auxiliary fields of loyalty card"
              },
              "logoText":{
                 "type":"string"
              },
              "foregroundColor":{
                 "type":"string"
              },
              "labelColor":{
                 "type":"string"
              }
           },
           "required":[
              "bgColor",
              "barcodeType",
              "logoText"
           ]
        },
        "googleLoyaltyCard":{
           "$schema":"http://json-schema.org/draft-04/schema#",
           "title":"Google Loyalty Card Template",
           "type":"object",
           "properties":{
              "className":{
                 "type":"string"
              },
              "issuerName":{
                 "type":"string"
              },
              "programLogo":{
                 "type":"string"
              },
              "programName":{
                 "type":"string"
              },
              "reviewStatus":{
                 "enum":[
                    "approved",
                    "draft",
                    "rejected",
                    "underReview"
                 ]
              },
              "validTimeInterval":{
                 "type":"string"
              },
              "hexFontColor":{
                 "type":"string"
              },
              "hexBackgroundColor":{
                 "type":"string"
              }
           },
           "required":[
              "className",
              "issuerName",
              "programName",
              "reviewStatus",
              "programLogo"
           ]
        }
     },
     "required":[
        "tierId",
        "termsAndConditions",
        "status"
     ]
    }
    
  • Example:
    {
     "termsAndConditions":{
        "en":"T and C",
        "de":"T and C De",
        "ja":"T and C Ja"
     },
     "templateId":"788ec0881e9d4fe9a482ca67032b999c",
     "templateName":"Diwali Offer Template",
     "status":"ACTIVE",
     "createdBy":"prateek.shastri@sap.com",
     "updatedBy":"prateek.shastri@sap.com",
     "googleCouponTemplate":{
        "id":"788ec0881e9d4fe9a482ca67032b999c",
        "details":"This template is for Diwali Offer",
        "provider":"Diwali Offer",
        "title":"Diwali Offer Template",
        "issuerName":"Felton",
        "redemptionChannel":"both",
        "reviewStatus":"DRAFT",
        "validTimeInterval":{
           "end":"2016-08-29T18:30:00.000Z"
        },
        "infoModuleObject":{
           "hexFontColor":"#292323",
           "hexBackgroundColor":"#f05656"
        },
        "imageModuleData":{
           "uri":"https://api.stage.yaas.io/hybris/media/v2/public/files/578731e4f071a4001d993e12"
        }
     },
     "appleCouponTemplate":{
        "bgColor":"#4484b3",
        "barcodeType":"AZTEC",
        "headerFields":{
           "en":[
              {
                 "fieldName":"VALID_TO",
                 "label":"Valid To",
                 "position":0
              }
           ],
           "de":[
              {
                 "fieldName":"VALID_TO",
                 "label":"Valid To de",
                 "position":0
              }
           ],
           "ja":[
              {
                 "fieldName":"VALID_TO",
                 "label":"Valid To ja",
                 "position":0
              }
           ]
        },
        "primaryFields":{
           "en":[
              {
                 "fieldName":"OFFER_CODE",
                 "label":"Offer Code",
                 "position":0
              }
           ],
           "de":[
              {
                 "fieldName":"OFFER_CODE",
                 "label":"Offer Code de",
                 "position":0
              }
           ],
           "ja":[
              {
                 "fieldName":"OFFER_CODE",
                 "label":"Offer Code ja",
                 "position":0
              }
           ]
        },
        "auxilaryFields":{
           "en":[
              {
                 "fieldName":"OFFER_NAME",
                 "label":"Offer Name",
                 "position":0
              }
           ],
           "de":[
              {
                 "fieldName":"OFFER_NAME",
                 "label":"Offer Name de",
                 "position":0
              }
           ],
           "ja":[
              {
                 "fieldName":"OFFER_NAME",
                 "label":"Offer Name ja",
                 "position":0
              }
           ]
        },
        "logoText":"OFFER_DESCRIPTION",
        "foregroundColor":"#050505",
        "labelColor":"#e0c1c1",
        "logo":"https://api.stage.yaas.io/hybris/media/v2/public/files/578731e352a7d8001df27b07",
        "stripImage":"https://api.stage.yaas.io/hybris/media/v2/public/files/578731e3f071a4001d993e11"
     }
    }
    

Response

  • Status Code: 200

 


  • Send feedback

    If you find any information that is unclear or incorrect, please let us know so that we can improve the Dev Portal content.

  • Get Help

    Use our private help channel. Receive updates over email and contact our specialists directly.

  • hybris Experts

    If you need more information about this topic, visit hybris Experts to post your own question and interact with our community and experts.