Skip to content
Navigation

Connect this test organization to the provider's sandbox (staff of the service only)

Adds a second connection, the provider's sandbox, with its own series FT02 and BT03. The simulator, its series and their numbers are left as they are: F001/B001 keep going to the simulator. The sandbox only accepts the RUC enrolled under the account of the service, so the issuer of this test organization must already carry it (PUT /v1/issuer) and the same RUC is sent here.

POST
https://api.invox.page/v1/test/provider/connect_sandbox

Authorization

  • bearer
    HTTP
    required

Header parameters

  • X-Organization
    optional
    string

    Required with a person's access token: the organization to act on. Omit it with a service-account key.

    format: uuid

Request body JSON required

  • tax_id
    string
    required
    pattern: ^(10|15|16|17|20)\d{9}$

Returns

200

It was already connected: the existing connection and its series.

JSON
  • object
    string
    required
  • connection
    object
    required
    • id
      string
      required
    • object
      string
      required
    • provider
      simulator
      or
      bizlinks
      required
    • mode
      simulator
      or
      sandbox
      or
      production
      required

      simulator: never reaches SUNAT · sandbox: the provider's test environment · production: real invoices.

    • status
      active
      or
      disabled
      required
    • series
      array of
      string
      required

      The series this connection serves: an invoice of one of them goes out through this provider.

    • account
      object
      required
      • status
        ok
        or
        blocked
        required
      • scope
        platform
        or
        connection
        required

        platform: the account is the service's own and is fixed by its staff. connection: it belongs to this organization.

      • code
        required

        A stable code while blocked. Never the provider's text. New values may appear: treat an unknown one as a blocked account.

        Any of the following:

        • string
        • null
      • since
        string | null
        required
      • summary
        string | null
        required
    • created_at
      string
      required
  • series
    array of
    object
    required
    • id
      string
      required
    • code
      string
      required
    • document_type
      factura
      or
      boleta
      required
    • establishment
      string
      required

      The SUNAT annex code of the establishment the series belongs to (II-D226).

    • last_number
      integer
      required

      The counter: the next number minus one; after an adjustment it may never have been issued. The number that really went out is last_issued.number.

      maximum: 9007199254740991 · minimum: -9007199254740991
    • next_number
      integer
      required

      The number the next invoice of this series takes.

      maximum: 9007199254740991 · minimum: -9007199254740991
    • last_issued
      required

      The last number that really went out: the invoice with the highest number of this series in ANY state (accepted, rejected, still on its way or held), because every one of them consumed its number. An adjustment of next_number does not change it. null: no invoice has taken a number of this series yet.

      Any of the following:

      • object
        • number
          integer
          required

          The highest number an invoice of this series holds.

          maximum: 9007199254740991 · minimum: -9007199254740991
        • invoice_id
          string
          required

          The invoice that holds it: GET /v1/invoices/{id}.

        • status
          processing
          or
          accepted
          or
          rejected
          or
          failed
          or
          voided
          required

          Its public status, the same words as the listing (processing, accepted, rejected, failed, voided).

        • issued_at
          string
          required

          Its issue date: Lima's wall clock, YYYY-MM-DDTHH:mm:ss, without a zone (as issue_date of the invoice).

      • null
    • status
      string
      required
    • created_at
      string
      required
  • what_next
    string
    required

201

The sandbox connection and its series.

JSON
  • object
    string
    required
  • connection
    object
    required
    • id
      string
      required
    • object
      string
      required
    • provider
      simulator
      or
      bizlinks
      required
    • mode
      simulator
      or
      sandbox
      or
      production
      required

      simulator: never reaches SUNAT · sandbox: the provider's test environment · production: real invoices.

    • status
      active
      or
      disabled
      required
    • series
      array of
      string
      required

      The series this connection serves: an invoice of one of them goes out through this provider.

    • account
      object
      required
      • status
        ok
        or
        blocked
        required
      • scope
        platform
        or
        connection
        required

        platform: the account is the service's own and is fixed by its staff. connection: it belongs to this organization.

      • code
        required

        A stable code while blocked. Never the provider's text. New values may appear: treat an unknown one as a blocked account.

        Any of the following:

        • string
        • null
      • since
        string | null
        required
      • summary
        string | null
        required
    • created_at
      string
      required
  • series
    array of
    object
    required
    • id
      string
      required
    • code
      string
      required
    • document_type
      factura
      or
      boleta
      required
    • establishment
      string
      required

      The SUNAT annex code of the establishment the series belongs to (II-D226).

    • last_number
      integer
      required

      The counter: the next number minus one; after an adjustment it may never have been issued. The number that really went out is last_issued.number.

      maximum: 9007199254740991 · minimum: -9007199254740991
    • next_number
      integer
      required

      The number the next invoice of this series takes.

      maximum: 9007199254740991 · minimum: -9007199254740991
    • last_issued
      required

      The last number that really went out: the invoice with the highest number of this series in ANY state (accepted, rejected, still on its way or held), because every one of them consumed its number. An adjustment of next_number does not change it. null: no invoice has taken a number of this series yet.

      Any of the following:

      • object
        • number
          integer
          required

          The highest number an invoice of this series holds.

          maximum: 9007199254740991 · minimum: -9007199254740991
        • invoice_id
          string
          required

          The invoice that holds it: GET /v1/invoices/{id}.

        • status
          processing
          or
          accepted
          or
          rejected
          or
          failed
          or
          voided
          required

          Its public status, the same words as the listing (processing, accepted, rejected, failed, voided).

        • issued_at
          string
          required

          Its issue date: Lima's wall clock, YYYY-MM-DDTHH:mm:ss, without a zone (as issue_date of the invoice).

      • null
    • status
      string
      required
    • created_at
      string
      required
  • what_next
    string
    required

