Store credit payment properties

When the Generic Payment webhook executes, it sends a JSON request body to the payment gateway.

The request body contains information about the order, the method of payment, and the type of transaction being initiated. The gateway processes the request and returns a JSON response body that contains information about the results of the transaction, including whether the transaction succeeded.

The set of properties in the request and response bodies, including the subobjects, vary depending on the type of transaction. For store credit gateways, there are four transaction types supported: authorize, void, refund, and balance inquiry.

Store credit payment request properties

This section describes the top-level properties and the properties of subobjects sent in the JSON request body of the Generic Payment webhook for store credit transactions. Note that if the includeOrderInWebhookPayload property in the gateway extension's config.json file is set to true, the order is also included in the request. See Order Submit webhook for information about the order properties.

Top-level properties

The following table describes the top-level properties that Oracle Commerce sends in the webhook request.

Property Description
transactionType

A code indicating the type of transaction. This must be one of the following numeric values:

0100 (authorize)
0110 (void)
0400 (refund)
0600 (balance inquiry)
channel

The area of the system where the payment-processing request originated. Valid values are:

storefront
agent
preview
orderId The ID of the order associated with the transaction.
currencyCode The ISO 4217 currency code.
locale The shopper’s locale, taken from the order. If no locale is set, the default locale from the storefront is used.
customProperties Additional key/value pairs to be sent to the payment provider.
siteURL The URL of the site on which the order was placed.
siteId The ID of the site on which the order was placed.
retryPaymentCount The number of times payment has been retried for the order.

paymentRequests properties

The following table describes the properties of paymentRequests objects that Oracle Commerce sends in the webhook request.

Property Description
paymentId The ID of the internal payment group.
transactionId The unique ID of the transaction. Consists of the order ID, the payment ID, and the transaction timestamp (in milliseconds), separated by hyphens.
transactionTimestamp

The timestamp of the transaction, expressed as an ISO 8601 value in the following format:

yyyy-MM-dd'T'HH:mm:ssZ

paymentMethod The payment method. For store credit, the value is storeCredit.
amount The expected amount of the transaction. The value of this property is a positive, 12-digit number that is expressed in base currency. For example, $125.75 is represented as 000000012575.
gatewayId The ID of the payment gateway.
customProperties Additional key/value pairs from the submitted order to be sent to the provider.

profile properties

The following table describes the properties of the profile object included in the request. These values are associated with the shopper purchasing the order.

Property Description
id The Commerce ID of the shopper profile
phoneNumber The phone number from the shopper profile
email The email address from the shopper profile
dynamicProperties The shopper profile dynamic properties if configured

profileDetails properties

The following table describes the properties of the profileDetails object in the request. These values are associated with the customer purchasing the order.

Property Description
id The ID of the customer profile
lastName The last name of the customer profile
firstName The first name of the customer profile
middleName The middle name of the customer profile
email The email address from the customer profile
taxExempt Indicates whether the customer tax-exempt status; either true or false
taxExemptionCode For a customer with tax-exempt status, the exemption code
profileType The type of profile; either b2c_user or b2b_user
receiveEmail Indicates whether the customer agrees to receive email; either yes or no
registrationDate

The timestamp of when the profile was created, expressed as an ISO 8601 value in the following format:

yyyy-MM-dd'T'HH:mm:ssZ

lastPasswordUpdate

The timestamp of when the password for the profile was last updated, expressed as an ISO 8601 value in the following format:

yyyy-MM-dd'T'HH:mm:ssZ

storeCredit properties

The following table describes the property of the storeCredit objects sent in an authorization request or balance inquiry.

Property Description
storeCreditNumber The number that uniquely identifies the store credit. For balance inquiries, if a store credit number is passed in the request, the amount specific to that store credit is sent back. Otherwise, all the store credits associated with the shopper profile are sent back.

referenceInfos properties

The following table describes the properties of the referenceInfos objects sent in a void request or refund request. The values of these properties are taken from the original authorization transaction so the merchant can map the void or refund to it.

Property Description
merchantTransactionId The transaction reference ID from the merchant.
hostTransactionId The transaction reference ID from the payment gateway.

billingAddress properties

The following table describes the properties of the billingAddress object in an authorization request. The billing address is the address of the shopper to whom the order is charged.

Property Description
lastName The last name of the shopper.
postalCode The postal code in the address (for example, the zip code in the United States).
phoneNumber The phone number associated with the address.
email The email address associated with the address.
state The state in the address.
address1 The first line of the address. Typically the street and number.
address2 The second line of the address. Included as an empty string in the JSON data if no value exists in the order.
firstName The first name of the shopper.
city The city in the address.
country The country in the address.

shippingAddress properties

The following table describes the properties of the shippingAddress object in a request. The shipping address is the address of the person (not necessarily the shopper) receiving the order.

