DesenvolvedoresReferência da APICarrinho
Adicionar item ao carrinho
POST
Adiciona um preço ao carrinho; se ele já estiver lá, soma a quantidade.
Chave: Chave publicável ou secreta.
Escopo: checkout:write.
Limite: 120 requisições a cada 1 min, além do limite geral de 600 por minuto por chave.
header
AutorizaçãoBearer <chave de API>Chave publicável (pk_…). Pode ir para o navegador; dá acesso só ao catálogo, ao carrinho e ao checkout.
cartId*stringFormato
uuidX-Cart-Token*stringToken devolvido na criação do carrinho.
application/json- body
priceId*stringFormato
uuidquantity?integerIntervalo
1 <= value <= 999Padrão
1customUnitAmount?integerValor escolhido pelo comprador em preços "pague quanto quiser", em centavos.
Intervalo
0 < value <= 9007199254740991checkoutFields?Respostas dos campos de checkout do produto, por chave.
Criado.
application/json- response
data*meta*curl -X POST 'https://minepag.com.br/api/v1/carts/497f6eca-6276-4993-bfeb-53cbbbba6f08/items' \ -H 'X-Cart-Token: string' \ -H 'Content-Type: application/json' \ -d '{ "priceId": "b245ceea-4bc7-4619-ae4c-559a1faf418e"}'{ "data": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "status": "active", "email": "string", "expiresAt": "2019-08-24T14:15:22Z", "currency": "BRL", "items": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "productId": "dcd53ddb-8104-4e48-8cc0-5df1088c6113", "productName": "string", "productSlug": "string", "priceId": "b245ceea-4bc7-4619-ae4c-559a1faf418e", "priceName": "string", "priceType": "one_time", "interval": "day", "intervalCount": -9007199254740991, "imageUrl": "string", "quantity": -9007199254740991, "listUnitAmount": -9007199254740991, "unitAmount": -9007199254740991, "offer": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "type": "string", "unitDiscount": -9007199254740991 }, "offerDiscount": -9007199254740991, "couponDiscount": -9007199254740991, "subtotal": -9007199254740991, "total": -9007199254740991, "available": -9007199254740991, "checkoutFields": [ { "key": "string", "label": "string", "type": "text", "required": true, "choices": [ null ], "helpText": "string", "value": "string" } ] } ], "coupon": { "code": "string", "applied": true, "discount": -9007199254740991, "message": "string" }, "totals": { "subtotal": -9007199254740991, "offerDiscountTotal": -9007199254740991, "couponDiscount": -9007199254740991, "trialDiscountTotal": -9007199254740991, "discountTotal": -9007199254740991, "total": -9007199254740991 }, "issues": [ { "lineId": "e698cdee-c4ef-4d12-b0ea-7c98b2fc64a8", "code": "product_unavailable", "message": "string" } ], "suggestedOffers": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "type": "string", "name": "string", "headline": "string", "description": "string", "ctaLabel": "string", "rewards": [ null ] } ] }, "meta": { "requestId": "string" }}