Facturación

Crear datos de facturación de un Invoice

Changed on

Registra los datos de facturación de un Invoice.

Se usa para asociar a un Invoice la información fiscal con la que se emitirá su billing document. Devuelve los datos creados. Falla con 400 por datos inválidos (montos, ítems o referencias) y con 409 si ya existen datos de facturación para ese Invoice.

post/invoice-billing-data

Request

  • Base URL
    https://api.trytoku.com
  • URL
    https://api.trytoku.com/invoice-billing-data
  • Auth
    API key in header x-api-key

Headers

x-account-keystring

Llave de API de una Account, para operar sobre esa Account en lugar de la principal.

Request body

cfdi_payment_method'PUE' | 'PPD' required

Método de pago del CFDI, según el catálogo c_MetodoPago del SAT mexicano: PUE (pago en una sola exhibición) cuando el comprobante se paga completo de una vez, y PPD (pago en parcialidades o diferido) cuando se paga en cuotas o después de emitido.

cfdi_use'CN01' | 'CP01' | 'D01' | 'D02' | 'D03' | 'D04' | 'D05' | 'D06' | 'D07' | 'D08' | 'D09' | 'D10' | 'G01' | 'G02' | 'G03' | 'I01' | 'I02' | 'I03' | 'I04' | 'I05' | 'I06' | 'I07' | 'I08' | 'P01' | 'S01' required

Clave de uso del CFDI: para qué declara el receptor el comprobante fiscal ante el SAT. Los valores son las claves del catálogo c_UsoCFDI que publica el SAT mexicano, no una codificación de Toku, y el receptor es quien determina cuál corresponde.

checkout_session_idstring

Identificador de la Checkout Session, para registrar los datos cuando el Invoice todavía no existe. Alternativa a id_invoice.

observationsstring

Texto libre que se guarda junto a los datos de facturación. No viaja al CFDI.

Example request

{
  "checkout_session_id": "cs_7Hn2kLm0QpXr7Zt3Wv1Nb8Yc4Ad6Ge5J",
  "item": {
    "identification_number": "SKU-4471",
    "product_code": "84111506",
    "product_description": "Servicio de suscripción mensual",
    "quantity": 1,
    "tax_object": "02",
    "taxes": [
      {
        "name": "IVA",
        "rate": 0.16
      }
    ],
    "unit_code": "E48",
    "unit_price": 1500
  },
  "items": [
    {
      "identification_number": "SKU-4471",
      "product_code": "84111506",
      "product_description": "Servicio de suscripción mensual",
      "quantity": 1,
      "tax_object": "02",
      "taxes": [
        {
          "name": "IVA",
          "rate": 0.16
        }
      ],
      "unit_code": "E48",
      "unit_price": 1500
    }
  ],
  "observations": "Facturar a nombre de la matriz"
}

Response

Successful Response

cfdi_payment_method'PUE' | 'PPD' required

Método de pago del CFDI, según el catálogo c_MetodoPago del SAT mexicano: PUE (pago en una sola exhibición) cuando el comprobante se paga completo de una vez, y PPD (pago en parcialidades o diferido) cuando se paga en cuotas o después de emitido.

cfdi_use'CN01' | 'CP01' | 'D01' | 'D02' | 'D03' | 'D04' | 'D05' | 'D06' | 'D07' | 'D08' | 'D09' | 'D10' | 'G01' | 'G02' | 'G03' | 'I01' | 'I02' | 'I03' | 'I04' | 'I05' | 'I06' | 'I07' | 'I08' | 'P01' | 'S01' required

Clave de uso del CFDI: para qué declara el receptor el comprobante fiscal ante el SAT. Los valores son las claves del catálogo c_UsoCFDI que publica el SAT mexicano, no una codificación de Toku, y el receptor es quien determina cuál corresponde.

checkout_session_idstring
id_invoicestring
observationsstring

Texto libre que se guarda junto a los datos de facturación. No viaja al CFDI.

Example response

{
  "item": {
    "identification_number": "SKU-4471",
    "product_code": "84111506",
    "product_description": "Servicio de suscripción mensual",
    "quantity": 1,
    "tax_object": "02",
    "taxes": [
      {
        "name": "IVA",
        "rate": 0.16
      }
    ],
    "unit_code": "E48",
    "unit_price": 1500
  },
  "items": [
    {
      "identification_number": "SKU-4471",
      "product_code": "84111506",
      "product_description": "Servicio de suscripción mensual",
      "quantity": 1,
      "tax_object": "02",
      "taxes": [
        {
          "name": "IVA",
          "rate": 0.16
        }
      ],
      "unit_code": "E48",
      "unit_price": 1500
    }
  ],
  "observations": "Facturar a nombre de la matriz"
}

Changes

    • breaking

      request body became required

    • breaking

      added to the request property allOf list

    • breaking

      added to the request property allOf list

    • breaking

      added to the request property allOf list

    • breaking

      removed the enum value PPD of the request property

    • breaking

      removed the enum value PUE of the request property

    • breaking

      the request property type changed from string to no type

    • breaking

      the request property type changed from string to no type

    • breaking

      the request property type changed from object to no type

    • breaking

      removed the success response with the status

    • warning

      removed the request property /

    • warning

      removed the request property /

    • warning

      removed the request property /

    • warning

      removed the request property /

    • warning

      removed the request property /

    • warning

      removed the request property /

    • warning

      removed the request property /

    • info

      api operation id crear-información-de-facturación-de-la-deuda removed and replaced with create_invoice_billing_data

    • info

      api tag Facturación added

    • info

      added the new optional header request parameter x-account-key

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      the request property became optional

    • info

      the request property became optional

    • info

      request property deprecated

    • info

      request property list-of-types was widened by adding types integer to media type application/json

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      removed the non-success response with the status

    • info

      added the success response with the status