Property Description
lastName The last name of the order recipient.
postalCode The postal code in the address (for example, the zip code in the United States).
phoneNumber The phone number associated with the address.
email The email address associate with the address.
state The state in the address.
address1 The first line of the address. Typically the street and number.
address2 The second line of the address. Included as an empty string in the JSON data if no value exists in the order.
firstName The first name of the order recipient.
city The city in the address.
country The country in the address.

Sample balance inquiry request

The following is an example of a store credit balance inquiry request:

{
  "orderId": "o78615",
  "profile": {
    "phoneNumber": "617-555-1977",
    "id": "se-570031",
    "email": "john@example.com"
    "dynamicProperties": [
      {
        "label": "Nickname",
        "id": "field1",
        "value": "Jack"
      }
    ]
},
  "channel": "agent",
  "locale": "en",
  "transactionId": "f4dd73a8-d722-407d-9d9d-e9db11a68ace-00e09e08-171e-4a83-8e75-96132ad61166-1509528103666",
  "transactionTimestamp": "2018-01-06T09:21:43+0000",
  "transactionType": "0600",
  "customProperties": null,
  "paymentId": "00e09e08-171e-4a83-8e75-96132ad61166",
  "gatewaySettings": {
    "paymentMethodTypes": "storeCredit"
  },
  "paymentMethod": "storeCredit",
  "shippingAddress": null,
  "siteId": "siteUS",
  "currencyCode": "USD",
  "gatewayId": "storeCreditPaymentGateway"
}

Sample authorization request

The following is an example of a store credit authorization request:

{
  "amount": "000000007490",
  "orderId": "o150425",
  "profile": {
    "phoneNumber": "617-555-1977",
    "id": "se-570031",
    "email": "john@example.com"
    "dynamicProperties": [
      {
        "label": "Nickname",
        "id": "field1",
        "value": "Jack"
      }
    ]
  },
  "profileDetails": {
       "id": "se-570031",
       "lastName": "Shopper",
       "firstName": "John",
       "taxExempt": false,
       "profileType": "b2c_user",
       "receiveEmail": "no",
       "registrationDate": "2019-10-15T06:50:51.000Z",
       "lastPasswordUpdate": "2019-10-15T06:50:51.000Z",
  }
  "channel": "agent",
  "locale": "en",
  "siteURL": "https://www.example.com",
  "transactionId": "o150425-pg150422-1509433854097",
  "transactionTimestamp": "2019-12-07T07:10:54+0000",
  "transactionType": "0100",
  "paymentId": "pg150422",
  "gatewaySettings": {
    "paymentMethodTypes": "storeCredit"
  },
  "paymentMethod": "storeCredit",
  "shippingAddress": {
    "lastName": "Niel",
    "country": "US",
    "firstName": "John",
    "phoneNumber": "617-555-1977",
    "address2": null,
    "city": "Cambridge",
    "address1": "1 Main St",
    "postalCode": "02142",
    "state": "MA",
    "email": "john@example.com"
  },
  "siteId": "siteUS",
  "billingAddress": {
    "country": "US",
    "lastName": "Niel",
    "firstName": "John",
    "phoneNumber": "617-555-1977",
    "city": "San Francisco",
    "address1": "1 Elm St",
    "postalCode": "91333",
    "state": "CA",
    "email": "john.niel@gmail.com"
  },
  "retryPaymentCount": 0,
  "currencyCode": "USD",
  "gatewayId": "storeCreditPaymentGateway"
}

Store credit payment response properties

This section describes the top-level properties and the properties of subobjects that should be returned in the response body of the Generic Payment webhook for store credit transactions.

Top-level properties

The following table describes the top-level properties that should be returned in the response body of the Generic Payment webhook for store credit transactions.

Property Description
transactionType

A code indicating the type of transaction. This must be one of the following numeric values, and is expected to match the value in the request:

0100 (authorize)
0110 (void)
0400 (refund)
0600 (balance inquiry)
currencyCode The ISO 4217 currency code. This is expected to match the value in the request.
locale The shopper’s locale. This is expected to match the value in the request.
channel The area of the system where the payment-processing request originated. This is expected to match the value in the request.
orderId The ID of the order associated with the payment. This is expected to match the value in the request.
siteId The ID of the site on which the order was placed. Must match the value from the request.

authorizationResponse, voidResponse, creditResponse, and inquireBalanceResponse properties

The following table describes the properties of the authorizationResponse, voidResponse, creditResponse, or inquireBalanceResponse object in the webhook response. Only one of these objects is included in each response (the object corresponding to the transaction type; for example, a voidResponse object for a void transaction). All of these object types require the same set of properties. The values of these properties indicate the results of the transaction.

Property Description
totalAvailableAmount The total amount available in all store credits
responseCode

The decision from the payment provider as interpreted by the merchant. The acceptable values depend on the transaction type. For an authorization request, the code must be one of the following values:

1000 (success)
4000 (sale complete)
9000 (decline)

For a void request, the code must be one of the following values:

