Module: resources/order-recipients

Orders Recipients resources

Source:
Source:

Methods

(inner) Personalization(programCode) → {*}

Parameters:
Name Type Description
programCode string

pangea program code

Source:
Returns:

registerMemberTags function

Type
*

(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

Source:
See:
Returns:

Create an order function that also stores geographic-specific PII information.

Type
module:resources/order-recipients~CreateOrderWithPiiStorageFunc

(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

Source:
See:
Returns:

create order function in context

Type
module:resources/order-recipients~GetOrderRecipientFunc

(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

Source:
Returns:

Orders object

Type
module:resources/orders~OrderRecipients

(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

Source:
See:
Returns:

create order function in context

Type
module:resources/order-recipients~StoreOrderRecipientFunc

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)

Source:

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.

Source:
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.

Source:
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

Source:

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

Source:

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

Source:

Personalization resources

Source:
Source:

Methods

(inner) Personalization(programCode) → {*}

Parameters:
Name Type Description
programCode string

pangea program code

Source:
Returns:

registerMemberTags function

Type
*

(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

Source:
See:
Returns:

Create an order function that also stores geographic-specific PII information.

Type
module:resources/order-recipients~CreateOrderWithPiiStorageFunc

(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

Source:
See:
Returns:

create order function in context

Type
module:resources/order-recipients~GetOrderRecipientFunc

(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

Source:
Returns:

Orders object

Type
module:resources/orders~OrderRecipients

(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

Source:
See:
Returns:

create order function in context

Type
module:resources/order-recipients~StoreOrderRecipientFunc

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)

Source:

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.

Source:
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.

Source:
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

Source:

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

Source:

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

Source: