Orders Recipients resources
- Copyright:
- 2015–2020 RewardOps Inc.
- Copyright:
- 2015–2023 RewardOps Inc.
Methods
# inner createOrderWithPiiStorage(orderContext) → {module:resources/order-recipients~CreateOrderWithPiiStorageFunc}
Higher order function for creating an order that first stores geographic-specific PII information, in context.
Parameters:
Name | Type | Description |
---|---|---|
orderContext |
module:resources/order-recipients~V5OrderContext
|
Order context object |
- See:
Create an order function that also stores geographic-specific PII information.
# inner getOrderRecipient(v5OrderContext) → {module:resources/order-recipients~GetOrderRecipientFunc}
Higher order function for fetching an order recipient in context.
NOTE: This is a v5 API endpoint, therefore ignores the apiVersion
config prop
Parameters:
Name | Type | Description |
---|---|---|
v5OrderContext |
module:resources/order-recipients~V5OrderContext
|
Order context object |
- See:
-
module:resources/order-recipients~GetOrderRecipientFunc
for examples.
create
order function in context
# protected inner orderRecipientFactory(contextTypeName, contextId, programCode) → {module:resources/orders~OrderRecipients}
Factory for creating orderRecipients
methods.
Parameters:
Name | Type | Description |
---|---|---|
contextTypeName |
string
|
The type of the parent context ('programs') |
contextId |
number
|
The ID of the order's parent program |
programCode |
string
|
The Code of the order's parent program |
Orders object
# inner Personalization(programCode) → {*}
Parameters:
Name | Type | Description |
---|---|---|
programCode |
string
|
pangea program code |
registerMemberTags function
*
# protected inner storeOrderRecipient(v5OrderContext) → {module:resources/order-recipients~StoreOrderRecipientFunc}
Higher order function for creating an order recipient in context.
NOTE: This is a v5 API endpoint, therefore ignores the apiVersion
Config
property.
Parameters:
Name | Type | Description |
---|---|---|
v5OrderContext |
module:resources/order-recipients~V5OrderContext
|
Order context object |
- See:
create
order function in context
Type Definitions
# AddressModelSchema
RewardOps Address model schema
Properties:
Name | Type | Description |
---|---|---|
address |
string
|
Street address |
address_2 |
string
|
Street address - 2 |
city |
string
|
City |
country_code |
string
|
Country code - ISO 3166-1 alpha-2 |
country_subregion_code |
string
|
Country subdivision code - ISO 3166-2 alpha-2 (State/Province) |
postal_code |
string
|
Postal code (ZIP code) |
# CreateOrderWithPiiStorageFunc
Create order function that makes a call to store geographic-specific PII information, then creates a new order along with the order recipient code generated from the first call.
Example
// Create new order for a program that has geographic-specific PII storage enabled.
// NOTE: Notice the second `'example_program_code'` argument on the `RO.program` method.
const program = RO.program(12, 'example_program_code');
program.order.create(
{
reward_id: 45231,
member: {
id: 'jb0987',
full_name: 'Jolanta Banicki',
email: 'jolanta.b@example.com',
},
},
(error, responseBody, response) => {
if (error) {
console.log(error);
} else {
console.log(result);
}
}
);
# GetOrderRecipientFunc
Fetch order recipient function.
Properties:
Name | Type | Description |
---|---|---|
orderRecipientCode |
string
|
Order recipient code (e.g., from a
|
callback |
module:api~requestCallback
|
Callback that handles the response. |
Example
// Used in the context of a program
const orderRecipient = ro.program(12, 'example_program_code').getOrderRecipient(
'poiuytr123456',
(undefined, responseBody, response) => {
console.log(result);
});
# MemberPiiRequestBody
Request body payload for Member PII information.
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
id |
string
|
Member ID |
|
accept_language |
string
|
The member's preferred locale, in the format of Accept-Language
as per RFC2616; e.g. |
|
gift |
string
|
<optional> |
Is the order a gift? |
full_name |
string
|
<optional> |
Full name |
ip_address |
string
|
<optional> |
IP address |
email |
string
|
<optional> |
Email address |
phone |
string
|
<optional> |
Phone number |
address |
module:resources/order-recipients~AddressModelSchema
|
<optional> |
Address |
# StoreOrderRecipientFunc
Store order recipient function that makes a call to store data for geographic-specific PII storage-enabled programs.
Properties:
Name | Type | Description |
---|---|---|
member |
module:resources/order-recipients~MemberPiiRequestBody
|
Member PII information |
# V5OrderContext
Order options object
Properties:
Name | Type | Description |
---|---|---|
contextTypeName |
string
|
The type of the parent context ('programs') |
contextId |
number
|
The ID of the order's parent program |
programCode |
string
|
The Code of the order's parent program |