V1::OrdersController
Orders
show
Get a order information
URL
GET /orders/:idParâmetros obrigatórios
Nome | Tipo | Descrição |
---|---|---|
id | Integer | of the order |
Objeto resposta
Order | The requested order |
create
Create new order
URL
POST /ordersParâmetros obrigatórios
Nome | Tipo | Descrição |
---|---|---|
order | Hash | The order to create |
order[student_id] | String | Student that the order belongs to |
Objeto resposta
Order | The created order or a list of errors |
update
Update an existing order and redirect to 'show' action
URL
PUT/PATCH /orders/:idParâmetros obrigatórios
Nome | Tipo | Descrição |
---|---|---|
order | Hash | The order to update |
Parâmetros opcionais
Nome | Tipo | Descrição |
---|---|---|
order[student_id] | String | Student that the order belongs to |
Objeto resposta
Order | The created order or a list of errors |
destroy
Change order status to 'Canceled'
URL
DELETE /orders/:idParâmetros obrigatórios
Nome | Tipo | Descrição |
---|---|---|
id | Integer | Id of an order |
cancel
Change order status to 'Canceled'
URL
PUT /orders/:id/cancelParâmetros obrigatórios
Nome | Tipo | Descrição |
---|---|---|
id | Integer | Id of an order |
import
Create new order with payments, items and invoices
URL
POST /orders/importParâmetros obrigatórios
Nome | Tipo | Descrição |
---|---|---|
order | Hash | The order to create |
order[student_id] | Integer | Student that the order belongs to |
order[school_id] | Integer | School that the order belongs to |
order[items_attributes][school_id] | Integer | School that the item belongs to |
order[items_attributes][payment_option_id] | Integer | PaymentOption that the item belongs to |
order[items_attributes][coupon_token_id] | Integer | Coupon token used |
order[items_attributes][quantity] | Integer | Product quantity |
order[items_attributes][total] | Integer | Item's price without discounts |
order[invoices_attributes][school_id] | Integer | Invoice's School |
order[invoices_attributes][amount] | Integer | Invoice's price |
order[invoices_attributes][occurrence] | Integer | Invoice's occurrence |
order[invoices_attributes][status] | String | Invoice's status (unsent, open, waiting_confirmation, paid, unpaid, overdue) |
order[invoices_attributes][payments_attributes][school_id] | Integer | Payment school |
order[invoices_attributes][payments_attributes][kind] | String | Payment kind (0..3) |
order[invoices_attributes][payments_attributes][status] | String | Payment status (unsent, failed, initiated, under_analysis, waiting_boleto, canceled, authorized, confirmed, reversed, refunded) |
Parâmetros opcionais
Nome | Tipo | Descrição |
---|---|---|
order[gateway_credential_id] | Integer | Gateway used in the order |
order[coupon_id] | Integer | Coupon used in the order |
order[amount_to_pay] | Integer | Order's amount to pay (price with discounts) |
order[total] | Integer | Order's total (price without discounts) |
order[kind] | Integer | Type number (0..3) of the order |
order[period] | Integer | Period number (0..4) of the order |
order[confirmed_at] | DateTime | When the order was confirmed |
order[created_at] | DateTime | When the order was created |
order[next_invoice_at] | DateTime | Next invoice |
order[uuid] | String | Order's external id |
order[status] | String | Order's status (initiated processing no_wait_processing confirmed canceled) |
order[gateway_reference] | String | Order's "id" in the gateway |
order[response] | Text | Response of the gateway |
order[message] | Text | Message of the gateway |
order[test] | Boolean | Gateway used um sandbox or production |
order[success] | Boolean | Response success to the gateway |
order[items_attributes] | Array | Items attributes to create with the order |
order[items_attributes][amount_to_pay] | Integer | Item's price with discouts |
order[items_attributes][amount_to_pay_in_credits] | Integer | Item's price in credits with discouts |
order[items_attributes][total_in_credits] | Integer | Item's price in credits without discounts |
order[items_attributes][created_at] | DateTime | Item's created date |
order[invoices_attributes] | Array | Invoices attributes to create with the order |
order[invoices_attributes][uuid] | String | Invoice's external id |
order[invoices_attributes][next_charge_at] | DateTime | Next charging |
order[invoices_attributes][created_at] | DateTime | Invoice's created date |
order[invoices_attributes][payments_attributes] | Array | Payments attributes to create with invoice |
order[invoices_attributes][payments_attributes][amount] | Integer | Payment price |
order[invoices_attributes][payments_attributes][uuid] | String | Payment external id |
order[invoices_attributes][payments_attributes][gateway_reference] | String | Gateway "id" for payment |
order[invoices_attributes][payments_attributes][link] | String | Payment link |
order[invoices_attributes][payments_attributes][boleto_code] | String | Payment boleto code |
order[invoices_attributes][payments_attributes][cardholder] | String | Payment cardholder |
order[invoices_attributes][payments_attributes][response] | Text | Gateway response |
order[invoices_attributes][payments_attributes][message] | Text | Gateway message |
order[invoices_attributes][payments_attributes][success] | Boolean | Gateway response sucess |
order[invoices_attributes][payments_attributes][test] | Boolean | Gateway used um sandbox or production |
order[invoices_attributes][payments_attributes][installments] | Integer | (required with common order with credit card) |
order[invoices_attributes][payments_attributes][gateway_fees] | Integer | Gateway fees |
order[invoices_attributes][payments_attributes][created_at] | DateTime | Payment created date |
Objeto resposta
Order | The created order or a list of errors |