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

# Generate Link API

> Generate reward links in bulk without needing recipient email addresses. Ideal for reward automation where links are distributed via your own channels.


| \*\*Property \*\* | \*\* Type \*\* | \*\* Description\*\*                                                         |
| :---------------- | :------------- | :--------------------------------------------------------------------------- |
| `campaignId`      | `String`       | Unique identifier of the campaign for which the link(s) should be generated. |
| `links_quantity`  | `Int`          | Number of links to generate.                                                 |
| `link_expiry`     | `String`       | Expiry date for the link(s) (format: `DD-MM-YYYY`).                          |

## Response Schema

| \*\*Path \*\*                         | \*\* Type \*\* | \*\* Description\*\*                                    |
| ------------------------------------- | -------------- | ------------------------------------------------------- |
| data                                  | object         | Root response object.                                   |
| data.generateLink                     | object         | Container for link generation result.                   |
| data.generateLink.success             | number         | API execution status (`1` = success).                   |
| data.generateLink.message             | string         | Message returned by the API.                            |
| data.generateLink.links               | array          | List of generated reward/claim links.                   |
| data.generateLink.links\[]            | string         | Individual generated link URL.                          |
| data.generateLink.batchId             | string         | Unique batch identifier for the generated link set.     |
| data.generateLink.campaignName        | string         | Name of the campaign for which links were generated.    |
| data.generateLink.campaignId          | string         | Campaign ID (string returned by API).                   |
| data.generateLink.denomination\_value | number         | Denomination/value associated with the generated links. |
| data.generateLink.countryName         | string         | Country for which the link campaign applies.            |
| data.generateLink.currencyCode        | string         | Currency code for the denomination.                     |


## OpenAPI

````yaml specs/reward-link-api.yaml POST /generateLink
openapi: 3.0.3
info:
  title: Xoxoday Reward Link API
  version: '1.2'
  description: >
    APIs for automating reward distribution via personalized reward links and
    campaigns.


    **Auth endpoints** resolve against
    `https://stagingstores.xoxoday.com/chef/v1/oauth`

    using a per-operation server override.


    **Campaign + Link operations** use
    `https://stagingstores.xoxoday.com/chef/v1/oauth/api`

    as the base. `/generateLink` and `/sendLinks` have dedicated real paths.

    Campaign operations (`/campaignList`, `/campaignDetails`) use short virtual
    path

    suffixes because both operations share the same real URL (`/v1/oauth/api`)
    and

    OpenAPI does not allow two POST operations on the same path.
servers:
  - url: https://stagingstores.xoxoday.com/chef/v1/oauth/api
    description: Sandbox
  - url: https://accounts.xoxoday.com/chef/v1/oauth/api
    description: Production
  - url: https://canvas.xoxoday.com/chef/v1/oauth/api
    description: Testing
security:
  - BearerAuth: []
tags:
  - name: Authentication
    description: Token management — validate and refresh access tokens.
  - name: Campaigns
    description: Fetch reward link campaigns and their details.
  - name: Links
    description: Generate and send reward links to recipients.
paths:
  /generateLink:
    post:
      tags:
        - Links
      summary: Generate Link API
      description: >
        Generate reward links in bulk without needing recipient email addresses.
        Ideal for reward automation where links are distributed via your own
        channels.
      operationId: generateLinks
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - query
                - tag
                - variables
              properties:
                query:
                  type: string
                  enum:
                    - xoxo_link.mutation.generateLink
                  default: xoxo_link.mutation.generateLink
                  description: Always use `xoxo_link.mutation.generateLink`.
                tag:
                  type: string
                  enum:
                    - xoxo_link
                  default: xoxo_link
                  description: Always use `xoxo_link`.
                variables:
                  type: object
                  required:
                    - data
                  properties:
                    data:
                      type: object
                      required:
                        - campaignId
                        - links_quantity
                        - link_expiry
                      properties:
                        campaignId:
                          type: integer
                          description: Unique identifier of the campaign.
                          example: 123
                        links_quantity:
                          type: integer
                          description: Number of links to generate.
                          example: 1
                        link_expiry:
                          type: string
                          description: 'Expiry date for the links. Format: `DD-MM-YYYY`.'
                          example: 19-03-1999
            example:
              query: xoxo_link.mutation.generateLink
              tag: xoxo_link
              variables:
                data:
                  campaignId: 123
                  links_quantity: 1
                  link_expiry: 19-03-1999
      responses:
        '200':
          description: Links generated successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      generateLink:
                        type: object
                        properties:
                          success:
                            type: integer
                            description: '`1` = success.'
                          message:
                            type: string
                          links:
                            type: array
                            description: List of generated reward link URLs.
                            items:
                              type: string
                          batchId:
                            type: string
                          campaignName:
                            type: string
                          campaignId:
                            type: string
                          denomination_value:
                            type: number
                          countryName:
                            type: string
                          currencyCode:
                            type: string
              example:
                data:
                  generateLink:
                    success: 1
                    message: Links generated successfully
                    links:
                      - https://plum.xoxoday.com/claim/abc123
                      - https://plum.xoxoday.com/claim/def456
                    batchId: batch_20260415_001
                    campaignName: Summer Rewards
                    campaignId: '123'
                    denomination_value: 10
                    countryName: USA
                    currencyCode: USD
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '502':
          $ref: '#/components/responses/BadGateway'
components:
  responses:
    BadRequest:
      description: Invalid request body or parameters.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
              message:
                type: string
    Unauthorized:
      description: Missing or invalid access token.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Unauthorized
    BadGateway:
      description: Upstream service error.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: '`Authorization: Bearer <access_token>`'

````