--- openapi: 3.0.1 info: title: Adopters API V2 version: v2 paths: "/api/v2/adopters/adopters": get: summary: Show current adopter tags: - Adopters parameters: - name: Authorization in: header required: true schema: type: string responses: '200': description: Current adopter shown content: application/json: schema: "$ref": "#/components/schemas/adopter" '401': description: Not authenticated content: application/json: schema: "$ref": "#/components/schemas/error_message" put: summary: Update current adopter tags: - Adopters parameters: - name: Authorization in: header required: true schema: type: string responses: '200': description: Adopter updated content: application/json: schema: "$ref": "#/components/schemas/adopter" '400': description: Invalid adopter content: application/json: schema: "$ref": "#/components/schemas/error_message" '401': description: Not authenticated content: application/json: schema: "$ref": "#/components/schemas/error_message" requestBody: content: multipart/form-data: schema: "$ref": "#/components/schemas/update_adopter" "/api/v2/adopters/adopters/adoption_applications": get: summary: Get current adopters adoption applications tags: - Adoption applications parameters: - name: Authorization in: header required: true schema: type: string responses: '200': description: Current adoption applications shown content: application/json: schema: "$ref": "#/components/schemas/adoption_applications" '401': description: Not authenticated content: application/json: schema: "$ref": "#/components/schemas/error_message" "/api/v2/adopters/adopters/chat_token": post: summary: Create chat token for the user tags: - Adopters parameters: - name: Authorization in: header required: true schema: type: string responses: '200': description: Chat token created content: application/json: schema: "$ref": "#/components/schemas/chat_token" '401': description: Not authenticated content: application/json: schema: "$ref": "#/components/schemas/error_message" "/api/v2/adopters/adopters/fcm_token": put: summary: Update fcm token of current device tags: - Adopters parameters: - name: Authorization in: header required: true schema: type: string responses: '200': description: FCM Token updated '401': description: Not authenticated content: application/json: schema: "$ref": "#/components/schemas/error_message" requestBody: content: application/json: schema: "$ref": "#/components/schemas/fcm_token" "/api/v2/adopters/pets/{id}/favorites": post: summary: Add pet to favorites tags: - Favorites parameters: - name: id in: path required: true - name: Authorization in: header required: true schema: type: string responses: '200': description: Pet added into favorites content: application/json: schema: "$ref": "#/components/schemas/pets" '404': description: Could not find pet content: application/json: schema: "$ref": "#/components/schemas/error_message" '401': description: Not Authenticated content: application/json: schema: "$ref": "#/components/schemas/error_message" delete: summary: Removes pet from collection tags: - Favorites parameters: - name: id in: path required: true - name: Authorization in: header required: true schema: type: string responses: '200': description: Pet removed from favorites content: application/json: schema: "$ref": "#/components/schemas/pets" '404': description: Could not find pet content: application/json: schema: "$ref": "#/components/schemas/error_message" '401': description: Not Authenticated content: application/json: schema: "$ref": "#/components/schemas/error_message" "/api/v2/adopters/favorites": get: summary: Get current user favorites collection tags: - Favorites parameters: - name: Authorization in: header required: true schema: type: string responses: '200': description: Favorites collection shown content: application/json: schema: "$ref": "#/components/schemas/pets" "/api/v2/adopters/filters/home": get: summary: Get home filter tags: - Filters responses: '200': description: Home filter shown content: application/json: schema: "$ref": "#/components/schemas/home_filter" "/api/v2/adopters/filters/search": get: summary: Get search filters tags: - Filters responses: '200': description: Search filters shown content: application/json: schema: "$ref": "#/components/schemas/search_filters" "/api/v2/adopters/info/store_links": get: summary: Get store links tags: - Info responses: '200': description: Store links shown content: application/json: schema: "$ref": "#/components/schemas/store_links" "/api/v2/adopters/info/product_categories": get: summary: Get product categories tags: - Info responses: '200': description: Product categories shown content: application/json: schema: "$ref": "#/components/schemas/product_categories" "/api/v2/adopters/organizations": get: summary: Index all organizations tags: - Organizations parameters: - name: Authorization in: header required: false schema: type: string responses: '200': description: Organizations listed content: application/json: schema: "$ref": "#/components/schemas/organizations" "/api/v2/adopters/organizations/{id}": get: summary: Show organization tags: - Organizations parameters: - name: id in: path required: true schema: type: integer - name: Authorization in: header required: false schema: type: string responses: '200': description: Organization shown content: application/json: schema: "$ref": "#/components/schemas/organization" '404': description: Organization not found content: application/json: schema: "$ref": "#/components/schemas/error_message" "/api/v2/adopters/organizations/{id}/needed_materials": get: summary: Show organizations needed materials tags: - Needed Materials parameters: - name: id in: path required: true schema: type: integer - name: Authorization in: header required: false schema: type: string responses: '200': description: Organization needed materials shown content: application/json: schema: "$ref": "#/components/schemas/needed_materials" '404': description: Organization not found content: application/json: schema: "$ref": "#/components/schemas/error_message" "/api/v2/adopters/organizations/equitable_donation_links": get: summary: Get equitable donation links tags: - Organizations responses: '200': description: Links shown content: application/json: schema: "$ref": "#/components/schemas/equitable_donation_links" "/api/v2/adopters/pets": get: summary: Search tags: - Pets parameters: - name: specie in: query required: false schema: type: string - name: genre[] in: query collectionFormat: multi required: false schema: type: array - name: age[] in: query collectionFormat: multi required: false schema: type: array - name: size[] in: query collectionFormat: multi required: false schema: type: array - name: page in: query required: false schema: type: integer - name: per_page in: query required: false schema: type: integer - name: Authorization in: header required: false schema: type: string responses: '200': description: Pets indexed content: application/json: schema: "$ref": "#/components/schemas/paginated_pets" "/api/v2/adopters/pets/{id}": get: summary: Show pet tags: - Pets parameters: - name: id in: path required: true schema: type: integer - name: Authorization in: header required: false schema: type: string responses: '200': description: Pet shown content: application/json: schema: "$ref": "#/components/schemas/pet" '403': description: Can't show pets which are not in adoption content: application/json: schema: "$ref": "#/components/schemas/error_message" '404': description: Pet not found content: application/json: schema: "$ref": "#/components/schemas/error_message" "/api/v2/adopters/products": get: summary: Search tags: - Products parameters: - name: name in: query required: false schema: type: string - name: price_gte in: query required: false schema: type: integer - name: price_lte in: query required: false schema: type: integer - name: category_id in: query required: false schema: type: integer - name: kg_gte in: query required: false schema: type: integer - name: kg_lte in: query required: false schema: type: integer - name: page in: query required: false schema: type: integer - name: per_page in: query required: false schema: type: integer responses: '200': description: Products indexed content: application/json: schema: "$ref": "#/components/schemas/products" "/api/v2/adopters/products/{id}": get: summary: Show product tags: - Products parameters: - name: id in: path required: true schema: type: integer responses: '200': description: Product shown content: application/json: schema: "$ref": "#/components/schemas/product" '404': description: Product not found content: application/json: schema: "$ref": "#/components/schemas/error_message" "/api/v2/adopters/sales": get: summary: Lists current user sales tags: - Sales parameters: - name: Authorization in: header required: true schema: type: string responses: '200': description: Sales listed content: application/json: schema: "$ref": "#/components/schemas/sales" post: summary: Create a sale tags: - Sales parameters: - name: Authorization in: header required: true schema: type: string responses: '201': description: Sale created content: application/json: schema: "$ref": "#/components/schemas/sale" '400': description: Sale invalid content: application/json: schema: "$ref": "#/components/schemas/error_message" requestBody: content: application/json: schema: "$ref": "#/components/schemas/new_sale" "/api/v2/adopters/sales/{id}": get: summary: Show sale tags: - Sales parameters: - name: id in: path required: true schema: type: integer - name: Authorization in: header required: true schema: type: string responses: '200': description: Sale shown content: application/json: schema: "$ref": "#/components/schemas/sale" '404': description: Sale not found content: application/json: schema: "$ref": "#/components/schemas/error_message" "/api/v2/adopters/shops": get: summary: Get all shops tags: - Shops responses: '200': description: Shops listed content: application/json: schema: "$ref": "#/components/schemas/shops" "/api/v2/adopters/shops/{id}": get: summary: Get specific shop tags: - Shops parameters: - name: id in: path required: true schema: type: integer responses: '200': description: Shop shown content: application/json: schema: "$ref": "#/components/schemas/shop" '404': description: Shop not found content: application/json: schema: "$ref": "#/components/schemas/error_message" components: schemas: error_message: type: object properties: description: type: string details: type: any error_code: type: integer http_status: type: integer required: - description - error_code - http_status fcm_token: type: object properties: fcm_token: type: string required: - fcm_token shops: type: array items: "$ref": "#/components/schemas/shop" shop: type: object properties: id: type: integer name: type: string description: type: string contact_email: type: string phone: type: string address: type: string image_url: type: string city: "$ref": "#/components/schemas/city" facebook_url: type: string nullable: true instagram_url: type: string nullable: true web_url: type: string nullable: true required: - id - name - description - image_url - contact_email - phone - address - city - facebook_url - instagram_url - web_url products: type: object properties: products: type: array items: "$ref": "#/components/schemas/product" meta: type: object properties: pagination: type: object properties: current_page: type: integer page: type: integer per_page: type: integer sales: type: array items: "$ref": "#/components/schemas/sale" sale: type: object properties: id: type: integer phone_number: type: string delivery_time_preference: type: string address: type: string amount: type: float mercadopago_id: type: string status: type: string adopter: "$ref": "#/components/schemas/adopter" purchase_lines: type: array items: "$ref": "#/components/schemas/purchase_line" required: - id - phone_number - delivery_time_preference - address - amount - mercadopago_id - adopter - status - purchase_lines new_sale: type: object properties: phone_number: type: string delivery_time_preference: type: string address: type: string mercadopago_id: type: string purchase_lines_attributes: type: array items: type: object properties: product_id: type: integer quantity: type: integer required: - product_id - quantity required: - phone_number - delivery_time_preference - address - mercadopago_id - purchase_lines_attributes purchase_lines: type: array items: "$ref": "#/components/schemas/purchase_line" purchase_line: type: object properties: id: type: integer quantity: type: integer product: "$ref": "#/components/schemas/product" required: - id - quantity - product product: type: object properties: id: type: integer name: type: string description: type: string price: type: float shop: "$ref": "#/components/schemas/shop" product_category: "$ref": "#/components/schemas/product_category" stock: type: integer kg: type: float nullable: true featured_image_url: type: string required: - id - name - description - price - shop - featured_image_url - product_category - stock - kg product_category: type: object properties: id: type: integer name: type: string required: - id - name product_categories: type: array items: "$ref": "#/components/schemas/product_category" category: type: object properties: id: type: integer value: type: string required: - id - value specie: type: object properties: id: type: string value: type: string required: - id - value genre: type: object properties: id: type: string value: type: string required: - id - value age: type: object properties: id: type: string value: type: string required: - id - value size: type: object properties: id: type: string value: type: string required: - id - value hair: type: object properties: id: type: string value: type: string required: - id - value castrated: type: object properties: id: type: string value: type: string required: - id - value needed_material: type: object properties: id: type: integer name: type: string description: type: string category: "$ref": "#/components/schemas/category" required: - id - name - description - category needed_materials: type: array items: "$ref": "#/components/schemas/needed_material" pet: type: object properties: id: type: integer name: type: string specie: "$ref": "#/components/schemas/specie" genre: "$ref": "#/components/schemas/genre" age: "$ref": "#/components/schemas/age" size: "$ref": "#/components/schemas/size" hair: "$ref": "#/components/schemas/hair" castrated: "$ref": "#/components/schemas/castrated" image_url: type: string history: type: string nullable: true organization: "$ref": "#/components/schemas/organization" required: - id - name - specie - genre - age - size - hair - castrated - organization - image_url - history pet_reduced: type: object properties: id: type: integer name: type: string specie: "$ref": "#/components/schemas/specie" age: "$ref": "#/components/schemas/age" size: "$ref": "#/components/schemas/size" hair: "$ref": "#/components/schemas/hair" castrated: "$ref": "#/components/schemas/castrated" image_url: type: string required: - id - name - specie - age - size - hair - castrated - image_url paginated_pets: type: object properties: pets: type: array items: "$ref": "#/components/schemas/pet_reduced" meta: type: object properties: pagination: type: object properties: current_page: type: integer page: type: integer per_page: type: integer pets: type: array items: "$ref": "#/components/schemas/pet_reduced" chat_token: type: object properties: token: type: string required: - token organization: type: object properties: id: type: integer name: type: string description: type: string image_url: type: string contact_email: type: string facebook_url: type: string nullable: true instagram_url: type: string nullable: true web_url: type: string nullable: true city: "$ref": "#/components/schemas/city" one_hundred_donation_link: type: string nullable: true two_hundred_donation_link: type: string nullable: true five_hundred_donation_link: type: string nullable: true one_thousand_donation_link: type: string nullable: true required: - id - name - description - image_url - contact_email - facebook_url - instagram_url - web_url - city - one_hundred_donation_link - two_hundred_donation_link - five_hundred_donation_link - one_thousand_donation_link organizations: type: array items: "$ref": "#/components/schemas/organization" equitable_donation_links: type: object properties: one_hundred_donation_link: type: string two_hundred_donation_link: type: string five_hundred_donation_link: type: string one_thousand_donation_link: type: string required: - one_hundred_donation_link - two_hundred_donation_link - five_hundred_donation_link - one_thousand_donation_link adopter: type: object properties: id: type: integer name: type: string email: type: string phone: type: string nullable: true image_url: type: string city: oneOf: - "$ref": "#/components/schemas/city" - type: 'null' chat_id: type: string nullable: true badge: type: string required: - id - name - email - image_url - phone - chat_id - badge update_adopter: type: object properties: name: type: string image: type: file adoption_applications: type: array items: "$ref": "#/components/schemas/adoption_application" adoption_application: type: object properties: id: type: integer status: type: string created_at: type: date channel_id: type: string nullable: true canceled: type: boolean rejected: type: boolean pet: "$ref": "#/components/schemas/pet_reduced" organization: "$ref": "#/components/schemas/organization" required: - id - status - created_at - channel_id - canceled - rejected - pet - organization country: type: object properties: id: type: integer name: type: string abbreviation: type: string required: - id - name - abbreviation city: type: object properties: id: type: integer name: type: string country: "$ref": "#/components/schemas/country" required: - id - name - country store_links: type: object properties: android: type: string ios: type: string required: - android - ios search_filters: type: array items: "$ref": "#/components/schemas/search_filter" home_filter: type: object properties: key: type: string options: type: array items: type: object properties: name: type: string match: type: array items: type: string icon: type: string required: - name - match - icon search_filter: type: object properties: key: type: string options: type: array items: type: object properties: id: type: string name: type: string required: - name - id required: - options - key servers: - url: https://{defaultHost} variables: defaultHost: default: www.example.com