API
Invoices
Create Bulk Invoices
1min
Bulk invoices API allows you to perform multiple create operations in a single HTTP request. It’s limited to 50 invoice objects and each object should be valid otherwise, if one invoice fails all fail and will not be created.
POST
Request
Body Parameters
invoices
Array
required
It accepts array of up to 50 invoice objects.
Curl
1curl -X POST https://api.moyasar.com/v1/invoices/bulk \
2 -u sk_test_MrtwozLJAuFmLKWWSaRaoaLX: \
3 -H "Content-Type: application/json" \
4 -d '{"invoices":
5 [{"amount": "60000", "currency": "SAR", "description": "Sample Invoice #100"},
6 {"amount": "8000", "currency": "SAR", "description": "Sample Invoice #101", "callback_url": "https://www.example.com/store/invoice.jsp"},
7 {"amount": "92000", "currency": "SAR", "description": "Sample Invoice #102"}
8 ]}'
Responses
201
404
1{
2 "invoices": [
3 {
4 "id": "8d5d7ceb-17d9-4731-90cd-b095e5e9e3cb",
5 "status": "initiated",
6 "amount": 60000,
7 "currency": "SAR",
8 "description": "Sample Invoice #100",
9 "logo_url": "https://s3-eu-west-1.amazonaws.com/moyasar.api.assets.prod/entities/logos/default.png",
10 "amount_format": "600.00 SAR",
11 "url": "https://checkout.moyasar.com/invoices/8d5d7ceb-17d9-4731-90cd-b095e5e9e3cb?lang=en",
12 "callback_url": null,
13 "expired_at": null,
14 "created_at": "2023-08-23T11:59:44.795Z",
15 "updated_at": "2023-08-23T11:59:44.795Z",
16 "back_url": null,
17 "success_url": null,
18 "metadata": null,
19 "payments": []
20 },
21 {
22 "id": "e3f4174c-ba92-4d2e-813e-53829acb955a",
23 "status": "initiated",
24 "amount": 8000,
25 "currency": "SAR",
26 "description": "Sample Invoice #101",
27 "logo_url": "https://s3-eu-west-1.amazonaws.com/moyasar.api.assets.prod/entities/logos/default.png",
28 "amount_format": "80.00 SAR",
29 "url": "https://checkout.moyasar.com/invoices/e3f4174c-ba92-4d2e-813e-53829acb955a?lang=en",
30 "callback_url": "https://www.example.com/store/invoice.jsp",
31 "expired_at": null,
32 "created_at": "2023-08-23T11:59:44.799Z",
33 "updated_at": "2023-08-23T11:59:44.799Z",
34 "back_url": null,
35 "success_url": null,
36 "metadata": null,
37 "payments": []
38 },
39 {
40 "id": "1c3fd158-12ea-4693-91bb-dfe143e96164",
41 "status": "initiated",
42 "amount": 92000,
43 "currency": "SAR",
44 "description": "Sample Invoice #102",
45 "logo_url": "https://s3-eu-west-1.amazonaws.com/moyasar.api.assets.prod/entities/logos/default.png",
46 "amount_format": "920.00 SAR",
47 "url": "https://checkout.moyasar.com/invoices/1c3fd158-12ea-4693-91bb-dfe143e96164?lang=en",
48 "callback_url": null,
49 "expired_at": null,
50 "created_at": "2023-08-23T11:59:44.801Z",
51 "updated_at": "2023-08-23T11:59:44.801Z",
52 "back_url": null,
53 "success_url": null,
54 "metadata": null,
55 "payments": []
56 }
57 ]
58}
59
Updated 25 Jan 2024
Did this page help you?