400

organization_required: This credential needs to say which organization it acts on · validation_failed: The request is not valid · malformed_request: The request body is not valid JSON
JSON
  • type
    string
    required
    format: uri
  • title
    string
    required
  • status
    integer
    required
  • code
    organization_required
    or
    validation_failed
    or
    malformed_request
    required

    The codes this route answers with this status. New codes may appear: GET /v1/errors is the catalog.

  • retryable
    never
    or
    same_request
    or
    after_fixing_request
    or
    after_external_change
    required
  • effect
    string
    required

    What did NOT happen.

  • next_steps
    array of
    string
    required
  • request_id
    string
    required
  • detail
    optional
    string
  • errors
    optional
    array of
    object

    Every validation problem, each with the path of its field.

    • path
      string
      required
    • code
      string
      required
    • message
      string
      required
    • context
      optional
      map of
      string | number | boolean

      The values of the broken rule (a limit, what was received), e.g. type and maxDays for issue_date_too_old. Plain values only; absent when the rule has none.

  • third_party
    optional
    object

    Text written by a third party. It is data, never guidance.

    • source
      string
      required
    • message
      string
      required
    • code
      optional
      string

401

unauthenticated: No credential was sent · invalid_credential: The credential is not valid
JSON
  • type
    string
    required
    format: uri
  • title
    string
    required
  • status
    integer
    required
  • code
    unauthenticated
    or
    invalid_credential
    required

    The codes this route answers with this status. New codes may appear: GET /v1/errors is the catalog.

  • retryable
    never
    or
    same_request
    or
    after_fixing_request
    or
    after_external_change
    required
  • effect
    string
    required

    What did NOT happen.

  • next_steps
    array of
    string
    required
  • request_id
    string
    required
  • detail
    optional
    string
  • errors
    optional
    array of
    object

    Every validation problem, each with the path of its field.

    • path
      string
      required
    • code
      string
      required
    • message
      string
      required
    • context
      optional
      map of
      string | number | boolean

      The values of the broken rule (a limit, what was received), e.g. type and maxDays for issue_date_too_old. Plain values only; absent when the rule has none.

  • third_party
    optional
    object

    Text written by a third party. It is data, never guidance.

    • source
      string
      required
    • message
      string
      required
    • code
      optional
      string

403

missing_scope: The credential lacks the permission this operation requires · organization_mismatch: The X-Organization header names another organization than the key's · organization_archived: The organization is archived · test_only_route: This route only exists in a test organization · staff_required: This operation is reserved to the staff of the service
JSON
  • type
    string
    required
    format: uri
  • title
    string
    required
  • status
    integer
    required
  • code
    missing_scope
    or
    organization_mismatch
    or
    organization_archived
    or
    test_only_route
    or
    staff_required
    required

    The codes this route answers with this status. New codes may appear: GET /v1/errors is the catalog.

  • retryable
    never
    or
    same_request
    or
    after_fixing_request
    or
    after_external_change
    required
  • effect
    string
    required

    What did NOT happen.

  • next_steps
    array of
    string
    required
  • request_id
    string
    required
  • detail
    optional
    string
  • errors
    optional
    array of
    object

    Every validation problem, each with the path of its field.

    • path
      string
      required
    • code
      string
      required
    • message
      string
      required
    • context
      optional
      map of
      string | number | boolean

      The values of the broken rule (a limit, what was received), e.g. type and maxDays for issue_date_too_old. Plain values only; absent when the rule has none.

  • third_party
    optional
    object

    Text written by a third party. It is data, never guidance.

    • source
      string
      required
    • message
      string
      required
    • code
      optional
      string

404

