Contents

POST [/instances/$INSTANCE]/private/templates#

This is used to create a template.

Required permission: templates-write

Request:

The request must be a TemplateCreateRequest.

Response:

204 No content:

The creation of the template is successful.

400 Bad Request:

The request body is malformed. Returned with TALER_EC_GENERIC_PARAMETER_MALFORMED.

404 Not found:

The merchant instance or OTP device is unknown. Returned with TALER_EC_MERCHANT_GENERIC_OTP_DEVICE_UNKNOWN.

409 Conflict:

A template with this ID already exists. Returned with TALER_EC_MERCHANT_PRIVATE_POST_TEMPLATES_CONFLICT_TEMPLATE_EXISTS.

413 Request entity too large:

The uploaded body is to long, it exceeds the size limit. Returned with an error code of TALER_EC_GENERIC_UPLOAD_EXCEEDS_LIMIT.

500 Internal Server Error:

The server experienced an internal failure. Returned with TALER_EC_GENERIC_DB_STORE_FAILED or TALER_EC_GENERIC_DB_FETCH_FAILED.

Details:

interface TemplateCreateRequest {

  // Template ID to use.
  template_id: string;

  // Human-readable description for the template.
  template_description: string;

  // OTP device ID.
  // This parameter is optional.
  otp_id?: string;

  // Fixed contract information for orders created from
  // this template.
  template_contract: TemplateContractDetails;

  // Key-value pairs matching a subset of the
  // fields from template_contract that are
  // user-editable defaults for this template.
  // Since protocol **v13**.
  editable_defaults?: Object;
}