{
  "info": {
    "name": "Linc API — sandbox",
    "description": "Collection de la sandbox Linc (https://linc.cd/developpeurs/). Renseignez les variables secretKey (sk_test_…) ou identifiant/mot de passe d'un compte de test, et deviceId. Les jetons, devis, bénéficiaires et références sont enregistrés automatiquement. Ne mettez jamais une clé de production dans cette collection.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://sandbox.api.linc.cd"
    },
    {
      "key": "identifier",
      "value": "+243810000000"
    },
    {
      "key": "password",
      "value": ""
    },
    {
      "key": "secretKey",
      "value": "sk_test_…"
    },
    {
      "key": "deviceId",
      "value": "postman-device-1"
    },
    {
      "key": "accessToken",
      "value": ""
    },
    {
      "key": "refreshToken",
      "value": ""
    },
    {
      "key": "pendingLoginId",
      "value": ""
    },
    {
      "key": "quoteId",
      "value": ""
    },
    {
      "key": "beneficiaryId",
      "value": ""
    },
    {
      "key": "reference",
      "value": ""
    },
    {
      "key": "linkId",
      "value": ""
    },
    {
      "key": "cardId",
      "value": ""
    }
  ],
  "item": [
    {
      "name": "Public",
      "item": [
        {
          "name": "Lister les corridors",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/corridors",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "corridors"
              ]
            },
            "auth": {
              "type": "noauth"
            }
          }
        }
      ]
    },
    {
      "name": "Marchand (clé secrète)",
      "item": [
        {
          "name": "Créer un lien de paiement",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/payment-links",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "payment-links"
              ]
            },
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{secretKey}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"amount\": \"25.00\",\n  \"currency\": \"USD\",\n  \"description\": \"Commande n° 10452\",\n  \"expires_in\": \"24h\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code < 300) {",
                  "  const body = pm.response.json();",
                  "  if (body.id !== undefined) pm.collectionVariables.set('linkId', body.id);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Afficher un lien de paiement",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/payment-links/{{linkId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "payment-links",
                "{{linkId}}"
              ]
            },
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{secretKey}}",
                  "type": "string"
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Client — authentification",
      "item": [
        {
          "name": "1. Se connecter",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "X-Device-Id",
                "value": "{{deviceId}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/auth/login",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "auth",
                "login"
              ]
            },
            "description": "200 : jetons. 202 two_factor_required : passez à l'étape 2 (et 1b pour recevoir un SMS).",
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"identifier\": \"{{identifier}}\",\n  \"password\": \"{{password}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code < 300) {",
                  "  const body = pm.response.json();",
                  "  if (body.pendingLoginId !== undefined) pm.collectionVariables.set('pendingLoginId', body.pendingLoginId);",
                  "  if (body.accessToken !== undefined) pm.collectionVariables.set('accessToken', body.accessToken);",
                  "  if (body.refreshToken !== undefined) pm.collectionVariables.set('refreshToken', body.refreshToken);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "1b. Recevoir le code par SMS",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "X-Device-Id",
                "value": "{{deviceId}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/auth/login/{{pendingLoginId}}/sms",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "auth",
                "login",
                "{{pendingLoginId}}",
                "sms"
              ]
            },
            "auth": {
              "type": "noauth"
            }
          }
        },
        {
          "name": "2. Second facteur",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "X-Device-Id",
                "value": "{{deviceId}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/auth/login/{{pendingLoginId}}/verify",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "auth",
                "login",
                "{{pendingLoginId}}",
                "verify"
              ]
            },
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"method\": \"totp\",\n  \"code\": \"123456\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code < 300) {",
                  "  const body = pm.response.json();",
                  "  if (body.accessToken !== undefined) pm.collectionVariables.set('accessToken', body.accessToken);",
                  "  if (body.refreshToken !== undefined) pm.collectionVariables.set('refreshToken', body.refreshToken);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "3. Renouveler les jetons",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/auth/refresh",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "auth",
                "refresh"
              ]
            },
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"refreshToken\": \"{{refreshToken}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code < 300) {",
                  "  const body = pm.response.json();",
                  "  if (body.accessToken !== undefined) pm.collectionVariables.set('accessToken', body.accessToken);",
                  "  if (body.refreshToken !== undefined) pm.collectionVariables.set('refreshToken', body.refreshToken);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Se déconnecter",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "X-Device-Id",
                "value": "{{deviceId}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/auth/logout",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "auth",
                "logout"
              ]
            },
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"refreshToken\": \"{{refreshToken}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "Client — transfert",
      "item": [
        {
          "name": "1. Demander un devis",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              },
              {
                "key": "X-Device-Id",
                "value": "{{deviceId}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/quotes",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "quotes"
              ]
            },
            "description": "Valable 60 secondes.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"amount\": \"150.00\",\n  \"currency\": \"USD\",\n  \"destinationCountry\": \"CI\",\n  \"payoutMethod\": \"mobile_money\",\n  \"sourceType\": \"mobile_money\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code < 300) {",
                  "  const body = pm.response.json();",
                  "  if (body.id !== undefined) pm.collectionVariables.set('quoteId', body.id);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "2. Ajouter un bénéficiaire",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "X-Device-Id",
                "value": "{{deviceId}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/beneficiaries",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "beneficiaries"
              ]
            },
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"fullName\": \"Bastian Kelyan\",\n  \"country\": \"CI\",\n  \"payoutMethod\": \"mobile_money\",\n  \"details\": {\n    \"msisdn\": \"+2250700000000\",\n    \"provider\": \"orange\",\n    \"relationship\": \"family\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code < 300) {",
                  "  const body = pm.response.json();",
                  "  if (body.id !== undefined) pm.collectionVariables.set('beneficiaryId', body.id);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "3. Envoyer",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              },
              {
                "key": "X-Device-Id",
                "value": "{{deviceId}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/transfers",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "transfers"
              ]
            },
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"quoteId\": \"{{quoteId}}\",\n  \"beneficiaryId\": \"{{beneficiaryId}}\",\n  \"source\": {\n    \"type\": \"mobile_money\",\n    \"provider\": \"airtel\",\n    \"msisdn\": \"+243970000000\"\n  },\n  \"purpose\": \"family_support\",\n  \"twoFactor\": {\n    \"method\": \"totp\",\n    \"code\": \"123456\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code < 300) {",
                  "  const body = pm.response.json();",
                  "  if (body.reference !== undefined) pm.collectionVariables.set('reference', body.reference);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "4. Suivre l'envoi",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "X-Device-Id",
                "value": "{{deviceId}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/transfers/{{reference}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "transfers",
                "{{reference}}"
              ]
            },
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Lister mes envois",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "X-Device-Id",
                "value": "{{deviceId}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/transfers",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "transfers"
              ]
            },
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Client — paiement marchand",
      "item": [
        {
          "name": "Lire un lien ou un QR",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "X-Device-Id",
                "value": "{{deviceId}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/merchant-payments/resolve",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "merchant-payments",
                "resolve"
              ]
            },
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"payload\": \"{{linkId}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Payer",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              },
              {
                "key": "X-Device-Id",
                "value": "{{deviceId}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/merchant-payments",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "merchant-payments"
              ]
            },
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"reference\": \"{{linkId}}\",\n  \"source\": {\n    \"type\": \"mobile_money\",\n    \"provider\": \"airtel\",\n    \"msisdn\": \"+243970000000\"\n  },\n  \"twoFactor\": {\n    \"method\": \"totp\",\n    \"code\": \"123456\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "Client — carte virtuelle",
      "item": [
        {
          "name": "Créer une carte",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              },
              {
                "key": "X-Device-Id",
                "value": "{{deviceId}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/cards",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "cards"
              ]
            },
            "description": "Mode wallet et KYC niveau 2 requis.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"network\": \"visa\",\n  \"embossedName\": \"AMANI K\",\n  \"twoFactor\": {\n    \"method\": \"totp\",\n    \"code\": \"123456\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code < 300) {",
                  "  const body = pm.response.json();",
                  "  if (body.id !== undefined) pm.collectionVariables.set('cardId', body.id);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Lister mes cartes",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "X-Device-Id",
                "value": "{{deviceId}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/cards",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "cards"
              ]
            },
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Geler",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "X-Device-Id",
                "value": "{{deviceId}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/cards/{{cardId}}/freeze",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "cards",
                "{{cardId}}",
                "freeze"
              ]
            },
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Dégeler",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "X-Device-Id",
                "value": "{{deviceId}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/cards/{{cardId}}/unfreeze",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "cards",
                "{{cardId}}",
                "unfreeze"
              ]
            },
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            }
          }
        }
      ]
    }
  ]
}
