# Quick Start Guide source: https://developer.mastercard.com/traditional-fulfillment-service/documentation/quick-start-guide/index.md ## Quick Start Guide {#quick-start-guide} This is the starting point for the Loyalty Traditional Fulfillment Service. Follow the six steps below in order to go from a new Mastercard Developers account to a first successful call against the Sandbox environment. Most developers complete this in about 5 minutes once their project exists. ## Before You Begin {#before-you-begin} Confirm each prerequisite before you start: * A Mastercard Developers account. * A project that uses the **Mastercard Loyalty Management** API. See [Create a Sandbox Project](https://developer.mastercard.com/traditional-fulfillment-service/documentation/tutorials-and-guides/sandbox-access-tutorial/index.md). * The Sandbox `.p12` keystore file downloaded from that project. * The keystore password and key alias shown when the keystore was created. * Your Sandbox consumer key, also called the Client ID. * A `program_id` for the rewards program you are testing. Your Mastercard representative provides this value. * A REST client such as curl or [Postman](https://developer.mastercard.com/traditional-fulfillment-service/documentation/postman-collection/index.md). Note: Your Client ID must be registered by the Mastercard Customer Implementation Services team before calls succeed. Step 1 covers this. ## Step 1: Get Access {#step-1-get-access} 1. Sign in to [My Projects](https://developer.mastercard.com/dashboard) and create a project. 2. Select **Mastercard Loyalty Management** from the **Choose API** list. 3. Copy your Sandbox consumer key and send the Client ID to your Mastercard Product Delivery or CIS Implementation Manager. Full screenshots for this step are in [Create a Sandbox Project](https://developer.mastercard.com/traditional-fulfillment-service/documentation/tutorials-and-guides/sandbox-access-tutorial/index.md). ## Step 2: Get Your Credentials {#step-2-get-your-credentials} 1. Download the **PKCS#12 Keystore** zip file from the project page. 2. Extract the `.p12` file and store it with your application resources. 3. Record the keystore password and the key alias. You cannot retrieve them later. ## Step 3: Select Your Environment {#step-3-select-your-environment} Use Sandbox for this first call. The base URL for each environment is listed in [API Basics](https://developer.mastercard.com/traditional-fulfillment-service/documentation/api-basics/index.md). | **Environment** | **Base URL** | |-----------------|------------------------------------------------------| | Sandbox | `https://sandbox.api.mastercard.com/loyalty/rewards` | ## Step 4: Set Up Authentication {#step-4-set-up-authentication} Loyalty Traditional Fulfillment Service uses OAuth 1.0a. Every request needs an `Authorization` header signed with your private key. 1. Add a Mastercard [OAuth1 signer library](https://github.com/Mastercard?utf8=%E2%9C%93&q=oauth1-signer&type=&language=) for your language. 2. Load the signing key from your `.p12` file using the keystore password and key alias. 3. Let the library build the `Authorization` header for each request. For the full explanation, see [Using OAuth 1.0a to Access Mastercard APIs](https://developer.mastercard.com/platform/documentation/security-and-authentication/using-oauth-1a-to-access-mastercard-apis/). All calls must use HTTPS with TLS 1.2 or higher. ## Step 5: Make Your First Sandbox Call {#step-5-make-your-first-sandbox-call} Retrieve the reward catalogs for your program. Replace `program_id` with your value and paste the signed header your signer library produced. ```bash curl --request GET \ --url 'https://sandbox.api.mastercard.com/loyalty/rewards/catalogs?program_id=49631' \ --header 'Accept: application/json' \ --header 'Authorization: OAuth oauth_consumer_key="YOUR_CONSUMER_KEY",oauth_nonce="YOUR_NONCE",oauth_signature="YOUR_GENERATED_SIGNATURE",oauth_signature_method="RSA-SHA256",oauth_timestamp="YOUR_TIMESTAMP",oauth_version="1.0"' ``` To run the same request without writing code, fork the collection on the [Postman Collection](https://developer.mastercard.com/traditional-fulfillment-service/documentation/postman-collection/index.md) page. ## Step 6: Confirm What Success Looks Like {#step-6-confirm-what-success-looks-like} A successful call returns HTTP `200` and a `catalogs` array. Each entry is one level of the program catalog hierarchy. ```json { "catalogs": [ { "id": 8032, "name": "Gift Cards", "imageURL": "https://www.loyaltygateway.com/rewards/ImageDisplayServlet?file=/apps_01/mcrewards_content/Catalog/en_US/categories/noimage.jpg", "parentCatalogId": 7991, "hasRewardItems": true } ] } ``` Check your result against this table: | **Status** | **Meaning** | **What to do** | |------------|-----------------------------------------------|----------------------------------------------------------------------------------------------| | `200` | The call succeeded. | Note an `id` where `hasRewardItems` is `true`. You need it to retrieve items. | | `400` | A required parameter is missing or invalid. | Confirm `program_id` is present and numeric. | | `401` | The Client ID is not entitled to the service. | Confirm the CIS team registered your Client ID, and confirm you signed with the Sandbox key. | For every reason code and its resolution steps, see [Code and Formats](https://developer.mastercard.com/traditional-fulfillment-service/documentation/code-and-formats/index.md). ## Next Steps {#next-steps} * Retrieve the rewards inside a catalog with the [Retrieve Items](https://developer.mastercard.com/traditional-fulfillment-service/documentation/use-cases/retrieve-items/index.md) use case. * Run the full set of positive and negative test cases in [Testing](https://developer.mastercard.com/traditional-fulfillment-service/documentation/tutorials-and-guides/api-testing-tutorial/index.md). * Review every operation in the [API Reference](https://developer.mastercard.com/traditional-fulfillment-service/documentation/api-reference/index.md). * When your integration is ready, follow [Move Project to Production](https://developer.mastercard.com/traditional-fulfillment-service/documentation/tutorials-and-guides/production-access-tutorial/index.md) for the promotion workflow, timeframes, and escalation contacts.