Tribe__Tickets__REST__V1__Endpoints__Cart::get_documentation()

{@inheritDoc}

Contents


Source

File: src/Tribe/REST/V1/Endpoints/Cart.php

	public function get_documentation() {
		$get_defaults = [
			'in'      => 'query',
			'default' => '',
		];

		$post_defaults = [
			'in'      => 'formData',
			'default' => '',
			'type'    => 'string',
		];

		return [
			'get'  => [
				'parameters' => $this->swaggerize_args( $this->READ_args(), $get_defaults ),
				'responses'  => [
					'200' => [
						'description' => __( 'Returns the list of tickets in the cart', 'event-tickets' ),
						'content'     => [
							'application/json' => [
								'schema' => [
									'type'       => 'object',
									'properties' => [
										'tickets'      => [
											'type'        => 'array',
											'description' => __( 'The list of tickets and their quantities in the cart', 'event-tickets' ),
										],
										'meta'         => [
											'type'        => 'array',
											'description' => __( 'The list of meta for each ticket item in the cart', 'event-tickets' ),
										],
										'cart_url'     => [
											'type'        => 'string',
											'description' => __( 'The provider cart URL', 'event-tickets' ),
										],
										'checkout_url' => [
											'type'        => 'string',
											'description' => __( 'The provider checkout URL', 'event-tickets' ),
										],
									],
								],
							],
						],
					],
					'403' => [
						'description' => __( 'The post does not have any tickets', 'event-tickets' ),
					],
				],
			],
			'post' => [
				'consumes'   => [ 'application/x-www-form-urlencoded' ],
				'parameters' => $this->swaggerize_args( $this->EDIT_args(), $post_defaults ),
				'responses'  => [
					'200' => [
						'description' => __( 'Returns the updated list of tickets in the cart and cart details', 'event-tickets' ),
						'content'     => [
							'application/json' => [
								'schema' => [
									'type'       => 'object',
									'properties' => [
										'tickets'      => [
											'type'        => 'array',
											'description' => __( 'The list of tickets and their quantities in the cart', 'event-tickets' ),
										],
										'meta'         => [
											'type'        => 'array',
											'description' => __( 'The list of meta for each ticket item in the cart', 'event-tickets' ),
										],
										'cart_url'     => [
											'type'        => 'string',
											'description' => __( 'The provider cart URL', 'event-tickets' ),
										],
										'checkout_url' => [
											'type'        => 'string',
											'description' => __( 'The provider checkout URL', 'event-tickets' ),
										],
									],
								],
							],
						],
					],
					'400' => [
						'description' => __( 'The post ID is invalid.', 'ticket-tickets' ),
						'content'     => [
							'application/json' => [
								'schema' => [
									'type' => 'object',
								],
							],
						],
					],
					'403' => [
						'description' => __( 'The post does not have any tickets', 'event-tickets' ),
					],
				],
			],
		];
	}

Top ↑

Changelog

Changelog
Version Description
4.11.0 Introduced.