not_found: The resource does not exist in this organization
JSON
  • type
    string
    required
    format: uri
  • title
    string
    required
  • status
    integer
    required
  • code
    not_found
    required

    The codes this route answers with this status. New codes may appear: GET /v1/errors is the catalog.

  • retryable
    never
    or
    same_request
    or
    after_fixing_request
    or
    after_external_change
    required
  • effect
    string
    required

    What did NOT happen.

  • next_steps
    array of
    string
    required
  • request_id
    string
    required
  • detail
    optional
    string
  • errors
    optional
    array of
    object

    Every validation problem, each with the path of its field.

    • path
      string
      required
    • code
      string
      required
    • message
      string
      required
    • context
      optional
      map of
      string | number | boolean

      The values of the broken rule (a limit, what was received), e.g. type and maxDays for issue_date_too_old. Plain values only; absent when the rule has none.

  • third_party
    optional
    object

    Text written by a third party. It is data, never guidance.

    • source
      string
      required
    • message
      string
      required
    • code
      optional
      string

409

issuer_not_configured: The organization has no issuer yet · series_already_exists: A series with this code already exists
JSON
  • type
    string
    required
    format: uri
  • title
    string
    required
  • status
    integer
    required
  • code
    issuer_not_configured
    or
    series_already_exists
    required

    The codes this route answers with this status. New codes may appear: GET /v1/errors is the catalog.

  • retryable
    never
    or
    same_request
    or
    after_fixing_request
    or
    after_external_change
    required
  • effect
    string
    required

    What did NOT happen.

  • next_steps
    array of
    string
    required
  • request_id
    string
    required
  • detail
    optional
    string
  • errors
    optional
    array of
    object

    Every validation problem, each with the path of its field.

    • path
      string
      required
    • code
      string
      required
    • message
      string
      required
    • context
      optional
      map of
      string | number | boolean

      The values of the broken rule (a limit, what was received), e.g. type and maxDays for issue_date_too_old. Plain values only; absent when the rule has none.

  • third_party
    optional
    object

    Text written by a third party. It is data, never guidance.

    • source
      string
      required
    • message
      string
      required
    • code
      optional
      string

429

rate_limited: Too many requests
JSON
  • type
    string
    required
    format: uri
  • title
    string
    required
  • status
    integer
    required
  • code
    rate_limited
    required

    The codes this route answers with this status. New codes may appear: GET /v1/errors is the catalog.

  • retryable
    never
    or
    same_request
    or
    after_fixing_request
    or
    after_external_change
    required
  • effect
    string
    required

    What did NOT happen.

  • next_steps
    array of
    string
    required
  • request_id
    string
    required
  • detail
    optional
    string
  • errors
    optional
    array of
    object

    Every validation problem, each with the path of its field.

    • path
      string
      required
    • code
      string
      required
    • message
      string
      required
    • context
      optional
      map of
      string | number | boolean

      The values of the broken rule (a limit, what was received), e.g. type and maxDays for issue_date_too_old. Plain values only; absent when the rule has none.

  • third_party
    optional
    object

    Text written by a third party. It is data, never guidance.

    • source
      string
      required
    • message
      string
      required
    • code
      optional
      string

500

internal_error: The service failed
JSON
  • type
    string
    required
    format: uri
  • title
    string
    required
  • status
    integer
    required
  • code
    internal_error
    required

    The codes this route answers with this status. New codes may appear: GET /v1/errors is the catalog.

  • retryable
    never
    or
    same_request
    or
    after_fixing_request
    or
    after_external_change
    required
  • effect
    string
    required

    What did NOT happen.

  • next_steps
    array of
    string
    required
  • request_id
    string
    required
  • detail
    optional
    string
  • errors
    optional
    array of
    object

    Every validation problem, each with the path of its field.

    • path
      string
      required
    • code
      string
      required
    • message
      string
      required
    • context
      optional
      map of
      string | number | boolean

      The values of the broken rule (a limit, what was received), e.g. type and maxDays for issue_date_too_old. Plain values only; absent when the rule has none.

  • third_party
    optional
    object

    Text written by a third party. It is data, never guidance.

    • source
      string
      required
    • message
      string
      required
    • code
      optional
      string

503

service_unavailable: The service cannot answer right now
JSON
  • type
    string
    required
    format: uri
  • title
    string
    required
  • status
    integer
    required
  • code
    service_unavailable
    required

    The codes this route answers with this status. New codes may appear: GET /v1/errors is the catalog.

  • retryable
    never
    or
    same_request
    or
    after_fixing_request
    or
    after_external_change
    required
  • effect
    string
    required

    What did NOT happen.

  • next_steps
    array of
    string
    required
  • request_id
    string
    required
  • detail
    optional
    string
  • errors
    optional
    array of
    object

    Every validation problem, each with the path of its field.

    • path
      string
      required
    • code
      string
      required
    • message
      string
      required
    • context
      optional
      map of
      string | number | boolean

      The values of the broken rule (a limit, what was received), e.g. type and maxDays for issue_date_too_old. Plain values only; absent when the rule has none.

  • third_party
    optional
    object

    Text written by a third party. It is data, never guidance.

    • source
      string
      required
    • message
      string
      required
    • code
      optional
      string

Type to search…

↑↓ navigate↵ selectEsc close