Skip to content

Instantly share code, notes, and snippets.

@r-martins
Created July 9, 2024 23:07
Show Gist options
  • Save r-martins/843cb0b3d9ace26dd2a5c328f4dd0f0c to your computer and use it in GitHub Desktop.
Save r-martins/843cb0b3d9ace26dd2a5c328f4dd0f0c to your computer and use it in GitHub Desktop.
Exemplo retorno API WordPress
{
"id": 562,
"parent_id": 561,
"status": "processing",
"currency": "BRL",
"version": "9.0.0",
"prices_include_tax": false,
"date_created": "2024-07-03T02:46:06",
"date_modified": "2024-07-03T02:46:12",
"discount_total": "0.00",
"discount_tax": "0.00",
"shipping_total": "0.00",
"shipping_tax": "0.00",
"cart_tax": "0.00",
"total": "89.00",
"total_tax": "0.00",
"customer_id": 1,
"order_key": "wc_order_yuVLqoMmgqeJI",
"billing": {
"first_name": "Ricardo",
"last_name": "Martins",
"company": "",
"address_1": "",
"address_2": "",
"city": "",
"state": "",
"postcode": "",
"country": "BR",
"email": "ricardo@ricardomartins.net.br",
"phone": "",
"number": "",
"neighborhood": "",
"persontype": "F",
"cpf": "01234567890",
"rg": "",
"cnpj": "",
"ie": "",
"birthdate": "",
"gender": "",
"cellphone": ""
},
"shipping": {
"first_name": "Ricardo",
"last_name": "Martins",
"company": "",
"address_1": "",
"address_2": "",
"city": "",
"state": "",
"postcode": "-",
"country": "BR",
"phone": "",
"number": "",
"neighborhood": ""
},
"payment_method": "rm-pagbank",
"payment_method_title": "Cartão de Crédito Pagbank",
"transaction_id": "CHAR_85454207-22A9-49C8-9A6A-A20861838D3B",
"customer_ip_address": "127.0.0.1",
"customer_user_agent": "WordPress/6.6-RC1; http://woocommerce.test",
"created_via": "",
"customer_note": "",
"date_completed": null,
"date_paid": "2024-07-03T02:46:12",
"cart_hash": "",
"number": "562",
"meta_data": {
"_pagbank_card_brand": "mastercard",
"_pagbank_card_exp_month": "3",
"_pagbank_card_exp_year": "2033",
"_pagbank_card_first_digits": "555566",
"_pagbank_card_holder": "John Dope",
"_pagbank_card_holder_name": "JOHN DOE",
"_pagbank_card_installments": "1",
"_pagbank_card_last_digits": "8884",
"_pagbank_card_response_reference": "032416400102",
"_pagbank_is_recurring": "1",
"pagbank_authorization_code": "145803",
"pagbank_card_installments": "1",
"pagbank_card_last4": "8884",
"pagbank_charge_id": "CHAR_85454207-22A9-49C8-9A6A-A20861838D3B",
"pagbank_is_sandbox": "1",
"pagbank_nsu": "032416400102",
"pagbank_order_charges": [
{
"id": "CHAR_85454207-22A9-49C8-9A6A-A20861838D3B",
"status": "PAID",
"created_at": "2024-07-03T02:46:10.098-03:00",
"paid_at": "2024-07-03T02:46:11.000-03:00",
"description": "",
"amount": {
"value": 8900,
"currency": "BRL",
"summary": {
"total": 8900,
"paid": 8900,
"refunded": 0
}
},
"payment_response": {
"code": "20000",
"message": "SUCESSO",
"reference": "032416400102",
"raw_data": {
"authorization_code": "145803",
"nsu": "032416400102",
"reason_code": "00"
}
},
"payment_method": {
"type": "CREDIT_CARD",
"installments": 1,
"capture": true,
"card": {
"id": "CARD_9B6565D6-489A-4C70-B36D-4406428F70A4",
"brand": "mastercard",
"first_digits": "555566",
"last_digits": "8884",
"exp_month": "3",
"exp_year": "2033",
"holder": {
"name": "John Dope"
},
"store": true
},
"soft_descriptor": "CompraViaPagBank"
},
"recurring": {
"type": "SUBSEQUENT"
},
"links": [
{
"rel": "SELF",
"href": "https://sandbox.api.pagseguro.com/charges/CHAR_85454207-22A9-49C8-9A6A-A20861838D3B",
"media": "application/json",
"type": "GET"
},
{
"rel": "CHARGE.CANCEL",
"href": "https://sandbox.api.pagseguro.com/charges/CHAR_85454207-22A9-49C8-9A6A-A20861838D3B/cancel",
"media": "application/json",
"type": "POST"
}
]
}
],
"pagbank_order_id": "ORDE_F840D32C-D703-41D0-A013-EACCF76A3675",
"pagbank_payment_method": "credit_card",
"pagbank_payment_response": {
"code": "20000",
"message": "SUCESSO",
"reference": "032416400102",
"raw_data": {
"authorization_code": "145803",
"nsu": "032416400102",
"reason_code": "00"
}
},
"pagbank_status": "PAID"
},
"line_items": [
{
"id": 1006,
"name": "Clube do Vinho",
"product_id": 29,
"variation_id": 0,
"quantity": 1,
"tax_class": "",
"subtotal": "99.00",
"subtotal_tax": "0.00",
"total": "99.00",
"total_tax": "0.00",
"taxes": [],
"meta_data": [],
"sku": "",
"price": 99,
"image": {
"id": "",
"src": ""
},
"parent_name": null
}
],
"tax_lines": [],
"shipping_lines": [
{
"id": 1007,
"method_title": "Frete grátis",
"method_id": "",
"instance_id": "",
"total": "0.00",
"total_tax": "0.00",
"taxes": [],
"meta_data": []
}
],
"fee_lines": [],
"coupon_lines": [],
"refunds": [],
"payment_url": "https://woocommerce.test/finalizar-compra/order-pay/562/?pay_for_order=true&key=wc_order_yuVLqoMmgqeJI",
"is_editable": false,
"needs_payment": false,
"needs_processing": true,
"date_created_gmt": "2024-07-03T05:46:06",
"date_modified_gmt": "2024-07-03T05:46:12",
"date_completed_gmt": null,
"date_paid_gmt": "2024-07-03T05:46:12",
"currency_symbol": "R$",
"_links": {
"self": [
{
"href": "https://woocommerce.test/wp-json/wc/v3/orders/562"
}
],
"collection": [
{
"href": "https://woocommerce.test/wp-json/wc/v3/orders"
}
],
"customer": [
{
"href": "https://woocommerce.test/wp-json/wc/v3/customers/1"
}
],
"up": [
{
"href": "https://woocommerce.test/wp-json/wc/v3/orders/561"
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment