{"_id":"5633004538f8aa0d00d30ff8","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":10,"slug":"merchants","title":"Merchants"},"parentDoc":null,"user":"544fc065698ab40800b4f888","version":{"_id":"56326e9cdf556c0d00cd08ca","project":"544fc17e698ab40800b4f891","__v":2,"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"],"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":"","githubsync":"","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\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. ### 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" } } ```