Module

resources/programs

Programs resources

View Source resources/programs.js, line 1

Members

object

# inner constant programs

A program-specific context type object with getAll and get methods.

NOTE: Response may be paginated if you have many programs.

See:

View Source resources/programs.js, line 37

Example
// Get a list of all programs available to you.
RO.programs.getAll((error, responseBody, response) => {
  if (error) {
    console.log(error);
  } else {
    console.log(result);
  }
});

Methods

# inner program(id, code) → {object}

Get details of a program.

The program object has methods for accessing the program's rewards and orders.

Parameters:
Name Type Description
id number

The ID of a program

code string

v5 uses program_code instead of program_id

View Source resources/programs.js, line 60

A program object for the program with the given ID

object
Example
// Get details for program 123
const myProgram = RO.program(123);
myProgram.details((error, responseBody, response) => {
  if (error) {
    console.log(error);
  } else {
    console.log(result);
  }
});