Incluir cobrança no pedido

Enquanto um pedido estiver aberto, é possível adicionar novas cobranças utilizando o order_id na criação de uma cobrança.

post
https://api.stone.com.br/core/v5/charges

Body

application/json
order_idstringrequired

Código do pedido

amountinteger(int32)required

Valor da cobrança em centavos

paymentobjectrequired

Dados sobre pagamento.

Show Child Parameters
due_atstring(date)

Data de vencimento da cobrança.

customer_idstring

Código do cliente.

customerobject

Dados do cliente. Se nem o customer_id nem o customer forem informados, será considerado o mesmo cliente do pedido.

metadatastring

Objeto chave/valor utilizado para armazenar informações adicionais sobre a cobrança.

Response

application/json

200

idstring

Example:ch_xyRZw5XCLhl3ENjP

codestring

Example:LM4AVYSYQ9

gateway_idstring

Example:769e2123-a634-46dc-8bba-529bba7fb726

amountinteger

Default:0

Example:2990

statusstring

Example:paid

currencystring

Example:BRL

payment_methodstring

Example:credit_card

due_atstring

Example:2017-04-05T00:00:00

paid_atstring

Example:2017-04-05T05:51:44

created_atstring

Example:2017-04-05T05:51:37

updated_atstring

Example:2017-04-05T05:51:37

orderobject
Show Child Parameters
customerobject
Show Child Parameters
last_transactionobject
Show Child Parameters
post/charges

Body

{ "order_id": "or_gnvV6V1VTgspL4JB", "amount": 2990, "payment": { "payment_method": "credit_card", "credit_card": { "installments": 1, "statement_descriptor": "AVENGERS", "card": { "number": "342793631858229", "holder_name": "Tony Stark", "exp_month": 1, "exp_year": 30, "cvv": "3531", "billing_address": { "zip_code": "90265", "city": "Malibu", "state": "CA", "country": "US", "line_1": "10880, Malibu Point, Malibu Central" } } } } }
 
application/json

Listar cobranças

get
https://api.stone.com.br/core/v5/charges

Query Parameters

codestring

Código de referência da cobrança no sistema da loja

statusstring

Status da cobrança. Valores possíveis: pending, paid, canceled, processing, failed, overpaid ou underpaid

payment_methodstring

Meio de pagamento. Valores possíveis: credit_card, boleto, bank_transfer, safetypay ou voucher

customer_idstring

Código do cliente.

order_idstring

Código do pedido.

created_sincestring

Data de início do período de criação a ser listado.

created_untilstring(date)

Data de final do período de criação a ser listado.

pageinteger(int32)

Página atual.

Default:1

sizeinteger(int32)

Quantidade de itens por página.

Default:10

Response

application/json

200

dataarray[object]
Show Child Parameters
pagingobject
Show Child Parameters
get/charges
 
application/json

Obter pedido

get
https://api.stone.com.br/core/v5/orders/{order_id}

Path Parameters

order_idstringrequired

Código identificador do pedido no sistema da loja. Max: 52 caracteres.

Response

application/json

200

One Of
idstring

Example:or_28dN9w7CLU79kDjL

codestring

Example:62LVFN7I4R

amountinteger

Default:0

Example:2990

currencystring

Example:BRL

closedboolean

Default:true

Example:true

itemsarray[object]
Show Child Parameters
customerobject
Show Child Parameters
statusstring

Example:paid

created_atstring

Example:2017-04-19T16:01:09Z

updated_atstring

Example:2017-04-19T16:01:11Z

closed_atstring

Example:2017-04-19T16:01:11Z

chargesarray[object]
Show Child Parameters
get/orders/{order_id}
 
application/json

Fechar um pedido

Utilizado para fechar um pedido para que não seja mais possível adicionar cobranças.

patch
https://api.stone.com.br/core/v5/orders/{order_id}/closed

Path Parameters

order_idstringrequired

Código do pedido.

Body

application/json
statusstringrequired

Status final do pedido. Valores possíveis: paid, canceled ou failed. Caso não enviado, valor default será paid.

Response

application/json

200

idstring

Example:or_koMvlQOTMCb9dpPO

codestring

Example:O8YDFPZUM3

amountinteger

Default:0

Example:2990

currencystring

Example:BRL

closedboolean

Default:true

Example:true

itemsarray[object]
Show Child Parameters
customerobject
Show Child Parameters
statusstring

Example:paid

created_atstring

Example:2017-06-06T16:03:40Z

updated_atstring

Example:2017-06-06T16:03:40Z

closed_atstring

Example:2017-06-06T16:03:47Z

patch/orders/{order_id}/closed

Body

{ "status": "status" }
 
application/json

Incluir item

Quando um pedido está aberto, você pode incluir itens nele.

post
https://api.stone.com.br/core/v5/orders/{order_id}/items

Path Parameters

order_idstringrequired

Código do pedido.

Body

application/json
amountinteger(int32)required

Valor do item.

codestring

Código do item no sistema da loja. Max: 52 caracteres. Obrigatório para transações de split

descriptionstringrequired

Descrição do item. Max: 256 caracteres.

quantitystringrequired

Quantidade de itens.

categorystring

Categoria do item. Max: 64 caracteres.

Response

application/json

200

idstring

Example:oi_ZD2lNDKcORty1pzw

descriptionstring

Example:Caneca Zero Grau

amountinteger

Default:0

Example:1090

quantityinteger

Default:0

Example:1

statusstring

Example:active

created_atstring

Example:2017-10-05T20:24:38Z

updated_atstring

Example:2017-10-05T20:24:38Z

orderobject
Show Child Parameters
sellerobject
Show Child Parameters
post/orders/{order_id}/items

Body

{ "amount": 1090, "description": "Caneca Zero Grau", "quantity": 1, "seller": { "document": "26224451990", "name": "Stark Industries", "code": "STRK_01", "description": "Changing the world for a better future.", "address": { "line_1": "10880, Malibu Point, Malibu Central", "zip_code": "90265", "city": "Malibu", "state": "CA", "country": "US" } } }
 
application/json