Swaps

A Swap represents one or more purchase documents received by the organization using built-in billing in Chile.

Swap object

List swaps

GET https://api.piriod.com/billers/built_in/swaps/

List swaps received by organization

Query Parameters

{
    // Response
}

Retrieve a swap

GET https://api.piriod.com/billers/built_in/swaps/{id}/

This endpoint retrieves a swap

Path Parameters

{
  "id": "swa_XlG3IObKyBTQhheBVh",
  "purchases": [
    "pur_lXwASXq0R2S29UWydk"
  ]
  "local_file": "https://s3.amazonaws.com/api.piriod.com/cl/exchange/local_file/j80ff821-0b43-4i78-a4d8-a13775cc9045.xml",
  "receipt": "https://s3.amazonaws.com/api.piriod.com/cl/exchange/local_file/Xh6wq867-0b43-4i78-a4d8-a13775cc9045.xml",
  "reception": "https://s3.amazonaws.com/api.piriod.com/cl/exchange/local_file/oL6Kq31b-0b43-4i78-a4d8-a13775cc9045.xml",
  "result": "https://s3.amazonaws.com/api.piriod.com/cl/exchange/local_file/P80wp821-0b43-4i78-a4d8-a13775cc9045.xml",
  "reply_to": "swaps@acmecl.com",
  "reply_by": "user@example.com",
  "reply_date": "2021-06-16T14:23:24.163035-00:00",
  "status": "ERM",
  "imported": false,
  "created": "2021-06-09T00:00:24.163035-00:00"
}

Update a swap

PATCH https://api.piriod.com/billers/built_in/swaps/{id}/

This endpoint updates a swap. Only swaps without status can updated.

Path Parameters

Request Body

{
  "id": "swa_XlG3IObKyBTQhheBVh",
  "purchases": [
    "pur_lXwASXq0R2S29UWydk"
  ]
  "local_file": "https://s3.amazonaws.com/api.piriod.com/cl/exchange/local_file/j80ff821-0b43-4i78-a4d8-a13775cc9045.xml",
  "receipt": "https://s3.amazonaws.com/api.piriod.com/cl/exchange/local_file/Xh6wq867-0b43-4i78-a4d8-a13775cc9045.xml",
  "reception": "https://s3.amazonaws.com/api.piriod.com/cl/exchange/local_file/oL6Kq31b-0b43-4i78-a4d8-a13775cc9045.xml",
  "result": "https://s3.amazonaws.com/api.piriod.com/cl/exchange/local_file/P80wp821-0b43-4i78-a4d8-a13775cc9045.xml",
  "reply_to": "swaps@acmecl.com",
  "reply_by": "user@example.com",
  "reply_date": "2021-06-16T14:23:24.163035-00:00",
  "status": "ERM",
  "imported": false,
  "created": "2021-06-09T00:00:24.163035-00:00"
}

Retrieve a swap PDF

GET https://api.piriod.com/billers/built_in/swaps/{id}/pdf/

This endpoint retrieves a PDF representation of the swap. Returns a Blob Base64 encoded.

Path Parameters

{
    "file": "JVBERi0xLjcKJeLjz9MKNiAwIG9iago8PCAvV..."
}

Last updated