Efectivo

Crear Referencia

Changed on

Crea una Referencia de pago en efectivo para que un Customer la pague en tienda.

Se usa para cobrar en efectivo en México: devuelve la Referencia que el Customer presenta en la caja de la cadena de tiendas y, cuando el proveedor lo entrega, la URL de su código de barras. El pago no queda registrado al crear la Referencia, sino cuando el proveedor notifica que se pagó en tienda.

El gateway es opcional: si no se envía, se usa el gateway por defecto de la Organization. Si la configuración de ese gateway es de Referencias de un solo uso, invoices es obligatorio y la Referencia queda por el total de esos Invoices.

Solo se puede crear una Referencia a la vez por Customer: si hay otra creación en curso para el mismo Customer, la solicitud se rechaza con HTTP 423 y se puede reintentar.

post/reference

Request

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

Request body

accountstring nullable

Identificador de la Account a la que se asocia la Referencia.

customerstring required

Identificador del Customer que pagará la Referencia en tienda.

gateway'oxxo' | 'paycash' | 'dapp' | 'tapi'

Cadenas de tiendas donde un Customer puede pagar una Referencia en efectivo en México.

invoicesstring[]

Identificadores de los Invoices que la Referencia salda. Obligatorio cuando la configuración del gateway usa Referencias de un solo uso.

Example request

{
  "account": "acc_Nkj5FQ4blAzg-ieIKeRpULgj4hjTf-UJ",
  "customer": "cus_fLPjkiFoTCpGKFUIA52AqiOg8B4OdIWO",
  "invoices": [
    "in_K3a1P1_p_t5UHJHJXmpkQYmqXCHvXrNi"
  ]
}

Response

Referencia creada. El Customer puede pagarla en tienda hasta que venza.

barcode_urlstring required

URL de la imagen del código de barras de la Referencia.

referencestring required

Número de Referencia que el Customer presenta en la caja de la tienda.

Changes

    • breaking

      request body became required

    • breaking

      the request property type changed from string to no type

    • breaking

      removed the media type application/json for the response with the status

    • breaking

      removed the success response with the status

    • warning

      deleted the header request parameter x-api-key

    • info

      api operation id reference removed and replaced with public_start_create_cash_mx_reference

    • info

      api tag Efectivo added

    • info

      added the new optional request property

    • info

      added subschema #2 to the request property anyOf list

    • info

      the request property default value was added

    • 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

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the success response with the status