PayJoy Vouchers API

Endpoints related to vouchers management

OpenAPI Specification

payjoy-vouchers-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: PayJoy Partner API V2 Carts Vouchers API
  version: 1.0.0
  description: 'PayJoy Partner API (Sales Integration) lets retail and OEM partners integrate PayJoy point-of-sale financing: retrieve cart/sale information, list merchants and sales clerks, offer and process customer repayments, redeem and cancel vouchers, pay down payments, and pull transaction history for reconciliation. Assembled by API Evangelist from the per-operation OpenAPI fragments published verbatim on the PayJoy developer portal API Reference.'
  contact:
    name: PayJoy Developer Portal
    url: https://developers.payjoy.com/
servers:
- url: https://partner-integration.sandbox.payjoy.com/partner-api
  description: Sandbox
security:
- PayJoyApiKeyAuth: []
tags:
- name: Vouchers
  description: Endpoints related to vouchers management
paths:
  /v2/vouchers/{voucherCode}/redeem:
    put:
      tags:
      - Vouchers
      summary: Redeems a Voucher
      description: Redeems the given voucher code
      operationId: redeemVoucher
      parameters:
      - name: X-PayJoy-ApiKey
        in: header
        required: true
        schema:
          type: string
      - name: voucherCode
        in: path
        required: true
        description: The unique identifier of the voucher
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - amount
              - currency
              properties:
                amount:
                  type: number
                  description: The voucher amount formatted as a number with two decimal places
                currency:
                  type: string
                  pattern: ^[A-Z]{3}$
                  description: ISO 4217 currency code
                metadata:
                  type: object
                  description: The metadata object information
              additionalProperties: false
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RedeemVoucherResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /v2/vouchers/{voucherCode}/cancel:
    put:
      tags:
      - Vouchers
      summary: Cancel a voucher
      description: Cancel the given voucher code
      operationId: cancelVoucher
      parameters:
      - name: X-PayJoy-ApiKey
        in: header
        required: true
        schema:
          type: string
      - name: voucherCode
        in: path
        required: true
        description: The unique identifier of the voucher
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - amount
              - currency
              properties:
                amount:
                  type: number
                  description: The voucher amount formatted as a number with two decimal places
                currency:
                  type: string
                  pattern: ^[A-Z]{3}$
                  description: ISO 4217 currency code
                metadata:
                  type: object
                  description: The metadata object information
              additionalProperties: false
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelVoucherResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/Error'
    Error:
      type: object
      properties:
        code:
          type: string
          description: The error code
        message:
          type: string
          description: Human-readable error message
        context:
          type: array
          items:
            type: object
            properties:
              key:
                type: string
              value:
                type: string
    RedeemVoucherResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            voucherCode:
              type: string
              description: The redeemed voucher code
            authorizationCode:
              type: string
              description: The unique authorization code
            redeemedAt:
              type: integer
              description: Timestamp in seconds for voucher redemption
    CancelVoucherResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            voucherCode:
              type: string
              description: The redeemed voucher code
            cancellationCode:
              type: string
              description: The unique cancellation code
            cancelledAt:
              type: integer
              description: Timestamp in seconds for voucher cancellation
  responses:
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    PayJoyApiKeyAuth:
      type: apiKey
      in: header
      name: X-PayJoy-ApiKey
      description: API key required to authenticate all requests. Include this key in the request header as `X-PayJoy-ApiKey`.