OSID Logo
OSID Specifications
billing batch package
Version 3.0.0
Release Candidate Preview
Interfaceosid.billing.batch.CustomerBatchAdminSession
Implementsosid.billing.CustomerAdminSession
Description

This session creates, updates, and deletes Customers in bulk. The data for create and update is provided by the consumer via the form object. OsidForms are requested for each create or update and may not be reused.

Create and update operations differ in their usage. To create a Customer, a CustomerForm is requested using getCustomerFormsForCreate() specifying the resource and desired record Types or none if no record Types are needed. Each of the returned CustomerForms will indicate that it is to be used with a create operation and can be used to examine metdata or validate data prior to creation. Once a CustomerForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each CustomerForm corresponds to an attempted transaction.

The CustomerForms returned from getCustomerFormsForCreate() may be linked to the originating request through the peer Ids of the CustomerForm. In the case where there may be duplicates, any CustomerForm of the same peer Ids may be used for a create operation.

Once a batch of CustomerForms are submitted for create, a CreateResponse is returned for each CustomerForm, although the ordering is not defined. Only errors that pertain to the entire create operation are returned from createCustomers(), errors specific to an individual CustomerForm are indicated in the corresponding CreateResponse. CreateResponses may be linked to the originating CustomerForm through the CustomerForm Id .

For updates, CustomerForms are requested to the Customer Id that is to be updated using getCustomerFormsForUpdate() where the reference Id in the CustomerForm may be used to link the request. Similarly, the CustomerForm has metadata about the data that can be updated and it can perform validation before submitting the update. The CustomerForm can only be used once for a successful update and cannot be reused.

Once a batch of CustomerForms are submitted for update, an UpdateResponse is returned for each CustomerForm, although the ordering is not defined. Only errors that pertain to the entire update operation are returned from updateCustomers(), errors specific to an individual CustomerForm are indicated in the corresponding UpdateResponse. UpdateResponses may be linked to the originating CustomerForm through the CustomerForm Id.

The delete operations delete Customers in bulk. To unmap a Customer from the current Business, the CustomerBusinessAssignmentSession should be used. These delete operations attempt to remove the Customer itself thus removing it from all known Business catalogs. Bulk delete operations return the results in DeleteResponses.

MethodgetCustomerFormsForCreate
Description

Gets the customer forms for creating a bunch of new customers. A new form is returned for each supplied resource.

Parametersosid.id.IdListresourceIdsa list of resource Ids
osid.type.Type[]customerRecordTypesarray of customer record types to be included in each create operation or an empty list if none
Returnosid.billing.batch.CustomerBatchFormListthe customer forms
ErrorsNOT_FOUNDa resource is not found
NULL_ARGUMENT resourceIds or customerRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to request forms with given record types
CompliancemandatoryThis method must be implemented.
MethodcreateCustomers
Description

Creates a new set of Customers. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in the BatchCreateResponse .

Parametersosid.billing.batch.CustomerBatchFormListcustomerFormsthe customer forms
Returnosid.transaction.batch.CreateResponseListthe create responses
ErrorsNULL_ARGUMENT customerForms is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetCustomerFormsForUpdate
Description

Gets the customer forms for updating an existing set of customers. A new customer form should be requested for each update transaction.

Parametersosid.id.IdListcustomerIdsthe Ids of the Customer
Returnosid.billing.batch.CustomerBatchFormListthe customer form
ErrorsNOT_FOUNDa customerId is not found
NULL_ARGUMENT customerIds is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateCustomers
Description

Updates existing customers. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in the BatchCreateResponse .

Parametersosid.billing.batch.CustomerBatchFormListcustomerFormsthe form containing the elements to be updated
Returnosid.transaction.batch.UpdateResponseListthe update responses
ErrorsNULL_ARGUMENT customerForms is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethoddeleteAllCustomers
Description

Deletes all Customers in this Business .

Returnosid.transaction.batch.DeleteResponseListthe delete responses
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethoddeleteCustomers
Description

Deletes customers for the given Ids.

Parametersosid.id.IdListcustomerIdsthe Ids of the customers to delete
Returnosid.transaction.batch.DeleteResponseListthe delete responses
ErrorsNULL_ARGUMENT customerIds is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethoddeleteCustomersForResource
Description

Deletes customers for the given resource.

Parametersosid.id.IdresourceIdthe Id of a resource
Returnosid.transaction.batch.DeleteResponseListthe delete responses
ErrorsNULL_ARGUMENT customerIds is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethoddeleteIneffectiveCustomersByDate
Description

Deletes customers expired before the given date.

Parametersosid.calendaring.DateTimedatea date
Returnosid.transaction.batch.DeleteResponseListthe delete responses
ErrorsNULL_ARGUMENT date is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodaliasCustomers
Description

Adds an Id to a Customer for the purpose of creating compatibility. The primary Id of the Customer is determined by the provider. The new Id is an alias to the primary Id. If the alias is a pointer to another customer, it is reassigned to the given customer Id.

Parametersosid.transaction.batch.AliasRequestListaliasRequeststhe alias requests
Returnosid.transaction.batch.AliasResponseListthe alias responses
ErrorsNULL_ARGUMENT aliasRequests is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.