> ## Documentation Index
> Fetch the complete documentation index at: https://developer.elliephant.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Place a gifting order



## OpenAPI

````yaml POST /api/gift-link
openapi: 3.0.0
info:
  title: Elliephant API
  version: 1.0.0
  description: With this API you can retrieve products, place orders, and so much more.
servers:
  - url: https://api.elliephant.com
  - url: https://api-sandbox.elliephant.com
security:
  - ClientIdAuth: []
    ApiKeyAuth: []
    ApiPasswordAuth: []
paths:
  /api/gift-link:
    post:
      summary: Place a gifting order
      operationId: placeGiftingOrder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                order_ref_id:
                  type: string
                  description: >-
                    ID generated from your system passed to ours that is the
                    unique reference number for this order.
                product_id:
                  type: integer
                  description: This the product id of the product that you want to gift.
                variation_id:
                  type: integer
                  description: >-
                    The variation id of the product you would like to gift. Only
                    needed if the product is a variable product.
                currency:
                  type: string
                  description: >-
                    The currency you would like to pay in. Sent in [ISO
                    4217](https://en.wikipedia.org/wiki/ISO_4217) format. eg
                    Australian Dollar is AUD.
                base_location:
                  type: string
                  description: >-
                    The country code in [ISO 3166-1
                    alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
                    format. eg AU for Australia.
                gift_of_choice:
                  type: string
                  description: >-
                    An option if you want your user to have an option to choose
                    a different gift as a gift of choice. This is either a `Y`
                    or `N`.
                order_branding:
                  type: string
                  description: >-
                    The type of branding that you are want for your gift link.
                    This is either `elliephant` or `company`. `company` can only
                    be used if your company branding as been set in your company
                    profile.
                recipient_details:
                  type: array
                  description: An array of information about the recipient.
                  items:
                    type: object
                    properties:
                      first_name:
                        type: string
                        description: The first name of your recipient.
                      last_name:
                        type: string
                        description: The last name of your recipient.
                      email:
                        type: string
                        description: The full email address of your recipient.
                      phone_number:
                        type: string
                        description: The phone number of your recipient.
                      delivery_address:
                        type: object
                        description: An array containing the address of the recipient.
                        properties:
                          address_line_1:
                            type: string
                            description: Line 1 of the address field.
                          address_line_2:
                            type: string
                            description: Line 2 of the address field.
                          suburb:
                            type: string
                            description: The suburb or town of the address.
                          state:
                            type: string
                            description: The state or providence of the address.
                          postcode_zipcode:
                            type: string
                            description: The postcode or zipcode of the address.
                          country:
                            type: string
                            description: >-
                              The country of the address as the full country
                              name eg Australia, England, Singapore etc.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    description: >-
                      Detail on if the order was placed successfully. Will
                      either be `success` or `error`
                  order_data:
                    type: array
                    description: An array containing the order values.
                    items:
                      type: object
                      properties:
                        order_id:
                          type: integer
                          description: >-
                            The ID of the order in our system, this is the ID
                            used to get the order details later.
                        order_number:
                          type: string
                          description: >-
                            The order number that is used for reference, this
                            will be in the format EO-00000.
                  order_totals:
                    type: array
                    description: An array containing the order totals.
                    items:
                      type: object
                      properties:
                        currency:
                          type: string
                          description: >-
                            The currency you payed in. Sent in [ISO
                            4217](https://en.wikipedia.org/wiki/ISO_4217)
                            format. eg Australian Dollar is AUD.
                        product_price:
                          type: string
                          description: The price of the product at time of purchase.
                        qty:
                          type: string
                          description: Total amount of items purchased.
                        subtotal:
                          type: string
                          description: >-
                            The subtotal of the order (calculated by the
                            equation `product_price` x `qty`).
                        shipping_cost:
                          type: string
                          description: The cost of the shipping at time of purchase.
                        order_fee:
                          type: string
                          description: The cost of the service fee at the tiem of purchase.
                        order_total:
                          type: string
                          description: >-
                            The total paid for the order (calculated by the
                            equation `subtotal` + `shipping_cost` +
                            `order_fee`).
                  recipient_return:
                    type: array
                    description: An array containing the recipient details.
                    items:
                      type: object
                      properties:
                        suborder_id:
                          type: integer
                          description: >-
                            The id of the order used for identification in our
                            system.
                        suborder_number:
                          type: string
                          description: >-
                            The order number that is used for reference, this
                            will be in the format EO-00000-00.
                        first_name:
                          type: string
                          description: The first name of your recipient.
                        last_name:
                          type: string
                          description: The last name of your recipient.
                        email:
                          type: string
                          description: The full email address of your recipient.
                        gift_url:
                          type: string
                          description: The gifting URL to share with your recipient.
              example:
                status: success
                order_data:
                  order_id: 152
                  order_number: EO-00152
                order_totals:
                  currency: AUD
                  product_price: 110
                  qty: 2
                  shipping_cost: 22
                  subtotal: 242
                  order_fee: 9.68
                  order_total: 251.68
                recipient_return:
                  - suborder_id: 357
                    suborder_number: EO-00152-1
                    first_name: John
                    last_name: Doe
                    email: john.doe@example.com
                    gift_url: >-
                      https://elliephantv2.com/redeem-your-gift/bfb7f903acf87bfea4c9698f3e2a6138
                  - suborder_id: 358
                    suborder_number: EO-00152-2
                    first_name: Jane
                    last_name: Smith
                    email: j.smith@example.com
                    gift_url: >-
                      https://elliephantv2.com/redeem-your-gift/a5c7ba3d3d4c7250ccc3191a938030d5
        '401':
          description: Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    description: >-
                      Detail on if the order was placed successfully. Will
                      either be `success` or `error`
                  message:
                    type: integer
                    description: The message returned with the error
              example:
                status: error
                message: You need to set a product_id
components:
  securitySchemes:
    ClientIdAuth:
      type: apiKey
      in: header
      name: CLIENT-ID
    ApiKeyAuth:
      type: apiKey
      in: header
      name: API-KEY
    ApiPasswordAuth:
      type: apiKey
      in: header
      name: API-PASSWORD

````