Module

resources/order-recipients

Orders Recipients resources

View Source resources/order-recipients.js, line 1

View Source resources/personalization.js, line 1

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:

View Source resources/order-recipients.js, line 117

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:

View Source resources/order-recipients.js, line 170

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

View Source resources/order-recipients.js, line 214

# inner Personalization(programCode) → {*}

Parameters:
Name Type Description
programCode string

pangea program code

View Source resources/personalization.js, line 20

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:

View Source resources/order-recipients.js, line 75

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)

View Source resources/order-recipients.js, line 263

# 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.

View Source resources/order-recipients.js, line 126

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 GetSummaryFunc payload).

callback module:api~requestCallback

Callback that handles the response.

View Source resources/order-recipients.js, line 185

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. en-CA, en-US

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

View Source resources/order-recipients.js, line 247

# 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

View Source resources/order-recipients.js, line 96

# 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

View Source resources/order-recipients.js, line 276

Personalization resources

View Source resources/order-recipients.js, line 1

View Source resources/personalization.js, line 1

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:

View Source resources/order-recipients.js, line 117

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:

View Source resources/order-recipients.js, line 170

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

View Source resources/order-recipients.js, line 214

# inner Personalization(programCode) → {*}

Parameters:
Name Type Description
programCode string

pangea program code

View Source resources/personalization.js, line 20

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:

View Source resources/order-recipients.js, line 75

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)

View Source resources/order-recipients.js, line 263

# 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.

View Source resources/order-recipients.js, line 126

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 GetSummaryFunc payload).

callback module:api~requestCallback

Callback that handles the response.

View Source resources/order-recipients.js, line 185

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. en-CA, en-US

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

View Source resources/order-recipients.js, line 247

# 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

View Source resources/order-recipients.js, line 96

# 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

View Source resources/order-recipients.js, line 276