{"_id":"5633004538f8aa0d00d30ff8","githubsync":"","project":"544fc17e698ab40800b4f891","category":{"_id":"56326e9ddf556c0d00cd08d4","pages":["56326ea0df556c0d00cd08ee","5633004538f8aa0d00d30ff8","5633005a62c48a0d00334def","563746db4dbdd919001b26d7","564038826d1ccf0d006ed778","5640470bd4b2e00d00bb3c22"],"version":"56326e9cdf556c0d00cd08ca","__v":6,"project":"544fc17e698ab40800b4f891","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-05-12T04:49:53.071Z","from_sync":false,"order":3,"slug":"merchants","title":"Merchants"},"parentDoc":null,"user":"544fc065698ab40800b4f888","version":{"_id":"56326e9cdf556c0d00cd08ca","project":"544fc17e698ab40800b4f891","__v":4,"createdAt":"2015-10-29T19:08:12.724Z","releaseDate":"2015-10-29T19:08:12.724Z","categories":["56326e9ddf556c0d00cd08cb","56326e9ddf556c0d00cd08cc","56326e9ddf556c0d00cd08cd","56326e9ddf556c0d00cd08ce","56326e9ddf556c0d00cd08cf","56326e9ddf556c0d00cd08d0","56326e9ddf556c0d00cd08d1","56326e9ddf556c0d00cd08d2","56326e9ddf556c0d00cd08d3","56326e9ddf556c0d00cd08d4","56d942ac337fd11300d6a251","5ab2fcf66a1d77001230b47e","5afc2943bd2ef4000330bca7"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"collector","version_clean":"2.1.0","version":"2.1"},"__v":11,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-10-30T05:29:41.858Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":"/v1/invoices"},"isReference":false,"order":2,"body":"An invoice is a statement of what a user will need to pay to another user. Reason behind the transaction can range from providing services, selling an item or simply sending money to another user.\n\nIn an invoice there will always be two entities involved:\n\n- The receiver who will receive the payment (the merchant).\n- The sender who will send the payment to fulfill the invoice (the customer).\n\n## Creating Invoices\n\nA `POST` to the invoice endpoint will create an invoice.\n\n`POST` https://api.coins.asia/v1/invoices/\n\n### Headers\n\n* `Content-Type`: `application/json`\n\n### Body\n\n* `amount` - The amount expected from the customer.\n* `currency` - Currency of transaction.\n* `external_transaction_id` - A transaction ID provided by the merchant.\n* `supported_payment_collectors` - Payment options available to the user when viewing the payment request ie `['coins_peso_wallet', 'cash_payment']`.\n* `expires_at` - The expiration of the invoice. Expects date time format ISO 8601 (e.g. `2016-10-20T13:00:00.000000Z`) or time delta from current time (e.g. `1w 3d 2h 32m 5s`).\n\n# Payment Options\n\nYou can specify specific payment options that a payment request will present to the paying user. Options that can be passed to the `supported_payment_collectors` attribute are the following:\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Code\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"coins_peso_wallet\",\n    \"1-0\": \"cash_payment\",\n    \"1-1\": \"Pay with any of the payment options that requires the user to pay over the counter. (Currently won't include bayad_deposit and palawan_deposit)\",\n    \"2-0\": \"seven_connect_deposit\",\n    \"3-0\": \"mlhuillier_deposit\",\n    \"4-0\": \"cebuana_lhuillier_deposit\",\n    \"5-0\": \"bayad_deposit\",\n    \"6-0\": \"palawan_deposit\",\n    \"0-1\": \"Pay with the user's Peso Coins wallet.\",\n    \"2-1\": \"Pay over the counter at any 7-eleven convenience store.\",\n    \"3-1\": \"Pay over the counter at any Mlhuillier branch.\",\n    \"4-1\": \"Pay over the counter at any Cebuana Lhuillier branch.\",\n    \"5-1\": \"Pay over the counter at any Bayad Center branch.\",\n    \"6-1\": \"Pay over the counter at any Palawan Pawnshop branch.\"\n  },\n  \"cols\": 2,\n  \"rows\": 7\n}\n[/block]\n### Example Request\n\n```\nPOST https://api.coins.asia/v1/invoices/\nContent-Type: application-json\nAuthorization: Token YOUR_MERCHANT_ACCESS_TOKEN\n\n{\n  \"amount\": 1000,\n  \"currency\": \"PHP\",\n  \"external_transaction_id\": \"14hb2389bb1\"\n}\n```\n\n### Example Response\n\n```\n{\n  \"invoice\":  {\n    \"id\": \"13g32b103\",\n    \"amount\": \"5.00000000\",\n    \"currency\": \"PHP\",\n    \"external_transaction_id\": \"14hb2389bb1\",\n    // ...\n    \"payment_url\": \"https://coins.ph/payme/mypaymentpage/payment/13g32b103\"\n  }\n}\n```\n\n## Retrieving Invoices\n\nA `GET` to the invoice endpoint will retrieve a list of the merchant's invoices, or a particular invoice if `:id` is provided\n\n`GET` https://api.coins.asia/v1/invoices/:id\n\n### Example Request\n\n```\n`GET` https://api.coins.asia/v1/invoices/13g32b103\nAuthorization: Token YOUR_MERCHANT_ACCESS_TOKEN\n```\n\n### Example Response\n\n```\n{\n  \"invoice\":  {\n    \"id\": \"13g32b103\",\n    \"amount\": \"5.00000000\",\n    \"currency\": \"PHP\",\n    \"external_transaction_id\": \"14hb2389bb1\",\n    // ...\n    \"payment_url\": \"https://coins.ph/payme/mypaymentpage/payment/13g32b103\"\n  }\n}\n```","excerpt":"","slug":"invoices","type":"basic","title":"Invoices"}
An invoice is a statement of what a user will need to pay to another user. Reason behind the transaction can range from providing services, selling an item or simply sending money to another user. In an invoice there will always be two entities involved: - The receiver who will receive the payment (the merchant). - The sender who will send the payment to fulfill the invoice (the customer). ## Creating Invoices A `POST` to the invoice endpoint will create an invoice. `POST` https://api.coins.asia/v1/invoices/ ### Headers * `Content-Type`: `application/json` ### Body * `amount` - The amount expected from the customer. * `currency` - Currency of transaction. * `external_transaction_id` - A transaction ID provided by the merchant. * `supported_payment_collectors` - Payment options available to the user when viewing the payment request ie `['coins_peso_wallet', 'cash_payment']`. * `expires_at` - The expiration of the invoice. Expects date time format ISO 8601 (e.g. `2016-10-20T13:00:00.000000Z`) or time delta from current time (e.g. `1w 3d 2h 32m 5s`). # Payment Options You can specify specific payment options that a payment request will present to the paying user. Options that can be passed to the `supported_payment_collectors` attribute are the following: [block:parameters] { "data": { "h-0": "Code", "h-1": "Description", "0-0": "coins_peso_wallet", "1-0": "cash_payment", "1-1": "Pay with any of the payment options that requires the user to pay over the counter. (Currently won't include bayad_deposit and palawan_deposit)", "2-0": "seven_connect_deposit", "3-0": "mlhuillier_deposit", "4-0": "cebuana_lhuillier_deposit", "5-0": "bayad_deposit", "6-0": "palawan_deposit", "0-1": "Pay with the user's Peso Coins wallet.", "2-1": "Pay over the counter at any 7-eleven convenience store.", "3-1": "Pay over the counter at any Mlhuillier branch.", "4-1": "Pay over the counter at any Cebuana Lhuillier branch.", "5-1": "Pay over the counter at any Bayad Center branch.", "6-1": "Pay over the counter at any Palawan Pawnshop branch." }, "cols": 2, "rows": 7 } [/block] ### Example Request ``` POST https://api.coins.asia/v1/invoices/ Content-Type: application-json Authorization: Token YOUR_MERCHANT_ACCESS_TOKEN { "amount": 1000, "currency": "PHP", "external_transaction_id": "14hb2389bb1" } ``` ### Example Response ``` { "invoice": { "id": "13g32b103", "amount": "5.00000000", "currency": "PHP", "external_transaction_id": "14hb2389bb1", // ... "payment_url": "https://coins.ph/payme/mypaymentpage/payment/13g32b103" } } ``` ## Retrieving Invoices A `GET` to the invoice endpoint will retrieve a list of the merchant's invoices, or a particular invoice if `:id` is provided `GET` https://api.coins.asia/v1/invoices/:id ### Example Request ``` `GET` https://api.coins.asia/v1/invoices/13g32b103 Authorization: Token YOUR_MERCHANT_ACCESS_TOKEN ``` ### Example Response ``` { "invoice": { "id": "13g32b103", "amount": "5.00000000", "currency": "PHP", "external_transaction_id": "14hb2389bb1", // ... "payment_url": "https://coins.ph/payme/mypaymentpage/payment/13g32b103" } } ```