# Giftcertificate

An object representing a gift certificate.

# Properties

Property Type Description
uid integer The unique identifier of the gift certificate.
code string The code that a customer would use to pay with the gift certificate at checkout.
ordernr integer An order uid
webshop integer The uid of the webshop that has the gift certificate.
article integer
article_name string
to string The receiver's name.
to_email string The receiver's email address.
from string The sender's name.
from_email string The sender's email address.
originalValue number The original value of the gift certificate.
remainingValue number The current remaining value of the gift certificate.
expiredate string The date and time for when the gift certificate expires.
currency string The currency for the value.
created string Date and time of twhen the gift certificate was created.
cancelled boolean Whether this gift certificate is cancelled.

# Methods

# generateCode

Generates a code for a gift certificate.

# Example

Giftcertificate.generateCode()

# get

Fetches information about a gift certificate.

# Parameters

Parameter Description
uid The unique identifier of a gift certificate.
query Which info to return. See Query language.

# getSchema

Fetches the JSON Schema which can be used for client-side validation.

# Parameters

The unique identifier of a gift certificate or null for a new instance.

# set

Creates or updates a gift certificate.

info

Note that originalValue must appear before remainingValue in the object, otherwise a validation error will be thrown.

# Example

Giftcertificate.set(null, {
  "to": "Receiver",
  "to_email": "receiver@example.com",
  "from": "Sender",
  "from_email": "sender@example.com",
  "code": "1630632412583",
  "expiredate": "2015-05-29",
  "currency": "EUR",
  "originalValue": 600,
  "remainingValue": 600
}, true)