2000 (success)
8000 (decline)

For a credit (refund) request, the code must be one of the following values:

3000 (success)
7000 (decline)

For a balance inquiry, the code must be one of the following values:

5000 (success)
6000 (decline)
responseDescription Information from the payment gateway about the response.
responseReason Information about why the transaction succeeded or failed.
hostTransactionId The transaction reference ID from the payment gateway.
merchantTransactionId The transaction reference ID from the merchant.
paymentId The ID of the internal payment group. Must match the value from the request.
transactionId The unique ID of the transaction. Consists of the order ID, the payment ID, and the transaction timestamp (in milliseconds), separated by hyphens. Must match the value from the request.
transactionTimestamp

The timestamp of the transaction in Oracle Commerce, expressed as an ISO 8601 value in the following format:

yyyy-MM-dd'T'HH:mm:ssZ

Must match the value from the request.

paymentMethod The payment method. Must match the value from the request. For store credit, the value is storeCredit.
amount

The actual amount of the transaction. This may differ from the amount in the request.

The value of this property is a positive, 12-digit number that is expressed in base currency. For example, $125.75 is represented as 000000012575.

merchantTransactionTimeStamp The timestamp of the transaction from the merchant (in milliseconds).
hostTransactionTimeStamp The timestamp of the transaction from the gateway (in milliseconds).
additionalProperties Key/value pairs for additional properties sent by the merchant.
customPaymentProperties Keys from the additionalProperties.
storeCredits Store credit details of the shopper profile.

storeCredit properties

The following table describes the properties of the objects in the storeCredits array.

Property Description
storeCreditNumber The number that uniquely identifies the store credit.
availableAmount Amount available in each store credit

Sample balance inquiry response

The following is an example of a response to a store credit balance inquiry request:

{
  "totalAvailableAmount": "500",
  "transactionType": "0600",
  "orderId": "o78615",
  "paymentId": "00e09e08-171e-4a83-8e75-96132ad61166",
  "channel": "agent",
  "paymentMethod": "storeCredit",
  "siteId": "siteUS",
  "locale": "en",
  "inquireBalanceResponse": {
    "hostTransactionTimestamp": "1509528105863",
    "responseReason": "inquireBalanceResponseReason",
    "storeCredits": [
      {
        "storeCreditNumber": "4123654789",
        "availableAamount": "100"
      },
      {
        "storeCreditNumber": "4123654790",
        "availableAamount": "200"
      },
      {
        "storeCreditNumber": "4123654791",
        "availableAamount": "200"
     }
],
    "customPaymentProperties": [
      "5000addnl-property-key5",
      "5000addnl-property-key2"
    ],
    "responseDescription": "inquireBalanceResponseDescription",
    "merchantTransactionId": "MERCH-TX-1509528105863",
    "hostTransactionId": "HOST-TX-1509528105863",
    "additionalProperties": {
      "5000addnl-property-key5": "5000payment-property-value5",
      "5000addnl-property-key4": "5000payment-property-value4",
      "5000addnl-property-key3": "5000payment-property-value3",
      "5000addnl-property-key2": "5000payment-property-value2",
      "5000addnl-property-key1": "5000payment-property-value1",
    },
    "responseCode": "5000",
    "merchantTransactionTimestamp": "1509528105863"
  },
  "currencyCode": "USD",
  "transactionId": "f4dd73a8-d722-407d-9d9d-e9db11a68ace-00e09e08-171e-4a83-8e75-96132ad61166-1509528103666",
  "transactionTimestamp": "2018-01-06T09:55:22+0000",
  "gatewayId": "storeCreditPaymentGateway"
}

Sample authorization response

The following is an example of a response to a store credit authorization request:

{
  "amount": "000000007490",
  "orderId": "o150425",
  "channel": "agent",
  "authorizationResponse": {
    "hostTransactionTimestamp": "1509433854723",
    "responseReason": "authResponseReason",
    "responseDescription": "authResponseDescription",
    "merchantTransactionId": "MERCH-TX-1509433854723",
    "hostTransactionId": "HOST-TX-1509433854723",
    "additionalProperties": {
      "1000addnl-property-key5": "1000payment-property-value5",
      "1000addnl-property-key4": "1000payment-property-value4",
      "1000addnl-property-key1": "1000payment-property-value1",
      "1000addnl-property-key3": "1000payment-property-value3",
      "1000addnl-property-key2": "1000payment-property-value2",
    },
    "responseCode": "1000",
    "merchantTransactionTimestamp": "1509433854723"
  },
  "locale": "en",
  "transactionId": "o150425-pg150422-1509433854097",
  "transactionTimestamp": "2018-01-06T09:47:48+0000",
  "transactionType": "0100",
  "paymentId": "pg150422",
  "paymentMethod": "storeCredit",
  "siteId": "siteUS",
  "currencyCode": "USD",
  "gatewayId": "storeCreditPaymentGateway"
}